Revision 406
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.main/src/main/java/org/gvsig/view3d/main/DummieLayerOrderManager.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright ? 2007-2014 gvSIG Association |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
|
|
25 |
package org.gvsig.view3d.main; |
|
26 |
|
|
27 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
28 |
import org.gvsig.fmap.mapcontext.layers.FLayers; |
|
29 |
import org.gvsig.fmap.mapcontext.layers.order.LayerOrderManager; |
|
30 |
import org.gvsig.tools.persistence.PersistentState; |
|
31 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
|
32 |
|
|
33 |
public class DummieLayerOrderManager implements LayerOrderManager { |
|
34 |
|
|
35 |
public void saveToState(PersistentState state) throws PersistenceException { |
|
36 |
} |
|
37 |
|
|
38 |
public void loadFromState(PersistentState state) |
|
39 |
throws PersistenceException { |
|
40 |
} |
|
41 |
|
|
42 |
public int getPosition(FLayers target, FLayer newLayer) { |
|
43 |
return 0; |
|
44 |
} |
|
45 |
|
|
46 |
public String getName() { |
|
47 |
return null; |
|
48 |
} |
|
49 |
|
|
50 |
public String getDescription() { |
|
51 |
return null; |
|
52 |
} |
|
53 |
|
|
54 |
public String getCode() { |
|
55 |
return null; |
|
56 |
} |
|
57 |
|
|
58 |
@Override |
|
59 |
public Object clone() throws CloneNotSupportedException { |
|
60 |
return new DummieLayerOrderManager(); |
|
61 |
} |
|
62 |
|
|
63 |
} |
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.main/src/main/java/org/gvsig/view3d/main/Main.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright ? 2007-2015 gvSIG Association |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
|
|
25 |
package org.gvsig.view3d.main; |
|
26 |
|
|
27 |
import java.awt.BorderLayout; |
|
28 |
import java.awt.Dimension; |
|
29 |
|
|
30 |
import javax.swing.JButton; |
|
31 |
import javax.swing.JFrame; |
|
32 |
import javax.swing.JMenu; |
|
33 |
import javax.swing.JMenuBar; |
|
34 |
import javax.swing.JMenuItem; |
|
35 |
import javax.swing.JToolBar; |
|
36 |
import javax.swing.WindowConstants; |
|
37 |
|
|
38 |
import org.cresques.cts.IProjection; |
|
39 |
import org.slf4j.Logger; |
|
40 |
import org.slf4j.LoggerFactory; |
|
41 |
|
|
42 |
import org.gvsig.fmap.crs.CRSFactory; |
|
43 |
import org.gvsig.fmap.dal.DALLocator; |
|
44 |
import org.gvsig.fmap.dal.DataManager; |
|
45 |
import org.gvsig.fmap.mapcontext.MapContext; |
|
46 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
|
47 |
import org.gvsig.fmap.mapcontext.MapContextManager; |
|
48 |
import org.gvsig.fmap.mapcontext.ViewPort; |
|
49 |
import org.gvsig.fmap.mapcontrol.MapControl; |
|
50 |
import org.gvsig.fmap.mapcontrol.MapControlCreationException; |
|
51 |
import org.gvsig.fmap.mapcontrol.MapControlLocator; |
|
52 |
import org.gvsig.fmap.mapcontrol.MapControlManager; |
|
53 |
import org.gvsig.fmap.mapcontrol.tools.PanListenerImpl; |
|
54 |
import org.gvsig.fmap.mapcontrol.tools.PointSelectionListener; |
|
55 |
import org.gvsig.fmap.mapcontrol.tools.ZoomInListenerImpl; |
|
56 |
import org.gvsig.fmap.mapcontrol.tools.ZoomOutListenerImpl; |
|
57 |
import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior; |
|
58 |
import org.gvsig.fmap.mapcontrol.tools.Behavior.MoveBehavior; |
|
59 |
import org.gvsig.fmap.mapcontrol.tools.Behavior.PointBehavior; |
|
60 |
import org.gvsig.fmap.mapcontrol.tools.Behavior.RectangleBehavior; |
|
61 |
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer; |
|
62 |
import org.gvsig.view3d.swing.api.View3DLocator; |
|
63 |
import org.gvsig.view3d.swing.api.View3DManager; |
|
64 |
|
|
65 |
/** |
|
66 |
* @author llmarques |
|
67 |
* |
|
68 |
*/ |
|
69 |
public class Main { |
|
70 |
|
|
71 |
private static final Logger logger = LoggerFactory.getLogger(Main.class); |
|
72 |
|
|
73 |
final View3DManager view3DManager; |
|
74 |
|
|
75 |
final MapControlManager mapControlManager; |
|
76 |
|
|
77 |
final DataManager dataManager; |
|
78 |
|
|
79 |
final MapContextManager mapContextManager; |
|
80 |
|
|
81 |
final String DEFAULT_CRS_CODE = "EPSG:23030"; |
|
82 |
|
|
83 |
final PaletteActions paletteActions; |
|
84 |
|
|
85 |
IProjection defaultProjection; |
|
86 |
|
|
87 |
MapControl mapControl; |
|
88 |
|
|
89 |
JFrame mainFrame; |
|
90 |
|
|
91 |
public Main() { |
|
92 |
view3DManager = View3DLocator.getManager(); |
|
93 |
mapControlManager = MapControlLocator.getMapControlManager(); |
|
94 |
dataManager = DALLocator.getDataManager(); |
|
95 |
mapContextManager = MapContextLocator.getMapContextManager(); |
|
96 |
defaultProjection = CRSFactory.getCRS(DEFAULT_CRS_CODE); |
|
97 |
paletteActions = new PaletteActions(this); |
|
98 |
|
|
99 |
MapContextLocator |
|
100 |
.registerDefaultOrderManager(DummieLayerOrderManager.class); |
|
101 |
} |
|
102 |
|
|
103 |
public static void main(String[] args) { |
|
104 |
new DefaultLibrariesInitializer().fullInitialize(); |
|
105 |
Main main = new Main(); |
|
106 |
main.doMain(); |
|
107 |
} |
|
108 |
|
|
109 |
private void doMain() { |
|
110 |
|
|
111 |
try { |
|
112 |
MapContext mapContext = |
|
113 |
new MapContext(new ViewPort(defaultProjection)); |
|
114 |
mapControl = mapControlManager.createJMapControlPanel(mapContext); |
|
115 |
|
|
116 |
mapControl.addBehavior("zoom", new Behavior[] { |
|
117 |
new RectangleBehavior(new ZoomInListenerImpl(mapControl)), |
|
118 |
new PointBehavior(new ZoomOutListenerImpl(mapControl), |
|
119 |
Behavior.BUTTON_RIGHT) }); |
|
120 |
mapControl.addBehavior("pan", new MoveBehavior(new PanListenerImpl( |
|
121 |
mapControl))); |
|
122 |
|
|
123 |
mapControl.addBehavior("pointSelection", |
|
124 |
new Behavior[] { new PointBehavior(new PointSelectionListener( |
|
125 |
mapControl)) }); |
|
126 |
|
|
127 |
IProjection defaultProjection = CRSFactory.getCRS(DEFAULT_CRS_CODE); |
|
128 |
mapControl.getViewPort().setProjection(defaultProjection); |
|
129 |
|
|
130 |
mapControl.setTool("pan"); |
|
131 |
|
|
132 |
} catch (MapControlCreationException e) { |
|
133 |
logger.error("Can't create mapControl", e); |
|
134 |
} |
|
135 |
|
|
136 |
// Create JFrame to show data |
|
137 |
mainFrame = new JFrame("View 3D test app"); |
|
138 |
mainFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); |
|
139 |
mainFrame.setPreferredSize(new Dimension(900, 680)); |
|
140 |
mainFrame.add(mapControl, BorderLayout.CENTER); |
|
141 |
|
|
142 |
// Create menu bar |
|
143 |
createMenu(); |
|
144 |
|
|
145 |
// Create tools bar |
|
146 |
createToolBar(); |
|
147 |
|
|
148 |
// Display the window. |
|
149 |
mainFrame.pack(); |
|
150 |
mainFrame.setLocation(100, 0); |
|
151 |
mainFrame.setVisible(true); |
|
152 |
|
|
153 |
} |
|
154 |
|
|
155 |
private void createMenu() { |
|
156 |
// Create the menu bar. |
|
157 |
JMenuBar menuBar = new JMenuBar(); |
|
158 |
|
|
159 |
// Build the menu. |
|
160 |
JMenu menuFile = new JMenu("File"); |
|
161 |
menuFile.add(new JMenuItem(paletteActions.getAction("exit"))); |
|
162 |
|
|
163 |
JMenu menuLayer = new JMenu("Layer"); |
|
164 |
menuLayer.add(new JMenuItem(paletteActions |
|
165 |
.getAction("add-vectorial-layer"))); |
|
166 |
menuLayer.add(new JMenuItem(paletteActions |
|
167 |
.getAction("add-raster-layer"))); |
|
168 |
|
|
169 |
JMenu menu3D = new JMenu("3D"); |
|
170 |
menu3D.add(new JMenuItem(paletteActions |
|
171 |
.getAction("create-sphere-view-3d"))); |
|
172 |
menu3D.add(new JMenuItem(paletteActions |
|
173 |
.getAction("create-flat-view-3d"))); |
|
174 |
menu3D.add(new JMenuItem(paletteActions |
|
175 |
.getAction("create-reload-view-3d"))); |
|
176 |
menu3D.add(new JMenuItem(paletteActions |
|
177 |
.getAction("create-synchronize-view-3d"))); |
|
178 |
|
|
179 |
menuBar.add(menuFile); |
|
180 |
menuBar.add(menuLayer); |
|
181 |
menuBar.add(menu3D); |
|
182 |
|
|
183 |
mainFrame.setJMenuBar(menuBar); |
|
184 |
} |
|
185 |
|
|
186 |
private void createToolBar() { |
|
187 |
JToolBar toolBar = new JToolBar(); |
|
188 |
|
|
189 |
toolBar.add(new JButton(paletteActions.getAction("add-vectorial-layer"))); |
|
190 |
toolBar.add(new JButton(paletteActions.getAction("add-raster-layer"))); |
|
191 |
toolBar.add(new JButton(paletteActions |
|
192 |
.getAction("create-sphere-view-3d"))); |
|
193 |
toolBar |
|
194 |
.add(new JButton(paletteActions.getAction("create-flat-view-3d"))); |
|
195 |
toolBar.add(new JButton(paletteActions |
|
196 |
.getAction("create-reload-view-3d"))); |
|
197 |
toolBar.add(new JButton(paletteActions |
|
198 |
.getAction("create-synchronize-view-3d"))); |
|
199 |
|
|
200 |
mainFrame.add(toolBar, BorderLayout.PAGE_START); |
|
201 |
|
|
202 |
} |
|
203 |
|
|
204 |
public MapControl getMapControl() { |
|
205 |
return this.mapControl; |
|
206 |
} |
|
207 |
|
|
208 |
public MapContext getMapContext() { |
|
209 |
return this.mapControl.getMapContext(); |
|
210 |
} |
|
211 |
|
|
212 |
public IProjection getDefaultProjection() { |
|
213 |
return defaultProjection; |
|
214 |
} |
|
215 |
} |
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.main/src/main/java/org/gvsig/view3d/main/PaletteActions.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright ? 2007-2015 gvSIG Association |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
|
|
25 |
package org.gvsig.view3d.main; |
|
26 |
|
|
27 |
import java.awt.event.ActionEvent; |
|
28 |
import java.io.File; |
|
29 |
import java.util.HashMap; |
|
30 |
import java.util.Map; |
|
31 |
|
|
32 |
import javax.swing.AbstractAction; |
|
33 |
import javax.swing.Action; |
|
34 |
import javax.swing.JFileChooser; |
|
35 |
|
|
36 |
import org.slf4j.Logger; |
|
37 |
import org.slf4j.LoggerFactory; |
|
38 |
|
|
39 |
import org.gvsig.fmap.dal.DALLocator; |
|
40 |
import org.gvsig.fmap.dal.DataManager; |
|
41 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
42 |
import org.gvsig.fmap.dal.exception.InitializeException; |
|
43 |
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException; |
|
44 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
|
45 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
46 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
|
47 |
import org.gvsig.fmap.mapcontext.MapContextManager; |
|
48 |
import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException; |
|
49 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
50 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
51 |
import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager; |
|
52 |
import org.gvsig.utils.GenericFileFilter; |
|
53 |
import org.gvsig.view3d.swing.api.View3DLocator; |
|
54 |
import org.gvsig.view3d.swing.api.View3DManager; |
|
55 |
import org.gvsig.view3d.swing.api.View3DPanel; |
|
56 |
|
|
57 |
/** |
|
58 |
* @author llmarques |
|
59 |
* |
|
60 |
*/ |
|
61 |
public class PaletteActions { |
|
62 |
|
|
63 |
private static final Logger logger = LoggerFactory |
|
64 |
.getLogger(PaletteActions.class); |
|
65 |
|
|
66 |
Map<String, Action> actions; |
|
67 |
Main main; |
|
68 |
|
|
69 |
public PaletteActions(Main main) { |
|
70 |
|
|
71 |
this.main = main; |
|
72 |
|
|
73 |
actions = new HashMap<String, Action>(); |
|
74 |
|
|
75 |
actions.put("exit", getExitAction()); |
|
76 |
actions.put("add-vectorial-layer", getAddVectorialLayerAction()); |
|
77 |
actions.put("add-raster-layer", getAddRasterLayerAction()); |
|
78 |
actions.put("create-sphere-view-3d", getCreateSphereViewAction()); |
|
79 |
actions.put("create-flat-view-3d", getCreateFlatViewAction()); |
|
80 |
actions.put("create-reload-view-3d", getCreateReloadLayersAction()); |
|
81 |
actions.put("create-synchronize-view-3d", getCreateSynchronizeAction()); |
|
82 |
|
|
83 |
} |
|
84 |
|
|
85 |
public Action getAction(String actionCommand) { |
|
86 |
return actions.get(actionCommand); |
|
87 |
} |
|
88 |
|
|
89 |
private AbstractAction getAddVectorialLayerAction() { |
|
90 |
return new AbstractAction("Add Vectorial layer") { |
|
91 |
|
|
92 |
/** |
|
93 |
* |
|
94 |
*/ |
|
95 |
private static final long serialVersionUID = 7506436995278783992L; |
|
96 |
|
|
97 |
public void actionPerformed(ActionEvent e) { |
|
98 |
ThreadSafeDialogsManager dlgManager = |
|
99 |
ToolsSwingLocator.getThreadSafeDialogsManager(); |
|
100 |
|
|
101 |
File[] file = |
|
102 |
dlgManager.showChooserDialog( |
|
103 |
"Seleccione una capa vectorial", |
|
104 |
JFileChooser.OPEN_DIALOG, JFileChooser.FILES_ONLY, |
|
105 |
false, new File(System.getProperty("user.home")), |
|
106 |
new GenericFileFilter(new String[] { ".shp" }, |
|
107 |
"(*.shp)"), true); |
|
108 |
|
|
109 |
if (file != null) { |
|
110 |
try { |
|
111 |
for (int i = 0; i < file.length; i++) { |
|
112 |
addVectorialLayer(file[i].getAbsolutePath()); |
|
113 |
} |
|
114 |
} catch (Exception ex) { |
|
115 |
logger.warn("Problems adding layer", ex); |
|
116 |
} |
|
117 |
} |
|
118 |
} |
|
119 |
}; |
|
120 |
} |
|
121 |
|
|
122 |
public void addRasterLayer(String layerPath) throws InitializeException, |
|
123 |
ProviderNotRegisteredException, ValidateDataParametersException, |
|
124 |
LoadLayerException { |
|
125 |
|
|
126 |
DataStoreParameters params; |
|
127 |
DataManager dataManager = DALLocator.getDataManager(); |
|
128 |
MapContextManager mapContextManager = |
|
129 |
MapContextLocator.getMapContextManager(); |
|
130 |
|
|
131 |
params = dataManager.createStoreParameters("Gdal Store"); |
|
132 |
params.setDynValue("FIELD_URI", layerPath); |
|
133 |
params.validate(); |
|
134 |
|
|
135 |
FeatureStore store = |
|
136 |
(FeatureStore) dataManager.openStore(params.getDataStoreName(), |
|
137 |
params); |
|
138 |
|
|
139 |
FLayer layer = mapContextManager.createLayer(store.getName(), store); |
|
140 |
this.main.getMapContext().getLayers().addLayer(layer); |
|
141 |
layer.setActive(true); |
|
142 |
} |
|
143 |
|
|
144 |
private AbstractAction getAddRasterLayerAction() { |
|
145 |
return new AbstractAction("Add Raster layer") { |
|
146 |
|
|
147 |
/** |
|
148 |
* |
|
149 |
*/ |
|
150 |
private static final long serialVersionUID = 7506436995278783992L; |
|
151 |
|
|
152 |
public void actionPerformed(ActionEvent e) { |
|
153 |
ThreadSafeDialogsManager dlgManager = |
|
154 |
ToolsSwingLocator.getThreadSafeDialogsManager(); |
|
155 |
|
|
156 |
File[] file = |
|
157 |
dlgManager.showChooserDialog("Seleccione una capa raster", |
|
158 |
JFileChooser.OPEN_DIALOG, JFileChooser.FILES_ONLY, |
|
159 |
false, new File(System.getProperty("user.home")), null, |
|
160 |
true); |
|
161 |
|
|
162 |
if (file != null) { |
|
163 |
try { |
|
164 |
for (int i = 0; i < file.length; i++) { |
|
165 |
addRasterLayer(file[i].getAbsolutePath()); |
|
166 |
} |
|
167 |
} catch (Exception ex) { |
|
168 |
logger.warn("Problems adding layer", ex); |
|
169 |
} |
|
170 |
} |
|
171 |
} |
|
172 |
}; |
|
173 |
} |
|
174 |
|
|
175 |
public void addVectorialLayer(String layerPath) throws InitializeException, |
|
176 |
ProviderNotRegisteredException, ValidateDataParametersException, |
|
177 |
LoadLayerException { |
|
178 |
|
|
179 |
DataStoreParameters params; |
|
180 |
DataManager dataManager = DALLocator.getDataManager(); |
|
181 |
MapContextManager mapContextManager = |
|
182 |
MapContextLocator.getMapContextManager(); |
|
183 |
|
|
184 |
params = dataManager.createStoreParameters("Shape"); |
|
185 |
|
|
186 |
File shpFile = new File(layerPath); |
|
187 |
|
|
188 |
params.setDynValue("shpFile", shpFile.getPath()); |
|
189 |
params.setDynValue("CRS", this.main.getDefaultProjection()); |
|
190 |
params.validate(); |
|
191 |
|
|
192 |
FeatureStore store = |
|
193 |
(FeatureStore) dataManager.openStore(params.getDataStoreName(), |
|
194 |
params); |
|
195 |
|
|
196 |
FLayer layer = mapContextManager.createLayer(store.getName(), store); |
|
197 |
this.main.getMapContext().getLayers().addLayer(layer); |
|
198 |
layer.setActive(true); |
|
199 |
} |
|
200 |
|
|
201 |
private AbstractAction getExitAction() { |
|
202 |
return new AbstractAction("Exit") { |
|
203 |
|
|
204 |
/** |
|
205 |
* |
|
206 |
*/ |
|
207 |
private static final long serialVersionUID = 7506436995278783992L; |
|
208 |
|
|
209 |
public void actionPerformed(ActionEvent e) { |
|
210 |
System.exit(0); |
|
211 |
} |
|
212 |
}; |
|
213 |
} |
|
214 |
|
|
215 |
private Action getCreateSphereViewAction() { |
|
216 |
return new AbstractAction("Create Sphere 3D visor") { |
|
217 |
|
|
218 |
/** |
|
219 |
* |
|
220 |
*/ |
|
221 |
private static final long serialVersionUID = 7506436995278783992L; |
|
222 |
|
|
223 |
public void actionPerformed(ActionEvent e) { |
|
224 |
View3DManager manager = View3DLocator.getManager(); |
|
225 |
View3DPanel view3dPanel = |
|
226 |
manager.createView3DPanel(main.getMapContext(), |
|
227 |
0); // Change value for constant key |
|
228 |
view3dPanel.show(); |
|
229 |
} |
|
230 |
}; |
|
231 |
} |
|
232 |
|
|
233 |
private Action getCreateSynchronizeAction() { |
|
234 |
return new AbstractAction("Synchronize views") { |
|
235 |
|
|
236 |
/** |
|
237 |
* |
|
238 |
*/ |
|
239 |
private static final long serialVersionUID = 7506436995278783992L; |
|
240 |
|
|
241 |
public void actionPerformed(ActionEvent e) { |
|
242 |
// TODO |
|
243 |
} |
|
244 |
}; |
|
245 |
} |
|
246 |
|
|
247 |
private Action getCreateReloadLayersAction() { |
|
248 |
return new AbstractAction("Reload layers") { |
|
249 |
|
|
250 |
/** |
|
251 |
* |
|
252 |
*/ |
|
253 |
private static final long serialVersionUID = 7506436995278783992L; |
|
254 |
|
|
255 |
public void actionPerformed(ActionEvent e) { |
|
256 |
// TODO |
|
257 |
} |
|
258 |
}; |
|
259 |
} |
|
260 |
|
|
261 |
private Action getCreateFlatViewAction() { |
|
262 |
return new AbstractAction("Create Flat 3D visor") { |
|
263 |
|
|
264 |
/** |
|
265 |
* |
|
266 |
*/ |
|
267 |
private static final long serialVersionUID = 7506436995278783992L; |
|
268 |
|
|
269 |
public void actionPerformed(ActionEvent e) { |
|
270 |
View3DManager manager = View3DLocator.getManager(); |
|
271 |
View3DPanel view3dPanel = |
|
272 |
manager.createView3DPanel(main.getMapContext(), |
|
273 |
1); // Change value for constant key |
|
274 |
view3dPanel.show(); |
|
275 |
} |
|
276 |
}; |
|
277 |
} |
|
278 |
} |
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.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.view3d</artifactId> |
|
6 |
<version>1.0.0-SNAPSHOT</version> |
|
7 |
</parent> |
|
8 |
<artifactId>org.gvsig.view3d.main</artifactId> |
|
9 |
<name>org.gvsig.view3d.main</name> |
|
10 |
<dependencies> |
|
11 |
<dependency> |
|
12 |
<groupId>org.gvsig</groupId> |
|
13 |
<artifactId>org.gvsig.view3d.swing.api</artifactId> |
|
14 |
</dependency> |
|
15 |
<dependency> |
|
16 |
<groupId>org.gvsig</groupId> |
|
17 |
<artifactId>org.gvsig.view3d.swing.impl</artifactId> |
|
18 |
<scope>runtime</scope> |
|
19 |
</dependency> |
|
20 |
</dependencies> |
|
1 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
2 |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
3 |
<modelVersion>4.0.0</modelVersion> |
|
4 |
<parent> |
|
5 |
<groupId>org.gvsig</groupId> |
|
6 |
<artifactId>org.gvsig.view3d</artifactId> |
|
7 |
<version>1.0.0-SNAPSHOT</version> |
|
8 |
</parent> |
|
9 |
<artifactId>org.gvsig.view3d.main</artifactId> |
|
10 |
<name>org.gvsig.view3d.main</name> |
|
11 |
<dependencies> |
|
12 |
<!-- Compile dependencies --> |
|
13 |
<dependency> |
|
14 |
<groupId>org.gvsig</groupId> |
|
15 |
<artifactId>org.gvsig.metadata.lib.basic.api</artifactId> |
|
16 |
<scope>compile</scope> |
|
17 |
</dependency> |
|
18 |
<dependency> |
|
19 |
<groupId>org.gvsig</groupId> |
|
20 |
<artifactId>org.gvsig.timesupport.lib.api</artifactId> |
|
21 |
<scope>compile</scope> |
|
22 |
</dependency> |
|
23 |
<dependency> |
|
24 |
<groupId>org.gvsig</groupId> |
|
25 |
<artifactId>org.gvsig.tools.swing.api</artifactId> |
|
26 |
<type>jar</type> |
|
27 |
<scope>compile</scope> |
|
28 |
</dependency> |
|
29 |
<dependency> |
|
30 |
<groupId>org.gvsig</groupId> |
|
31 |
<artifactId>org.gvsig.fmap.control</artifactId> |
|
32 |
<scope>compile</scope> |
|
33 |
</dependency> |
|
34 |
<dependency> |
|
35 |
<groupId>org.gvsig</groupId> |
|
36 |
<artifactId>org.gvsig.fmap.dal.api</artifactId> |
|
37 |
<scope>compile</scope> |
|
38 |
</dependency> |
|
39 |
<dependency> |
|
40 |
<groupId>org.gvsig</groupId> |
|
41 |
<artifactId>org.gvsig.fmap.geometry.api</artifactId> |
|
42 |
<scope>compile</scope> |
|
43 |
</dependency> |
|
44 |
<dependency> |
|
45 |
<groupId>org.gvsig</groupId> |
|
46 |
<artifactId>org.gvsig.fmap.mapcontext.api</artifactId> |
|
47 |
<scope>compile</scope> |
|
48 |
</dependency> |
|
49 |
<dependency> |
|
50 |
<groupId>org.gvsig</groupId> |
|
51 |
<artifactId>org.gvsig.raster.lib.api</artifactId> |
|
52 |
<version>2.2.6</version> |
|
53 |
</dependency> |
|
54 |
<dependency> |
|
55 |
<groupId>org.gvsig</groupId> |
|
56 |
<artifactId>org.gvsig.raster.swing.api</artifactId> |
|
57 |
<version>2.2.6</version> |
|
58 |
</dependency> |
|
59 |
|
|
60 |
<!-- runtime dependencies --> |
|
61 |
<dependency> |
|
62 |
<groupId>org.gvsig</groupId> |
|
63 |
<artifactId>org.gvsig.metadata.lib.basic.impl</artifactId> |
|
64 |
<scope>runtime</scope> |
|
65 |
</dependency> |
|
66 |
<dependency> |
|
67 |
<groupId>org.gvsig</groupId> |
|
68 |
<artifactId>org.gvsig.fmap.geometry.generalpath</artifactId> |
|
69 |
<scope>runtime</scope> |
|
70 |
</dependency> |
|
71 |
<dependency> |
|
72 |
<groupId>org.gvsig</groupId> |
|
73 |
<artifactId>org.gvsig.fmap.geometry.operation</artifactId> |
|
74 |
<scope>runtime</scope> |
|
75 |
</dependency> |
|
76 |
<dependency> |
|
77 |
<groupId>org.gvsig</groupId> |
|
78 |
<artifactId>org.gvsig.fmap.mapcontext.impl</artifactId> |
|
79 |
<scope>runtime</scope> |
|
80 |
</dependency> |
|
81 |
<dependency> |
|
82 |
<groupId>org.gvsig</groupId> |
|
83 |
<artifactId>org.gvsig.symbology.lib.impl</artifactId> |
|
84 |
<scope>runtime</scope> |
|
85 |
</dependency> |
|
86 |
<dependency> |
|
87 |
<groupId>org.gvsig</groupId> |
|
88 |
<artifactId>org.gvsig.fmap.dal.impl</artifactId> |
|
89 |
<scope>runtime</scope> |
|
90 |
</dependency> |
|
91 |
<!-- <dependency> --> |
|
92 |
<!-- <groupId>org.gvsig</groupId> --> |
|
93 |
<!-- <artifactId>org.gvsig.fmap.dal.spi</artifactId> --> |
|
94 |
<!-- <scope>runtime</scope> --> |
|
95 |
<!-- </dependency> --> |
|
96 |
<dependency> |
|
97 |
<groupId>org.gvsig</groupId> |
|
98 |
<artifactId>org.gvsig.fmap.dal.file.shp</artifactId> |
|
99 |
<scope>runtime</scope> |
|
100 |
</dependency> |
|
101 |
<dependency> |
|
102 |
<groupId>org.gvsig</groupId> |
|
103 |
<artifactId>org.gvsig.fmap.dal.file.dbf</artifactId> |
|
104 |
<scope>runtime</scope> |
|
105 |
</dependency> |
|
106 |
<!-- <dependency> --> |
|
107 |
<!-- <groupId>org.gvsig</groupId> --> |
|
108 |
<!-- <artifactId>org.gvsig.fmap.dal.file.lib</artifactId> --> |
|
109 |
<!-- <scope>runtime</scope> --> |
|
110 |
<!-- </dependency> --> |
|
111 |
<dependency> |
|
112 |
<groupId>org.gvsig</groupId> |
|
113 |
<artifactId>org.gvsig.timesupport.lib.impl</artifactId> |
|
114 |
<scope>runtime</scope> |
|
115 |
</dependency> |
|
116 |
<dependency> |
|
117 |
<groupId>org.gvsig</groupId> |
|
118 |
<artifactId>org.gvsig.tools.evaluator.sqljep</artifactId> |
|
119 |
<scope>runtime</scope> |
|
120 |
</dependency> |
|
121 |
<dependency> |
|
122 |
<groupId>org.gvsig</groupId> |
|
123 |
<artifactId>org.gvsig.proj.lib.proj4j</artifactId> |
|
124 |
<scope>runtime</scope> |
|
125 |
</dependency> |
|
126 |
<dependency> |
|
127 |
<groupId>org.gvsig</groupId> |
|
128 |
<artifactId>org.gvsig.raster.lib.impl</artifactId> |
|
129 |
<version>2.2.6</version> |
|
130 |
<scope>runtime</scope> |
|
131 |
</dependency> |
|
132 |
<dependency> |
|
133 |
<groupId>org.gvsig</groupId> |
|
134 |
<artifactId>org.gvsig.raster.swing.impl</artifactId> |
|
135 |
<version>2.2.6</version> |
|
136 |
<scope>runtime</scope> |
|
137 |
</dependency> |
|
138 |
|
|
139 |
<!-- View3D dependencies --> |
|
140 |
<dependency> |
|
141 |
<groupId>org.gvsig</groupId> |
|
142 |
<artifactId>org.gvsig.view3d.swing.api</artifactId> |
|
143 |
</dependency> |
|
144 |
<dependency> |
|
145 |
<groupId>org.gvsig</groupId> |
|
146 |
<artifactId>org.gvsig.view3d.swing.impl</artifactId> |
|
147 |
<scope>runtime</scope> |
|
148 |
</dependency> |
|
149 |
|
|
150 |
</dependencies> |
|
21 | 151 |
</project> |
Also available in: Unified diff