Revision 38
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.1/pom.xml | ||
---|---|---|
1 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<groupId>org.gvsig</groupId> |
|
4 |
<artifactId>org.gvsig.derivedgeometries</artifactId> |
|
5 |
<version>1.0.1</version> |
|
6 |
<packaging>pom</packaging> |
|
7 |
<name>org.gvsig.derivedgeometries</name> |
|
8 |
<parent> |
|
9 |
<groupId>org.gvsig</groupId> |
|
10 |
<artifactId>org.gvsig.desktop</artifactId> |
|
11 |
<version>2.0.67</version> |
|
12 |
</parent> |
|
13 |
<url>http://devel.gvsig.org/sites/org.gvsig.derivedgeometries/${project.version}</url> |
|
14 |
<scm> |
|
15 |
<connection>scm:svn:https://devel.gvsig.org/svn/gvsig-derived-geometries/org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.1</connection> |
|
16 |
<developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-derived-geometries/org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.1</developerConnection> |
|
17 |
<url>https://devel.gvsig.org/redmine/projects/gvsig-derived-geometries/repository/show/org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.1</url> |
|
18 |
</scm> |
|
19 |
<repositories> |
|
20 |
<repository> |
|
21 |
<id>gvsig-public-http-repository</id> |
|
22 |
<name>gvSIG maven public HTTP repository</name> |
|
23 |
<url>http://devel.gvsig.org/m2repo/j2se</url> |
|
24 |
<releases> |
|
25 |
<enabled>true</enabled> |
|
26 |
<updatePolicy>daily</updatePolicy> |
|
27 |
<checksumPolicy>warn</checksumPolicy> |
|
28 |
</releases> |
|
29 |
<snapshots> |
|
30 |
<enabled>true</enabled> |
|
31 |
<updatePolicy>daily</updatePolicy> |
|
32 |
<checksumPolicy>warn</checksumPolicy> |
|
33 |
</snapshots> |
|
34 |
</repository> |
|
35 |
</repositories> |
|
36 |
<distributionManagement> |
|
37 |
<site> |
|
38 |
<id>gvsig-repository</id> |
|
39 |
<url>dav:https://devel.gvsig.org/download/projects/gvsig-derived-geometries/pool/${project.artifactId}/${project.version}</url> |
|
40 |
</site> |
|
41 |
</distributionManagement> |
|
42 |
<build> |
|
43 |
<plugins> |
|
44 |
<plugin> |
|
45 |
<groupId>org.apache.maven.plugins</groupId> |
|
46 |
<artifactId>maven-release-plugin</artifactId> |
|
47 |
<configuration> |
|
48 |
<tagBase>https://devel.gvsig.org/svn/gvsig-derived-geometries/${project.artifactId}/tags</tagBase> |
|
49 |
<goal>deploy</goal> |
|
50 |
</configuration> |
|
51 |
</plugin> |
|
52 |
</plugins> |
|
53 |
</build> |
|
54 |
|
|
55 |
<modules> |
|
56 |
<module>org.gvsig.derivedgeometries.app</module> |
|
57 |
<module>org.gvsig.derivedgeometries.swing</module> |
|
58 |
<module>org.gvsig.derivedgeometries.main</module> |
|
59 |
</modules> |
|
60 |
<dependencyManagement> |
|
61 |
<dependencies> |
|
62 |
<dependency> |
|
63 |
<groupId>org.gvsig</groupId> |
|
64 |
<artifactId> |
|
65 |
org.gvsig.derivedgeometries.swing.api |
|
66 |
</artifactId> |
|
67 |
<version>1.0.1</version> |
|
68 |
</dependency> |
|
69 |
<dependency> |
|
70 |
<groupId>org.gvsig</groupId> |
|
71 |
<artifactId> |
|
72 |
org.gvsig.derivedgeometries.swing.impl |
|
73 |
</artifactId> |
|
74 |
<version>1.0.1</version> |
|
75 |
</dependency> |
|
76 |
</dependencies> |
|
77 |
</dependencyManagement> |
|
78 |
</project> |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.1/org.gvsig.derivedgeometries.main/src/main/java/org/gvsig/derivedgeometries/main/DummyLayerOrderManager.java | ||
---|---|---|
1 |
/* |
|
2 |
* Copyright 2014 DiSiD Technologies S.L.L. All rights reserved. |
|
3 |
* |
|
4 |
* Project : DiSiD org.gvsig.derivedgeometries.main |
|
5 |
* SVN Id : $Id$ |
|
6 |
*/ |
|
7 |
package org.gvsig.derivedgeometries.main; |
|
8 |
|
|
9 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
10 |
import org.gvsig.fmap.mapcontext.layers.FLayers; |
|
11 |
import org.gvsig.fmap.mapcontext.layers.order.LayerOrderManager; |
|
12 |
import org.gvsig.tools.persistence.PersistentState; |
|
13 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
|
14 |
|
|
15 |
|
|
16 |
public class DummyLayerOrderManager implements LayerOrderManager{ |
|
17 |
|
|
18 |
public void saveToState(PersistentState state) throws PersistenceException { |
|
19 |
// TODO Auto-generated method stub |
|
20 |
|
|
21 |
} |
|
22 |
|
|
23 |
public void loadFromState(PersistentState state) |
|
24 |
throws PersistenceException { |
|
25 |
// TODO Auto-generated method stub |
|
26 |
|
|
27 |
} |
|
28 |
|
|
29 |
public int getPosition(FLayers target, FLayer newLayer) { |
|
30 |
// TODO Auto-generated method stub |
|
31 |
return 0; |
|
32 |
} |
|
33 |
|
|
34 |
public String getName() { |
|
35 |
// TODO Auto-generated method stub |
|
36 |
return null; |
|
37 |
} |
|
38 |
|
|
39 |
public String getDescription() { |
|
40 |
// TODO Auto-generated method stub |
|
41 |
return null; |
|
42 |
} |
|
43 |
|
|
44 |
public String getCode() { |
|
45 |
// TODO Auto-generated method stub |
|
46 |
return null; |
|
47 |
} |
|
48 |
|
|
49 |
public Object clone() throws CloneNotSupportedException{ |
|
50 |
return new DummyLayerOrderManager(); |
|
51 |
} |
|
52 |
|
|
53 |
} |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.1/org.gvsig.derivedgeometries.main/src/main/java/org/gvsig/derivedgeometries/main/Main.java | ||
---|---|---|
1 |
/* |
|
2 |
* Copyright 2014 DiSiD Technologies S.L.L. All rights reserved. |
|
3 |
* |
|
4 |
* Project : DiSiD org.gvsig.derivedgeometries.main |
|
5 |
* SVN Id : $Id$ |
|
6 |
*/ |
|
7 |
package org.gvsig.derivedgeometries.main; |
|
8 |
|
|
9 |
import java.awt.BorderLayout; |
|
10 |
import java.awt.Dimension; |
|
11 |
import java.awt.event.ActionEvent; |
|
12 |
import java.io.File; |
|
13 |
|
|
14 |
import javax.swing.AbstractAction; |
|
15 |
import javax.swing.JButton; |
|
16 |
import javax.swing.JComponent; |
|
17 |
import javax.swing.JFrame; |
|
18 |
import javax.swing.JMenu; |
|
19 |
import javax.swing.JMenuBar; |
|
20 |
import javax.swing.JMenuItem; |
|
21 |
import javax.swing.JOptionPane; |
|
22 |
import javax.swing.JToolBar; |
|
23 |
import javax.swing.WindowConstants; |
|
24 |
|
|
25 |
import org.cresques.cts.IProjection; |
|
26 |
|
|
27 |
import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesLocator; |
|
28 |
import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesManager; |
|
29 |
import org.gvsig.fmap.crs.CRSFactory; |
|
30 |
import org.gvsig.fmap.dal.DALLocator; |
|
31 |
import org.gvsig.fmap.dal.DataManager; |
|
32 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
33 |
import org.gvsig.fmap.dal.exception.InitializeException; |
|
34 |
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException; |
|
35 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
|
36 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
37 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
|
38 |
import org.gvsig.fmap.mapcontext.MapContextManager; |
|
39 |
import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException; |
|
40 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
41 |
import org.gvsig.fmap.mapcontrol.MapControl; |
|
42 |
import org.gvsig.fmap.mapcontrol.MapControlCreationException; |
|
43 |
import org.gvsig.fmap.mapcontrol.MapControlLocator; |
|
44 |
import org.gvsig.fmap.mapcontrol.MapControlManager; |
|
45 |
import org.gvsig.fmap.mapcontrol.tools.PanListenerImpl; |
|
46 |
import org.gvsig.fmap.mapcontrol.tools.Behavior.MoveBehavior; |
|
47 |
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer; |
|
48 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
49 |
import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager; |
|
50 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager; |
|
51 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager.MODE; |
|
52 |
|
|
53 |
public class Main { |
|
54 |
|
|
55 |
final String DEFAULT_CRS_CODE = "EPSG:23030"; |
|
56 |
|
|
57 |
private DerivedGeometriesManager derivedGeometriesManager; |
|
58 |
private MapControlManager mapControlManager; |
|
59 |
private DataManager dataManager; |
|
60 |
private MapContextManager mapContextManager; |
|
61 |
private WindowManager windowManager; |
|
62 |
|
|
63 |
private MapControl mapControl; |
|
64 |
|
|
65 |
private JFrame mainFrame; |
|
66 |
|
|
67 |
// Actions |
|
68 |
private AbstractAction derivedGeometries; |
|
69 |
|
|
70 |
private AbstractAction openAddLayerDialog; |
|
71 |
|
|
72 |
private AbstractAction exit; |
|
73 |
|
|
74 |
|
|
75 |
|
|
76 |
public static void main(String[] args) { |
|
77 |
new DefaultLibrariesInitializer().fullInitialize(); |
|
78 |
Main main = new Main(); |
|
79 |
main.doMain(); |
|
80 |
|
|
81 |
} |
|
82 |
|
|
83 |
public Main() { |
|
84 |
mapControlManager = MapControlLocator.getMapControlManager(); |
|
85 |
derivedGeometriesManager = DerivedGeometriesLocator.getManager(); |
|
86 |
dataManager = DALLocator.getDataManager(); |
|
87 |
mapContextManager = MapContextLocator.getMapContextManager(); |
|
88 |
windowManager = ToolsSwingLocator.getWindowManager(); |
|
89 |
mapContextManager.getSymbolManager().getSymbolPreferences() |
|
90 |
.setDefaultSymbolFillColorAleatory(true); |
|
91 |
|
|
92 |
// Register our DummyLayerOrderManger needed to add sample layer |
|
93 |
MapContextLocator.registerDefaultOrderManager(DummyLayerOrderManager.class); |
|
94 |
} |
|
95 |
|
|
96 |
private void doMain() { |
|
97 |
try { |
|
98 |
mapControl = mapControlManager.createJMapControlPanel(); |
|
99 |
} catch (MapControlCreationException e) { |
|
100 |
// TODO Auto-generated catch block |
|
101 |
} |
|
102 |
|
|
103 |
mapControl.addBehavior("pan", new MoveBehavior(new PanListenerImpl( |
|
104 |
mapControl))); |
|
105 |
|
|
106 |
mapControl.setTool("pan"); |
|
107 |
|
|
108 |
IProjection defaultProjection = CRSFactory.getCRS(DEFAULT_CRS_CODE); |
|
109 |
mapControl.getViewPort().setProjection(defaultProjection); |
|
110 |
|
|
111 |
// Create JFrame to show data |
|
112 |
mainFrame = new JFrame("Editing test app"); |
|
113 |
mainFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); |
|
114 |
mainFrame.setPreferredSize(new Dimension(800, 680)); |
|
115 |
mainFrame.add(mapControl, BorderLayout.CENTER); |
|
116 |
|
|
117 |
// Create actions |
|
118 |
createActions(); |
|
119 |
|
|
120 |
// Create menu bar |
|
121 |
createMenu(); |
|
122 |
|
|
123 |
// Create tools bar |
|
124 |
createToolBar(); |
|
125 |
|
|
126 |
// Display the window. |
|
127 |
mainFrame.pack(); |
|
128 |
mainFrame.setLocation(500, 0); |
|
129 |
mainFrame.setVisible(true); |
|
130 |
} |
|
131 |
|
|
132 |
private void createToolBar() { |
|
133 |
JToolBar toolBar = new JToolBar(); |
|
134 |
|
|
135 |
toolBar.add(new JButton(openAddLayerDialog)); |
|
136 |
toolBar.add(new JButton(derivedGeometries)); |
|
137 |
|
|
138 |
mainFrame.add(toolBar, BorderLayout.PAGE_START); |
|
139 |
|
|
140 |
} |
|
141 |
|
|
142 |
private void createMenu() { |
|
143 |
// Create the menu bar. |
|
144 |
JMenuBar menuBar = new JMenuBar(); |
|
145 |
|
|
146 |
// Build the menu. |
|
147 |
JMenu menuFile = new JMenu("File"); |
|
148 |
menuFile.add(openAddLayerDialog); |
|
149 |
menuFile.add(new JMenuItem(exit)); |
|
150 |
|
|
151 |
mainFrame.setJMenuBar(menuBar); |
|
152 |
|
|
153 |
} |
|
154 |
|
|
155 |
@SuppressWarnings("serial") |
|
156 |
private void createActions() { |
|
157 |
|
|
158 |
derivedGeometries = new AbstractAction("DerivedGeometries") { |
|
159 |
|
|
160 |
public void actionPerformed(ActionEvent e) { |
|
161 |
JComponent panel = |
|
162 |
derivedGeometriesManager.getDerivedGeometriesPanel( |
|
163 |
mapControl).asJComponent(); |
|
164 |
|
|
165 |
windowManager.showWindow(panel, "derived_geometries", |
|
166 |
MODE.WINDOW); |
|
167 |
} |
|
168 |
}; |
|
169 |
|
|
170 |
openAddLayerDialog = new AbstractAction("Add sample layers") { |
|
171 |
|
|
172 |
public void actionPerformed(ActionEvent e) { |
|
173 |
try { |
|
174 |
addLayer("src/main/resources/sample-cartography/puertos_andalucia.shp"); |
|
175 |
addLayer("src/main/resources/sample-cartography/hidro_andalucia.shp"); |
|
176 |
addLayer("src/main/resources/sample-cartography/Provincias andalucia.shp"); |
|
177 |
|
|
178 |
ThreadSafeDialogsManager dlgManager = |
|
179 |
ToolsSwingLocator.getThreadSafeDialogsManager(); |
|
180 |
|
|
181 |
StringBuilder stb = new StringBuilder(); |
|
182 |
stb.append("Layer: Provincias_andalucia Type: multisurface\n"); |
|
183 |
stb.append("Layer: hidro_andalucia Type: multicurve\n"); |
|
184 |
stb.append("Layer: puertos_andalucia Type: point\n"); |
|
185 |
|
|
186 |
dlgManager.messageDialog(stb.toString(), |
|
187 |
"Sample layers added succesfully", JOptionPane.INFORMATION_MESSAGE); |
|
188 |
} catch (Exception e1) { |
|
189 |
// TODO Auto-generated catch block |
|
190 |
e1.printStackTrace(); |
|
191 |
} |
|
192 |
} |
|
193 |
}; |
|
194 |
|
|
195 |
exit = new AbstractAction("Exit") { |
|
196 |
|
|
197 |
public void actionPerformed(ActionEvent e) { |
|
198 |
System.exit(0); |
|
199 |
} |
|
200 |
}; |
|
201 |
|
|
202 |
} |
|
203 |
|
|
204 |
public void addLayer(String shpPath) throws InitializeException, |
|
205 |
ProviderNotRegisteredException, ValidateDataParametersException, |
|
206 |
LoadLayerException { |
|
207 |
DataStoreParameters params; |
|
208 |
params = dataManager.createStoreParameters("Shape"); |
|
209 |
|
|
210 |
File shpFile = new File(shpPath); |
|
211 |
|
|
212 |
params.setDynValue("shpFile", shpFile.getPath()); |
|
213 |
params.setDynValue("CRS", CRSFactory.getCRS(DEFAULT_CRS_CODE)); |
|
214 |
params.validate(); |
|
215 |
|
|
216 |
FeatureStore store = |
|
217 |
(FeatureStore) dataManager.openStore("Shape", params); |
|
218 |
|
|
219 |
FLayer layer = mapContextManager.createLayer(store.getName(), store); |
|
220 |
|
|
221 |
|
|
222 |
mapControl.getMapContext().getLayers().addLayer(layer); |
|
223 |
mapControl.getMapContext().getLayers().setActive(true); |
|
224 |
layer.dispose(); |
|
225 |
|
|
226 |
} |
|
227 |
|
|
228 |
} |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.1/org.gvsig.derivedgeometries.main/pom.xml | ||
---|---|---|
1 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<parent> |
|
4 |
<groupId>org.gvsig</groupId> |
|
5 |
<artifactId>org.gvsig.derivedgeometries</artifactId> |
|
6 |
<version>1.0.1</version> |
|
7 |
</parent> |
|
8 |
<artifactId>org.gvsig.derivedgeometries.main</artifactId> |
|
9 |
<name>org.gvsig.derivedgeometries.main</name> |
|
10 |
|
|
11 |
<dependencies> |
|
12 |
<dependency> |
|
13 |
<groupId>org.gvsig</groupId> |
|
14 |
<artifactId>org.gvsig.metadata.lib.basic.api</artifactId> |
|
15 |
<scope>compile</scope> |
|
16 |
</dependency> |
|
17 |
<dependency> |
|
18 |
<groupId>org.gvsig</groupId> |
|
19 |
<artifactId>org.gvsig.fmap.control</artifactId> |
|
20 |
<scope>compile</scope> |
|
21 |
</dependency> |
|
22 |
<dependency> |
|
23 |
<groupId>org.gvsig</groupId> |
|
24 |
<artifactId>org.gvsig.fmap.dal.api</artifactId> |
|
25 |
<scope>compile</scope> |
|
26 |
</dependency> |
|
27 |
<dependency> |
|
28 |
<groupId>org.gvsig</groupId> |
|
29 |
<artifactId>org.gvsig.fmap.geometry.api</artifactId> |
|
30 |
<scope>compile</scope> |
|
31 |
</dependency> |
|
32 |
<dependency> |
|
33 |
<groupId>org.gvsig</groupId> |
|
34 |
<artifactId>org.gvsig.fmap.mapcontext.api</artifactId> |
|
35 |
<scope>compile</scope> |
|
36 |
</dependency> |
|
37 |
<dependency> |
|
38 |
<groupId>org.gvsig</groupId> |
|
39 |
<artifactId>org.gvsig.tools.swing.api</artifactId> |
|
40 |
<scope>compile</scope> |
|
41 |
</dependency> |
|
42 |
|
|
43 |
<!-- runtime dependencies --> |
|
44 |
<dependency> |
|
45 |
<groupId>org.gvsig</groupId> |
|
46 |
<artifactId>org.gvsig.metadata.lib.basic.impl</artifactId> |
|
47 |
<scope>runtime</scope> |
|
48 |
</dependency> |
|
49 |
<dependency> |
|
50 |
<groupId>org.gvsig</groupId> |
|
51 |
<artifactId>org.gvsig.fmap.geometry.generalpath</artifactId> |
|
52 |
<scope>runtime</scope> |
|
53 |
</dependency> |
|
54 |
<dependency> |
|
55 |
<groupId>org.gvsig</groupId> |
|
56 |
<artifactId>org.gvsig.fmap.geometry.operation</artifactId> |
|
57 |
<scope>runtime</scope> |
|
58 |
</dependency> |
|
59 |
<dependency> |
|
60 |
<groupId>org.gvsig</groupId> |
|
61 |
<artifactId>org.gvsig.fmap.mapcontext.impl</artifactId> |
|
62 |
<scope>runtime</scope> |
|
63 |
</dependency> |
|
64 |
<dependency> |
|
65 |
<groupId>org.gvsig</groupId> |
|
66 |
<artifactId>org.gvsig.symbology.lib.impl</artifactId> |
|
67 |
<scope>runtime</scope> |
|
68 |
</dependency> |
|
69 |
<dependency> |
|
70 |
<groupId>org.gvsig</groupId> |
|
71 |
<artifactId>org.gvsig.fmap.dal.impl</artifactId> |
|
72 |
<scope>runtime</scope> |
|
73 |
</dependency> |
|
74 |
<dependency> |
|
75 |
<groupId>org.gvsig</groupId> |
|
76 |
<artifactId>org.gvsig.fmap.dal.spi</artifactId> |
|
77 |
<scope>runtime</scope> |
|
78 |
</dependency> |
|
79 |
<dependency> |
|
80 |
<groupId>org.gvsig</groupId> |
|
81 |
<artifactId>org.gvsig.fmap.dal.file.shp</artifactId> |
|
82 |
<scope>runtime</scope> |
|
83 |
</dependency> |
|
84 |
<dependency> |
|
85 |
<groupId>org.gvsig</groupId> |
|
86 |
<artifactId>org.gvsig.fmap.dal.file.dbf</artifactId> |
|
87 |
<scope>runtime</scope> |
|
88 |
</dependency> |
|
89 |
<dependency> |
|
90 |
<groupId>org.gvsig</groupId> |
|
91 |
<artifactId>org.gvsig.fmap.dal.file.lib</artifactId> |
|
92 |
<scope>runtime</scope> |
|
93 |
</dependency> |
|
94 |
<dependency> |
|
95 |
<groupId>org.gvsig</groupId> |
|
96 |
<artifactId>org.gvsig.timesupport.lib.api</artifactId> |
|
97 |
<scope>runtime</scope> |
|
98 |
</dependency> |
|
99 |
<dependency> |
|
100 |
<groupId>org.gvsig</groupId> |
|
101 |
<artifactId>org.gvsig.timesupport.lib.impl</artifactId> |
|
102 |
<scope>runtime</scope> |
|
103 |
</dependency> |
|
104 |
<dependency> |
|
105 |
<groupId>org.gvsig</groupId> |
|
106 |
<artifactId>org.gvsig.tools.evaluator.sqljep</artifactId> |
|
107 |
<scope>runtime</scope> |
|
108 |
</dependency> |
|
109 |
<dependency> |
|
110 |
<groupId>org.gvsig</groupId> |
|
111 |
<artifactId>org.gvsig.proj.lib.proj4j</artifactId> |
|
112 |
<scope>runtime</scope> |
|
113 |
</dependency> |
|
114 |
<dependency> |
|
115 |
<groupId>org.gvsig</groupId> |
|
116 |
<artifactId> |
|
117 |
org.gvsig.derivedgeometries.swing.api |
|
118 |
</artifactId> |
|
119 |
</dependency> |
|
120 |
<dependency> |
|
121 |
<groupId>org.gvsig</groupId> |
|
122 |
<artifactId> |
|
123 |
org.gvsig.derivedgeometries.swing.impl |
|
124 |
</artifactId> |
|
125 |
</dependency> |
|
126 |
<dependency> |
|
127 |
<groupId>org.gvsig</groupId> |
|
128 |
<artifactId>org.gvsig.tools.swing.impl</artifactId> |
|
129 |
<scope>runtime</scope> |
|
130 |
</dependency> |
|
131 |
</dependencies> |
|
132 |
</project> |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.1/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.derivedgeometries.swing.api.DerivedGeometriesLibrary |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.1/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/DerivedGeometriesManager.java | ||
---|---|---|
1 |
/* |
|
2 |
* Copyright 2014 DiSiD Technologies S.L.L. All rights reserved. |
|
3 |
* |
|
4 |
* Project : DiSiD org.gvsig.derivedgeometries.swing.api |
|
5 |
* SVN Id : $Id$ |
|
6 |
*/ |
|
7 |
package org.gvsig.derivedgeometries.swing.api; |
|
8 |
|
|
9 |
import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesProcess.TYPE; |
|
10 |
import org.gvsig.derivedgeometries.swing.api.panels.DerivedGeometriesPanel; |
|
11 |
import org.gvsig.derivedgeometries.swing.api.panels.FeaturesControlPanel; |
|
12 |
import org.gvsig.derivedgeometries.swing.api.panels.LayerAndProcessSelectionPanel; |
|
13 |
import org.gvsig.fmap.geom.Geometry; |
|
14 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
|
15 |
import org.gvsig.fmap.mapcontrol.MapControl; |
|
16 |
|
|
17 |
/** |
|
18 |
* Main class to manage DerivedGeometries functionalities |
|
19 |
* |
|
20 |
* @author gvSIG team |
|
21 |
* @version $Id$ |
|
22 |
*/ |
|
23 |
public interface DerivedGeometriesManager { |
|
24 |
|
|
25 |
/** |
|
26 |
* Creates an empty {@link DerivedGeometriesParameters} |
|
27 |
* |
|
28 |
* @return |
|
29 |
*/ |
|
30 |
public DerivedGeometriesParameters createDerivedGeometriesParameters(); |
|
31 |
|
|
32 |
/** |
|
33 |
* Creates a {@link DerivedGeometriesParameters}. |
|
34 |
* |
|
35 |
* @param mapControl |
|
36 |
* @param sourceLayer |
|
37 |
* @param outputLayerName |
|
38 |
* Name of output layer. |
|
39 |
* @param outputLayerPath |
|
40 |
* Path of output layer. |
|
41 |
* @param outputLayerType |
|
42 |
* Type of output layer. See {@link Geometry.TYPES} |
|
43 |
* @param processType |
|
44 |
* Type of process. See {@link DerivedGeometriesProcess.TYPE} |
|
45 |
* @return |
|
46 |
*/ |
|
47 |
public DerivedGeometriesParameters createDerivedGeometriesParameters( |
|
48 |
MapControl mapControl, FLyrVect sourceLayer, String outputLayerName, |
|
49 |
String outputLayerPath, int outputLayerType, TYPE processType); |
|
50 |
|
|
51 |
/** |
|
52 |
* @return a new {@link FeaturesControlPanel}. |
|
53 |
*/ |
|
54 |
public FeaturesControlPanel getFeaturesControlPanel(); |
|
55 |
|
|
56 |
/** |
|
57 |
* @param mapControl |
|
58 |
* to get vectorial layers, adds listeners... |
|
59 |
* @return a new {@link DerivedGeometriesPanel}. |
|
60 |
*/ |
|
61 |
public DerivedGeometriesPanel getDerivedGeometriesPanel( |
|
62 |
MapControl mapControl); |
|
63 |
|
|
64 |
/** |
|
65 |
* @param mapControl |
|
66 |
* mapControl to get vectorial layers, adds listeners... |
|
67 |
* @return a new {@link LayerAndProcessSelectionPanel} |
|
68 |
*/ |
|
69 |
public LayerAndProcessSelectionPanel getLayerAndProcessSelectionPanel( |
|
70 |
MapControl mapControl); |
|
71 |
|
|
72 |
/** |
|
73 |
* Given {@link DerivedGeometriesParameters}, starts a new |
|
74 |
* {@link DerivedGeometriesProcess}. |
|
75 |
* |
|
76 |
* @param parameters |
|
77 |
*/ |
|
78 |
public void startDerivedGeometriesProcess( |
|
79 |
DerivedGeometriesParameters parameters); |
|
80 |
|
|
81 |
} |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.1/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/exceptions/ValidateSourceLayerException.java | ||
---|---|---|
1 |
/* |
|
2 |
* Copyright 2014 DiSiD Technologies S.L.L. All rights reserved. |
|
3 |
* |
|
4 |
* Project : DiSiD org.gvsig.derivedgeometries.swing.impl |
|
5 |
* SVN Id : $Id$ |
|
6 |
*/ |
|
7 |
package org.gvsig.derivedgeometries.swing.api.exceptions; |
|
8 |
|
|
9 |
public class ValidateSourceLayerException extends DerivedGeometriesException { |
|
10 |
|
|
11 |
/** |
|
12 |
* |
|
13 |
*/ |
|
14 |
private static final long serialVersionUID = 6671117008934615055L; |
|
15 |
|
|
16 |
private static final String MESSAGE = |
|
17 |
"An error has been produced validating source layer."; |
|
18 |
|
|
19 |
private static final String KEY = "_ValidateSourceLayerException"; |
|
20 |
|
|
21 |
public ValidateSourceLayerException(Throwable ex) { |
|
22 |
super(MESSAGE, ex, KEY, serialVersionUID); |
|
23 |
} |
|
24 |
|
|
25 |
public ValidateSourceLayerException(String message, Throwable ex) { |
|
26 |
super(message, ex, KEY, serialVersionUID); |
|
27 |
} |
|
28 |
|
|
29 |
} |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.1/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/exceptions/LoadSelectedFeatureDataException.java | ||
---|---|---|
1 |
/* |
|
2 |
* Copyright 2014 DiSiD Technologies S.L.L. All rights reserved. |
|
3 |
* |
|
4 |
* Project : DiSiD org.gvsig.derivedgeometries.swing.impl |
|
5 |
* SVN Id : $Id$ |
|
6 |
*/ |
|
7 |
package org.gvsig.derivedgeometries.swing.api.exceptions; |
|
8 |
|
|
9 |
public class LoadSelectedFeatureDataException extends |
|
10 |
DerivedGeometriesException { |
|
11 |
|
|
12 |
/** |
|
13 |
* |
|
14 |
*/ |
|
15 |
private static final long serialVersionUID = -1477432246895858868L; |
|
16 |
|
|
17 |
private static final String MESSAGE = |
|
18 |
"An error has been produced loading selected features."; |
|
19 |
|
|
20 |
private static final String KEY = "_LoadSelectedFeatureDataException"; |
|
21 |
|
|
22 |
public LoadSelectedFeatureDataException(Throwable ex) { |
|
23 |
super(MESSAGE, ex, KEY, serialVersionUID); |
|
24 |
} |
|
25 |
|
|
26 |
public LoadSelectedFeatureDataException(String message, Throwable ex) { |
|
27 |
super(message, ex, KEY, serialVersionUID); |
|
28 |
} |
|
29 |
|
|
30 |
} |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.1/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/exceptions/FormatRowException.java | ||
---|---|---|
1 |
/* |
|
2 |
* Copyright 2014 DiSiD Technologies S.L.L. All rights reserved. |
|
3 |
* |
|
4 |
* Project : DiSiD org.gvsig.derivedgeometries.swing.impl |
|
5 |
* SVN Id : $Id$ |
|
6 |
*/ |
|
7 |
package org.gvsig.derivedgeometries.swing.api.exceptions; |
|
8 |
|
|
9 |
|
|
10 |
public class FormatRowException extends DerivedGeometriesException { |
|
11 |
|
|
12 |
/** |
|
13 |
* |
|
14 |
*/ |
|
15 |
private static final long serialVersionUID = 6292433772869829638L; |
|
16 |
|
|
17 |
private static final String MESSAGE = |
|
18 |
"An error has been produced formating row."; |
|
19 |
|
|
20 |
private static final String KEY = "_FormatRowException"; |
|
21 |
|
|
22 |
public FormatRowException(Throwable ex) { |
|
23 |
super(MESSAGE, ex, KEY, serialVersionUID); |
|
24 |
} |
|
25 |
|
|
26 |
public FormatRowException(String message, Throwable ex) { |
|
27 |
super(message, ex, KEY, serialVersionUID); |
|
28 |
} |
|
29 |
|
|
30 |
} |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.1/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/exceptions/FetaureTableModelException.java | ||
---|---|---|
1 |
/* |
|
2 |
* Copyright 2014 DiSiD Technologies S.L.L. All rights reserved. |
|
3 |
* |
|
4 |
* Project : DiSiD org.gvsig.derivedgeometries.swing.impl |
|
5 |
* SVN Id : $Id$ |
|
6 |
*/ |
|
7 |
package org.gvsig.derivedgeometries.swing.api.exceptions; |
|
8 |
|
|
9 |
public class FetaureTableModelException extends DerivedGeometriesException { |
|
10 |
|
|
11 |
/** |
|
12 |
* |
|
13 |
*/ |
|
14 |
private static final long serialVersionUID = -5003333029683139078L; |
|
15 |
|
|
16 |
private static final String MESSAGE = |
|
17 |
"An error has been produced creating feature table model."; |
|
18 |
|
|
19 |
private static final String KEY = "_FeatureTableModelException"; |
|
20 |
|
|
21 |
public FetaureTableModelException(Throwable ex) { |
|
22 |
super(MESSAGE, ex, KEY, serialVersionUID); |
|
23 |
} |
|
24 |
|
|
25 |
public FetaureTableModelException(String message, Throwable ex) { |
|
26 |
super(message, ex, KEY, serialVersionUID); |
|
27 |
} |
|
28 |
|
|
29 |
} |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.1/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/exceptions/DerivedGeometriesException.java | ||
---|---|---|
1 |
/* |
|
2 |
* Copyright 2014 DiSiD Technologies S.L.L. All rights reserved. |
|
3 |
* |
|
4 |
* Project : DiSiD org.gvsig.derivedgeometries.swing.api |
|
5 |
* SVN Id : $Id$ |
|
6 |
*/ |
|
7 |
package org.gvsig.derivedgeometries.swing.api.exceptions; |
|
8 |
|
|
9 |
import org.gvsig.tools.exception.BaseException; |
|
10 |
|
|
11 |
public class DerivedGeometriesException extends BaseException { |
|
12 |
|
|
13 |
/** |
|
14 |
* |
|
15 |
*/ |
|
16 |
private static final long serialVersionUID = -5881366280361882646L; |
|
17 |
|
|
18 |
private static final String MESSAGE = |
|
19 |
"An error has been produced in the Derived Geometries library"; |
|
20 |
|
|
21 |
private static final String KEY = "_DerivedGeometriesException"; |
|
22 |
|
|
23 |
/** |
|
24 |
* Constructor to be used in rare cases, usually you must create a new child |
|
25 |
* exception class for each case. |
|
26 |
* <strong>Don't use this constructor in child classes.</strong> |
|
27 |
*/ |
|
28 |
public DerivedGeometriesException() { |
|
29 |
super(MESSAGE, KEY, serialVersionUID); |
|
30 |
} |
|
31 |
|
|
32 |
/** |
|
33 |
* Constructor to be used in rare cases, usually you must create a new child |
|
34 |
* exception class for each case. |
|
35 |
* <p> |
|
36 |
* <strong>Don't use this constructor in child classes.</strong> |
|
37 |
* </p> |
|
38 |
* |
|
39 |
* @param cause |
|
40 |
* the original cause of the exception |
|
41 |
*/ |
|
42 |
public DerivedGeometriesException(Exception cause) { |
|
43 |
super(MESSAGE, cause, KEY, serialVersionUID); |
|
44 |
} |
|
45 |
|
|
46 |
/** |
|
47 |
* @see BaseException#BaseException(String, String, long). |
|
48 |
* @param message |
|
49 |
* the default messageFormat to describe the exception |
|
50 |
* @param key |
|
51 |
* the key to use to search a localized messageFormnata |
|
52 |
* @param code |
|
53 |
* the unique code to identify the exception |
|
54 |
*/ |
|
55 |
protected DerivedGeometriesException(String message, String key, long code) { |
|
56 |
super(message, key, code); |
|
57 |
} |
|
58 |
|
|
59 |
/** |
|
60 |
* @see BaseException#BaseException(String, Throwable, String, long). |
|
61 |
* @param message |
|
62 |
* the default messageFormat to describe the exception |
|
63 |
* @param cause |
|
64 |
* the original cause of the exception |
|
65 |
* @param key |
|
66 |
* the key to use to search a localized messageFormnata |
|
67 |
* @param code |
|
68 |
* the unique code to identify the exception |
|
69 |
*/ |
|
70 |
protected DerivedGeometriesException(String message, Throwable cause, |
|
71 |
String key, long code) { |
|
72 |
super(message, cause, key, code); |
|
73 |
} |
|
74 |
|
|
75 |
} |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.1/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/panels/FeaturesControlPanel.java | ||
---|---|---|
1 |
/* |
|
2 |
* Copyright 2014 DiSiD Technologies S.L.L. All rights reserved. |
|
3 |
* |
|
4 |
* Project : DiSiD org.gvsig.derivedgeometries.swing.impl |
|
5 |
* SVN Id : $Id$ |
|
6 |
*/ |
|
7 |
package org.gvsig.derivedgeometries.swing.api.panels; |
|
8 |
|
|
9 |
import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesParameters; |
|
10 |
import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesProcess; |
|
11 |
import org.gvsig.tools.swing.api.Component; |
|
12 |
|
|
13 |
/** |
|
14 |
* Features control panel contains three panels. First panel shows information |
|
15 |
* about source layer and output layer. Second panel shows information of source |
|
16 |
* layer features and the last panel permits users to add, remove and order |
|
17 |
* selected features to create derived geometries. |
|
18 |
* |
|
19 |
* @author gvSIG team |
|
20 |
* @version $Id$ |
|
21 |
* |
|
22 |
*/ |
|
23 |
public interface FeaturesControlPanel extends Component { |
|
24 |
|
|
25 |
/** |
|
26 |
* Sets parameters to show information and initialize actions. |
|
27 |
* |
|
28 |
* @param parameters |
|
29 |
*/ |
|
30 |
public void setParameters(DerivedGeometriesParameters parameters); |
|
31 |
|
|
32 |
/** |
|
33 |
* @return parameters of panel. |
|
34 |
*/ |
|
35 |
public DerivedGeometriesParameters getParameters(); |
|
36 |
|
|
37 |
/** |
|
38 |
* Does action panel. Gets selected features, closes panel and starts |
|
39 |
* {@link DerivedGeometriesProcess} |
|
40 |
* |
|
41 |
*/ |
|
42 |
public void doAction(); |
|
43 |
|
|
44 |
/** |
|
45 |
* Validate if data of third panel is correct. |
|
46 |
* |
|
47 |
* @return True if it is valid otherwise false. |
|
48 |
*/ |
|
49 |
public boolean validateFields(); |
|
50 |
} |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.1/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/panels/LayerAndProcessSelectionPanel.java | ||
---|---|---|
1 |
/* |
|
2 |
* Copyright 2014 DiSiD Technologies S.L.L. All rights reserved. |
|
3 |
* |
|
4 |
* Project : DiSiD org.gvsig.derivedgeometries.swing.impl |
|
5 |
* SVN Id : $Id$ |
|
6 |
*/ |
|
7 |
package org.gvsig.derivedgeometries.swing.api.panels; |
|
8 |
|
|
9 |
import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesParameters; |
|
10 |
import org.gvsig.derivedgeometries.swing.api.exceptions.ValidateSourceLayerException; |
|
11 |
import org.gvsig.fmap.mapcontrol.MapControl; |
|
12 |
import org.gvsig.tools.swing.api.Component; |
|
13 |
/** |
|
14 |
* |
|
15 |
* @author gvSIG team |
|
16 |
* @version $Id$ |
|
17 |
* |
|
18 |
*/ |
|
19 |
public interface LayerAndProcessSelectionPanel extends Component { |
|
20 |
|
|
21 |
/** |
|
22 |
* |
|
23 |
* @return |
|
24 |
*/ |
|
25 |
public DerivedGeometriesParameters getParameters(); |
|
26 |
|
|
27 |
/** |
|
28 |
* |
|
29 |
* @param mapControl |
|
30 |
*/ |
|
31 |
public void setMapControl(MapControl mapControl); |
|
32 |
|
|
33 |
/** |
|
34 |
* |
|
35 |
*/ |
|
36 |
public void doAccept(); |
|
37 |
|
|
38 |
/** |
|
39 |
* |
|
40 |
*/ |
|
41 |
public void doCancel(); |
|
42 |
|
|
43 |
/** |
|
44 |
* |
|
45 |
* @return |
|
46 |
*/ |
|
47 |
public boolean validateFields(); |
|
48 |
|
|
49 |
/** |
|
50 |
* |
|
51 |
* @return |
|
52 |
* @throws ValidateSourceLayerException |
|
53 |
*/ |
|
54 |
public boolean validateSourceLayer() throws ValidateSourceLayerException; |
|
55 |
|
|
56 |
} |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.1/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/panels/DerivedGeometriesPanel.java | ||
---|---|---|
1 |
/* |
|
2 |
* Copyright 2014 DiSiD Technologies S.L.L. All rights reserved. |
|
3 |
* |
|
4 |
* Project : DiSiD org.gvsig.derivedgeometries.swing.impl |
|
5 |
* SVN Id : $Id$ |
|
6 |
*/ |
|
7 |
package org.gvsig.derivedgeometries.swing.api.panels; |
|
8 |
|
|
9 |
import org.gvsig.tools.swing.api.Component; |
|
10 |
|
|
11 |
/** |
|
12 |
* Panel that contains {@link LayerAndProcessSelectionPanel} and |
|
13 |
* {@link FeaturesControlPanel} |
|
14 |
* |
|
15 |
* @author gvSIG team |
|
16 |
* @version $Id$ |
|
17 |
* |
|
18 |
*/ |
|
19 |
public interface DerivedGeometriesPanel extends Component { |
|
20 |
|
|
21 |
} |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.1/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/DerivedGeometriesProcess.java | ||
---|---|---|
1 |
/* |
|
2 |
* Copyright 2014 DiSiD Technologies S.L.L. All rights reserved. |
|
3 |
* |
|
4 |
* Project : DiSiD org.gvsig.derivedgeometries.swing.api |
|
5 |
* SVN Id : $Id$ |
|
6 |
*/ |
|
7 |
package org.gvsig.derivedgeometries.swing.api; |
|
8 |
|
|
9 |
import org.gvsig.tools.task.MonitorableTask; |
|
10 |
|
|
11 |
/** |
|
12 |
* Process definition to create derived geometries. |
|
13 |
* |
|
14 |
* @author gvSIG team |
|
15 |
* @version $Id$ |
|
16 |
* |
|
17 |
*/ |
|
18 |
public interface DerivedGeometriesProcess extends MonitorableTask { |
|
19 |
|
|
20 |
/** |
|
21 |
* Type of process. |
|
22 |
*/ |
|
23 |
public enum TYPE { |
|
24 |
POINTS_TO_LINE, POINTS_TO_POLYGON, LINES_TO_CLOSED_POLYLINE; |
|
25 |
} |
|
26 |
|
|
27 |
/** |
|
28 |
* @return parameters of process. |
|
29 |
*/ |
|
30 |
public DerivedGeometriesParameters getParameters(); |
|
31 |
|
|
32 |
/** |
|
33 |
* Starts process. |
|
34 |
*/ |
|
35 |
public void start(); |
|
36 |
|
|
37 |
} |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.1/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/DerivedGeometriesLocator.java | ||
---|---|---|
1 |
/* |
|
2 |
* Copyright 2014 DiSiD Technologies S.L.L. All rights reserved. |
|
3 |
* |
|
4 |
* Project : DiSiD org.gvsig.derivedgeometries.swing.api |
|
5 |
* SVN Id : $Id$ |
|
6 |
*/ |
|
7 |
package org.gvsig.derivedgeometries.swing.api; |
|
8 |
|
|
9 |
import org.gvsig.tools.locator.BaseLocator; |
|
10 |
import org.gvsig.tools.locator.Locator; |
|
11 |
import org.gvsig.tools.locator.LocatorException; |
|
12 |
|
|
13 |
/** |
|
14 |
* This locator is the entry point for the DerivedGeometries library, providing |
|
15 |
* access to all DerivedGeometries services through the |
|
16 |
* {@link DerivedGeometriesManager} . |
|
17 |
* |
|
18 |
* @author gvSIG team |
|
19 |
* @version $Id$ |
|
20 |
*/ |
|
21 |
public class DerivedGeometriesLocator extends BaseLocator { |
|
22 |
|
|
23 |
private static final String LOCATOR_NAME = "DerivedGeometriesLocator"; |
|
24 |
|
|
25 |
public static final String MANAGER_NAME = "DerivedGeometriesSwing.manager"; |
|
26 |
|
|
27 |
private static final String MANAGER_DESCRIPTION = |
|
28 |
"Derived Geometries Swing Manager"; |
|
29 |
|
|
30 |
private static final DerivedGeometriesLocator instance = |
|
31 |
new DerivedGeometriesLocator(); |
|
32 |
|
|
33 |
/** |
|
34 |
* Return the singleton instance. |
|
35 |
* |
|
36 |
* @return the singleton instance |
|
37 |
*/ |
|
38 |
public static DerivedGeometriesLocator getInstance() { |
|
39 |
return instance; |
|
40 |
} |
|
41 |
|
|
42 |
public String getLocatorName() { |
|
43 |
return LOCATOR_NAME; |
|
44 |
} |
|
45 |
|
|
46 |
/** |
|
47 |
* Return a reference to DerivedGeometriesManager. |
|
48 |
* |
|
49 |
* @return a reference to DerivedGeometriesManager |
|
50 |
* @throws LocatorException |
|
51 |
* if there is no access to the class or the class |
|
52 |
* cannot be instantiated |
|
53 |
* @see Locator#get(String) |
|
54 |
*/ |
|
55 |
public static DerivedGeometriesManager getManager() throws LocatorException { |
|
56 |
return (DerivedGeometriesManager) getInstance().get(MANAGER_NAME); |
|
57 |
} |
|
58 |
|
|
59 |
/** |
|
60 |
* Registers the Class implementing the DerivedGeometriesLocator interface. |
|
61 |
* |
|
62 |
* @param clazz |
|
63 |
* implementing the DerivedGeometriesgManager interface |
|
64 |
*/ |
|
65 |
public static void registerManager(Class clazz) { |
|
66 |
getInstance().register(MANAGER_NAME, MANAGER_DESCRIPTION, clazz); |
|
67 |
} |
|
68 |
|
|
69 |
public static void registerDefaultManager(Class clazz) { |
|
70 |
getInstance().registerDefault(MANAGER_NAME, MANAGER_DESCRIPTION, clazz); |
|
71 |
} |
|
72 |
|
|
73 |
} |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.1/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/DerivedGeometriesParameters.java | ||
---|---|---|
1 |
/* |
|
2 |
* Copyright 2014 DiSiD Technologies S.L.L. All rights reserved. |
|
3 |
* |
|
4 |
* Project : DiSiD org.gvsig.derivedgeometries.swing.api |
|
5 |
* SVN Id : $Id$ |
|
6 |
*/ |
|
7 |
package org.gvsig.derivedgeometries.swing.api; |
|
8 |
|
|
9 |
import java.util.List; |
|
10 |
|
|
11 |
import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesProcess.TYPE; |
|
12 |
import org.gvsig.fmap.dal.feature.FeatureReference; |
|
13 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
14 |
import org.gvsig.fmap.geom.Geometry; |
|
15 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
|
16 |
import org.gvsig.fmap.mapcontrol.MapControl; |
|
17 |
|
|
18 |
/** |
|
19 |
* |
|
20 |
* Definition of derived geometries parameters. |
|
21 |
* |
|
22 |
* @author gvSIG team |
|
23 |
* @version $Id$ |
|
24 |
* |
|
25 |
*/ |
|
26 |
public interface DerivedGeometriesParameters { |
|
27 |
|
|
28 |
/** |
|
29 |
* @return Gets if process has to add layer to map context. |
|
30 |
*/ |
|
31 |
public boolean getAddLayer(); |
|
32 |
|
|
33 |
/** |
|
34 |
* @return Gets if process has to create new feature store |
|
35 |
*/ |
|
36 |
public boolean getCreateNewFeatureStore(); |
|
37 |
|
|
38 |
/** |
|
39 |
* @return Gets feature store to edit |
|
40 |
*/ |
|
41 |
public FeatureStore getFeatureStore(); |
|
42 |
|
|
43 |
/** |
|
44 |
* @return mapControl of source layer and output layer |
|
45 |
*/ |
|
46 |
public MapControl getMapControl(); |
|
47 |
|
|
48 |
/** |
|
49 |
* @return name of output layer. |
|
50 |
*/ |
|
51 |
public String getOutPutLayerName(); |
|
52 |
|
|
53 |
/** |
|
54 |
* @return path of output layer. |
|
55 |
*/ |
|
56 |
public String getOutPutLayerPath(); |
|
57 |
|
|
58 |
/** |
|
59 |
* @return type of output layer. See {@link Geometry.TYPES} |
|
60 |
*/ |
|
61 |
public int getOutPutLayerType(); |
|
62 |
|
|
63 |
/** |
|
64 |
* @return process type. See {@link DerivedGeometriesProcess.TYPE} |
|
65 |
*/ |
|
66 |
public TYPE getProcessType(); |
|
67 |
|
|
68 |
/** |
|
69 |
* @return an ordered list of selected features. |
|
70 |
*/ |
|
71 |
public List<FeatureReference> getSelectedFeatures(); |
|
72 |
|
|
73 |
/** |
|
74 |
* @return source layer. |
|
75 |
*/ |
|
76 |
public FLyrVect getSourceLayer(); |
|
77 |
|
|
78 |
/** |
|
79 |
* @param b |
|
80 |
* Sets if process has to add output layer to mapContext or not. |
|
81 |
*/ |
|
82 |
public void setAddLayer(boolean b); |
|
83 |
|
|
84 |
/** |
|
85 |
* @param createNewFeatureStore |
|
86 |
* Sets if process has to create new feature store o not. |
|
87 |
*/ |
|
88 |
public void setCreateNewFeatureStore(boolean createNewFeatureStore); |
|
89 |
|
|
90 |
/** |
|
91 |
* @param featureStore |
|
92 |
* Sets feature store to edit |
|
93 |
*/ |
|
94 |
public void setFeatureStore(FeatureStore featureStore); |
|
95 |
|
|
96 |
/** |
|
97 |
* Sets name of output layer |
|
98 |
* |
|
99 |
* @param name |
|
100 |
*/ |
|
101 |
public void setOutPutLayerName(String name); |
|
102 |
|
|
103 |
/** |
|
104 |
* Sets path of output layer |
|
105 |
* |
|
106 |
* @param path |
|
107 |
*/ |
|
108 |
public void setOutPutLayerPath(String path); |
|
109 |
|
|
110 |
/** |
|
111 |
* Sets type of output layer. See {@link Geometry.TYPES} |
|
112 |
* |
|
113 |
* @param type |
|
114 |
*/ |
|
115 |
public void setOutPutLayerType(int type); |
|
116 |
|
|
117 |
/** |
|
118 |
* Sets type of {@link DerivedGeometriesProcess} process. |
|
119 |
* |
|
120 |
* @param type |
|
121 |
*/ |
|
122 |
public void setProcessType(TYPE type); |
|
123 |
|
|
124 |
/** |
|
125 |
* Sets selected features to create derived geometries. |
|
126 |
* |
|
127 |
* @param theFeatures |
|
128 |
* ordered list. |
|
129 |
*/ |
|
130 |
public void setSelectedFeatures(List<FeatureReference> theFeatures); |
|
131 |
|
|
132 |
/** |
|
133 |
* Sets source layer. |
|
134 |
* |
|
135 |
* @param sourceLayer |
|
136 |
*/ |
|
137 |
public void setSourceLayer(FLyrVect sourceLayer); |
|
138 |
|
|
139 |
} |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.1/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/DerivedGeometriesLibrary.java | ||
---|---|---|
1 |
/* |
|
2 |
* Copyright 2014 DiSiD Technologies S.L.L. All rights reserved. |
|
3 |
* |
|
4 |
* Project : DiSiD org.gvsig.derivedgeometries.swing.api |
|
5 |
* SVN Id : $Id$ |
|
6 |
*/ |
|
7 |
package org.gvsig.derivedgeometries.swing.api; |
|
8 |
|
|
9 |
import org.gvsig.fmap.dal.DALLibrary; |
|
10 |
import org.gvsig.fmap.geom.GeometryLibrary; |
|
11 |
import org.gvsig.tools.library.AbstractLibrary; |
|
12 |
import org.gvsig.tools.library.LibraryException; |
|
13 |
import org.gvsig.tools.locator.ReferenceNotRegisteredException; |
|
14 |
|
|
15 |
/** |
|
16 |
* |
|
17 |
* Library for API initialization and configuration. |
|
18 |
* |
|
19 |
* @author gvSIG team |
|
20 |
* @version $Id$ |
|
21 |
*/ |
|
22 |
public class DerivedGeometriesLibrary extends AbstractLibrary { |
|
23 |
|
|
24 |
@Override |
|
25 |
public void doRegistration() { |
|
26 |
registerAsAPI(DerivedGeometriesLibrary.class); |
|
27 |
require(DALLibrary.class); |
|
28 |
require(GeometryLibrary.class); |
|
29 |
} |
|
30 |
|
|
31 |
@Override |
|
32 |
protected void doInitialize() throws LibraryException { |
|
33 |
// Do nothing |
|
34 |
} |
|
35 |
|
|
36 |
@Override |
|
37 |
protected void doPostInitialize() throws LibraryException { |
|
38 |
// Validate there is any implementation registered. |
|
39 |
DerivedGeometriesManager manager = |
|
40 |
DerivedGeometriesLocator.getManager(); |
|
41 |
if (manager == null) { |
|
42 |
throw new ReferenceNotRegisteredException( |
|
43 |
DerivedGeometriesLocator.MANAGER_NAME, |
|
44 |
DerivedGeometriesLocator.getInstance()); |
|
45 |
} |
|
46 |
|
|
47 |
} |
|
48 |
|
|
49 |
} |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.1/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/pom.xml | ||
---|---|---|
1 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<parent> |
|
4 |
<groupId>org.gvsig</groupId> |
|
5 |
<artifactId>org.gvsig.derivedgeometries.swing</artifactId> |
|
6 |
<version>1.0.1</version> |
|
7 |
</parent> |
|
8 |
<artifactId>org.gvsig.derivedgeometries.swing.api</artifactId> |
|
9 |
<name>org.gvsig.derivedgeometries.swing.api</name> |
|
10 |
<dependencies> |
|
11 |
<dependency> |
|
12 |
<groupId>org.gvsig</groupId> |
|
13 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
14 |
</dependency> |
|
15 |
<dependency> |
|
16 |
<groupId>org.gvsig</groupId> |
|
17 |
<artifactId>org.gvsig.fmap.dal.api</artifactId> |
|
18 |
</dependency> |
|
19 |
<dependency> |
|
20 |
<groupId>org.gvsig</groupId> |
|
21 |
<artifactId>org.gvsig.fmap.control</artifactId> |
|
22 |
</dependency> |
|
23 |
</dependencies> |
|
24 |
</project> |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.1/org.gvsig.derivedgeometries.swing/pom.xml | ||
---|---|---|
1 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<parent> |
|
4 |
<groupId>org.gvsig</groupId> |
|
5 |
<artifactId>org.gvsig.derivedgeometries</artifactId> |
|
6 |
<version>1.0.1</version> |
|
7 |
</parent> |
|
8 |
<artifactId>org.gvsig.derivedgeometries.swing</artifactId> |
|
9 |
<packaging>pom</packaging> |
|
10 |
<name>org.gvsig.derivedgeometries.swing</name> |
|
11 |
<modules> |
|
12 |
<module>org.gvsig.derivedgeometries.swing.api</module> |
|
13 |
<module>org.gvsig.derivedgeometries.swing.impl</module> |
|
14 |
</modules> |
|
15 |
</project> |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.1/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.derivedgeometries.swing.impl.DefaultDerivedGeometriesLibrary |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.1/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/DefaultDerivedGeometriesParameters.java | ||
---|---|---|
1 |
/* |
|
2 |
* Copyright 2014 DiSiD Technologies S.L.L. All rights reserved. |
|
3 |
* |
|
4 |
* Project : DiSiD org.gvsig.derivedgeometries.swing.impl |
|
5 |
* SVN Id : $Id$ |
|
6 |
*/ |
|
7 |
package org.gvsig.derivedgeometries.swing.impl; |
|
8 |
|
|
9 |
import java.util.ArrayList; |
|
10 |
import java.util.List; |
|
11 |
|
|
12 |
import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesParameters; |
|
13 |
import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesProcess.TYPE; |
|
14 |
import org.gvsig.fmap.dal.feature.FeatureReference; |
|
15 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
16 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
|
17 |
import org.gvsig.fmap.mapcontrol.MapControl; |
|
18 |
|
|
19 |
public class DefaultDerivedGeometriesParameters implements |
|
20 |
DerivedGeometriesParameters { |
|
21 |
|
|
22 |
private MapControl mapControl; |
|
23 |
private FLyrVect sourceLayer; |
|
24 |
private String outputLayerName; |
|
25 |
private String outputLayerPath; |
|
26 |
private int outputLayerType; |
|
27 |
private TYPE processType; |
|
28 |
private List<FeatureReference> selectedFeatures; |
|
29 |
private boolean addLayer; |
|
30 |
private boolean createNewFeatureStore; |
|
31 |
private FeatureStore featureStore; |
|
32 |
|
|
33 |
public DefaultDerivedGeometriesParameters() { |
|
34 |
|
|
35 |
} |
|
36 |
|
|
37 |
public DefaultDerivedGeometriesParameters(MapControl mapControl, |
|
38 |
FLyrVect sourceLayer, String outputLayerName, String outputLayerPath, |
|
39 |
int outputLayerType, TYPE processType) { |
|
40 |
|
|
41 |
this.mapControl = mapControl; |
|
42 |
this.sourceLayer = sourceLayer; |
|
43 |
this.outputLayerName = outputLayerName; |
|
44 |
this.outputLayerPath = outputLayerPath; |
|
45 |
this.outputLayerType = outputLayerType; |
|
46 |
this.processType = processType; |
|
47 |
this.selectedFeatures = new ArrayList<FeatureReference>(); |
|
48 |
this.addLayer = true; |
|
49 |
this.createNewFeatureStore = true; |
|
50 |
} |
|
51 |
|
|
52 |
public boolean getAddLayer() { |
|
53 |
return this.addLayer; |
|
54 |
} |
|
55 |
|
|
56 |
public boolean getCreateNewFeatureStore() { |
|
57 |
return this.createNewFeatureStore; |
|
58 |
} |
|
59 |
|
|
60 |
public FeatureStore getFeatureStore() { |
|
61 |
return this.featureStore; |
|
62 |
} |
|
63 |
|
|
64 |
public MapControl getMapControl() { |
Also available in: Unified diff