Revision 867 org.gvsig.geotools.proj/trunk/org.gvsig.geotools.proj/org.gvsig.geotools.proj.main/src/main/java/org/gvsig/geotools/proj/main/TestCrsPanel.java
TestCrsPanel.java | ||
---|---|---|
1 | 1 |
package org.gvsig.geotools.proj.main; |
2 | 2 |
|
3 | 3 |
|
4 |
import java.util.List; |
|
5 |
|
|
4 | 6 |
import javax.swing.JFrame; |
5 | 7 |
import javax.swing.SwingUtilities; |
6 | 8 |
|
7 | 9 |
import org.apache.log4j.ConsoleAppender; |
8 | 10 |
import org.apache.log4j.Level; |
9 | 11 |
import org.apache.log4j.PatternLayout; |
12 |
import org.gvsig.proj.catalog.TransformationDefinition; |
|
13 |
import org.gvsig.proj.catalog.exception.CoordinateReferenceSystemException; |
|
14 |
import org.gvsig.proj.catalog.exception.UnsupportedCoordinateReferenceSystemException; |
|
10 | 15 |
import org.gvsig.proj.swing.CoordinateReferenceSystemSelectorComponent; |
11 | 16 |
import org.gvsig.proj.swing.CoordinateReferenceSystemSwingLocator; |
17 |
import org.gvsig.proj.swing.CoordinateTransformationSelectorComponent; |
|
12 | 18 |
import org.gvsig.proj.swing.impl.DefaultCoordinateReferenceSystemSwingManager; |
13 | 19 |
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer; |
14 | 20 |
|
... | ... | |
17 | 23 |
public TestCrsPanel() { |
18 | 24 |
// TODO Auto-generated constructor stub |
19 | 25 |
} |
20 |
|
|
26 |
|
|
21 | 27 |
public static void main(String[] args) { |
22 | 28 |
ConsoleAppender console = new ConsoleAppender(); //create appender |
23 | 29 |
//configure the appender |
... | ... | |
32 | 38 |
initializer.fullInitialize(); |
33 | 39 |
final JFrame frame = new JFrame(); |
34 | 40 |
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
41 |
|
|
42 |
try { |
|
35 | 43 |
DefaultCoordinateReferenceSystemSwingManager manager = (DefaultCoordinateReferenceSystemSwingManager) CoordinateReferenceSystemSwingLocator.getSwingManager(); |
44 |
manager.getCoordinateReferenceSystemHistory().add(manager.getCatalogManager().getCRSDefinition("EPSG:3857")); |
|
45 |
manager.getCoordinateReferenceSystemHistory().add(manager.getCatalogManager().getCRSDefinition("EPSG:23030")); |
|
46 |
|
|
47 |
CoordinateReferenceSystemSelectorComponent selector = manager.createCoordinateReferenceSystemSelectionComponent(); |
|
48 |
selector.setCustomGroupLabel("Layer"); |
|
49 |
|
|
50 |
selector.addCustomCRS(manager.getCatalogManager().getCRSDefinition("EPSG:25830")); |
|
51 |
selector.addCustomCRS(manager.getCatalogManager().getCRSDefinition("EPSG:25831")); |
|
36 | 52 |
|
37 |
CoordinateReferenceSystemSelectorComponent selector = manager.createCoordinateReferenceSystemSelectionComponent(); |
|
38 | 53 |
frame.add(selector.asJComponent()); |
39 | 54 |
frame.setSize(400, 600); |
40 | 55 |
//frame.pack(); |
... | ... | |
43 | 58 |
frame.setVisible(true); |
44 | 59 |
} |
45 | 60 |
}); |
46 |
|
|
61 |
} catch (UnsupportedCoordinateReferenceSystemException e) { |
|
62 |
// TODO Auto-generated catch block |
|
63 |
e.printStackTrace(); |
|
64 |
} |
|
47 | 65 |
} |
48 |
|
|
49 | 66 |
} |
Also available in: Unified diff