Revision 12273
tags/old-raster/extensions/extGeoreferencing/.classpath | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<classpath> |
|
3 |
<classpathentry kind="src" path="src"/> |
|
4 |
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> |
|
5 |
<classpathentry kind="var" path="JUNIT_HOME/junit.jar"/> |
|
6 |
<classpathentry kind="src" path="/libFMap"/> |
|
7 |
<classpathentry kind="src" path="/appgvSIG"/> |
|
8 |
<classpathentry kind="lib" path="/_fwAndami/lib/xerces_2_5_0.jar"/> |
|
9 |
<classpathentry kind="lib" path="/libFMap/lib/gt2-legacy.jar"/> |
|
10 |
<classpathentry combineaccessrules="false" kind="src" path="/_fwAndami"/> |
|
11 |
<classpathentry combineaccessrules="false" kind="src" path="/libDriverManager"/> |
|
12 |
<classpathentry sourcepath="/Utiles/src" kind="lib" path="/_fwAndami/lib/iver-utiles.jar"/> |
|
13 |
<classpathentry kind="src" path="src-test"/> |
|
14 |
<classpathentry kind="lib" path="/_fwAndami/lib/beans.jar"/> |
|
15 |
<classpathentry sourcepath="/libCq CMS for java" kind="lib" path="/libFMap/lib/cms.jar"/> |
|
16 |
<classpathentry kind="lib" path="/_fwAndami/lib/kxml2.jar"/> |
|
17 |
<classpathentry sourcepath="/libExceptions" kind="lib" path="/libFMap/lib/gvsig-exceptions.jar"/> |
|
18 |
<classpathentry sourcepath="/libGDBMS" kind="lib" path="/libFMap/lib/gdbms-0.8-SNAPSHOT.jar"/> |
|
19 |
<classpathentry kind="output" path="bin"/> |
|
20 |
</classpath> |
|
0 | 21 |
tags/old-raster/extensions/extGeoreferencing/.project | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<projectDescription> |
|
3 |
<name>extGeoreferencing</name> |
|
4 |
<comment></comment> |
|
5 |
<projects> |
|
6 |
</projects> |
|
7 |
<buildSpec> |
|
8 |
<buildCommand> |
|
9 |
<name>org.eclipse.jdt.core.javabuilder</name> |
|
10 |
<arguments> |
|
11 |
</arguments> |
|
12 |
</buildCommand> |
|
13 |
<buildCommand> |
|
14 |
<name>de.loskutov.FileSync.FSBuilder</name> |
|
15 |
<arguments> |
|
16 |
</arguments> |
|
17 |
</buildCommand> |
|
18 |
</buildSpec> |
|
19 |
<natures> |
|
20 |
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature> |
|
21 |
<nature>org.eclipse.jdt.core.javanature</nature> |
|
22 |
<nature>org.eclipse.jem.beaninfo.BeanInfoNature</nature> |
|
23 |
</natures> |
|
24 |
</projectDescription> |
|
0 | 25 |
tags/old-raster/extensions/extGeoreferencing/src-test/TestFrame.java | ||
---|---|---|
1 |
import java.awt.event.ComponentEvent; |
|
2 |
import java.awt.event.ComponentListener; |
|
3 |
|
|
4 |
import javax.swing.JFrame; |
|
5 |
|
|
6 |
import org.gvsig.georeferencing.gui.selectPoints.DataPointPanel; |
|
7 |
|
|
8 |
|
|
9 |
public class TestFrame extends JFrame implements ComponentListener{ |
|
10 |
|
|
11 |
public void componentHidden(ComponentEvent arg0) { |
|
12 |
|
|
13 |
} |
|
14 |
public void componentMoved(ComponentEvent arg0) { |
|
15 |
|
|
16 |
} |
|
17 |
public void componentResized(ComponentEvent arg0) { |
|
18 |
System.out.println(this.getSize().getWidth()+" "+this.getSize().getHeight()); |
|
19 |
} |
|
20 |
public void componentShown(ComponentEvent arg0) { |
|
21 |
|
|
22 |
|
|
23 |
} |
|
24 |
public TestFrame(){ |
|
25 |
this.addComponentListener(this); |
|
26 |
this.setSize(353,158); |
|
27 |
DataPointPanel tbp = new DataPointPanel(); |
|
28 |
this.getContentPane().add(tbp); |
|
29 |
this.show(); |
|
30 |
} |
|
31 |
/** |
|
32 |
* @param args |
|
33 |
*/ |
|
34 |
public static void main(String[] args) { |
|
35 |
TestFrame f = new TestFrame(); |
|
36 |
} |
|
37 |
|
|
38 |
} |
|
0 | 39 |
tags/old-raster/extensions/extGeoreferencing/src-test/TestGeoOperation.java | ||
---|---|---|
1 |
import org.gvsig.georeferencing.GeoOperations; |
|
2 |
import org.gvsig.georeferencing.utils.AffineT; |
|
3 |
import org.gvsig.georeferencing.utils.PointT; |
|
4 |
|
|
5 |
|
|
6 |
public class TestGeoOperation { |
|
7 |
|
|
8 |
private static final int MAXPOINTS = 3; |
|
9 |
|
|
10 |
public TestGeoOperation(GeoOperations go, double x, double y, int o){ |
|
11 |
PointT[] srcPoints = new PointT[TestGeoOperation.MAXPOINTS]; |
|
12 |
PointT[] dstPoints = new PointT[TestGeoOperation.MAXPOINTS]; |
|
13 |
PointT corner = new PointT(); |
|
14 |
int numsrcpoints = 3; |
|
15 |
int order = 0; |
|
16 |
AffineT affine = new AffineT(); |
|
17 |
|
|
18 |
if(numsrcpoints >= 3*10) |
|
19 |
order = 3; |
|
20 |
else if(numsrcpoints >= 3*6) |
|
21 |
order = 2; |
|
22 |
else |
|
23 |
order = 1; |
|
24 |
|
|
25 |
srcPoints[0] = new PointT(); |
|
26 |
srcPoints[0].setX(3108); |
|
27 |
srcPoints[0].setY(3523); |
|
28 |
srcPoints[0].setI(numsrcpoints); |
|
29 |
|
|
30 |
srcPoints[1] = new PointT(); |
|
31 |
srcPoints[1].setX(1651); |
|
32 |
srcPoints[1].setY(1463); |
|
33 |
srcPoints[1].setI(numsrcpoints); |
|
34 |
|
|
35 |
srcPoints[2] = new PointT(); |
|
36 |
srcPoints[2].setX(5578); |
|
37 |
srcPoints[2].setY(300); |
|
38 |
srcPoints[2].setI(numsrcpoints); |
|
39 |
|
|
40 |
dstPoints[0] = new PointT(); |
|
41 |
dstPoints[0].setX(433700.9072); |
|
42 |
dstPoints[0].setY(4582611.7542); |
|
43 |
dstPoints[0].setI(numsrcpoints); |
|
44 |
|
|
45 |
dstPoints[1] = new PointT(); |
|
46 |
dstPoints[1].setX(432975.8313); |
|
47 |
dstPoints[1].setY(4581581.5722); |
|
48 |
dstPoints[1].setI(numsrcpoints); |
|
49 |
|
|
50 |
dstPoints[2] = new PointT(); |
|
51 |
dstPoints[2].setX(434939.2793); |
|
52 |
dstPoints[2].setY(4581000.0758); |
|
53 |
dstPoints[2].setI(numsrcpoints); |
|
54 |
|
|
55 |
//Calcular la transformaci?n afin por m?nimos cuadrados |
|
56 |
affine = go.computeLeastSquaresAffine(affine, srcPoints, dstPoints, order); |
|
57 |
|
|
58 |
corner.setX(x); |
|
59 |
corner.setY(y); |
|
60 |
order = o; |
|
61 |
|
|
62 |
//Transformaci?no de un punto |
|
63 |
double[] point = go.transformPoint((int)corner.getX(), (int)corner.getY(), affine); |
|
64 |
|
|
65 |
System.out.println("Order: "+order); |
|
66 |
System.out.println("Pixel Point: ("+corner.getX()+", "+corner.getY()+")"); |
|
67 |
System.out.println("Map Point: ("+point[0]+", "+point[1]+")"); |
|
68 |
} |
|
69 |
/** |
|
70 |
* @param args |
|
71 |
*/ |
|
72 |
public static void main(String[] args) { |
|
73 |
GeoOperations go = new GeoOperations(); |
|
74 |
double x = Double.parseDouble(args[0]); |
|
75 |
double y = Double.parseDouble(args[1]); |
|
76 |
int order = Integer.parseInt(args[2]); |
|
77 |
TestGeoOperation f = new TestGeoOperation(go, x, y, order); |
|
78 |
} |
|
79 |
|
|
80 |
} |
|
0 | 81 |
tags/old-raster/extensions/extGeoreferencing/src-test/org/gvsig/georeferencing/utils/ZoomStackTest.java | ||
---|---|---|
1 |
package org.gvsig.georeferencing.utils; |
|
2 |
|
|
3 |
import junit.framework.TestCase; |
|
4 |
|
|
5 |
import org.cresques.px.Extent; |
|
6 |
|
|
7 |
/** |
|
8 |
* |
|
9 |
* @author Nacho Brodin (brodin_ign@gva.es) |
|
10 |
*/ |
|
11 |
public class ZoomStackTest extends TestCase{ |
|
12 |
private static final int NEXTENTS = 3; |
|
13 |
private StackZoom stack = null; |
|
14 |
Extent[] ext = new Extent[NEXTENTS]; |
|
15 |
Extent newExt = new Extent(4, 4, 4, 4); |
|
16 |
|
|
17 |
public void setUp() { |
|
18 |
System.out.println("ZoomStackTest running..."); |
|
19 |
stack = new StackZoom(); |
|
20 |
for(int i=0;i<NEXTENTS;i++){ |
|
21 |
ext[i] = new Extent(i, i ,i ,i); |
|
22 |
if(i == 0) |
|
23 |
stack.setInitExtent(ext[i], true); |
|
24 |
else |
|
25 |
stack.setZoom(ext[i]); |
|
26 |
} |
|
27 |
} |
|
28 |
|
|
29 |
public void testStack(){ |
|
30 |
//Top apunta al ?ltimo elemento y selectElem tambien |
|
31 |
assertEquals(stack.getStackSize(), NEXTENTS - 1); |
|
32 |
assertEquals(stack.getSelectElem(), NEXTENTS - 1); |
|
33 |
|
|
34 |
//Vaciamos la pila y volvemos a llenarla |
|
35 |
assertNull(stack.getNextZoom()); |
|
36 |
assertEquals(stack.getLastZoom(), ext[1]); |
|
37 |
assertEquals(stack.getLastZoom(), ext[0]); |
|
38 |
assertNull(stack.getLastZoom()); |
|
39 |
assertEquals(stack.getNextZoom(), ext[1]); |
|
40 |
assertEquals(stack.getNextZoom(), ext[2]); |
|
41 |
assertNull(stack.getNextZoom()); |
|
42 |
|
|
43 |
//Eliminamos un elemento e insertamos otro |
|
44 |
assertEquals(stack.getLastZoom(), ext[1]); |
|
45 |
|
|
46 |
stack.setZoom(newExt); |
|
47 |
|
|
48 |
assertNull(stack.getNextZoom()); |
|
49 |
assertEquals(stack.getLastZoom(), ext[1]); |
|
50 |
assertEquals(stack.getNextZoom(), newExt); |
|
51 |
} |
|
52 |
} |
|
0 | 53 |
tags/old-raster/extensions/extGeoreferencing/src-test/org/gvsig/georeferencing/gui/dialog/TestGeorefDialog.java | ||
---|---|---|
1 |
package org.gvsig.georeferencing.gui.dialog; |
|
2 |
import java.awt.BorderLayout; |
|
3 |
import java.awt.Dimension; |
|
4 |
import java.awt.FlowLayout; |
|
5 |
import java.awt.event.ComponentEvent; |
|
6 |
import java.awt.event.ComponentListener; |
|
7 |
import java.awt.geom.Point2D; |
|
8 |
|
|
9 |
import javax.swing.JButton; |
|
10 |
import javax.swing.JFrame; |
|
11 |
import javax.swing.JInternalFrame; |
|
12 |
import javax.swing.JPanel; |
|
13 |
import javax.swing.JToggleButton; |
|
14 |
import javax.swing.UIManager; |
|
15 |
import javax.swing.table.DefaultTableModel; |
|
16 |
|
|
17 |
import org.gvsig.georeferencing.gui.panels.ConectorPanel; |
|
18 |
import org.gvsig.georeferencing.gui.panels.OptionsPanel; |
|
19 |
import org.gvsig.georeferencing.gui.panels.ZoomControlPanel; |
|
20 |
import org.gvsig.georeferencing.gui.pointsTable.TablePointsPanel; |
|
21 |
import org.gvsig.georeferencing.gui.pointsTable.TablePointsPanel.PointTable; |
|
22 |
import org.gvsig.georeferencing.gui.selectPoints.DataPointPanel; |
|
23 |
import org.gvsig.georeferencing.gui.selectPoints.SelectPointsPanel; |
|
24 |
import org.gvsig.georeferencing.utils.GeoUtils; |
|
25 |
|
|
26 |
import com.iver.andami.PluginServices; |
|
27 |
import com.iver.cit.gvsig.fmap.ViewPort; |
|
28 |
import com.iver.cit.gvsig.fmap.layers.IGeoUi; |
|
29 |
import com.iver.cit.gvsig.fmap.tools.Behavior.GeoMoveBehavior; |
|
30 |
import com.iver.cit.gvsig.fmap.tools.Behavior.GeoRedimBehavior; |
|
31 |
import com.iver.cit.gvsig.project.documents.view.gui.View; |
|
32 |
|
|
33 |
|
|
34 |
public class TestGeorefDialog extends JFrame implements ComponentListener{ |
|
35 |
|
|
36 |
private int w = 412, h = /*278;*/458; |
|
37 |
|
|
38 |
public void componentHidden(ComponentEvent arg0) { |
|
39 |
|
|
40 |
} |
|
41 |
public void componentMoved(ComponentEvent arg0) { |
|
42 |
|
|
43 |
} |
|
44 |
public void componentResized(ComponentEvent arg0) { |
|
45 |
System.out.println(this.getSize().getWidth()+" "+this.getSize().getHeight()); |
|
46 |
} |
|
47 |
public void componentShown(ComponentEvent arg0) { |
|
48 |
|
|
49 |
} |
|
50 |
public TestGeorefDialog(){ |
|
51 |
this.addComponentListener(this); |
|
52 |
this.setSize(w, h); |
|
53 |
GeoreferencingDialogTest tbp = new GeoreferencingDialogTest(this); |
|
54 |
this.getContentPane().add(tbp); |
|
55 |
this.show(); |
|
56 |
} |
|
57 |
/** |
|
58 |
* @param args |
|
59 |
*/ |
|
60 |
public static void main(String[] args) { |
|
61 |
try { |
|
62 |
//UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); |
|
63 |
UIManager.setLookAndFeel("com.jgoodies.looks.plastic.PlasticXPLookAndFeel"); |
|
64 |
//UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); |
|
65 |
} catch( Exception e ) { |
|
66 |
System.err.println( "No se puede cambiar al LookAndFeel"); |
|
67 |
} |
|
68 |
TestGeorefDialog f = new TestGeorefDialog(); |
|
69 |
} |
|
70 |
|
|
71 |
|
|
72 |
class GeoreferencingDialogTest extends JPanel implements IGeoUi, ComponentListener { |
|
73 |
|
|
74 |
//**********************Vars********************************** |
|
75 |
private JPanel pBotones = null; // @jve:decl-index=0: |
|
76 |
private JButton bProcesar = null; // @jve:decl-index=0: |
|
77 |
private JButton bCancelar = null; // @jve:decl-index=0: |
|
78 |
private GeoRedimBehavior rb = null; |
|
79 |
private GeoMoveBehavior mb = null; |
|
80 |
; |
|
81 |
private JFrame frame = null; |
|
82 |
|
|
83 |
private ConectorPanel conectorPanel = null; |
|
84 |
|
|
85 |
private boolean enlarge = false; |
|
86 |
private int normalWidth = 400; |
|
87 |
private int normalHeight = 273; |
|
88 |
private int enlargeHeight = 438; |
|
89 |
private int tmpWidth = normalWidth; |
|
90 |
|
|
91 |
private JButton bAceptar = null; |
|
92 |
|
|
93 |
private TablePointsPanel tablePointsPanel = null; |
|
94 |
|
|
95 |
/** |
|
96 |
* Panel que contiene los botones de la barra inferior |
|
97 |
*/ |
|
98 |
private DialogButtons dialogButtons = null; |
|
99 |
//**********************End Vars****************************** |
|
100 |
|
|
101 |
|
|
102 |
//**********************Methods******************************* |
|
103 |
/** |
|
104 |
* Constructor. |
|
105 |
*/ |
|
106 |
public GeoreferencingDialogTest(JFrame f) { |
|
107 |
frame = f; |
|
108 |
initialize(); |
|
109 |
} |
|
110 |
|
|
111 |
/** |
|
112 |
* En la inicializaci?n de la ventana a?adimos los tags de est? y cargamos |
|
113 |
* ls herramientas para manejar las imagenes a georeferenciar. |
|
114 |
*/ |
|
115 |
private void initialize() { |
|
116 |
|
|
117 |
this.setLayout(new BorderLayout()); |
|
118 |
if(!enlarge){ |
|
119 |
this.setPreferredSize(new java.awt.Dimension(normalWidth, normalHeight)); |
|
120 |
this.setSize(new java.awt.Dimension(400,273)); |
|
121 |
this.getConectorPanel().getAdjustGeorefPanel().getZoomLeft().setVisible(false); |
|
122 |
this.getConectorPanel().getAdjustGeorefPanel().getZoomRight().setVisible(false); |
|
123 |
}else{ |
|
124 |
this.setPreferredSize(new java.awt.Dimension(normalWidth, enlargeHeight)); |
|
125 |
this.setSize(new java.awt.Dimension(normalWidth, enlargeHeight)); |
|
126 |
this.getConectorPanel().getAdjustGeorefPanel().getZoomLeft().setVisible(true); |
|
127 |
this.getConectorPanel().getAdjustGeorefPanel().getZoomRight().setVisible(true); |
|
128 |
} |
|
129 |
this.setLocation(new java.awt.Point(0,0)); |
|
130 |
|
|
131 |
this.add(this.getPBotones(), BorderLayout.SOUTH); |
|
132 |
this.add(this.getConectorPanel(), BorderLayout.NORTH); |
|
133 |
|
|
134 |
tablePointsPanel = getConectorPanel().getDataPointsTabPanel().getTablePointsPanel(); |
|
135 |
tablePointsPanel.getTableControlerPanel().getBClear().addActionListener(this.getConectorPanel().getDataPointsTabPanel().getSelectPointsPanel()); |
|
136 |
tablePointsPanel.getTableControlerPanel().getBDelPoint().addActionListener(this.getConectorPanel().getDataPointsTabPanel().getSelectPointsPanel()); |
|
137 |
|
|
138 |
getBInsertPointOfTablePoints().addActionListener(conectorPanel.getDataPointsTabPanel().getSelectPointsPanel()); |
|
139 |
getBNewPointOfTablePoints().addActionListener(conectorPanel.getDataPointsTabPanel().getSelectPointsPanel()); |
|
140 |
} |
|
141 |
|
|
142 |
|
|
143 |
/** |
|
144 |
* This method initializes jButton |
|
145 |
* |
|
146 |
* @return javax.swing.JButton |
|
147 |
*/ |
|
148 |
public JButton getBAccept() { |
|
149 |
if (bAceptar == null) { |
|
150 |
bAceptar = new JButton(); |
|
151 |
bAceptar.setText(PluginServices.getText(this,"aceptar")); |
|
152 |
bAceptar.setToolTipText(PluginServices.getText(this,"accept_tip")); |
|
153 |
} |
|
154 |
return bAceptar; |
|
155 |
} |
|
156 |
|
|
157 |
/** |
|
158 |
* This method initializes bProcesar |
|
159 |
* |
|
160 |
* @return javax.swing.JButton |
|
161 |
*/ |
|
162 |
public JButton getBProcess() { |
|
163 |
if (bProcesar == null) { |
|
164 |
bProcesar = new JButton(); |
|
165 |
bProcesar.setText(PluginServices.getText(this,"procesar")); |
|
166 |
bProcesar.setToolTipText(PluginServices.getText(this,"process_tip")); |
|
167 |
bProcesar.setEnabled(true); |
|
168 |
} |
|
169 |
return bProcesar; |
|
170 |
} |
|
171 |
|
|
172 |
/** |
|
173 |
* El bot?n cancelar restaura el extent con el que se carg? la imagen a georreferenciar |
|
174 |
* y cierra la ventana. |
|
175 |
* |
|
176 |
* @return javax.swing.JButton |
|
177 |
*/ |
|
178 |
public JButton getBCancel() { |
|
179 |
if (bCancelar == null) { |
|
180 |
bCancelar = new JButton(); |
|
181 |
bCancelar.setText(PluginServices.getText(this,"cancelar")); |
|
182 |
bCancelar.setToolTipText(PluginServices.getText(this,"cancel_tip")); |
|
183 |
} |
|
184 |
return bCancelar; |
|
185 |
} |
|
186 |
|
|
187 |
/** |
|
188 |
* Asigna a las textbox el valor de pixel pasado |
|
189 |
* @param x valor x |
|
190 |
* @param y valor y |
|
191 |
*/ |
|
192 |
public void setPixelText(double x, double y){ |
|
193 |
getSelectPointsPanel().getDataPointPanel().getTX().setText(String.valueOf(x)); |
|
194 |
getSelectPointsPanel().getDataPointPanel().getTY().setText(String.valueOf(y)); |
|
195 |
} |
|
196 |
|
|
197 |
/** |
|
198 |
* Asigna a las textbox el valor de coordenadas pasado |
|
199 |
* @param x valor x |
|
200 |
* @param y valor y |
|
201 |
*/ |
|
202 |
public void setMapCoordText(double x, double y){ |
|
203 |
getSelectPointsPanel().getDataPointPanel().getLongitud().setText(GeoUtils.tailDecimals(String.valueOf(x), 5)); |
|
204 |
getSelectPointsPanel().getDataPointPanel().getLatitud().setText(GeoUtils.tailDecimals(String.valueOf(y), 5)); |
|
205 |
} |
|
206 |
|
|
207 |
/** |
|
208 |
* Esta funci?n resetea los controles del panel de info de un punto. |
|
209 |
*/ |
|
210 |
public void resetControls(boolean active){ |
|
211 |
getConectorPanel().getDataPointsTabPanel().getTablePointsPanel().setSaveToDisk(active); |
|
212 |
getConectorPanel().getDataPointsTabPanel().getSelectPointsPanel().resetControls(active); |
|
213 |
getConectorPanel().getAdjustGeorefPanel().getZoomLeft().clear(); |
|
214 |
getConectorPanel().getAdjustGeorefPanel().getZoomRight().clear(); |
|
215 |
setEnabled(active); |
|
216 |
} |
|
217 |
|
|
218 |
/* (non-Javadoc) |
|
219 |
* @see java.awt.event.ComponentListener#componentHidden(java.awt.event.ComponentEvent) |
|
220 |
*/ |
|
221 |
public void componentHidden(ComponentEvent arg0) { |
|
222 |
|
|
223 |
} |
|
224 |
/* (non-Javadoc) |
|
225 |
* @see java.awt.event.ComponentListener#componentMoved(java.awt.event.ComponentEvent) |
|
226 |
*/ |
|
227 |
public void componentMoved(ComponentEvent arg0) { |
|
228 |
|
|
229 |
} |
|
230 |
/* (non-Javadoc) |
|
231 |
* @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent) |
|
232 |
*/ |
|
233 |
public void componentResized(ComponentEvent ev) { |
|
234 |
|
|
235 |
if(frame.getWidth() <= this.normalWidth + 10) |
|
236 |
frame.setSize(this.normalWidth, frame.getHeight()); |
|
237 |
|
|
238 |
if(this.getConectorPanel().getDataPointsTabPanel().getTbPoints().getSelectedIndex() == 1){ |
|
239 |
tmpWidth = frame.getWidth(); |
|
240 |
this.newFrameSize(frame.getWidth(), frame.getHeight() - 10); |
|
241 |
} |
|
242 |
} |
|
243 |
/* (non-Javadoc) |
|
244 |
* @see java.awt.event.ComponentListener#componentShown(java.awt.event.ComponentEvent) |
|
245 |
*/ |
|
246 |
public void componentShown(ComponentEvent arg0) { |
|
247 |
|
|
248 |
} |
|
249 |
|
|
250 |
/** |
|
251 |
*Inicializa el tama?o del dialogo |
|
252 |
*/ |
|
253 |
public void resetSize(){ |
|
254 |
if(!enlarge){ |
|
255 |
frame.setSize(this.normalWidth + 12, this.normalHeight + 10); |
|
256 |
}else{ |
|
257 |
frame.setSize(this.normalWidth + 12, this.enlargeHeight + 10); |
|
258 |
} |
|
259 |
newFrameSize((int)Math.round(this.normalWidth / 0.98), this.normalHeight); |
|
260 |
} |
|
261 |
|
|
262 |
/** |
|
263 |
* Calculo del nuevo tama?o a partir de un frame redimensionado |
|
264 |
* @param w Ancho del frame |
|
265 |
* @param h Alto del frame |
|
266 |
*/ |
|
267 |
public void newFrameSize(int w, int h){ |
|
268 |
int newWidth = (int)Math.round(w * 0.98); |
|
269 |
|
|
270 |
this.setSize(new java.awt.Dimension(newWidth, normalHeight )); |
|
271 |
this.setPreferredSize(new java.awt.Dimension(newWidth, normalHeight )); |
|
272 |
this.getConectorPanel().newFrameSize(newWidth, h); |
|
273 |
} |
|
274 |
|
|
275 |
//**********************End Methods*************************** |
|
276 |
|
|
277 |
//**********************Setters & Getters********************* |
|
278 |
/** |
|
279 |
* Obtiene la tabla de puntos |
|
280 |
*/ |
|
281 |
public PointTable getTable(){ |
|
282 |
return this.getConectorPanel().getDataPointsTabPanel().getTablePointsPanel().getJTable(); |
|
283 |
} |
|
284 |
|
|
285 |
/** |
|
286 |
* Asigna un valor a una posici?n de la tabla |
|
287 |
* @param value Valor a asignar |
|
288 |
* @param row Fila en la que se asigna |
|
289 |
* @param col Columna en la que se asigna |
|
290 |
*/ |
|
291 |
public void setTableValueAt(String value, int row, int col)throws ArrayIndexOutOfBoundsException{ |
|
292 |
((DefaultTableModel)getTable().getTable().getModel()).setValueAt(value, row, col); |
|
293 |
} |
|
294 |
|
|
295 |
/** |
|
296 |
* Asigna un valor del checkBox para una fila de la tabla |
|
297 |
* @param row Fila en la que se asigna |
|
298 |
*/ |
|
299 |
public void setCheckValueAt(Boolean value, int row)throws ArrayIndexOutOfBoundsException{ |
|
300 |
((DefaultTableModel)getTable().getTable().getModel()).setValueAt(value, row, 0); |
|
301 |
} |
|
302 |
|
|
303 |
/** |
|
304 |
* Obtiene el n?mero de filas de la tabla |
|
305 |
* @return N?mero de filas de la tabla |
|
306 |
*/ |
|
307 |
public int getTableRowCount(){ |
|
308 |
return getTable().getTable().getRowCount(); |
|
309 |
} |
|
310 |
|
|
311 |
/** |
|
312 |
* A?ade una nueva fila a la tabla de puntos |
|
313 |
*/ |
|
314 |
public void addTableNew(){ |
|
315 |
getTable().getTableModel().addNew(); |
|
316 |
} |
|
317 |
/** |
|
318 |
* @return Returns the tmpWidth. |
|
319 |
*/ |
|
320 |
public int getTmpWidth() { |
|
321 |
return tmpWidth; |
|
322 |
} |
|
323 |
/** |
|
324 |
* @param tmpWidth The tmpWidth to set. |
|
325 |
*/ |
|
326 |
public void setTmpWidth(int tmpWidth) { |
|
327 |
this.tmpWidth = tmpWidth; |
|
328 |
} |
|
329 |
/** |
|
330 |
* @return Returns the enlargeHeight. |
|
331 |
*/ |
|
332 |
public int getEnlargeHeight() { |
|
333 |
return enlargeHeight; |
|
334 |
} |
|
335 |
/** |
|
336 |
* @return Returns the normalHeight. |
|
337 |
*/ |
|
338 |
public int getNormalHeight() { |
|
339 |
return normalHeight; |
|
340 |
} |
|
341 |
|
|
342 |
/** |
|
343 |
* @return Returns the normalWidth. |
|
344 |
*/ |
|
345 |
public int getNormalWidth() { |
|
346 |
return normalWidth; |
|
347 |
} |
|
348 |
|
|
349 |
/** |
|
350 |
* Asigna el valor del campo RMS |
|
351 |
* @param rms Cadena que representa el RMS |
|
352 |
*/ |
|
353 |
public void setRMS(String rms){ |
|
354 |
this.getConectorPanel().getDataPointsTabPanel().getSelectPointsPanel().getErrorPointPanel().getTRMS().setText(rms); |
|
355 |
} |
|
356 |
|
|
357 |
/** |
|
358 |
* Asigna el valor del campo de residuo en X |
|
359 |
* @param rms Cadena que representa el RMS |
|
360 |
*/ |
|
361 |
public void setResX(String resX){ |
|
362 |
this.getConectorPanel().getDataPointsTabPanel().getSelectPointsPanel().getErrorPointPanel().getTResX().setText(resX); |
|
363 |
} |
|
364 |
|
|
365 |
/** |
|
366 |
* Asigna el valor del campo de residuo en Y |
|
367 |
* @param rms Cadena que representa el RMS |
|
368 |
*/ |
|
369 |
public void setResY(String resY){ |
|
370 |
this.getConectorPanel().getDataPointsTabPanel().getSelectPointsPanel().getErrorPointPanel().getTResY().setText(resY); |
|
371 |
} |
|
372 |
|
|
373 |
/** |
|
374 |
* Asigna el valor del campo RMS |
|
375 |
* @param rms Cadena que representa el RMS |
|
376 |
*/ |
|
377 |
public void setTotal(String total){ |
|
378 |
this.getConectorPanel().getDataPointsTabPanel().getSelectPointsPanel().getErrorPointPanel().getTTotal().setText(total); |
|
379 |
} |
|
380 |
|
|
381 |
/** |
|
382 |
* Selecciona un tab del cuadro |
|
383 |
* @param index |
|
384 |
*/ |
|
385 |
public void setSelectedTab(int index){ |
|
386 |
try{ |
|
387 |
this.getConectorPanel().getDataPointsTabPanel().getTbPoints().setSelectedIndex(index); |
|
388 |
}catch(IllegalArgumentException ex){ |
|
389 |
//Si peta al seleccionar un tab, pues nada. |
|
390 |
} |
|
391 |
} |
|
392 |
|
|
393 |
/** |
|
394 |
* @param extended The extended to set. |
|
395 |
*/ |
|
396 |
public void setEnlarge(boolean enlarge) { |
|
397 |
this.enlarge = enlarge; |
|
398 |
if(!enlarge){ |
|
399 |
frame.setSize(new Dimension(this.normalWidth + 12, this.normalHeight + 10)); |
|
400 |
//frame.setPreferredSize(new Dimension(this.normalWidth + 12, this.normalHeight + 10)); |
|
401 |
this.setPreferredSize(new Dimension(this.normalWidth, this.normalHeight)); |
|
402 |
this.setSize(new Dimension(this.normalWidth, this.normalHeight)); |
|
403 |
this.getConectorPanel().setCanvasVisible(false); |
|
404 |
}else{ |
|
405 |
frame.setSize(new Dimension(this.normalWidth + 12, this.enlargeHeight + 10)); |
|
406 |
//frame.setPreferredSize(new Dimension(this.normalWidth + 12, this.enlargeHeight + 10)); |
|
407 |
this.setPreferredSize(new Dimension(this.normalWidth, this.enlargeHeight)); |
|
408 |
this.setSize(new Dimension(this.normalWidth, this.enlargeHeight)); |
|
409 |
this.getConectorPanel().setCanvasVisible(true); |
|
410 |
} |
|
411 |
frame.pack(); |
|
412 |
} |
|
413 |
|
|
414 |
/** |
|
415 |
* @return Returns the extended. |
|
416 |
*/ |
|
417 |
public boolean isEnlarge() { |
|
418 |
return enlarge; |
|
419 |
} |
|
420 |
|
|
421 |
/** |
|
422 |
* Obtiene el panel conector |
|
423 |
* @return |
|
424 |
*/ |
|
425 |
public ConectorPanel getConectorPanel() { |
|
426 |
if (conectorPanel == null) { |
|
427 |
conectorPanel = new ConectorPanel(); |
|
428 |
} |
|
429 |
|
|
430 |
return conectorPanel; |
|
431 |
} |
|
432 |
|
|
433 |
/** |
|
434 |
* This method initializes jPanel |
|
435 |
* |
|
436 |
* @return javax.swing.JPanel |
|
437 |
*/ |
|
438 |
private JPanel getPBotones() { |
|
439 |
if (pBotones == null) { |
|
440 |
FlowLayout flowLayout1 = new FlowLayout(); |
|
441 |
pBotones = new JPanel(); |
|
442 |
pBotones.setLayout(flowLayout1); |
|
443 |
flowLayout1.setHgap(2); |
|
444 |
flowLayout1.setAlignment(java.awt.FlowLayout.RIGHT); |
|
445 |
pBotones.add(getDialogButtons(), null); |
|
446 |
pBotones.add(getBProcess(), null); |
|
447 |
pBotones.add(getBAccept(), null); |
|
448 |
pBotones.add(getBCancel(), null); |
|
449 |
} |
|
450 |
return pBotones; |
|
451 |
} |
|
452 |
|
|
453 |
/** |
|
454 |
* @return Returns the GeoRedimBehavior. |
|
455 |
*/ |
|
456 |
public GeoRedimBehavior getGeoRedimBehavior() { |
|
457 |
return rb; |
|
458 |
} |
|
459 |
|
|
460 |
/** |
|
461 |
* @param rb The GeoRedimBehavior to set. |
|
462 |
*/ |
|
463 |
public void setGeoRedimBehavior(GeoRedimBehavior rb) { |
|
464 |
this.rb = rb; |
|
465 |
} |
|
466 |
|
|
467 |
/** |
|
468 |
* @return Returns the GeoMoveBehavior |
|
469 |
*/ |
|
470 |
public GeoMoveBehavior getGeoMoveBehavior() { |
|
471 |
return mb; |
|
472 |
} |
|
473 |
|
|
474 |
/** |
|
475 |
* @param mb The GeoMoveBehavior to set. |
|
476 |
*/ |
|
477 |
public void setGeoMoveBehavior(GeoMoveBehavior mb) { |
|
478 |
this.mb = mb; |
|
479 |
} |
|
480 |
|
|
481 |
|
|
482 |
/** |
|
483 |
* Obtiene el punto de la lista que ha sido seleccionado |
|
484 |
* @return |
|
485 |
*/ |
|
486 |
public int getSelectedPoint(){ |
|
487 |
return getConectorPanel().getDataPointsTabPanel(). |
|
488 |
getSelectPointsPanel().getTableControlerPanel().getSelectedIndex(); |
|
489 |
} |
|
490 |
|
|
491 |
/** |
|
492 |
* Obtiene el control de la mini imagen que tiene los botones a la izquierda |
|
493 |
* @return ZoomControlPanel |
|
494 |
*/ |
|
495 |
public ZoomControlPanel getZoomControlLeft(){ |
|
496 |
return this.getConectorPanel().getAdjustGeorefPanel().getZoomLeft(); |
|
497 |
} |
|
498 |
|
|
499 |
/** |
|
500 |
* Obtiene el control de la mini imagen que tiene los botones a la derecha |
|
501 |
* @return ZoomControlPanel |
|
502 |
*/ |
|
503 |
public ZoomControlPanel getZoomControlRight(){ |
|
504 |
return this.getConectorPanel().getAdjustGeorefPanel().getZoomRight(); |
|
505 |
} |
|
506 |
|
|
507 |
/** |
|
508 |
* Obtiene el panel de selecci?n de puntos |
|
509 |
* @return Panel de selecci?n de puntos |
|
510 |
*/ |
|
511 |
public SelectPointsPanel getSelectPointsPanel(){ |
|
512 |
return this.getConectorPanel().getDataPointsTabPanel().getSelectPointsPanel(); |
|
513 |
} |
|
514 |
|
|
515 |
/** |
|
516 |
* Obtiene el panel de opciones |
|
517 |
* @return OptionPanel |
|
518 |
*/ |
|
519 |
public OptionsPanel getOptionsPanel(){ |
|
520 |
return getConectorPanel().getAdjustGeorefPanel().getOptionsPanel(); |
|
521 |
} |
|
522 |
|
|
523 |
/** |
|
524 |
* Activa o desactiva este panel y todos los que lo componen |
|
525 |
* @param enabled variable booleana para la activaci?n y/o desactivaci?n |
|
526 |
*/ |
|
527 |
public void setEnabled(boolean enabled){ |
|
528 |
conectorPanel.getDataPointsTabPanel().getSelectPointsPanel().setEnabled(enabled); |
|
529 |
conectorPanel.getAdjustGeorefPanel().setEnabled(enabled); |
|
530 |
} |
|
531 |
|
|
532 |
/** |
|
533 |
* |
|
534 |
*/ |
|
535 |
public ViewPort getLeftInitViewport(ViewPort vp, Point2D center, ViewPort initVp, double zoom){ |
|
536 |
return getZoomControlLeft().getCanvas().initViewPort(vp, center, initVp, zoom); |
|
537 |
} |
|
538 |
|
|
539 |
/** |
|
540 |
* Obtiene el bot?n de activar/desactivar la inserci?n de punto del panel del control de |
|
541 |
* tabla |
|
542 |
* @return JToggleButton |
|
543 |
*/ |
|
544 |
public JToggleButton getBInsertPointOfTablePoints(){ |
|
545 |
return tablePointsPanel.getPTablePanelButtons().getBInsertPoint(); |
|
546 |
} |
|
547 |
|
|
548 |
/** |
|
549 |
* Obtiene el bot?n de activar/desactivar la inserci?n de punto del panel del control de |
|
550 |
* tabla |
|
551 |
* @return JToggleButton |
|
552 |
*/ |
|
553 |
public JButton getBNewPointOfTablePoints(){ |
|
554 |
return tablePointsPanel.getTableControlerPanel().getBNew(); |
|
555 |
} |
|
556 |
|
|
557 |
/** |
|
558 |
* This method initializes jPanel |
|
559 |
* |
|
560 |
* @return javax.swing.JPanel |
|
561 |
*/ |
|
562 |
public DialogButtons getDialogButtons() { |
|
563 |
if (dialogButtons == null) { |
|
564 |
dialogButtons = new DialogButtons(); |
|
565 |
} |
|
566 |
return dialogButtons; |
|
567 |
} |
|
568 |
|
|
569 |
/** |
|
570 |
* Activa/desactiva los botones de la barra correspondientes al salvado |
|
571 |
* de datos a disco. |
|
572 |
* @param active true activa los controles y false los desactiva. |
|
573 |
*/ |
|
574 |
public void setEnableSaveButtons(boolean active){ |
|
575 |
getDialogButtons().getBSave().setEnabled(active); |
|
576 |
getDialogButtons().getBExportToCSV().setEnabled(active); |
|
577 |
} |
|
578 |
//**********************End Setters & Getters***************** |
|
579 |
|
|
580 |
public void updateData(int nPunto, Point2D pixel, Point2D map, View view) { |
|
581 |
|
|
582 |
} |
|
583 |
|
|
584 |
public void savePoints() throws Exception { |
|
585 |
|
|
586 |
} |
|
587 |
|
|
588 |
public boolean isErrorCSV() { |
|
589 |
return false; |
|
590 |
} |
|
591 |
|
|
592 |
public double[][] getErrors() { |
|
593 |
return null; |
|
594 |
} |
|
595 |
|
|
596 |
public void close() { |
|
597 |
|
|
598 |
} |
|
599 |
|
|
600 |
} |
|
601 |
|
|
602 |
|
|
603 |
} |
|
0 | 604 |
tags/old-raster/extensions/extGeoreferencing/src-test/org/gvsig/georeferencing/gui/pointsTable/PointsTable.java | ||
---|---|---|
1 |
package org.gvsig.georeferencing.gui.pointsTable; |
|
2 |
|
|
3 |
import java.awt.Component; |
|
4 |
import java.awt.GridLayout; |
|
5 |
import java.awt.event.ActionEvent; |
|
6 |
import java.awt.event.ActionListener; |
|
7 |
|
|
8 |
import javax.swing.AbstractCellEditor; |
|
9 |
import javax.swing.JCheckBox; |
|
10 |
import javax.swing.JPanel; |
|
11 |
import javax.swing.JScrollPane; |
|
12 |
import javax.swing.JTable; |
|
13 |
import javax.swing.SwingConstants; |
|
14 |
import javax.swing.SwingUtilities; |
|
15 |
import javax.swing.event.ListSelectionListener; |
|
16 |
import javax.swing.table.DefaultTableModel; |
|
17 |
import javax.swing.table.TableCellEditor; |
|
18 |
import javax.swing.table.TableCellRenderer; |
|
19 |
import javax.swing.table.TableModel; |
|
20 |
|
|
21 |
/** |
|
22 |
* Clase que representa la tabla de puntos |
|
23 |
* @author Nacho Brodin (brodin_ign@gva.es) |
|
24 |
*/ |
|
25 |
public class PointsTable extends JPanel { |
|
26 |
|
|
27 |
private JTable table = null; |
|
28 |
private JScrollPane jScrollPane = null; |
|
29 |
|
|
30 |
private TableModelPoint tabModel = null; |
|
31 |
private TableModel tabModel1 = null; |
|
32 |
final static String[] columnNames = {"", "N?", "X", "Y", |
|
33 |
"X'", "Y'", "Error X", |
|
34 |
"Error Y", "RMS"}; |
|
35 |
|
|
36 |
|
|
37 |
public TableModelPoint getTableModel(){ |
|
38 |
return tabModel; |
|
39 |
} |
|
40 |
|
|
41 |
public PointsTable() { |
|
42 |
super(new GridLayout(1,0)); |
|
43 |
|
|
44 |
|
|
45 |
//table.setPreferredScrollableViewportSize(new Dimension(500, 70)); |
|
46 |
|
|
47 |
|
|
48 |
/*TableColumn column = null; |
|
49 |
for (int i = 0; i < table.getModel().getColumnCount(); i++) { |
|
50 |
column = table.getColumnModel().getColumn(i); |
|
51 |
if(i == 0){ |
|
52 |
column.setCellRenderer(new CheckColumnRenderer()); |
|
53 |
column.setCellEditor(new CheckColumnEditor()); |
|
54 |
column.setMaxWidth(19); |
|
55 |
column.setMinWidth(19); |
|
56 |
} |
|
57 |
if(i == 1){ |
|
58 |
column.setMaxWidth(25); |
|
59 |
column.setMinWidth(25); |
|
60 |
} |
|
61 |
if((i == 2) || (i == 3)){ |
|
62 |
column.setMinWidth(50); |
|
63 |
column.setMaxWidth(140); |
|
64 |
} |
|
65 |
if((i == 4) || (i == 5)){ |
|
66 |
column.setMinWidth(80); |
|
67 |
column.setMaxWidth(190); |
|
68 |
} |
|
69 |
}*/ |
|
70 |
|
|
71 |
add( getJScrollPane()); |
|
72 |
} |
|
73 |
|
|
74 |
private JScrollPane getJScrollPane() { |
|
75 |
if (jScrollPane == null) { |
|
76 |
jScrollPane = new JScrollPane(); |
|
77 |
jScrollPane.setBounds(6, 17, 469, 280); |
|
78 |
jScrollPane.setViewportView(getTable()); |
|
79 |
} |
|
80 |
return jScrollPane; |
|
81 |
} |
|
82 |
|
|
83 |
public JTable getTable() { |
|
84 |
if (table == null) { |
|
85 |
table = new JTable(); |
|
86 |
table.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); |
|
87 |
table.getSelectionModel().addListSelectionListener(new ListSelectionListener() { |
|
88 |
public void valueChanged(javax.swing.event.ListSelectionEvent e) { |
|
89 |
|
|
90 |
} |
|
91 |
}); |
|
92 |
//tabModel = new TableModelPoint(); |
|
93 |
tabModel1 = new DefaultTableModel(null, columnNames); |
|
94 |
table = new JTable(tabModel1); |
|
95 |
} |
|
96 |
return table; |
|
97 |
} |
|
98 |
|
|
99 |
/** |
|
100 |
* TableModel del JTable que contiene los puntos con sus errores |
|
101 |
* @author Nacho Brodin (brodin_ign@gva.es) |
|
102 |
*/ |
|
103 |
public class TableModelPoint extends DefaultTableModel { |
|
104 |
|
|
105 |
public TableModelPoint(){ |
|
106 |
super(new Object[0][9], columnNames); |
|
107 |
} |
|
108 |
|
|
109 |
public int getColumnCount() { |
|
110 |
return columnNames.length; |
|
111 |
} |
|
112 |
|
|
113 |
public String getColumnName(int col) { |
|
114 |
return columnNames[col]; |
|
115 |
} |
|
116 |
|
|
117 |
public Class getColumnClass(int c) { |
|
118 |
if (c == 0) |
|
119 |
return Boolean.class; |
|
120 |
return String.class; |
|
121 |
} |
|
122 |
|
|
123 |
public void addNew() { |
|
124 |
super.addRow(new Object[] {new Boolean(true), "", "", "", "", "", "", "", ""}); |
|
125 |
} |
|
126 |
|
|
127 |
public void setValueAt(Object value, int row, int col) { |
|
128 |
super.setValueAt(value, row, col); |
|
129 |
} |
|
130 |
|
|
131 |
/** |
|
132 |
* Devuelve true si la celda es editable. Solo son editables |
|
133 |
* las celdas de los puntos. |
|
134 |
*/ |
|
135 |
public boolean isCellEditable(int row, int col){ |
|
136 |
return false; |
|
137 |
} |
|
138 |
} |
|
139 |
|
|
140 |
class CheckColumnRenderer extends JCheckBox implements TableCellRenderer { |
|
141 |
final private static long serialVersionUID = -3370601314380922368L; |
|
142 |
|
|
143 |
public Component getTableCellRendererComponent(JTable table, |
|
144 |
Object value, |
|
145 |
boolean isSelected, |
|
146 |
boolean hasFocus, |
|
147 |
int row, int column) { |
|
148 |
if (value == null) { |
|
149 |
this.setSelected(false); |
|
150 |
} |
|
151 |
|
|
152 |
Boolean ValueAsBoolean = (Boolean) value; |
|
153 |
this.setSelected(ValueAsBoolean.booleanValue()); |
|
154 |
this.setHorizontalAlignment(SwingConstants.CENTER); |
|
155 |
|
|
156 |
return this; |
|
157 |
} |
|
158 |
} |
|
159 |
|
|
160 |
class CheckColumnEditor extends AbstractCellEditor implements TableCellEditor { |
|
161 |
final private static long serialVersionUID = -3370601314380922368L; |
|
162 |
public JCheckBox checkBox; |
|
163 |
|
|
164 |
public CheckColumnEditor() { |
|
165 |
super(); |
|
166 |
checkBox = new JCheckBox(); |
|
167 |
checkBox.addActionListener(new ActionListener() { |
|
168 |
public void actionPerformed(ActionEvent event) { |
|
169 |
//checkBox.setSelected(!checkBox.isSelected()); |
|
170 |
fireEditingStopped(); |
|
171 |
} |
|
172 |
}); |
|
173 |
} |
|
174 |
|
|
175 |
public Component getTableCellEditorComponent(JTable table, Object obj, |
|
176 |
boolean isSelected, |
|
177 |
int row, int col) { |
|
178 |
checkBox.setHorizontalAlignment(SwingUtilities.CENTER); |
|
179 |
|
|
180 |
Boolean lValueAsBoolean = (Boolean) obj; |
|
181 |
checkBox.setSelected(lValueAsBoolean.booleanValue()); |
|
182 |
|
|
183 |
return checkBox; |
|
184 |
} |
|
185 |
|
|
186 |
public Object getCellEditorValue() { |
|
187 |
return new Boolean(checkBox.isSelected()); |
|
188 |
} |
|
189 |
} |
|
190 |
|
|
191 |
|
|
192 |
} |
|
0 | 193 |
tags/old-raster/extensions/extGeoreferencing/src-test/org/gvsig/georeferencing/gui/pointsTable/TestTable.java | ||
---|---|---|
1 |
package org.gvsig.georeferencing.gui.pointsTable; |
|
2 |
import java.awt.event.ComponentEvent; |
|
3 |
import java.awt.event.ComponentListener; |
|
4 |
|
|
5 |
import javax.swing.JFrame; |
|
6 |
import javax.swing.UIManager; |
|
7 |
|
|
8 |
|
|
9 |
public class TestTable extends JFrame implements ComponentListener{ |
|
10 |
|
|
11 |
private int widthTable = 575, heightTable = 110; |
|
12 |
|
|
13 |
public void componentHidden(ComponentEvent arg0) { |
|
14 |
|
|
15 |
} |
|
16 |
public void componentMoved(ComponentEvent arg0) { |
|
17 |
|
|
18 |
} |
|
19 |
public void componentResized(ComponentEvent arg0) { |
|
20 |
System.out.println(this.getSize().getWidth()+" "+this.getSize().getHeight()); |
|
21 |
} |
|
22 |
public void componentShown(ComponentEvent arg0) { |
|
23 |
|
|
24 |
} |
|
25 |
public TestTable(){ |
|
26 |
this.addComponentListener(this); |
|
27 |
this.setSize(553,158); |
|
28 |
PointsTable table = new PointsTable(); |
|
29 |
table.setSize(new java.awt.Dimension(widthTable, heightTable)); |
|
30 |
table.setPreferredSize(new java.awt.Dimension(widthTable, heightTable)); |
|
31 |
this.getContentPane().add(table); |
|
32 |
this.show(); |
|
33 |
} |
|
34 |
/** |
|
35 |
* @param args |
|
36 |
*/ |
|
37 |
public static void main(String[] args) { |
|
38 |
try { |
|
39 |
//UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); |
|
40 |
UIManager.setLookAndFeel("com.jgoodies.looks.plastic.PlasticXPLookAndFeel"); |
|
41 |
//UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); |
|
42 |
} catch( Exception e ) { |
|
43 |
System.err.println( "No se puede cambiar al LookAndFeel"); |
|
44 |
} |
|
45 |
TestTable f = new TestTable(); |
|
46 |
} |
|
47 |
|
|
48 |
} |
|
0 | 49 |
tags/old-raster/extensions/extGeoreferencing/config/text.properties | ||
---|---|---|
1 |
#Translations for language [es] |
|
2 |
#Mon Oct 30 09:38:21 CET 2006 |
|
3 |
accept_tip=Procesa los GCP's y salva la georreferenciaci\u00f3n. Da por terminada la introducci\u00f3n de GCP's. |
|
4 |
aceptar=Aceptar |
|
5 |
activo=Activo |
|
6 |
algoritmo=Algoritmo |
|
7 |
ampl_extent=Variar la extensi\u00f3n de la imagen a georreferenciar |
|
8 |
anterior=Anterior |
|
9 |
borrar_todos=Borrar todos los puntos |
|
10 |
borrar_uno=Borrar punto seleccionado |
|
11 |
cancel_tip=Cierra el dialogo deshaciendo los \u00faltimos cambios. Puede volver a editarse para georreferenciar. |
|
12 |
cancelar=Cancelar |
|
13 |
cargar=Cargar |
|
14 |
centrar_punto=Centrar punto seleccionado en la vista |
|
15 |
confirmacion=Confirmaci\u00f3n |
|
16 |
coordenadas_vacias=Coordenadas vac\u00edas |
|
17 |
crear_worldfile=Crear fichero de georreferenciaci\u00f3n (worldfile) |
|
18 |
cuadro_no_asociado=El cuadro de georreferenciaci\u00f3n no est\u00e1 asociado a ninguna capa sobre la vista, este se cerrar\u00e1. Por favor, abra el di\u00e1logo asociado a la capa que necesite. |
|
19 |
de=de |
|
20 |
de\ =de |
|
21 |
de\ 0=de 0 |
|
22 |
desactivar_capa=Oculta la capa despu\u00e9s del primer punto. |
|
23 |
desactivar_puntos=Desactiva capa de puntos despu\u00e9s del primer punto. |
|
24 |
eliminar_punto=Eliminar punto |
|
25 |
eliminar_todos_puntos=Eliminar todos los puntos |
|
26 |
error_capa_puntos=Error al cargar la capa. Puede que la capa de Georreferenciaci\u00f3n no est\u00e9 activa. |
|
27 |
errores_csv=Incluir los errores en fichero CSV. |
|
28 |
escala=Escala |
|
29 |
fuera_de_extent=El punto seleccionado est\u00e1 fuera del extent de la imagen |
|
30 |
gcps_exist="Ya existen puntos de control asociados al raster. ?Desea sobreescribirlos?" |
|
31 |
georaster=Georreferenciaci\u00f3n |
|
32 |
georef=Georreferenciar |
|
33 |
georef_file=Fichero de georreferenciaci\u00f3n |
|
34 |
georreferenciar=Georreferenciar |
|
35 |
grado_polinomio=Grado del polinomio |
|
36 |
imagen_no_accesible=No ha sido posible acceder a la imagen. |
|
37 |
import_from_ascii=Importar la tabla de puntos desde fichero .csv. |
|
38 |
latitud=Latitud |
|
39 |
load_from_xml=Cargar desde fichero XML (.rmf) |
|
40 |
mostrar_puntos=Mostrar numeraci\u00f3n |
|
41 |
Mover_geo=Mover imagen a georreferenciar |
|
42 |
no=No |
|
43 |
nuevo=Nuevo |
|
44 |
options=Opciones |
|
45 |
plegar_despl=Plegar/Desplegar |
|
46 |
primero=Primero |
|
47 |
procesar=Procesar |
|
48 |
process_tip=Procesa los GCP's y asigna un extent temporal a la imagen. |
|
49 |
punto=Punto |
|
50 |
puntos=Puntos |
|
51 |
save_to_ascii=Exportar tabla de puntos a fichero de texto. |
|
52 |
save_to_xml=Salvar a fichero XML (.grf) |
|
53 |
seleccionar_fichero=Seleccionar fichero |
|
54 |
selectfromview=Seleccionar punto desde la vista |
|
55 |
siguiente=Siguiente |
|
56 |
table=Tabla |
|
57 |
total=Total |
|
58 |
ultimo=\u00daltimo |
|
59 |
usar_georeferenciacion_de_la_imagen=Usar georeferenciaci\u00f3n de la imagen |
|
60 |
yes=Si |
|
61 |
Zoom_previo=Extensi\u00f3n anterior |
|
62 |
Zoom_sgte=Extensi\u00f3n siguiente |
|
0 | 63 |
tags/old-raster/extensions/extGeoreferencing/config/text_zh.properties | ||
---|---|---|
1 |
#Translations for language [en] |
|
2 |
#Fri Nov 03 13:14:56 CET 2006 |
|
3 |
accept_tip=\u8fd0\u884c GCPs \u4ee5\u53ca\u4fdd\u5b58\u5730\u7406\u53c2\u8003\u3002\u7ed3\u675f GCPs \u4ecb\u7ecd\u3002 |
|
4 |
aceptar=\u786e\u5b9a |
|
5 |
activo=\u6fc0\u6d3b |
|
6 |
algoritmo=\u7b97\u6cd5 |
|
7 |
ampl_extent=\u66f4\u6539\u7528\u4e8e\u5730\u7406\u53c2\u8003\u7684\u56fe\u7247\u6269\u5c55 |
|
8 |
anterior=\u540e\u9000 |
|
9 |
borrar_todos=\u5168\u90e8\u5220\u9664 |
|
10 |
borrar_uno=\u5220\u9664\u5df2\u9009\u5b9a\u6807\u70b9 |
|
11 |
cancel_tip=\u64a4\u6d88\u6700\u540e\u66f4\u6539\u548c\u5173\u95ed\u5bf9\u8bdd\u6846\u3002\u53ef\u4ee5\u91cd\u65b0\u7f16\u8f91\u5b83\u3002 |
|
12 |
cancelar=\u53d6\u6d88 |
|
13 |
cargar=\u8f7d\u5165 |
|
14 |
centrar_punto=\u5728\u89c6\u56fe\u4e0a\u628a\u5df2\u9009\u5b9a\u6807\u70b9\u96c6\u4e2d |
|
15 |
confirmacion=\u786e\u8ba4... |
|
16 |
coordenadas_vacias=\u7a7a\u5750\u6807 |
|
17 |
crear_worldfile=\u521b\u5efa Worldfile |
|
18 |
cuadro_no_asociado=\u5730\u7406\u53c2\u8003\u7bb1\u672a\u4e0e\u89c6\u56fe\u4e0a\u4efb\u4f55\u56fe\u5c42\u8054\u5408\uff0c\u5b83\u5c06\u4f1a\u88ab\u5173\u95ed\u3002\u8bf7\u6253\u5f00\u6709\u5173\u5bf9\u8bdd\u6846\u3002 |
|
19 |
de=\u7684 |
|
20 |
de\ =\u7684 |
|
21 |
de\ 0=0 \u7684 |
|
22 |
desactivar_capa=\u5728\u7b2c\u4e00\u70b9\u4e4b\u540e\u9690\u85cf\u56fe\u5c42\u3002 |
|
23 |
desactivar_puntos=\u5728\u7b2c\u4e00\u70b9\u4e4b\u540e\u7981\u7528\u6807\u70b9\u56fe\u5c42 |
|
24 |
eliminar_punto=\u5220\u9664\u6807\u70b9 |
|
25 |
eliminar_todos_puntos=\u5220\u9664\u6240\u6709\u6807\u70b9 |
|
26 |
error_capa_puntos=\u8f7d\u5165\u56fe\u5c42\u65f6\u51fa\u9519\u3002\u53ef\u80fd\u5730\u7406\u53c2\u8003\u5c42\u672a\u88ab\u6fc0\u6d3b\u3002 |
|
27 |
errores_csv=\u5c06\u9519\u8bef\u5305\u62ec\u5728 CSV \u6587\u4ef6\u4e2d\u3002 |
|
28 |
escala=\u6bd4\u4f8b |
|
29 |
fuera_de_extent=\u5df2\u9009\u5b9a\u6807\u70b9\u5904\u4e8e\u56fe\u7247\u9650\u5ea6\u4e4b\u5916\u3002 |
|
30 |
gcps_exist="\u4e0eRaster\u8054\u5408\u7684\u63a7\u5236\u70b9\u5df2\u5b58\u5728\u3002 \u8981\u66ff\u6362\u5b83\u5417?" |
|
31 |
georaster=\u5730\u7406\u53c2\u8003 |
|
32 |
georef=\u5730\u7406\u53c2\u8003 |
|
33 |
georef_file=\u5730\u7406\u53c2\u8003\u6587\u4ef6 |
|
34 |
georreferenciar=\u5730\u7406\u53c2\u8003\u56fe\u7247 |
|
35 |
grado_polinomio=\u591a\u9879\u5f0f\u5ea6 |
|
36 |
imagen_no_accesible=\u65e0\u6cd5\u8bfb\u53d6\u56fe\u7247\u3002 |
|
37 |
import_from_ascii=\u4ece CSV \u6587\u4ef6\u4e2d\u8f93\u5165\u8868\u683c (.csv) |
|
38 |
latitud=\u7eac\u5ea6 |
|
39 |
load_from_xml=\u4ece XML \u6587\u4ef6\u4e2d\u8f7d\u5165 (.rmf) |
|
40 |
mostrar_puntos=\u663e\u793a\u6570\u5b57 |
|
41 |
Mover_geo=\u79fb\u52a8\u5730\u7406\u53c2\u8003\u56fe\u7247\u3002 |
|
42 |
no=\u5426 |
|
43 |
nuevo=\u65b0\u5efa |
|
44 |
options=\u9009\u9879 |
|
45 |
plegar_despl=\u9ad8\u7ea7 |
|
46 |
primero=First |
|
47 |
procesar=\u5904\u7406 |
|
48 |
process_tip=\u8fd0\u884c GCP's \u4ee5\u53ca\u4e3a\u56fe\u7247\u6307\u5b9a\u4e00\u4e2a\u4e34\u65f6\u6269\u5c55\u3002 |
|
49 |
punto=\u6807\u70b9 |
|
50 |
puntos=\u6807\u70b9 |
|
51 |
save_to_ascii=\u5c06\u6807\u70b9\u8868\u683c\u8f93\u5230\u6587\u6863\u4e2d\u3002 |
|
52 |
save_to_xml=\u5b58\u76d8\u4e3a XML (.grf) |
|
53 |
seleccionar_fichero=\u9009\u62e9\u6587\u4ef6 |
|
54 |
selectfromview=\u4ece\u89c6\u56fe\u91cc\u9009\u5b9a\u6807\u70b9 |
|
55 |
siguiente=\u7ee7\u7eed |
|
56 |
table=\u8868\u683c |
|
57 |
total=\u5168\u90e8 |
|
58 |
ultimo=\u6700\u540e\u4e00\u6b21 |
|
59 |
usar_georeferenciacion_de_la_imagen=\u4f7f\u7528\u56fe\u7247\u7684\u5730\u7406\u53c2\u8003 |
|
60 |
yes=\u662f |
|
61 |
Zoom_previo=\u4e0a\u4e00\u4e2a\u7f29\u653e |
|
62 |
Zoom_sgte=\u4e0b\u4e00\u4e2a\u7f29\u653e |
|
0 | 63 |
tags/old-raster/extensions/extGeoreferencing/config/text_en.properties | ||
---|---|---|
1 |
#Translations for language [en] |
|
2 |
#Mon Oct 30 09:38:21 CET 2006 |
|
3 |
accept_tip=Process the GCPs and save the georreferencing. Finish the GCPs introduction. |
|
4 |
aceptar=Accept |
|
5 |
activo=Active |
|
6 |
algoritmo=Algorithm |
|
7 |
ampl_extent=Change the extension of the image to georreference |
|
8 |
anterior=Previous |
|
9 |
borrar_todos=Delete all |
|
10 |
borrar_uno=Delete selected point |
|
11 |
cancel_tip=Undo the last changes and close the dialog. It can be edited again to georreference. |
|
12 |
cancelar=Cancel |
|
13 |
cargar=Load |
|
14 |
centrar_punto=Center view in the selected point |
|
15 |
confirmacion=Confirm that... |
|
16 |
coordenadas_vacias=Empty coordinates |
|
17 |
crear_worldfile=Create worldfile |
|
18 |
cuadro_no_asociado=The georreferencing box is not associated with any layer on the view, it will be closed. Please, open the dialog associated to the required layer. |
|
19 |
de=of |
|
20 |
de\ =of |
|
21 |
de\ 0=of 0 |
|
22 |
desactivar_capa=Hide the layer after the first point. |
|
23 |
desactivar_puntos=Disable the point layer after the first point. |
|
24 |
eliminar_punto=Remove point |
|
25 |
eliminar_todos_puntos=Remove all points |
|
26 |
error_capa_puntos=Error loading the layer. Maybe the Georreferencing layer is not active. |
|
27 |
errores_csv=Include the errors in the CSV file. |
|
28 |
escala=Scale |
|
29 |
fuera_de_extent=The selected point is out of the image's extent |
|
30 |
georaster=Georeferencing |
|
31 |
georef=Georeference |
|
32 |
georef_file=Georeferencing file |
|
33 |
georreferenciar=Georeference image |
|
34 |
grado_polinomio=Polynom deegree |
|
35 |
imagen_no_accesible=Unable to access the image |
|
36 |
import_from_ascii=Import table from a CSV (.csv) file. |
|
37 |
latitud=Latitud |
|
38 |
load_from_xml=Load from XML file (.rmf) |
|
39 |
mostrar_puntos=Show numbers |
|
40 |
Mover_geo=Move georeferenced image. |
|
41 |
no=No |
|
42 |
nuevo=New |
|
43 |
options=Options |
|
44 |
plegar_despl=Advanced |
|
45 |
primero=First |
|
46 |
procesar=Process |
|
47 |
process_tip=Processes the GCP's and assigns a temporal extent to the images |
|
48 |
punto=Point |
|
49 |
puntos=Points |
|
50 |
save_to_ascii=Export table of points into a text file. |
|
51 |
save_to_xml=Save to XML (.grf) |
|
52 |
seleccionar_fichero=Select file |
|
53 |
selectfromview=Select a point from the view |
|
54 |
siguiente=Next |
|
55 |
table=Table |
|
56 |
total=Total |
|
57 |
ultimo=Last |
|
58 |
usar_georeferenciacion_de_la_imagen=Use image georeferentiation |
|
59 |
yes=Yes |
|
60 |
Zoom_previo=Previous zoom |
|
61 |
Zoom_sgte=Next zoom |
|
0 | 62 |
tags/old-raster/extensions/extGeoreferencing/config/text_gl.properties | ||
---|---|---|
1 |
#Translations for language [gl] |
|
2 |
#Mon Oct 30 09:38:21 CET 2006 |
|
3 |
accept_tip= |
|
4 |
aceptar=Aceptar |
|
5 |
activo=Activo |
|
6 |
algoritmo=Algoritmo |
|
7 |
ampl_extent= |
|
8 |
anterior=Anterior |
|
9 |
borrar_todos=Borrar todos os puntos |
|
10 |
borrar_uno=Borrar punto seleccionado |
|
11 |
cancel_tip= |
|
12 |
cancelar=Cancelar |
|
13 |
cargar= |
|
14 |
centrar_punto= |
|
15 |
confirmacion=Confirmaci\u00f3n |
|
16 |
coordenadas_vacias=Coordenadas baleiras |
|
17 |
crear_worldfile=Crear arquivo de xeoreferenciaci\u00f3n (worldfile) |
|
18 |
cuadro_no_asociado= |
|
19 |
de=de |
|
20 |
de\ = |
|
21 |
de\ 0= |
|
22 |
desactivar_capa= |
|
23 |
desactivar_puntos= |
|
24 |
eliminar_punto= |
|
25 |
eliminar_todos_puntos= |
|
26 |
error_capa_puntos=Erro ao cargar a capa. Pode que a capa de Xeoreferenciaci\u00f3n non est\u00e9 activa |
|
27 |
errores_csv= |
|
28 |
escala=Escala |
|
29 |
fuera_de_extent=O punto seleccionado est\u00e1 f\u00f3ra do 'extent' da imaxe |
|
30 |
georaster=Xeoreferenciaci\u00f3n |
|
31 |
georef=Xeoreferenciar |
|
32 |
georef_file= |
|
33 |
georreferenciar=Xeoreferenciar |
|
34 |
grado_polinomio=Grao do polinomio |
|
35 |
imagen_no_accesible= |
|
36 |
import_from_ascii= |
|
37 |
latitud=Latitude |
|
38 |
load_from_xml=Cargar desde arquivo XML (.rmf) |
|
39 |
mostrar_puntos=Amosar numeraci\u00f3n |
|
40 |
Mover_geo=Mover imaxe a xeorefenciar |
|
41 |
no=Non |
|
42 |
nuevo=Novo |
|
43 |
options=Opci\u00f3ns |
|
44 |
plegar_despl=Plegar/Desplegar |
|
45 |
primero=Primeiro |
|
46 |
procesar= |
|
47 |
process_tip= |
|
48 |
punto=Punto |
|
49 |
puntos=Puntos |
|
50 |
save_to_ascii=Exportar t\u00e1boa de puntos a arquivo de texto. |
|
51 |
save_to_xml=Garda a arquivo XML (.grf) |
|
52 |
seleccionar_fichero=Seleccionar arquivo |
|
53 |
selectfromview= |
|
54 |
siguiente=Seguinte |
|
55 |
table=T\u00e1boa |
|
56 |
total= |
|
57 |
ultimo=Derradeiro |
|
58 |
usar_georeferenciacion_de_la_imagen= |
|
59 |
yes=Si |
|
60 |
Zoom_previo= |
|
61 |
Zoom_sgte= |
|
0 | 62 |
tags/old-raster/extensions/extGeoreferencing/config/text_ca.properties | ||
---|---|---|
1 |
#Translations for language [ca] |
|
2 |
#Mon Oct 30 09:38:21 CET 2006 |
|
3 |
accept_tip= |
|
4 |
aceptar=Acceptar |
|
5 |
activo=Actiu |
|
6 |
algoritmo=Algoritme |
|
7 |
ampl_extent= |
|
8 |
anterior=Anterior |
|
9 |
borrar_todos=Esborrar tots els punts |
|
10 |
borrar_uno=Esborrar punt seleccionat |
|
11 |
cancel_tip= |
|
12 |
cancelar=Cancel\u00b7lar |
|
13 |
cargar=Carregar |
|
14 |
centrar_punto= |
|
15 |
confirmacion=Confirmaci\u00f3 |
|
16 |
coordenadas_vacias=Coordenades buides |
|
17 |
crear_worldfile=Crear fitxer de georeferenciaci\u00f3 (worldfile) |
|
18 |
cuadro_no_asociado= |
|
19 |
de=de |
|
20 |
de\ = |
|
21 |
de\ 0= |
|
22 |
desactivar_capa= |
|
23 |
desactivar_puntos= |
|
24 |
eliminar_punto=Eliminar punt |
|
25 |
eliminar_todos_puntos=Eliminar tots els punts |
|
26 |
error_capa_puntos=Error en carregar la capa. \u00c9s possible que la capa de Georeferenciaci\u00f3 no estiga activa |
|
27 |
errores_csv= |
|
28 |
escala=Escala |
|
29 |
fuera_de_extent=El punt seleccionat est\u00e0 fora de l'extensi\u00f3 de la imatge |
|
30 |
georaster=Georeferenciaci\u00f3 |
|
31 |
georef=Georeferenciar |
|
32 |
georef_file= |
|
33 |
georreferenciar=Georeferenciar |
|
34 |
grado_polinomio=Grau del polinomi |
|
35 |
imagen_no_accesible= |
|
36 |
import_from_ascii= |
Also available in: Unified diff