Revision 394
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.69/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.69/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/DerivedGeometriesProcess.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2014 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.derivedgeometries.swing.api; |
|
24 |
|
|
25 |
import org.gvsig.tools.ToolsLocator; |
|
26 |
import org.gvsig.tools.i18n.I18nManager; |
|
27 |
import org.gvsig.tools.task.MonitorableTask; |
|
28 |
|
|
29 |
/** |
|
30 |
* Process definition to create derived geometries. |
|
31 |
* |
|
32 |
* @author gvSIG team |
|
33 |
* @version $Id$ |
|
34 |
*/ |
|
35 |
public interface DerivedGeometriesProcess extends MonitorableTask { |
|
36 |
|
|
37 |
/** |
|
38 |
* Type of process. |
|
39 |
*/ |
|
40 |
public enum TYPE { |
|
41 |
POINTS_TO_LINE("_points_to_line"), |
|
42 |
POINTS_TO_POLYGON("_points_to_polygon"), |
|
43 |
LINES_TO_CLOSED_POLYLINE("_lines_to_closed_polyline"); |
|
44 |
|
|
45 |
private String value; |
|
46 |
|
|
47 |
TYPE(String value) { |
|
48 |
this.value = value; |
|
49 |
} |
|
50 |
|
|
51 |
public String toString() { |
|
52 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
53 |
return i18n.getTranslation(value); |
|
54 |
} |
|
55 |
} |
|
56 |
|
|
57 |
/** |
|
58 |
* @return parameters of process. |
|
59 |
*/ |
|
60 |
public DerivedGeometriesParameters getParameters(); |
|
61 |
|
|
62 |
/** |
|
63 |
* Starts process. |
|
64 |
*/ |
|
65 |
public void start(); |
|
66 |
|
|
67 |
} |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.69/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/DerivedGeometriesLocator.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2014 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.derivedgeometries.swing.api; |
|
24 |
|
|
25 |
import org.gvsig.tools.locator.BaseLocator; |
|
26 |
import org.gvsig.tools.locator.Locator; |
|
27 |
import org.gvsig.tools.locator.LocatorException; |
|
28 |
|
|
29 |
/** |
|
30 |
* This locator is the entry point for the DerivedGeometries library, providing |
|
31 |
* access to all DerivedGeometries services through the |
|
32 |
* {@link DerivedGeometriesManager} . |
|
33 |
* |
|
34 |
* @author gvSIG team |
|
35 |
* @version $Id$ |
|
36 |
*/ |
|
37 |
public class DerivedGeometriesLocator extends BaseLocator { |
|
38 |
|
|
39 |
private static final String LOCATOR_NAME = "DerivedGeometriesLocator"; |
|
40 |
|
|
41 |
public static final String MANAGER_NAME = "DerivedGeometriesSwing.manager"; |
|
42 |
|
|
43 |
private static final String MANAGER_DESCRIPTION = |
|
44 |
"Derived Geometries Swing Manager"; |
|
45 |
|
|
46 |
private static final DerivedGeometriesLocator instance = |
|
47 |
new DerivedGeometriesLocator(); |
|
48 |
|
|
49 |
/** |
|
50 |
* Return the singleton instance. |
|
51 |
* |
|
52 |
* @return the singleton instance |
|
53 |
*/ |
|
54 |
public static DerivedGeometriesLocator getInstance() { |
|
55 |
return instance; |
|
56 |
} |
|
57 |
|
|
58 |
public String getLocatorName() { |
|
59 |
return LOCATOR_NAME; |
|
60 |
} |
|
61 |
|
|
62 |
/** |
|
63 |
* Return a reference to DerivedGeometriesManager. |
|
64 |
* |
|
65 |
* @return a reference to DerivedGeometriesManager |
|
66 |
* @throws LocatorException |
|
67 |
* if there is no access to the class or the class |
|
68 |
* cannot be instantiated |
|
69 |
* @see Locator#get(String) |
|
70 |
*/ |
|
71 |
public static DerivedGeometriesManager getManager() throws LocatorException { |
|
72 |
return (DerivedGeometriesManager) getInstance().get(MANAGER_NAME); |
|
73 |
} |
|
74 |
|
|
75 |
/** |
|
76 |
* Registers the Class implementing the DerivedGeometriesLocator interface. |
|
77 |
* |
|
78 |
* @param clazz |
|
79 |
* implementing the DerivedGeometriesgManager interface |
|
80 |
*/ |
|
81 |
public static void registerManager(Class clazz) { |
|
82 |
getInstance().register(MANAGER_NAME, MANAGER_DESCRIPTION, clazz); |
|
83 |
} |
|
84 |
|
|
85 |
public static void registerDefaultManager(Class clazz) { |
|
86 |
getInstance().registerDefault(MANAGER_NAME, MANAGER_DESCRIPTION, clazz); |
|
87 |
} |
|
88 |
|
|
89 |
} |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.69/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/DerivedGeometriesParameters.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2014 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.derivedgeometries.swing.api; |
|
24 |
|
|
25 |
import java.util.List; |
|
26 |
|
|
27 |
import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesProcess.TYPE; |
|
28 |
import org.gvsig.fmap.dal.feature.FeatureReference; |
|
29 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
30 |
import org.gvsig.fmap.geom.Geometry; |
|
31 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
|
32 |
import org.gvsig.fmap.mapcontrol.MapControl; |
|
33 |
|
|
34 |
/** |
|
35 |
* |
|
36 |
* Definition of derived geometries parameters. |
|
37 |
* |
|
38 |
* @author gvSIG team |
|
39 |
* @version $Id$ |
|
40 |
* |
|
41 |
*/ |
|
42 |
public interface DerivedGeometriesParameters { |
|
43 |
|
|
44 |
/** |
|
45 |
* @return Gets if process has to add layer to map context. |
|
46 |
*/ |
|
47 |
public boolean getAddLayer(); |
|
48 |
|
|
49 |
/** |
|
50 |
* @return Gets if process has to create new feature store |
|
51 |
*/ |
|
52 |
public boolean getCreateNewFeatureStore(); |
|
53 |
|
|
54 |
/** |
|
55 |
* @return Gets feature store to edit |
|
56 |
*/ |
|
57 |
public FeatureStore getFeatureStore(); |
|
58 |
|
|
59 |
/** |
|
60 |
* @return mapControl of source layer and output layer |
|
61 |
*/ |
|
62 |
public MapControl getMapControl(); |
|
63 |
|
|
64 |
/** |
|
65 |
* @return name of output layer. |
|
66 |
*/ |
|
67 |
public String getOutPutLayerName(); |
|
68 |
|
|
69 |
/** |
|
70 |
* @return path of output layer. |
|
71 |
*/ |
|
72 |
public String getOutPutLayerPath(); |
|
73 |
|
|
74 |
/** |
|
75 |
* @return type of output layer. See {@link Geometry.TYPES} |
|
76 |
*/ |
|
77 |
public int getOutPutLayerType(); |
|
78 |
|
|
79 |
/** |
|
80 |
* @return process type. See {@link DerivedGeometriesProcess.TYPE} |
|
81 |
*/ |
|
82 |
public TYPE getProcessType(); |
|
83 |
|
|
84 |
/** |
|
85 |
* @return an ordered list of selected features. |
|
86 |
*/ |
|
87 |
public List<FeatureReference> getSelectedFeatures(); |
|
88 |
|
|
89 |
/** |
|
90 |
* @return source layer. |
|
91 |
*/ |
|
92 |
public FLyrVect getSourceLayer(); |
|
93 |
|
|
94 |
/** |
|
95 |
* @param b |
|
96 |
* Sets if process has to add output layer to mapContext or not. |
|
97 |
*/ |
|
98 |
public void setAddLayer(boolean b); |
|
99 |
|
|
100 |
/** |
|
101 |
* @param createNewFeatureStore |
|
102 |
* Sets if process has to create new feature store o not. |
|
103 |
*/ |
|
104 |
public void setCreateNewFeatureStore(boolean createNewFeatureStore); |
|
105 |
|
|
106 |
/** |
|
107 |
* @param featureStore |
|
108 |
* Sets feature store to edit |
|
109 |
*/ |
|
110 |
public void setFeatureStore(FeatureStore featureStore); |
|
111 |
|
|
112 |
/** |
|
113 |
* Sets name of output layer |
|
114 |
* |
|
115 |
* @param name |
|
116 |
*/ |
|
117 |
public void setOutPutLayerName(String name); |
|
118 |
|
|
119 |
/** |
|
120 |
* Sets path of output layer |
|
121 |
* |
|
122 |
* @param path |
|
123 |
*/ |
|
124 |
public void setOutPutLayerPath(String path); |
|
125 |
|
|
126 |
/** |
|
127 |
* Sets type of output layer. See {@link Geometry.TYPES} |
|
128 |
* |
|
129 |
* @param type |
|
130 |
*/ |
|
131 |
public void setOutPutLayerType(int type); |
|
132 |
|
|
133 |
/** |
|
134 |
* Sets type of {@link DerivedGeometriesProcess} process. |
|
135 |
* |
|
136 |
* @param type |
|
137 |
*/ |
|
138 |
public void setProcessType(TYPE type); |
|
139 |
|
|
140 |
/** |
|
141 |
* Sets selected features to create derived geometries. |
|
142 |
* |
|
143 |
* @param theFeatures |
|
144 |
* ordered list. |
|
145 |
*/ |
|
146 |
public void setSelectedFeatures(List<FeatureReference> theFeatures); |
|
147 |
|
|
148 |
/** |
|
149 |
* Sets source layer. |
|
150 |
* |
|
151 |
* @param sourceLayer |
|
152 |
*/ |
|
153 |
public void setSourceLayer(FLyrVect sourceLayer); |
|
154 |
|
|
155 |
} |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.69/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/DerivedGeometriesLibrary.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2014 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.derivedgeometries.swing.api; |
|
24 |
|
|
25 |
import org.gvsig.fmap.dal.DALLibrary; |
|
26 |
import org.gvsig.fmap.geom.GeometryLibrary; |
|
27 |
import org.gvsig.tools.library.AbstractLibrary; |
|
28 |
import org.gvsig.tools.library.LibraryException; |
|
29 |
import org.gvsig.tools.locator.ReferenceNotRegisteredException; |
|
30 |
|
|
31 |
/** |
|
32 |
* |
|
33 |
* Library for API initialization and configuration. |
|
34 |
* |
|
35 |
* @author gvSIG team |
|
36 |
* @version $Id$ |
|
37 |
*/ |
|
38 |
public class DerivedGeometriesLibrary extends AbstractLibrary { |
|
39 |
|
|
40 |
@Override |
|
41 |
public void doRegistration() { |
|
42 |
registerAsAPI(DerivedGeometriesLibrary.class); |
|
43 |
require(DALLibrary.class); |
|
44 |
require(GeometryLibrary.class); |
|
45 |
} |
|
46 |
|
|
47 |
@Override |
|
48 |
protected void doInitialize() throws LibraryException { |
|
49 |
// Do nothing |
|
50 |
} |
|
51 |
|
|
52 |
@Override |
|
53 |
protected void doPostInitialize() throws LibraryException { |
|
54 |
// Validate there is any implementation registered. |
|
55 |
DerivedGeometriesManager manager = |
|
56 |
DerivedGeometriesLocator.getManager(); |
|
57 |
if (manager == null) { |
|
58 |
throw new ReferenceNotRegisteredException( |
|
59 |
DerivedGeometriesLocator.MANAGER_NAME, |
|
60 |
DerivedGeometriesLocator.getInstance()); |
|
61 |
} |
|
62 |
|
|
63 |
} |
|
64 |
|
|
65 |
} |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.69/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/tablemodels/DerivedGeometriesSelectionModel.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2014 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.derivedgeometries.swing.api.tablemodels; |
|
24 |
|
|
25 |
import java.util.List; |
|
26 |
|
|
27 |
import javax.swing.ListSelectionModel; |
|
28 |
|
|
29 |
import org.gvsig.fmap.dal.feature.FeatureReference; |
|
30 |
|
|
31 |
public interface DerivedGeometriesSelectionModel extends ListSelectionModel { |
|
32 |
|
|
33 |
/** |
|
34 |
* |
|
35 |
* @return |
|
36 |
*/ |
|
37 |
public List<FeatureReference> getSelectedFeatures(); |
|
38 |
|
|
39 |
/** |
|
40 |
* |
|
41 |
* @param list |
|
42 |
*/ |
|
43 |
public void setSelectedFeatures(List<FeatureReference> list); |
|
44 |
|
|
45 |
} |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.69/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/DerivedGeometriesManager.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2014 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.derivedgeometries.swing.api; |
|
24 |
|
|
25 |
import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesProcess.TYPE; |
|
26 |
import org.gvsig.derivedgeometries.swing.api.panels.DerivedGeometriesPanel; |
|
27 |
import org.gvsig.derivedgeometries.swing.api.panels.FeaturesControlPanel; |
|
28 |
import org.gvsig.derivedgeometries.swing.api.panels.LayerAndProcessSelectionPanel; |
|
29 |
import org.gvsig.fmap.geom.Geometry; |
|
30 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
|
31 |
import org.gvsig.fmap.mapcontrol.MapControl; |
|
32 |
|
|
33 |
/** |
|
34 |
* Main class to manage DerivedGeometries functionalities |
|
35 |
* |
|
36 |
* @author gvSIG team |
|
37 |
* @version $Id$ |
|
38 |
*/ |
|
39 |
public interface DerivedGeometriesManager { |
|
40 |
|
|
41 |
/** |
|
42 |
* Creates an empty {@link DerivedGeometriesParameters} |
|
43 |
* |
|
44 |
* @return |
|
45 |
*/ |
|
46 |
public DerivedGeometriesParameters createDerivedGeometriesParameters(); |
|
47 |
|
|
48 |
/** |
|
49 |
* Creates a {@link DerivedGeometriesParameters}. |
|
50 |
* |
|
51 |
* @param mapControl |
|
52 |
* @param sourceLayer |
|
53 |
* @param outputLayerName |
|
54 |
* Name of output layer. |
|
55 |
* @param outputLayerPath |
|
56 |
* Path of output layer. |
|
57 |
* @param outputLayerType |
|
58 |
* Type of output layer. See {@link Geometry.TYPES} |
|
59 |
* @param processType |
|
60 |
* Type of process. See {@link DerivedGeometriesProcess.TYPE} |
|
61 |
* @return |
|
62 |
*/ |
|
63 |
public DerivedGeometriesParameters createDerivedGeometriesParameters( |
|
64 |
MapControl mapControl, FLyrVect sourceLayer, String outputLayerName, |
|
65 |
String outputLayerPath, int outputLayerType, TYPE processType); |
|
66 |
|
|
67 |
/** |
|
68 |
* @return a new {@link FeaturesControlPanel}. |
|
69 |
*/ |
|
70 |
public FeaturesControlPanel getFeaturesControlPanel(); |
|
71 |
|
|
72 |
/** |
|
73 |
* @param mapControl |
|
74 |
* to get vectorial layers, adds listeners... |
|
75 |
* @return a new {@link DerivedGeometriesPanel}. |
|
76 |
*/ |
|
77 |
public DerivedGeometriesPanel getDerivedGeometriesPanel( |
|
78 |
MapControl mapControl); |
|
79 |
|
|
80 |
/** |
|
81 |
* @param mapControl |
|
82 |
* mapControl to get vectorial layers, adds listeners... |
|
83 |
* @return a new {@link LayerAndProcessSelectionPanel} |
|
84 |
*/ |
|
85 |
public LayerAndProcessSelectionPanel getLayerAndProcessSelectionPanel( |
|
86 |
MapControl mapControl); |
|
87 |
|
|
88 |
/** |
|
89 |
* Given {@link DerivedGeometriesParameters}, starts a new |
|
90 |
* {@link DerivedGeometriesProcess}. |
|
91 |
* |
|
92 |
* @param parameters |
|
93 |
*/ |
|
94 |
public void startDerivedGeometriesProcess( |
|
95 |
DerivedGeometriesParameters parameters); |
|
96 |
|
|
97 |
} |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.69/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/exceptions/FetaureTableModelException.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2014 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.derivedgeometries.swing.api.exceptions; |
|
24 |
|
|
25 |
public class FetaureTableModelException extends DerivedGeometriesException { |
|
26 |
|
|
27 |
/** |
|
28 |
* |
|
29 |
*/ |
|
30 |
private static final long serialVersionUID = -5003333029683139078L; |
|
31 |
|
|
32 |
private static final String MESSAGE = |
|
33 |
"An error has been produced creating feature table model."; |
|
34 |
|
|
35 |
private static final String KEY = "_FeatureTableModelException"; |
|
36 |
|
|
37 |
public FetaureTableModelException(Throwable ex) { |
|
38 |
super(MESSAGE, ex, KEY, serialVersionUID); |
|
39 |
} |
|
40 |
|
|
41 |
public FetaureTableModelException(String message, Throwable ex) { |
|
42 |
super(message, ex, KEY, serialVersionUID); |
|
43 |
} |
|
44 |
|
|
45 |
} |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.69/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/exceptions/DerivedGeometriesException.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2014 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.derivedgeometries.swing.api.exceptions; |
|
24 |
|
|
25 |
import org.gvsig.tools.exception.BaseException; |
|
26 |
|
|
27 |
public class DerivedGeometriesException extends BaseException { |
|
28 |
|
|
29 |
/** |
|
30 |
* |
|
31 |
*/ |
|
32 |
private static final long serialVersionUID = -5881366280361882646L; |
|
33 |
|
|
34 |
private static final String MESSAGE = |
|
35 |
"An error has been produced in the Derived Geometries library"; |
|
36 |
|
|
37 |
private static final String KEY = "_DerivedGeometriesException"; |
|
38 |
|
|
39 |
/** |
|
40 |
* Constructor to be used in rare cases, usually you must create a new child |
|
41 |
* exception class for each case. |
|
42 |
* <strong>Don't use this constructor in child classes.</strong> |
|
43 |
*/ |
|
44 |
public DerivedGeometriesException() { |
|
45 |
super(MESSAGE, KEY, serialVersionUID); |
|
46 |
} |
|
47 |
|
|
48 |
/** |
|
49 |
* Constructor to be used in rare cases, usually you must create a new child |
|
50 |
* exception class for each case. |
|
51 |
* <p> |
|
52 |
* <strong>Don't use this constructor in child classes.</strong> |
|
53 |
* </p> |
|
54 |
* |
|
55 |
* @param cause |
|
56 |
* the original cause of the exception |
|
57 |
*/ |
|
58 |
public DerivedGeometriesException(Exception cause) { |
|
59 |
super(MESSAGE, cause, KEY, serialVersionUID); |
|
60 |
} |
|
61 |
|
|
62 |
/** |
|
63 |
* @see BaseException#BaseException(String, String, long). |
|
64 |
* @param message |
|
65 |
* the default messageFormat to describe the exception |
|
66 |
* @param key |
|
67 |
* the key to use to search a localized messageFormnata |
|
68 |
* @param code |
|
69 |
* the unique code to identify the exception |
|
70 |
*/ |
|
71 |
protected DerivedGeometriesException(String message, String key, long code) { |
|
72 |
super(message, key, code); |
|
73 |
} |
|
74 |
|
|
75 |
/** |
|
76 |
* @see BaseException#BaseException(String, Throwable, String, long). |
|
77 |
* @param message |
|
78 |
* the default messageFormat to describe the exception |
|
79 |
* @param cause |
|
80 |
* the original cause of the exception |
|
81 |
* @param key |
|
82 |
* the key to use to search a localized messageFormnata |
|
83 |
* @param code |
|
84 |
* the unique code to identify the exception |
|
85 |
*/ |
|
86 |
protected DerivedGeometriesException(String message, Throwable cause, |
|
87 |
String key, long code) { |
|
88 |
super(message, cause, key, code); |
|
89 |
} |
|
90 |
|
|
91 |
} |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.69/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/exceptions/ValidateSourceLayerException.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2014 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.derivedgeometries.swing.api.exceptions; |
|
24 |
|
|
25 |
public class ValidateSourceLayerException extends DerivedGeometriesException { |
|
26 |
|
|
27 |
/** |
|
28 |
* |
|
29 |
*/ |
|
30 |
private static final long serialVersionUID = 6671117008934615055L; |
|
31 |
|
|
32 |
private static final String MESSAGE = |
|
33 |
"An error has been produced validating source layer."; |
|
34 |
|
|
35 |
private static final String KEY = "_ValidateSourceLayerException"; |
|
36 |
|
|
37 |
public ValidateSourceLayerException(Throwable ex) { |
|
38 |
super(MESSAGE, ex, KEY, serialVersionUID); |
|
39 |
} |
|
40 |
|
|
41 |
public ValidateSourceLayerException(String message, Throwable ex) { |
|
42 |
super(message, ex, KEY, serialVersionUID); |
|
43 |
} |
|
44 |
|
|
45 |
} |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.69/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/exceptions/LoadSelectedFeatureDataException.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2014 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.derivedgeometries.swing.api.exceptions; |
|
24 |
|
|
25 |
public class LoadSelectedFeatureDataException extends |
|
26 |
DerivedGeometriesException { |
|
27 |
|
|
28 |
/** |
|
29 |
* |
|
30 |
*/ |
|
31 |
private static final long serialVersionUID = -1477432246895858868L; |
|
32 |
|
|
33 |
private static final String MESSAGE = |
|
34 |
"An error has been produced loading selected features."; |
|
35 |
|
|
36 |
private static final String KEY = "_LoadSelectedFeatureDataException"; |
|
37 |
|
|
38 |
public LoadSelectedFeatureDataException(Throwable ex) { |
|
39 |
super(MESSAGE, ex, KEY, serialVersionUID); |
|
40 |
} |
|
41 |
|
|
42 |
public LoadSelectedFeatureDataException(String message, Throwable ex) { |
|
43 |
super(message, ex, KEY, serialVersionUID); |
|
44 |
} |
|
45 |
|
|
46 |
} |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.69/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/exceptions/FormatRowException.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2014 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.derivedgeometries.swing.api.exceptions; |
|
24 |
|
|
25 |
|
|
26 |
public class FormatRowException extends DerivedGeometriesException { |
|
27 |
|
|
28 |
/** |
|
29 |
* |
|
30 |
*/ |
|
31 |
private static final long serialVersionUID = 6292433772869829638L; |
|
32 |
|
|
33 |
private static final String MESSAGE = |
|
34 |
"An error has been produced formating row."; |
|
35 |
|
|
36 |
private static final String KEY = "_FormatRowException"; |
|
37 |
|
|
38 |
public FormatRowException(Throwable ex) { |
|
39 |
super(MESSAGE, ex, KEY, serialVersionUID); |
|
40 |
} |
|
41 |
|
|
42 |
public FormatRowException(String message, Throwable ex) { |
|
43 |
super(message, ex, KEY, serialVersionUID); |
|
44 |
} |
|
45 |
|
|
46 |
} |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.69/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/panels/FeaturesControlPanel.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2014 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.derivedgeometries.swing.api.panels; |
|
24 |
|
|
25 |
import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesParameters; |
|
26 |
import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesProcess; |
|
27 |
import org.gvsig.tools.swing.api.Component; |
|
28 |
|
|
29 |
/** |
|
30 |
* Features control panel contains three panels. First panel shows information |
|
31 |
* about source layer and output layer. Second panel shows information of source |
|
32 |
* layer features and the last panel permits users to add, remove and order |
|
33 |
* selected features to create derived geometries. |
|
34 |
* |
|
35 |
* @author gvSIG team |
|
36 |
* @version $Id$ |
|
37 |
* |
|
38 |
*/ |
|
39 |
public interface FeaturesControlPanel extends Component { |
|
40 |
|
|
41 |
/** |
|
42 |
* Sets parameters to show information and initialize actions. |
|
43 |
* |
|
44 |
* @param parameters |
|
45 |
*/ |
|
46 |
public void setParameters(DerivedGeometriesParameters parameters); |
|
47 |
|
|
48 |
/** |
|
49 |
* @return parameters of panel. |
|
50 |
*/ |
|
51 |
public DerivedGeometriesParameters getParameters(); |
|
52 |
|
|
53 |
/** |
|
54 |
* Does action panel. Gets selected features, closes panel and starts |
|
55 |
* {@link DerivedGeometriesProcess} |
|
56 |
* |
|
57 |
*/ |
|
58 |
public void doAction(); |
|
59 |
|
|
60 |
/** |
|
61 |
* Validate if data of third panel is correct. |
|
62 |
* |
|
63 |
* @return True if it is valid otherwise false. |
|
64 |
*/ |
|
65 |
public boolean validateFields(); |
|
66 |
} |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.69/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/panels/LayerAndProcessSelectionPanel.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2014 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.derivedgeometries.swing.api.panels; |
|
24 |
|
|
25 |
import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesParameters; |
|
26 |
import org.gvsig.derivedgeometries.swing.api.exceptions.ValidateSourceLayerException; |
|
27 |
import org.gvsig.fmap.mapcontrol.MapControl; |
|
28 |
import org.gvsig.tools.swing.api.Component; |
|
29 |
|
|
30 |
/** |
|
31 |
* |
|
32 |
* @author gvSIG team |
|
33 |
* @version $Id$ |
|
34 |
* |
|
35 |
*/ |
|
36 |
public interface LayerAndProcessSelectionPanel extends Component { |
|
37 |
|
|
38 |
/** |
|
39 |
* |
|
40 |
* @return |
|
41 |
*/ |
|
42 |
public DerivedGeometriesParameters getParameters(); |
|
43 |
|
|
44 |
/** |
|
45 |
* |
|
46 |
* @param mapControl |
|
47 |
*/ |
|
48 |
public void setMapControl(MapControl mapControl); |
|
49 |
|
|
50 |
/** |
|
51 |
* |
|
52 |
*/ |
|
53 |
public void doAccept(); |
|
54 |
|
|
55 |
/** |
|
56 |
* |
|
57 |
*/ |
|
58 |
public void doCancel(); |
|
59 |
|
|
60 |
/** |
|
61 |
* |
|
62 |
* @return |
|
63 |
*/ |
|
64 |
public boolean validateFields(); |
|
65 |
|
|
66 |
/** |
|
67 |
* |
|
68 |
* @return |
|
69 |
* @throws ValidateSourceLayerException |
|
70 |
*/ |
|
71 |
public boolean validateSourceLayer() throws ValidateSourceLayerException; |
|
72 |
|
|
73 |
} |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.69/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/panels/DerivedGeometriesPanel.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2014 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.derivedgeometries.swing.api.panels; |
|
24 |
|
|
25 |
import org.gvsig.tools.swing.api.Component; |
|
26 |
|
|
27 |
/** |
|
28 |
* Panel that contains {@link LayerAndProcessSelectionPanel} and |
|
29 |
* {@link FeaturesControlPanel} |
|
30 |
* |
|
31 |
* @author gvSIG team |
|
32 |
* @version $Id$ |
|
33 |
* |
|
34 |
*/ |
|
35 |
public interface DerivedGeometriesPanel extends Component { |
|
36 |
|
|
37 |
} |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.69/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.69</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.69/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.69</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.69/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/AbstractDerivedGeometriesProcess.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2014 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.derivedgeometries.swing.impl; |
|
24 |
|
|
25 |
import java.util.ArrayList; |
|
26 |
import java.util.List; |
|
27 |
|
|
28 |
import org.cresques.cts.IProjection; |
|
29 |
|
|
30 |
import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesParameters; |
|
31 |
import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesProcess; |
|
32 |
import org.gvsig.fmap.dal.DALLocator; |
|
33 |
import org.gvsig.fmap.dal.DataManager; |
|
34 |
import org.gvsig.fmap.dal.DataServerExplorer; |
|
35 |
import org.gvsig.fmap.dal.DataServerExplorerParameters; |
|
36 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
37 |
import org.gvsig.fmap.dal.EditingNotification; |
|
38 |
import org.gvsig.fmap.dal.EditingNotificationManager; |
|
39 |
import org.gvsig.fmap.dal.feature.EditableFeature; |
|
40 |
import org.gvsig.fmap.dal.feature.EditableFeatureAttributeDescriptor; |
|
41 |
import org.gvsig.fmap.dal.feature.EditableFeatureType; |
|
42 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
|
43 |
import org.gvsig.fmap.dal.feature.FeatureReference; |
|
44 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
45 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
46 |
import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters; |
|
47 |
import org.gvsig.fmap.dal.swing.DALSwingLocator; |
|
48 |
import org.gvsig.fmap.geom.DataTypes; |
|
49 |
import org.gvsig.fmap.geom.Geometry; |
|
50 |
import org.gvsig.fmap.geom.GeometryLocator; |
|
51 |
import org.gvsig.fmap.geom.GeometryManager; |
|
52 |
import org.gvsig.fmap.geom.primitive.Point; |
|
53 |
import org.gvsig.fmap.geom.primitive.Surface; |
|
54 |
import org.gvsig.fmap.geom.type.GeometryType; |
|
55 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
|
56 |
import org.gvsig.fmap.mapcontext.MapContextManager; |
|
57 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
|
58 |
import org.gvsig.fmap.mapcontrol.MapControlLocator; |
|
59 |
import org.gvsig.tools.task.AbstractMonitorableTask; |
|
60 |
|
|
61 |
public abstract class AbstractDerivedGeometriesProcess extends |
|
62 |
AbstractMonitorableTask implements DerivedGeometriesProcess { |
|
63 |
|
|
64 |
private DerivedGeometriesParameters parameters; |
|
65 |
|
|
66 |
public AbstractDerivedGeometriesProcess(String name, |
|
67 |
DerivedGeometriesParameters parameters) { |
|
68 |
super(name); |
|
69 |
this.parameters = parameters; |
|
70 |
} |
|
71 |
|
|
72 |
protected FeatureStore addLayerToMapContex(String name, String path, |
|
73 |
IProjection projection) throws Exception { |
|
74 |
DataManager dataManager = DALLocator.getDataManager(); |
|
75 |
MapContextManager mapContextManager = |
|
76 |
MapContextLocator.getMapContextManager(); |
|
77 |
DataStoreParameters dataStoreParams = |
|
78 |
dataManager.createStoreParameters("Shape"); |
|
79 |
dataStoreParams.setDynValue("shpfile", path); |
|
80 |
dataStoreParams.setDynValue("CRS", projection); |
|
81 |
dataStoreParams.setDynValue("useNullGeometry", false); |
|
82 |
dataStoreParams.validate(); |
|
83 |
|
|
84 |
FLyrVect newLayer = |
|
85 |
(FLyrVect) mapContextManager.createLayer(name, dataStoreParams); |
|
86 |
getParameters().getMapControl().getMapContext().getLayers() |
|
87 |
.addLayer(newLayer); |
|
88 |
|
|
89 |
return newLayer.getFeatureStore(); |
|
90 |
} |
|
91 |
|
|
92 |
protected Surface closeSurfaceIfNecessary(Surface surface) { |
|
93 |
if (!isClosed(surface) && surface != null) { |
|
94 |
Point firstp = surface.getVertex(0); |
|
95 |
firstp = (Point) firstp.cloneGeometry(); |
|
96 |
surface.addVertex(firstp); |
|
97 |
} |
|
98 |
return surface; |
|
99 |
} |
|
100 |
|
|
101 |
protected void createNewFeatureStore(FeatureType sourceFeatureType, |
|
102 |
int outputLayerType, String outputLayerPath, IProjection projection) |
|
103 |
throws Exception { |
|
104 |
|
|
105 |
DataManager dataManager = DALLocator.getDataManager(); |
|
106 |
DataServerExplorerParameters eparams = |
|
107 |
dataManager.createServerExplorerParameters("FilesystemExplorer"); |
|
108 |
eparams.setDynValue("initialpath", "/data"); |
|
109 |
DataServerExplorer serverExplorer = |
|
110 |
dataManager.openServerExplorer(eparams.getExplorerName(), eparams); |
|
111 |
|
|
112 |
NewFeatureStoreParameters sparams = |
|
113 |
(NewFeatureStoreParameters) serverExplorer |
|
114 |
.getAddParameters("Shape"); |
|
115 |
|
|
116 |
EditableFeatureType newEditableFeatureType = |
|
117 |
(EditableFeatureType) sparams.getDefaultFeatureType(); |
|
118 |
|
|
119 |
// Iterate over feature type. Don't add geometry fields. |
|
120 |
for (int i = 0; i < sourceFeatureType.size(); i++) { |
|
121 |
String fieldName = |
|
122 |
sourceFeatureType.getAttributeDescriptor(i).getName(); |
|
123 |
int fieldType = |
|
124 |
sourceFeatureType.getAttributeDescriptor(i).getType(); |
|
125 |
if (fieldType != DataTypes.GEOMETRY) { |
|
126 |
newEditableFeatureType.add(fieldName, fieldType); |
|
127 |
} |
|
128 |
} |
|
129 |
|
|
130 |
// Add new geometry field with new geometry type |
|
131 |
FeatureAttributeDescriptor geometryAttribute = |
|
132 |
(FeatureAttributeDescriptor) sourceFeatureType |
|
133 |
.get(sourceFeatureType.getDefaultGeometryAttributeName()); |
|
134 |
EditableFeatureAttributeDescriptor newGeometryAttribute = |
|
135 |
newEditableFeatureType.add(geometryAttribute.getName(), |
|
136 |
geometryAttribute.getType(), geometryAttribute.getSize()); |
|
137 |
|
|
138 |
GeometryManager geoManager = GeometryLocator.getGeometryManager(); |
|
139 |
GeometryType sourceLayerGeomType = |
|
140 |
sourceFeatureType.getDefaultGeometryAttribute().getGeomType(); |
|
141 |
GeometryType outputLayerGeomType = |
|
142 |
geoManager.getGeometryType(outputLayerType, |
|
143 |
sourceLayerGeomType.getSubType()); |
|
144 |
|
|
145 |
newGeometryAttribute.setGeometryType(outputLayerGeomType); |
|
146 |
newGeometryAttribute.setPrecision(geometryAttribute.getPrecision()); |
|
147 |
newGeometryAttribute.setDefaultValue(geometryAttribute |
|
148 |
.getDefaultValue()); |
|
149 |
|
|
150 |
newEditableFeatureType |
|
151 |
.setDefaultGeometryAttributeName(geometryAttribute.getName()); |
|
152 |
|
|
153 |
sparams.setDynValue("geometryType", null); |
|
154 |
sparams.setDynValue("shpfile", outputLayerPath); |
|
155 |
sparams.setDynValue("CRS", projection); |
|
156 |
sparams.setDynValue("useNullGeometry", false); |
|
157 |
sparams.setDefaultFeatureType(newEditableFeatureType); |
|
158 |
sparams.validate(); |
|
159 |
|
|
160 |
serverExplorer.add("Shape", sparams, true); |
|
161 |
} |
|
162 |
|
|
163 |
protected void endEditingMode(FeatureStore featureStore) throws Exception { |
|
164 |
|
|
165 |
EditingNotificationManager editingNotificationManager = |
|
166 |
DALSwingLocator.getEditingNotificationManager(); |
|
167 |
|
|
168 |
EditingNotification notification = |
|
169 |
editingNotificationManager.notifyObservers(this, |
|
170 |
EditingNotification.BEFORE_EXIT_EDITING_STORE, null, |
|
171 |
featureStore); |
|
172 |
|
|
173 |
if (notification.isCanceled()) { |
|
174 |
String message = |
|
175 |
String.format( |
|
176 |
"FinishEditing of %1 has been canceled by some observer", |
|
177 |
featureStore.getName()); |
|
178 |
throw new InterruptedException(message); |
|
179 |
} |
|
180 |
|
|
181 |
getParameters().getMapControl().getCanceldraw().setCanceled(true); |
|
182 |
|
|
183 |
featureStore.finishEditing(); |
|
184 |
featureStore.deleteObserver(parameters.getMapControl()); |
|
185 |
|
|
186 |
editingNotificationManager.notifyObservers(this, |
|
187 |
EditingNotification.AFTER_EXIT_EDITING_STORE, null, featureStore); |
|
188 |
} |
|
189 |
|
|
190 |
protected FeatureStore getFeatureStore(String outputLayerPath, |
|
191 |
IProjection projection) throws Exception { |
|
192 |
|
|
193 |
DataManager dataManager = DALLocator.getDataManager(); |
|
194 |
DataStoreParameters dataStoreParams = |
|
195 |
dataManager.createStoreParameters("Shape"); |
|
196 |
dataStoreParams.setDynValue("shpfile", outputLayerPath); |
|
197 |
dataStoreParams.setDynValue("CRS", projection); |
|
198 |
dataStoreParams.setDynValue("useNullGeometry", false); |
|
199 |
dataStoreParams.validate(); |
|
200 |
|
|
201 |
return (FeatureStore) dataManager.openStore("Shape", dataStoreParams); |
|
202 |
} |
|
203 |
|
|
204 |
protected List<Geometry> getGeometries( |
|
205 |
List<FeatureReference> selectedFeatures) throws Exception { |
|
206 |
List<Geometry> geometries = new ArrayList<Geometry>(); |
|
207 |
for (FeatureReference featureReference : selectedFeatures) { |
|
208 |
Geometry geom = featureReference.getFeature().getDefaultGeometry(); |
|
209 |
geometries.add(geom); |
|
210 |
} |
|
211 |
return geometries; |
|
212 |
} |
|
213 |
|
|
214 |
public DerivedGeometriesParameters getParameters() { |
|
215 |
return this.parameters; |
|
216 |
} |
|
217 |
|
|
218 |
protected void insertGeometryIntoFeauteStore(FeatureStore newFeatureStore, |
|
219 |
Geometry geometry) throws Exception { |
|
220 |
EditableFeature eFeature = newFeatureStore.createNewFeature(true); |
|
221 |
eFeature.setGeometry(newFeatureStore.getDefaultFeatureType() |
|
222 |
.getDefaultGeometryAttributeName(), geometry); |
|
223 |
newFeatureStore.insert(eFeature); |
|
224 |
|
|
225 |
} |
|
226 |
|
|
227 |
private boolean isClosed(Surface surface) { |
|
228 |
|
|
229 |
if (surface != null) { |
|
230 |
Point firstPoint = surface.getVertex(0); |
|
231 |
Point lastPoint = surface.getVertex(surface.getNumVertices() - 1); |
|
232 |
if (firstPoint.equals(lastPoint)) { |
|
233 |
return true; |
|
234 |
} |
|
235 |
} |
|
236 |
return false; |
|
237 |
} |
|
238 |
|
|
239 |
protected void setEditingMode(FeatureStore featureStore) throws Exception { |
|
240 |
EditingNotificationManager editingNotificationManager = |
|
241 |
DALSwingLocator.getEditingNotificationManager(); |
|
242 |
|
|
243 |
EditingNotification notification = |
|
244 |
editingNotificationManager.notifyObservers(this, |
|
245 |
EditingNotification.BEFORE_ENTER_EDITING_STORE, null, |
|
246 |
featureStore); |
|
247 |
|
|
248 |
if (notification.isCanceled()) { |
|
249 |
String message = |
|
250 |
String.format("Edit of %1 has been canceled by some observer", |
|
251 |
featureStore.getName()); |
|
252 |
throw new InterruptedException(message); |
|
253 |
} |
|
254 |
|
|
255 |
featureStore.edit(); |
|
256 |
|
|
257 |
featureStore.addObserver(parameters.getMapControl()); |
|
258 |
|
|
259 |
editingNotificationManager.notifyObservers(this, |
|
260 |
EditingNotification.AFTER_ENTER_EDITING_STORE, null, featureStore); |
|
261 |
} |
|
262 |
|
|
263 |
public void setParameters(DerivedGeometriesParameters theParameters) { |
|
264 |
this.parameters = theParameters; |
|
265 |
} |
|
266 |
} |
org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.69/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/views/FeaturesControlPanelView.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2014 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.derivedgeometries.swing.impl.views; |
|
24 |
|
|
25 |
import java.awt.BorderLayout; |
|
26 |
import java.awt.Dimension; |
|
27 |
import java.awt.GridBagConstraints; |
|
28 |
import java.awt.GridBagLayout; |
|
29 |
import java.awt.Insets; |
|
30 |
|
|
31 |
import javax.swing.BorderFactory; |
|
32 |
import javax.swing.ImageIcon; |
|
33 |
import javax.swing.JButton; |
|
34 |
import javax.swing.JLabel; |
|
35 |
import javax.swing.JPanel; |
|
36 |
import javax.swing.JScrollPane; |
|
37 |
import javax.swing.JSplitPane; |
|
38 |
import javax.swing.JTable; |
|
39 |
import javax.swing.JTextField; |
|
40 |
import javax.swing.ListSelectionModel; |
|
41 |
import javax.swing.table.TableModel; |
|
42 |
|
|
43 |
import org.gvsig.derivedgeometries.swing.api.exceptions.FetaureTableModelException; |
|
44 |
import org.gvsig.fmap.dal.exception.DataException; |
|
45 |
import org.gvsig.fmap.dal.feature.FeatureQuery; |
|
46 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
47 |
import org.gvsig.fmap.mapcontrol.dal.feature.swing.FeatureTable; |
|
48 |
import org.gvsig.fmap.mapcontrol.dal.feature.swing.table.ConfigurableFeatureTableModel; |
|
49 |
import org.gvsig.tools.ToolsLocator; |
|
50 |
import org.gvsig.tools.exception.BaseException; |
|
51 |
import org.gvsig.tools.i18n.I18nManager; |
|
52 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
53 |
|
|
54 |
public class FeaturesControlPanelView extends JPanel { |
|
55 |
|
|
56 |
private static final long serialVersionUID = -3899738999699332396L; |
|
57 |
|
|
58 |
private I18nManager i18nManager = ToolsLocator.getI18nManager(); |
|
59 |
|
|
60 |
private JPanel summaryPanel; |
|
61 |
|
|
62 |
private JLabel sourceLayerNameLabel; |
|
63 |
|
|
64 |
private JTextField sourceLayerNameTextField; |
|
65 |
|
|
66 |
private JLabel destLayerNameLabel; |
|
67 |
|
|
68 |
private JTextField destLayerNameTextField; |
|
69 |
|
|
70 |
private JPanel centerPanel; |
|
71 |
|
|
72 |
private JSplitPane horizontalSplitPane; |
|
73 |
|
|
74 |
private JPanel featuresPanel; |
|
75 |
|
|
76 |
private JScrollPane allFeaturesScrollPane; |
|
77 |
|
|
78 |
private FeatureTable allFeaturesTable; |
|
79 |
|
|
80 |
private ConfigurableFeatureTableModel allFeaturesTableModel; |
|
81 |
|
|
82 |
private JPanel newFeatureSelectionPanel; |
|
83 |
|
|
84 |
private JPanel motionButtonsPanel; |
|
85 |
|
|
86 |
private JScrollPane selectedFeaturesScrollPane; |
|
87 |
|
|
88 |
private JTable selectedFeaturesTable; |
|
89 |
|
|
90 |
private JButton addAllIconButton; |
|
91 |
|
|
92 |
private JButton removeAllIconButton; |
|
93 |
|
|
94 |
private JButton addIconButton; |
|
95 |
|
|
96 |
private JButton removeIconButton; |
|
97 |
|
|
98 |
private JButton moveUpButton; |
|
99 |
|
|
100 |
private JButton moveDownButton; |
|
101 |
|
|
102 |
public FeaturesControlPanelView() { |
|
103 |
initialize(); |
|
104 |
} |
|
105 |
|
|
106 |
private void initialize() { |
|
107 |
setLayout(new BorderLayout()); |
|
108 |
add(getSummaryPanel(), BorderLayout.PAGE_START); |
|
109 |
add(getCenterPanel(), BorderLayout.CENTER); |
|
110 |
} |
|
111 |
|
|
112 |
@Override |
|
113 |
public Dimension getPreferredSize() { |
|
114 |
return new Dimension(500, 550); |
|
115 |
} |
|
116 |
|
|
117 |
protected JScrollPane getAllFeaturesScrollPane() { |
|
118 |
if (allFeaturesScrollPane == null) { |
|
119 |
allFeaturesScrollPane = new JScrollPane(); |
|
120 |
allFeaturesScrollPane |
|
121 |
.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); |
|
122 |
} |
|
123 |
|
|
124 |
return allFeaturesScrollPane; |
|
125 |
} |
|
126 |
|
|
127 |
@SuppressWarnings("serial") |
|
128 |
protected FeatureTable getAllFeaturesTable(FeatureStore featureStore) |
|
129 |
throws FetaureTableModelException { |
|
130 |
if (allFeaturesTable == null) { |
Also available in: Unified diff