Revision 2987 trunk/extensions/extGeoreferencing/src/com/iver/cit/gvsig/gui/Panels/SelectPointsPanel.java
SelectPointsPanel.java | ||
---|---|---|
156 | 156 |
} |
157 | 157 |
|
158 | 158 |
/** |
159 |
* Recorta los decimales para el visualizado en la selecci?n de puntos |
|
160 |
* @param s Cadena de entrada |
|
161 |
* @return Cadena de salida con decimales recortados |
|
162 |
*/ |
|
163 |
public static String tailDecimal(String s){ |
|
164 |
int len = 2; |
|
165 |
int index = s.indexOf("."); |
|
166 |
if( index == -1) |
|
167 |
return s; |
|
168 |
else{ |
|
169 |
if((index + len) >= s.length()) |
|
170 |
return s; |
|
171 |
return s.substring(0, index + len + 1); |
|
172 |
} |
|
173 |
} |
|
174 |
|
|
175 |
/** |
|
159 | 176 |
* Busca el punto en la capa FLyrPoint que corresponde con la posicion pos |
160 | 177 |
* y carga la informaci?n de este en el panel de informaci?n. |
161 | 178 |
* @param pos |
... | ... | |
167 | 184 |
getTY().setText(""+pto.pixelPoint.getY()); |
168 | 185 |
} |
169 | 186 |
if(pto.mapPoint != null){ |
170 |
getLatitud().setText(""+pto.mapPoint.getY());
|
|
171 |
getLongitud().setText(""+pto.mapPoint.getX());
|
|
187 |
getLatitud().setText(tailDecimal(""+pto.mapPoint.getY()));
|
|
188 |
getLongitud().setText(tailDecimal(""+pto.mapPoint.getX()));
|
|
172 | 189 |
} |
173 | 190 |
} |
174 | 191 |
|
... | ... | |
482 | 499 |
public JButton getBSelectFromView() { |
483 | 500 |
if (bSelectFromView == null) { |
484 | 501 |
bSelectFromView = new JButton(); |
485 |
bSelectFromView.setText(PluginServices.getText(this, PluginServices.getText(this, "seleccionar")));
|
|
502 |
bSelectFromView.setText(PluginServices.getText(this, PluginServices.getText(this, "asignar_coordenadas")));
|
|
486 | 503 |
bSelectFromView.setPreferredSize(new java.awt.Dimension(125,25)); |
487 | 504 |
bSelectFromView.setEnabled(false); |
488 | 505 |
bSelectFromView.addActionListener(new java.awt.event.ActionListener() { |
... | ... | |
491 | 508 |
loadLyrPoint(); |
492 | 509 |
lyrPoints.setLastTool(theView.getMapControl().getTool()); |
493 | 510 |
GeorefPointerListener.posPoint = getCPoint().getSelectedIndex(); |
511 |
GeorefPointerListener.firstPoint = true; |
|
494 | 512 |
theView.getMapControl().setTool("pointLyrSelection"); |
495 | 513 |
} |
496 | 514 |
}); |
... | ... | |
622 | 640 |
* lista no salvar? ning?n valor. |
623 | 641 |
*/ |
624 | 642 |
public void checkTextField(JTextField tf, boolean xValue, boolean pixelValue, int code){ |
625 |
System.out.println("--->"+code); |
|
626 |
|
|
643 |
|
|
627 | 644 |
//Ignoramos las teclas Del, Spr, Mayusculas, Alt, Ctrl, Enter |
628 | 645 |
if(code == 8 || code == 127 || code == 16 || code == 20 || |
629 | 646 |
code == 18 || code == 17 || code == 10 ) |
... | ... | |
746 | 763 |
if (tLongitud == null) { |
747 | 764 |
tLongitud = new JTextField(); |
748 | 765 |
tLongitud.setPreferredSize(new java.awt.Dimension(111,19)); |
749 |
tLongitud.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
|
|
766 |
tLongitud.setHorizontalAlignment(javax.swing.JTextField.LEFT);
|
|
750 | 767 |
tLongitud.addKeyListener(new java.awt.event.KeyListener() { |
751 | 768 |
public void keyPressed(java.awt.event.KeyEvent e) {} |
752 | 769 |
public void keyReleased(java.awt.event.KeyEvent e) { |
Also available in: Unified diff