Revision 34304
trunk/extensions/extGraph/config/about.htm | ||
---|---|---|
5 | 5 |
<style></style> |
6 | 6 |
</head> |
7 | 7 |
<body> |
8 |
<table width="60%" border="0">
|
|
8 |
<table width="90%" border="0">
|
|
9 | 9 |
<tr> |
10 |
<td width="64%"><img src="images/logo_horiz_bicolor_gva.png" width="329" height="50"></td> |
|
11 |
<td width="36%"><div align="right"><img src="images/logoIver2.png" width="87" height="50"></div></td> |
|
10 |
<td width="50%"><img src="images/logo_horiz_bicolor_gva.png" width="329" height="50"></td> |
|
11 |
<td width="25%"><div align="center"><img src="images/logoIver2.png" width="87" height="50"></div></td> |
|
12 |
<td width="25%"><div align="right"><img src="images/logoScolab.png" width="84" height="50"></div></td> |
|
12 | 13 |
</tr> |
13 | 14 |
<tr> |
14 |
<td colspan="2"><font face="Arial, Helvetica, sans-serif">© Copyright
|
|
15 |
Generalitat Valenciana, IVER T.I. 2009.</font></td> |
|
15 |
<td colspan="3"><font face="Arial, Helvetica, sans-serif">© Copyright
|
|
16 |
Generalitat Valenciana, IVER T.I. 2009, SCOLAB Software Colaborativo.</font></td>
|
|
16 | 17 |
</tr> |
17 | 18 |
</table> |
18 | 19 |
<!--<p><br><br><b> Build Number: #build.number#</b></p>--> |
19 | 20 |
<p> Faster version with Fibonacci Queue in AStar, Dijkstra, etc. And in order to avoid getting values from |
20 | 21 |
recordset, a cache is done, so if you calculate more routes, you will get an improvement of speed. |
21 | 22 |
<br><br> |
22 |
<b> Code name: extGraph-v_1.0-#build.number#</b>
|
|
23 |
<b> Code name: extGraph-v_1.1-#build.number#</b>
|
|
23 | 24 |
</p> |
24 | 25 |
|
25 | 26 |
</body> |
trunk/extensions/extGraph/build.number | ||
---|---|---|
1 | 1 |
#Build Number for ANT. Do not edit! |
2 | 2 |
#Fri Jan 15 09:01:23 CET 2010 |
3 |
build.number=1239 |
|
3 |
build.number=1240 |
trunk/extensions/extGraph/src/org/gvsig/graph/gui/RouteControlPanel.java | ||
---|---|---|
166 | 166 |
|
167 | 167 |
import javax.swing.ImageIcon; |
168 | 168 |
import javax.swing.JCheckBox; |
169 |
import javax.swing.JComboBox; |
|
170 | 169 |
import javax.swing.JLabel; |
171 | 170 |
import javax.swing.JOptionPane; |
172 | 171 |
import javax.swing.JPanel; |
... | ... | |
846 | 845 |
return btnSaveStage; |
847 | 846 |
} |
848 | 847 |
|
849 |
class FormatSelectionPanel extends JPanel implements IWindow { |
|
850 |
|
|
851 |
JComboBox formats; |
|
852 |
WindowInfo wi = null; |
|
853 |
private boolean isOkButtonPressed = false;; |
|
854 |
|
|
855 |
public FormatSelectionPanel(String introductoryText) { |
|
856 |
super(new BorderLayout()); |
|
857 |
String[] formatos = { "SHP", "DXF", "POSTGIS" }; //, "GML" }; |
|
858 |
formats = new JComboBox(formatos); |
|
859 |
GridBagLayoutPanel contentPanel = |
|
860 |
new GridBagLayoutPanel(); |
|
861 |
contentPanel.addComponent(new JLabel(introductoryText)); |
|
862 |
contentPanel.addComponent(formats); |
|
863 |
JButton okButton = new JButton(PluginServices.getText(null, |
|
864 |
"Aceptar")); |
|
865 |
okButton.addActionListener(new ActionListener() { |
|
866 |
public void actionPerformed(ActionEvent arg0) { |
|
867 |
setIsOkButtonPressed(true); |
|
868 |
close(); |
|
869 |
} |
|
870 |
}); |
|
871 |
contentPanel.addComponent(okButton); |
|
872 |
|
|
873 |
add(contentPanel); |
|
874 |
} |
|
875 |
|
|
876 |
protected void setIsOkButtonPressed(boolean b) { |
|
877 |
this.isOkButtonPressed = b; |
|
878 |
|
|
879 |
} |
|
880 |
|
|
881 |
void close() { |
|
882 |
PluginServices.getMDIManager().closeWindow(this); |
|
883 |
} |
|
884 |
|
|
885 |
public String getSelectedFormat() { |
|
886 |
return (String) formats.getSelectedItem(); |
|
887 |
} |
|
888 |
|
|
889 |
public WindowInfo getWindowInfo() { |
|
890 |
if (wi == null) { |
|
891 |
wi = new WindowInfo(WindowInfo.MODALDIALOG | WindowInfo.PALETTE); |
|
892 |
wi.setTitle(PluginServices |
|
893 |
.getText(null, "Format_selection"));// Internacionalizar |
|
894 |
// esto |
|
895 |
wi.setWidth(400); |
|
896 |
wi.setHeight(55); |
|
897 |
} |
|
898 |
return wi; |
|
899 |
} |
|
900 |
|
|
901 |
public Object getWindowProfile() { |
|
902 |
return WindowInfo.DIALOG_PROFILE; |
|
903 |
} |
|
904 |
|
|
905 |
public boolean isOkButtonPressed() { |
|
906 |
return isOkButtonPressed; |
|
907 |
} |
|
908 |
|
|
909 |
} |
|
910 |
|
|
911 | 848 |
public void actionPerformed(ActionEvent e) { |
912 | 849 |
Component c = (Component) e.getSource(); |
913 | 850 |
if (c.equals(getBtnLoadStage())) { |
trunk/extensions/extGraph/src/org/gvsig/graph/gui/FormatSelectionPanelData.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
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 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2010 Software Colaborativo (www.scolab.es) development |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.graph.gui; |
|
29 |
|
|
30 |
import javax.swing.JComboBox; |
|
31 |
|
|
32 |
import com.iver.andami.ui.mdiManager.WindowInfo; |
|
33 |
|
|
34 |
public class FormatSelectionPanelData { |
|
35 |
private JComboBox formats; |
|
36 |
private WindowInfo wi; |
|
37 |
private boolean isOkButtonPressed; |
|
38 |
|
|
39 |
public FormatSelectionPanelData(WindowInfo wi, boolean isOkButtonPressed) { |
|
40 |
this.wi = wi; |
|
41 |
this.isOkButtonPressed = isOkButtonPressed; |
|
42 |
} |
|
43 |
|
|
44 |
public JComboBox getFormats() { |
|
45 |
return formats; |
|
46 |
} |
|
47 |
|
|
48 |
public void setFormats(JComboBox formats) { |
|
49 |
this.formats = formats; |
|
50 |
} |
|
51 |
|
|
52 |
public WindowInfo getWi() { |
|
53 |
return wi; |
|
54 |
} |
|
55 |
|
|
56 |
public void setWi(WindowInfo wi) { |
|
57 |
this.wi = wi; |
|
58 |
} |
|
59 |
|
|
60 |
public boolean isOkButtonPressed() { |
|
61 |
return isOkButtonPressed; |
|
62 |
} |
|
63 |
|
|
64 |
public void setOkButtonPressed(boolean isOkButtonPressed) { |
|
65 |
this.isOkButtonPressed = isOkButtonPressed; |
|
66 |
} |
|
67 |
} |
trunk/extensions/extGraph/src/org/gvsig/graph/gui/RouteReportPanel.java | ||
---|---|---|
112 | 112 |
import javax.swing.event.HyperlinkEvent; |
113 | 113 |
import javax.swing.event.HyperlinkListener; |
114 | 114 |
|
115 |
import org.cresques.cts.IProjection; |
|
115 | 116 |
import org.gvsig.graph.core.DocumentRenderer; |
116 | 117 |
import org.gvsig.graph.core.TurnUtil; |
117 | 118 |
import org.gvsig.graph.solvers.Route; |
119 |
import org.gvsig.graph.solvers.RouteMemoryDriver; |
|
118 | 120 |
import org.gvsig.gui.beans.swing.JButton; |
119 | 121 |
|
120 | 122 |
import com.hardcode.gdbms.engine.values.DoubleValue; |
121 | 123 |
import com.iver.andami.PluginServices; |
122 | 124 |
import com.iver.andami.ui.mdiManager.IWindow; |
123 | 125 |
import com.iver.andami.ui.mdiManager.WindowInfo; |
126 |
import com.iver.cit.gvsig.addlayer.AddLayerDialog; |
|
127 |
import com.iver.cit.gvsig.fmap.MapContext; |
|
124 | 128 |
import com.iver.cit.gvsig.fmap.MapControl; |
125 | 129 |
import com.iver.cit.gvsig.fmap.core.IFeature; |
126 | 130 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
127 | 131 |
import com.iver.cit.gvsig.fmap.core.SymbologyFactory; |
128 | 132 |
import com.iver.cit.gvsig.fmap.core.symbols.ILineSymbol; |
133 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
|
129 | 134 |
import com.iver.cit.gvsig.fmap.layers.GraphicLayer; |
135 |
import com.iver.cit.gvsig.fmap.layers.LayerFactory; |
|
130 | 136 |
import com.iver.cit.gvsig.fmap.rendering.FGraphic; |
131 | 137 |
|
132 | 138 |
public class RouteReportPanel extends JPanel implements IWindow { |
... | ... | |
254 | 260 |
initialize(); |
255 | 261 |
scrollPanel.setViewportView(htmlPanel); |
256 | 262 |
add(scrollPanel, BorderLayout.CENTER); |
257 |
JButton btn = new JButton(_T("Print")); |
|
258 |
btn.addActionListener(new ActionListener() { |
|
263 |
JPanel south = new JPanel(); |
|
264 |
JButton btnPrint = new JButton(_T("Print")); |
|
265 |
btnPrint.addActionListener(new ActionListener() { |
|
259 | 266 |
|
260 | 267 |
public void actionPerformed(ActionEvent e) { |
261 | 268 |
printReport(); |
262 | 269 |
} |
263 | 270 |
|
264 | 271 |
}); |
265 |
add(btn, BorderLayout.SOUTH); |
|
272 |
JButton btnExport = new JButton(_T("Export")); |
|
273 |
btnExport.addActionListener(new ActionListener() { |
|
274 |
|
|
275 |
public void actionPerformed(ActionEvent e) { |
|
276 |
exportRoute(); |
|
277 |
} |
|
278 |
|
|
279 |
}); |
|
280 |
|
|
281 |
south.add(btnPrint); |
|
282 |
south.add(btnExport); |
|
283 |
add(south, BorderLayout.SOUTH); |
|
266 | 284 |
} |
267 | 285 |
|
286 |
protected void exportRoute() { |
|
287 |
RouteMemoryDriver driver = new RouteMemoryDriver(route.getFeatureList()); |
|
288 |
IProjection projection = AddLayerDialog.getLastProjection(); |
|
289 |
FLyrVect routeLayer = (FLyrVect) LayerFactory.createLayer("Route", |
|
290 |
driver, projection); |
|
291 |
|
|
292 |
FormatSelectionPanel selectionPanel = new FormatSelectionPanel(PluginServices.getText(null, |
|
293 |
"Seleccione_un_formato_para_guardar_la_ruta")); |
|
294 |
PluginServices.getMDIManager().addWindow(selectionPanel); |
|
295 |
|
|
296 |
String format = selectionPanel.getSelectedFormat(); |
|
297 |
com.iver.cit.gvsig.ExportTo export = new com.iver.cit.gvsig.ExportTo(); |
|
298 |
MapContext context = mapControl.getMapContext(); |
|
299 |
if (format.equalsIgnoreCase("SHP")) { |
|
300 |
export.saveToShp(context, routeLayer); |
|
301 |
} else if (format.equalsIgnoreCase("DXF")) { |
|
302 |
export.saveToDxf(context, routeLayer); |
|
303 |
// } else if (format.equalsIgnoreCase("GML")) { |
|
304 |
// export.saveToGml(context, routeLayer); |
|
305 |
} else if (format.equalsIgnoreCase("POSTGIS")) { |
|
306 |
export.saveToPostGIS(context, routeLayer); |
|
307 |
} |
|
308 |
|
|
309 |
|
|
310 |
} |
|
311 |
|
|
268 | 312 |
/** |
269 | 313 |
* Prints report (html) |
270 | 314 |
*/ |
trunk/extensions/extGraph/src/org/gvsig/graph/gui/FormatSelectionPanel.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
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 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2010 Software Colaborativo (www.scolab.es) development |
|
26 |
*/ |
|
27 |
|
|
28 |
/** |
|
29 |
* |
|
30 |
*/ |
|
31 |
package org.gvsig.graph.gui; |
|
32 |
|
|
33 |
import java.awt.BorderLayout; |
|
34 |
import java.awt.event.ActionEvent; |
|
35 |
import java.awt.event.ActionListener; |
|
36 |
|
|
37 |
import javax.swing.JComboBox; |
|
38 |
import javax.swing.JLabel; |
|
39 |
import javax.swing.JPanel; |
|
40 |
|
|
41 |
import org.gvsig.gui.beans.swing.GridBagLayoutPanel; |
|
42 |
import org.gvsig.gui.beans.swing.JButton; |
|
43 |
|
|
44 |
import com.iver.andami.PluginServices; |
|
45 |
import com.iver.andami.ui.mdiManager.IWindow; |
|
46 |
import com.iver.andami.ui.mdiManager.WindowInfo; |
|
47 |
|
|
48 |
class FormatSelectionPanel extends JPanel implements IWindow { |
|
49 |
|
|
50 |
/** |
|
51 |
* |
|
52 |
*/ |
|
53 |
FormatSelectionPanelData data = new FormatSelectionPanelData(null, |
|
54 |
false); |
|
55 |
|
|
56 |
public FormatSelectionPanel(String introductoryText) { |
|
57 |
super(new BorderLayout()); |
|
58 |
String[] formatos = { "SHP", "DXF", "POSTGIS" }; //, "GML" }; |
|
59 |
data.setFormats(new JComboBox(formatos)); |
|
60 |
GridBagLayoutPanel contentPanel = |
|
61 |
new GridBagLayoutPanel(); |
|
62 |
contentPanel.addComponent(new JLabel(introductoryText)); |
|
63 |
contentPanel.addComponent(data.getFormats()); |
|
64 |
JButton okButton = new JButton(PluginServices.getText(null, |
|
65 |
"Aceptar")); |
|
66 |
okButton.addActionListener(new ActionListener() { |
|
67 |
public void actionPerformed(ActionEvent arg0) { |
|
68 |
setIsOkButtonPressed(true); |
|
69 |
close(); |
|
70 |
} |
|
71 |
}); |
|
72 |
contentPanel.addComponent(okButton); |
|
73 |
|
|
74 |
add(contentPanel); |
|
75 |
} |
|
76 |
|
|
77 |
protected void setIsOkButtonPressed(boolean b) { |
|
78 |
this.data.setOkButtonPressed(b); |
|
79 |
|
|
80 |
} |
|
81 |
|
|
82 |
void close() { |
|
83 |
PluginServices.getMDIManager().closeWindow(this); |
|
84 |
} |
|
85 |
|
|
86 |
public String getSelectedFormat() { |
|
87 |
return (String) data.getFormats().getSelectedItem(); |
|
88 |
} |
|
89 |
|
|
90 |
public WindowInfo getWindowInfo() { |
|
91 |
if (data.getWi() == null) { |
|
92 |
data.setWi(new WindowInfo(WindowInfo.MODALDIALOG | WindowInfo.PALETTE)); |
|
93 |
data.getWi().setTitle(PluginServices |
|
94 |
.getText(null, "Format_selection"));// Internacionalizar |
|
95 |
// esto |
|
96 |
data.getWi().setWidth(400); |
|
97 |
data.getWi().setHeight(55); |
|
98 |
} |
|
99 |
return data.getWi(); |
|
100 |
} |
|
101 |
|
|
102 |
public Object getWindowProfile() { |
|
103 |
return WindowInfo.DIALOG_PROFILE; |
|
104 |
} |
|
105 |
|
|
106 |
public boolean isOkButtonPressed() { |
|
107 |
return data.isOkButtonPressed(); |
|
108 |
} |
|
109 |
|
|
110 |
} |
Also available in: Unified diff