Revision 9956
trunk/extensions/extCAD/src/com/iver/cit/gvsig/gui/cad/CADToolAdapter.java | ||
---|---|---|
22 | 22 |
import java.util.prefs.Preferences; |
23 | 23 |
|
24 | 24 |
import org.cresques.cts.IProjection; |
25 |
import org.gvsig.gui.beans.controls.combolabel.ComboCoords; |
|
25 | 26 |
|
26 | 27 |
import com.iver.andami.PluginServices; |
27 | 28 |
import com.iver.andami.ui.mdiFrame.MainFrame; |
... | ... | |
54 | 55 |
import com.iver.cit.gvsig.project.documents.view.snapping.ISnapperRaster; |
55 | 56 |
import com.iver.cit.gvsig.project.documents.view.snapping.ISnapperVectorial; |
56 | 57 |
import com.iver.cit.gvsig.project.documents.view.snapping.SnappingVisitor; |
58 |
import com.iver.cit.gvsig.project.documents.view.toolListeners.StatusBarListener; |
|
57 | 59 |
import com.iver.utiles.console.JConsole; |
58 | 60 |
import com.vividsolutions.jts.geom.Envelope; |
59 | 61 |
|
... | ... | |
105 | 107 |
|
106 | 108 |
private static boolean flatnessInitialized=false; |
107 | 109 |
private static Preferences prefs = Preferences.userRoot().node( "cadtooladapter" ); |
108 |
|
|
110 |
private StatusBarListener sbl=null; |
|
111 |
/* (non-Javadoc) |
|
112 |
* @see com.iver.cit.gvsig.fmap.tools.Behavior.IBehavior#setMapControl(com.iver.cit.gvsig.fmap.MapControl) |
|
113 |
*/ |
|
114 |
public void setMapControl(MapControl mc) { |
|
115 |
super.setMapControl(mc); |
|
116 |
sbl=new StatusBarListener(getMapControl()); |
|
117 |
} |
|
109 | 118 |
/** |
110 | 119 |
* Pinta de alguna manera especial las geometrias seleccionadas para la |
111 | 120 |
* edici?n. En caso de que el snapping est? activado, pintar? el efecto del |
... | ... | |
310 | 319 |
private void showCoords(Point2D pPix) |
311 | 320 |
{ |
312 | 321 |
String[] axisText = new String[2]; |
313 |
NumberFormat nf = NumberFormat.getInstance(); |
|
322 |
axisText[0] = "X = "; |
|
323 |
axisText[1] = "Y = "; |
|
324 |
// NumberFormat nf = NumberFormat.getInstance(); |
|
314 | 325 |
MapControl mapControl = getMapControl(); |
315 | 326 |
ViewPort vp = mapControl.getMapContext().getViewPort(); |
316 | 327 |
IProjection iProj = vp.getProjection(); |
317 |
if (iProj.getAbrev().equals("EPSG:4326") || iProj.getAbrev().equals("EPSG:4230")) { |
|
318 |
axisText[0] = "Lon = "; |
|
319 |
axisText[1] = "Lat = "; |
|
320 |
nf.setMaximumFractionDigits(8); |
|
321 |
} else { |
|
322 |
axisText[0] = "X = "; |
|
323 |
axisText[1] = "Y = "; |
|
324 |
nf.setMaximumFractionDigits(2); |
|
325 |
} |
|
328 |
|
|
329 |
// if (iProj.getAbrev().equals("EPSG:4326") || iProj.getAbrev().equals("EPSG:4230")) { |
|
330 |
// axisText[0] = "Lon = "; |
|
331 |
// axisText[1] = "Lat = "; |
|
332 |
// nf.setMaximumFractionDigits(8); |
|
333 |
// } else { |
|
334 |
// axisText[0] = "X = "; |
|
335 |
// axisText[1] = "Y = "; |
|
336 |
// nf.setMaximumFractionDigits(2); |
|
337 |
// } |
|
326 | 338 |
Point2D p; |
327 | 339 |
if (mapAdjustedPoint == null) |
328 | 340 |
{ |
... | ... | |
332 | 344 |
{ |
333 | 345 |
p = mapAdjustedPoint; |
334 | 346 |
} |
347 |
sbl.setFractionDigits(p); |
|
348 |
axisText = sbl.setCoorDisplayText(axisText); |
|
335 | 349 |
MainFrame mF = PluginServices.getMainFrame(); |
336 | 350 |
|
337 | 351 |
if (mF != null) |
... | ... | |
341 | 355 |
mF.getStatusBar().setControlValue("scale",String.valueOf(mapControl.getMapContext().getScaleView())); |
342 | 356 |
mF.getStatusBar().setMessage("projection", iProj.getAbrev()); |
343 | 357 |
|
344 |
mF.getStatusBar().setMessage("x", |
|
345 |
axisText[0] + String.valueOf(nf.format(p.getX()/MapContext.CHANGEM[vp.getDistanceUnits()]))); |
|
346 |
mF.getStatusBar().setMessage("y", |
|
347 |
axisText[1] + String.valueOf(nf.format(p.getY()/MapContext.CHANGEM[vp.getDistanceUnits()]))); |
|
358 |
// mF.getStatusBar().setMessage("x", |
|
359 |
// axisText[0] + String.valueOf(nf.format(p.getX()/MapContext.CHANGEM[vp.getDistanceUnits()]))); |
|
360 |
// mF.getStatusBar().setMessage("y", |
|
361 |
// axisText[1] + String.valueOf(nf.format(p.getY()/MapContext.CHANGEM[vp.getDistanceUnits()]))); |
|
362 |
String[] coords=sbl.getCoords(p); |
|
363 |
ComboCoords combocoords=(ComboCoords)PluginServices.getMainFrame().getComponentByName("coords"); |
|
364 |
combocoords.setLabelX(axisText[0]); |
|
365 |
combocoords.setLabelY(axisText[1]); |
|
366 |
combocoords.setValueX(coords[0]); |
|
367 |
combocoords.setValueY(coords[1]); |
|
348 | 368 |
} |
349 | 369 |
} |
350 | 370 |
|
trunk/frameworks/_fwAndami/src/com/iver/andami/Launcher.java | ||
---|---|---|
112 | 112 |
import com.iver.andami.plugins.config.generate.ActionTool; |
113 | 113 |
import com.iver.andami.plugins.config.generate.ComboButton; |
114 | 114 |
import com.iver.andami.plugins.config.generate.ComboButtonElement; |
115 |
import com.iver.andami.plugins.config.generate.ComboCoords; |
|
115 | 116 |
import com.iver.andami.plugins.config.generate.ComboScale; |
116 | 117 |
import com.iver.andami.plugins.config.generate.Depends; |
117 | 118 |
import com.iver.andami.plugins.config.generate.Extension; |
... | ... | |
370 | 371 |
//File file=new File("theme/andami-theme.xml"); |
371 | 372 |
File file; |
372 | 373 |
if (name==null){ |
373 |
file=new File("theme/andami-theme.xml");
|
|
374 |
file=new File("theme/andami-theme.xml"); |
|
374 | 375 |
}else{ |
375 |
file=new File(name);
|
|
376 |
file=new File(name); |
|
376 | 377 |
} |
377 |
|
|
378 |
|
|
378 | 379 |
if (file.exists()) { |
379 | 380 |
theme.readTheme(file); |
380 | 381 |
} |
... | ... | |
832 | 833 |
Iterator e = orderedExtensions.keySet().iterator(); |
833 | 834 |
|
834 | 835 |
// sort the toolbars and tools from 'normal' extensions (actiontools, selectabletools) |
835 |
// and load the combo-scales and combo-buttons for the status bar |
|
836 |
// and load the combo-scales combo-labels and combo-buttons for the status bar
|
|
836 | 837 |
while (e.hasNext()) { |
837 | 838 |
Extension ext = (Extension) e.next(); |
838 | 839 |
|
... | ... | |
896 | 897 |
logger.error(Messages.getString("Launcher.error_getting_class_loader_for_status_bar_control"), e1); |
897 | 898 |
} |
898 | 899 |
} |
900 |
ComboCoords[] comboCoordsArray = ext.getComboCoords(); |
|
901 |
for (int k=0; k < comboCoordsArray.length; k++) { |
|
902 |
org.gvsig.gui.beans.controls.combolabel.ComboCoords combo = new org.gvsig.gui.beans.controls.combolabel.ComboCoords(); |
|
903 |
String name = comboCoordsArray[k].getName(); |
|
904 |
if (name!=null) |
|
905 |
combo.setName(name); |
|
906 |
try { |
|
907 |
frame.addStatusBarControl(loader.loadClass(ext.getClassName()),combo); |
|
908 |
} catch (ClassNotFoundException e1) { |
|
909 |
logger.error(Messages.getString("Launcher.error_getting_class_loader_for_status_bar_control"), e1); |
|
910 |
} |
|
911 |
} |
|
899 | 912 |
|
900 | 913 |
ComboButton[] comboButtonArray = ext.getComboButton(); |
901 | 914 |
for (int k=0; k < comboButtonArray.length; k++) { |
... | ... | |
2003 | 2016 |
|
2004 | 2017 |
if (osName.length() > 4 && osName.substring(0,5).toLowerCase().equals("linux")) |
2005 | 2018 |
return nonWinDefaultLookAndFeel; |
2006 |
|
|
2019 |
|
|
2007 | 2020 |
return UIManager.getSystemLookAndFeelClassName(); |
2008 | 2021 |
} |
2009 | 2022 |
|
trunk/frameworks/_fwAndami/src/com/iver/andami/plugins/config/generate/ComboCoordsDescriptor.java | ||
---|---|---|
1 |
/* |
|
2 |
* This class was automatically generated with |
|
3 |
* <a href="http://www.castor.org">Castor 0.9.5.3</a>, using an XML |
|
4 |
* Schema. |
|
5 |
* $Id$ |
|
6 |
*/ |
|
7 |
|
|
8 |
package com.iver.andami.plugins.config.generate; |
|
9 |
|
|
10 |
//---------------------------------/ |
|
11 |
//- Imported classes and packages -/ |
|
12 |
//---------------------------------/ |
|
13 |
|
|
14 |
import org.exolab.castor.mapping.AccessMode; |
|
15 |
import org.exolab.castor.xml.TypeValidator; |
|
16 |
import org.exolab.castor.xml.XMLFieldDescriptor; |
|
17 |
import org.exolab.castor.xml.validators.*; |
|
18 |
|
|
19 |
/** |
|
20 |
* Class ComboCoordsDescriptor. |
|
21 |
* |
|
22 |
* @version $Revision$ $Date$ |
|
23 |
*/ |
|
24 |
public class ComboCoordsDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { |
|
25 |
|
|
26 |
|
|
27 |
//--------------------------/ |
|
28 |
//- Class/Member Variables -/ |
|
29 |
//--------------------------/ |
|
30 |
|
|
31 |
/** |
|
32 |
* Field nsPrefix |
|
33 |
*/ |
|
34 |
private java.lang.String nsPrefix; |
|
35 |
|
|
36 |
/** |
|
37 |
* Field nsURI |
|
38 |
*/ |
|
39 |
private java.lang.String nsURI; |
|
40 |
|
|
41 |
/** |
|
42 |
* Field xmlName |
|
43 |
*/ |
|
44 |
private java.lang.String xmlName; |
|
45 |
|
|
46 |
/** |
|
47 |
* Field identity |
|
48 |
*/ |
|
49 |
private org.exolab.castor.xml.XMLFieldDescriptor identity; |
|
50 |
|
|
51 |
|
|
52 |
//----------------/ |
|
53 |
//- Constructors -/ |
|
54 |
//----------------/ |
|
55 |
|
|
56 |
public ComboCoordsDescriptor() { |
|
57 |
super(); |
|
58 |
xmlName = "combo-coords"; |
|
59 |
org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; |
|
60 |
org.exolab.castor.xml.XMLFieldHandler handler = null; |
|
61 |
org.exolab.castor.xml.FieldValidator fieldValidator = null; |
|
62 |
//-- initialize attribute descriptors |
|
63 |
|
|
64 |
//-- _name |
|
65 |
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", org.exolab.castor.xml.NodeType.Attribute); |
|
66 |
desc.setImmutable(true); |
|
67 |
handler = (new org.exolab.castor.xml.XMLFieldHandler() { |
|
68 |
public java.lang.Object getValue( java.lang.Object object ) |
|
69 |
throws IllegalStateException |
|
70 |
{ |
|
71 |
ComboCoords target = (ComboCoords) object; |
|
72 |
return target.getName(); |
|
73 |
} |
|
74 |
public void setValue( java.lang.Object object, java.lang.Object value) |
|
75 |
throws IllegalStateException, IllegalArgumentException |
|
76 |
{ |
|
77 |
try { |
|
78 |
ComboCoords target = (ComboCoords) object; |
|
79 |
target.setName( (java.lang.String) value); |
|
80 |
} |
|
81 |
catch (java.lang.Exception ex) { |
|
82 |
throw new IllegalStateException(ex.toString()); |
|
83 |
} |
|
84 |
} |
|
85 |
public java.lang.Object newInstance( java.lang.Object parent ) { |
|
86 |
return null; |
|
87 |
} |
|
88 |
} ); |
|
89 |
desc.setHandler(handler); |
|
90 |
desc.setRequired(true); |
|
91 |
addFieldDescriptor(desc); |
|
92 |
|
|
93 |
//-- validation code for: _name |
|
94 |
fieldValidator = new org.exolab.castor.xml.FieldValidator(); |
|
95 |
fieldValidator.setMinOccurs(1); |
|
96 |
{ //-- local scope |
|
97 |
StringValidator typeValidator = new StringValidator(); |
|
98 |
typeValidator.setWhiteSpace("preserve"); |
|
99 |
fieldValidator.setValidator(typeValidator); |
|
100 |
} |
|
101 |
desc.setValidator(fieldValidator); |
|
102 |
//-- initialize element descriptors |
|
103 |
|
|
104 |
} //-- com.iver.andami.plugins.config.generate.ComboCoordsDescriptor() |
|
105 |
|
|
106 |
|
|
107 |
//-----------/ |
|
108 |
//- Methods -/ |
|
109 |
//-----------/ |
|
110 |
|
|
111 |
/** |
|
112 |
* Method getAccessMode |
|
113 |
*/ |
|
114 |
public org.exolab.castor.mapping.AccessMode getAccessMode() |
|
115 |
{ |
|
116 |
return null; |
|
117 |
} //-- org.exolab.castor.mapping.AccessMode getAccessMode() |
|
118 |
|
|
119 |
/** |
|
120 |
* Method getExtends |
|
121 |
*/ |
|
122 |
public org.exolab.castor.mapping.ClassDescriptor getExtends() |
|
123 |
{ |
|
124 |
return null; |
|
125 |
} //-- org.exolab.castor.mapping.ClassDescriptor getExtends() |
|
126 |
|
|
127 |
/** |
|
128 |
* Method getIdentity |
|
129 |
*/ |
|
130 |
public org.exolab.castor.mapping.FieldDescriptor getIdentity() |
|
131 |
{ |
|
132 |
return identity; |
|
133 |
} //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() |
|
134 |
|
|
135 |
/** |
|
136 |
* Method getJavaClass |
|
137 |
*/ |
|
138 |
public java.lang.Class getJavaClass() |
|
139 |
{ |
|
140 |
return com.iver.andami.plugins.config.generate.ComboCoords.class; |
|
141 |
} //-- java.lang.Class getJavaClass() |
|
142 |
|
|
143 |
/** |
|
144 |
* Method getNameSpacePrefix |
|
145 |
*/ |
|
146 |
public java.lang.String getNameSpacePrefix() |
|
147 |
{ |
|
148 |
return nsPrefix; |
|
149 |
} //-- java.lang.String getNameSpacePrefix() |
|
150 |
|
|
151 |
/** |
|
152 |
* Method getNameSpaceURI |
|
153 |
*/ |
|
154 |
public java.lang.String getNameSpaceURI() |
|
155 |
{ |
|
156 |
return nsURI; |
|
157 |
} //-- java.lang.String getNameSpaceURI() |
|
158 |
|
|
159 |
/** |
|
160 |
* Method getValidator |
|
161 |
*/ |
|
162 |
public org.exolab.castor.xml.TypeValidator getValidator() |
|
163 |
{ |
|
164 |
return this; |
|
165 |
} //-- org.exolab.castor.xml.TypeValidator getValidator() |
|
166 |
|
|
167 |
/** |
|
168 |
* Method getXMLName |
|
169 |
*/ |
|
170 |
public java.lang.String getXMLName() |
|
171 |
{ |
|
172 |
return xmlName; |
|
173 |
} //-- java.lang.String getXMLName() |
|
174 |
|
|
175 |
} |
|
0 | 176 |
trunk/frameworks/_fwAndami/src/com/iver/andami/plugins/config/generate/ComboCoords.java | ||
---|---|---|
1 |
/* |
|
2 |
* This class was automatically generated with |
|
3 |
* <a href="http://www.castor.org">Castor 0.9.5.3</a>, using an XML |
|
4 |
* Schema. |
|
5 |
* $Id$ |
|
6 |
*/ |
|
7 |
|
|
8 |
package com.iver.andami.plugins.config.generate; |
|
9 |
|
|
10 |
//---------------------------------/ |
|
11 |
//- Imported classes and packages -/ |
|
12 |
//---------------------------------/ |
|
13 |
|
|
14 |
import java.io.IOException; |
|
15 |
import java.io.Reader; |
|
16 |
import java.io.Serializable; |
|
17 |
import java.io.Writer; |
|
18 |
import org.exolab.castor.xml.MarshalException; |
|
19 |
import org.exolab.castor.xml.Marshaller; |
|
20 |
import org.exolab.castor.xml.Unmarshaller; |
|
21 |
import org.exolab.castor.xml.ValidationException; |
|
22 |
import org.xml.sax.ContentHandler; |
|
23 |
|
|
24 |
/** |
|
25 |
* Class ComboCoords. |
|
26 |
* |
|
27 |
* @version $Revision$ $Date$ |
|
28 |
*/ |
|
29 |
public class ComboCoords implements java.io.Serializable { |
|
30 |
|
|
31 |
|
|
32 |
//--------------------------/ |
|
33 |
//- Class/Member Variables -/ |
|
34 |
//--------------------------/ |
|
35 |
|
|
36 |
/** |
|
37 |
* Field _name |
|
38 |
*/ |
|
39 |
private java.lang.String _name; |
|
40 |
|
|
41 |
|
|
42 |
//----------------/ |
|
43 |
//- Constructors -/ |
|
44 |
//----------------/ |
|
45 |
|
|
46 |
public ComboCoords() { |
|
47 |
super(); |
|
48 |
} //-- com.iver.andami.plugins.config.generate.ComboCoords() |
|
49 |
|
|
50 |
|
|
51 |
//-----------/ |
|
52 |
//- Methods -/ |
|
53 |
//-----------/ |
|
54 |
|
|
55 |
/** |
|
56 |
* Returns the value of field 'name'. |
|
57 |
* |
|
58 |
* @return the value of field 'name'. |
|
59 |
*/ |
|
60 |
public java.lang.String getName() |
|
61 |
{ |
|
62 |
return this._name; |
|
63 |
} //-- java.lang.String getName() |
|
64 |
|
|
65 |
/** |
|
66 |
* Method isValid |
|
67 |
*/ |
|
68 |
public boolean isValid() |
|
69 |
{ |
|
70 |
try { |
|
71 |
validate(); |
|
72 |
} |
|
73 |
catch (org.exolab.castor.xml.ValidationException vex) { |
|
74 |
return false; |
|
75 |
} |
|
76 |
return true; |
|
77 |
} //-- boolean isValid() |
|
78 |
|
|
79 |
/** |
|
80 |
* Method marshal |
|
81 |
* |
|
82 |
* @param out |
|
83 |
*/ |
|
84 |
public void marshal(java.io.Writer out) |
|
85 |
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException |
|
86 |
{ |
|
87 |
|
|
88 |
Marshaller.marshal(this, out); |
|
89 |
} //-- void marshal(java.io.Writer) |
|
90 |
|
|
91 |
/** |
|
92 |
* Method marshal |
|
93 |
* |
|
94 |
* @param handler |
|
95 |
*/ |
|
96 |
public void marshal(org.xml.sax.ContentHandler handler) |
|
97 |
throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException |
|
98 |
{ |
|
99 |
|
|
100 |
Marshaller.marshal(this, handler); |
|
101 |
} //-- void marshal(org.xml.sax.ContentHandler) |
|
102 |
|
|
103 |
/** |
|
104 |
* Sets the value of field 'name'. |
|
105 |
* |
|
106 |
* @param name the value of field 'name'. |
|
107 |
*/ |
|
108 |
public void setName(java.lang.String name) |
|
109 |
{ |
|
110 |
this._name = name; |
|
111 |
} //-- void setName(java.lang.String) |
|
112 |
|
|
113 |
/** |
|
114 |
* Method unmarshal |
|
115 |
* |
|
116 |
* @param reader |
|
117 |
*/ |
|
118 |
public static java.lang.Object unmarshal(java.io.Reader reader) |
|
119 |
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException |
|
120 |
{ |
|
121 |
return (com.iver.andami.plugins.config.generate.ComboCoords) Unmarshaller.unmarshal(com.iver.andami.plugins.config.generate.ComboCoords.class, reader); |
|
122 |
} //-- java.lang.Object unmarshal(java.io.Reader) |
|
123 |
|
|
124 |
/** |
|
125 |
* Method validate |
|
126 |
*/ |
|
127 |
public void validate() |
|
128 |
throws org.exolab.castor.xml.ValidationException |
|
129 |
{ |
|
130 |
org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); |
|
131 |
validator.validate(this); |
|
132 |
} //-- void validate() |
|
133 |
|
|
134 |
} |
|
0 | 135 |
trunk/frameworks/_fwAndami/src/com/iver/andami/plugins/config/generate/ToolBarDescriptor.java | ||
---|---|---|
322 | 322 |
{ //-- local scope |
323 | 323 |
} |
324 | 324 |
desc.setValidator(fieldValidator); |
325 |
//-- _comboCoordsList |
|
326 |
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(com.iver.andami.plugins.config.generate.ComboCoords.class, "_comboCoordsList", "combo-coords", org.exolab.castor.xml.NodeType.Element); |
|
327 |
handler = (new org.exolab.castor.xml.XMLFieldHandler() { |
|
328 |
public java.lang.Object getValue( java.lang.Object object ) |
|
329 |
throws IllegalStateException |
|
330 |
{ |
|
331 |
ToolBar target = (ToolBar) object; |
|
332 |
return target.getComboCoords(); |
|
333 |
} |
|
334 |
public void setValue( java.lang.Object object, java.lang.Object value) |
|
335 |
throws IllegalStateException, IllegalArgumentException |
|
336 |
{ |
|
337 |
try { |
|
338 |
ToolBar target = (ToolBar) object; |
|
339 |
target.addComboCoords( (com.iver.andami.plugins.config.generate.ComboCoords) value); |
|
340 |
} |
|
341 |
catch (java.lang.Exception ex) { |
|
342 |
throw new IllegalStateException(ex.toString()); |
|
343 |
} |
|
344 |
} |
|
345 |
public java.lang.Object newInstance( java.lang.Object parent ) { |
|
346 |
return new com.iver.andami.plugins.config.generate.ComboCoords(); |
|
347 |
} |
|
348 |
} ); |
|
349 |
desc.setHandler(handler); |
|
350 |
desc.setMultivalued(true); |
|
351 |
addFieldDescriptor(desc); |
|
352 |
|
|
353 |
//-- validation code for: _comboCoordsList |
|
354 |
fieldValidator = new org.exolab.castor.xml.FieldValidator(); |
|
355 |
fieldValidator.setMinOccurs(0); |
|
356 |
{ //-- local scope |
|
357 |
} |
|
358 |
desc.setValidator(fieldValidator); |
|
325 | 359 |
} //-- com.iver.andami.plugins.config.generate.ToolBarDescriptor() |
326 | 360 |
|
327 | 361 |
|
trunk/frameworks/_fwAndami/src/com/iver/andami/plugins/config/generate/ToolBar.java | ||
---|---|---|
80 | 80 |
*/ |
81 | 81 |
private java.util.Vector _comboScaleList; |
82 | 82 |
|
83 |
/** |
|
84 |
* Field _comboCoordsList |
|
85 |
*/ |
|
86 |
private java.util.Vector _comboCoordsList; |
|
83 | 87 |
|
88 |
|
|
84 | 89 |
//----------------/ |
85 | 90 |
//- Constructors -/ |
86 | 91 |
//----------------/ |
... | ... | |
91 | 96 |
_selectableToolList = new Vector(); |
92 | 97 |
_comboButtonList = new Vector(); |
93 | 98 |
_comboScaleList = new Vector(); |
99 |
_comboCoordsList = new Vector(); |
|
94 | 100 |
} //-- com.iver.andami.plugins.config.generate.ToolBar() |
95 | 101 |
|
96 | 102 |
|
... | ... | |
145 | 151 |
} //-- void addComboButton(int, com.iver.andami.plugins.config.generate.ComboButton) |
146 | 152 |
|
147 | 153 |
/** |
154 |
* Method addComboCoords |
|
155 |
* |
|
156 |
* @param vComboCoords |
|
157 |
*/ |
|
158 |
public void addComboCoords(com.iver.andami.plugins.config.generate.ComboCoords vComboCoords) |
|
159 |
throws java.lang.IndexOutOfBoundsException |
|
160 |
{ |
|
161 |
_comboCoordsList.addElement(vComboCoords); |
|
162 |
} //-- void addComboCoords(com.iver.andami.plugins.config.generate.ComboCoords) |
|
163 |
|
|
164 |
/** |
|
165 |
* Method addComboCoords |
|
166 |
* |
|
167 |
* @param index |
|
168 |
* @param vComboCoords |
|
169 |
*/ |
|
170 |
public void addComboCoords(int index, com.iver.andami.plugins.config.generate.ComboCoords vComboCoords) |
|
171 |
throws java.lang.IndexOutOfBoundsException |
|
172 |
{ |
|
173 |
_comboCoordsList.insertElementAt(vComboCoords, index); |
|
174 |
} //-- void addComboCoords(int, com.iver.andami.plugins.config.generate.ComboCoords) |
|
175 |
|
|
176 |
/** |
|
148 | 177 |
* Method addComboScale |
149 | 178 |
* |
150 | 179 |
* @param vComboScale |
... | ... | |
223 | 252 |
} //-- java.util.Enumeration enumerateComboButton() |
224 | 253 |
|
225 | 254 |
/** |
255 |
* Method enumerateComboCoords |
|
256 |
*/ |
|
257 |
public java.util.Enumeration enumerateComboCoords() |
|
258 |
{ |
|
259 |
return _comboCoordsList.elements(); |
|
260 |
} //-- java.util.Enumeration enumerateComboCoords() |
|
261 |
|
|
262 |
/** |
|
226 | 263 |
* Method enumerateComboScale |
227 | 264 |
*/ |
228 | 265 |
public java.util.Enumeration enumerateComboScale() |
... | ... | |
313 | 350 |
} //-- int getComboButtonCount() |
314 | 351 |
|
315 | 352 |
/** |
353 |
* Method getComboCoords |
|
354 |
* |
|
355 |
* @param index |
|
356 |
*/ |
|
357 |
public com.iver.andami.plugins.config.generate.ComboCoords getComboCoords(int index) |
|
358 |
throws java.lang.IndexOutOfBoundsException |
|
359 |
{ |
|
360 |
//-- check bounds for index |
|
361 |
if ((index < 0) || (index > _comboCoordsList.size())) { |
|
362 |
throw new IndexOutOfBoundsException(); |
|
363 |
} |
|
364 |
|
|
365 |
return (com.iver.andami.plugins.config.generate.ComboCoords) _comboCoordsList.elementAt(index); |
|
366 |
} //-- com.iver.andami.plugins.config.generate.ComboCoords getComboCoords(int) |
|
367 |
|
|
368 |
/** |
|
369 |
* Method getComboCoords |
|
370 |
*/ |
|
371 |
public com.iver.andami.plugins.config.generate.ComboCoords[] getComboCoords() |
|
372 |
{ |
|
373 |
int size = _comboCoordsList.size(); |
|
374 |
com.iver.andami.plugins.config.generate.ComboCoords[] mArray = new com.iver.andami.plugins.config.generate.ComboCoords[size]; |
|
375 |
for (int index = 0; index < size; index++) { |
|
376 |
mArray[index] = (com.iver.andami.plugins.config.generate.ComboCoords) _comboCoordsList.elementAt(index); |
|
377 |
} |
|
378 |
return mArray; |
|
379 |
} //-- com.iver.andami.plugins.config.generate.ComboCoords[] getComboCoords() |
|
380 |
|
|
381 |
/** |
|
382 |
* Method getComboCoordsCount |
|
383 |
*/ |
|
384 |
public int getComboCoordsCount() |
|
385 |
{ |
|
386 |
return _comboCoordsList.size(); |
|
387 |
} //-- int getComboCoordsCount() |
|
388 |
|
|
389 |
/** |
|
316 | 390 |
* Method getComboScale |
317 | 391 |
* |
318 | 392 |
* @param index |
... | ... | |
499 | 573 |
} //-- void removeAllComboButton() |
500 | 574 |
|
501 | 575 |
/** |
576 |
* Method removeAllComboCoords |
|
577 |
*/ |
|
578 |
public void removeAllComboCoords() |
|
579 |
{ |
|
580 |
_comboCoordsList.removeAllElements(); |
|
581 |
} //-- void removeAllComboCoords() |
|
582 |
|
|
583 |
/** |
|
502 | 584 |
* Method removeAllComboScale |
503 | 585 |
*/ |
504 | 586 |
public void removeAllComboScale() |
... | ... | |
527 | 609 |
} //-- com.iver.andami.plugins.config.generate.ComboButton removeComboButton(int) |
528 | 610 |
|
529 | 611 |
/** |
612 |
* Method removeComboCoords |
|
613 |
* |
|
614 |
* @param index |
|
615 |
*/ |
|
616 |
public com.iver.andami.plugins.config.generate.ComboCoords removeComboCoords(int index) |
|
617 |
{ |
|
618 |
java.lang.Object obj = _comboCoordsList.elementAt(index); |
|
619 |
_comboCoordsList.removeElementAt(index); |
|
620 |
return (com.iver.andami.plugins.config.generate.ComboCoords) obj; |
|
621 |
} //-- com.iver.andami.plugins.config.generate.ComboCoords removeComboCoords(int) |
|
622 |
|
|
623 |
/** |
|
530 | 624 |
* Method removeComboScale |
531 | 625 |
* |
532 | 626 |
* @param index |
... | ... | |
611 | 705 |
} //-- void setComboButton(com.iver.andami.plugins.config.generate.ComboButton) |
612 | 706 |
|
613 | 707 |
/** |
708 |
* Method setComboCoords |
|
709 |
* |
|
710 |
* @param index |
|
711 |
* @param vComboCoords |
|
712 |
*/ |
|
713 |
public void setComboCoords(int index, com.iver.andami.plugins.config.generate.ComboCoords vComboCoords) |
|
714 |
throws java.lang.IndexOutOfBoundsException |
|
715 |
{ |
|
716 |
//-- check bounds for index |
|
717 |
if ((index < 0) || (index > _comboCoordsList.size())) { |
|
718 |
throw new IndexOutOfBoundsException(); |
|
719 |
} |
|
720 |
_comboCoordsList.setElementAt(vComboCoords, index); |
|
721 |
} //-- void setComboCoords(int, com.iver.andami.plugins.config.generate.ComboCoords) |
|
722 |
|
|
723 |
/** |
|
724 |
* Method setComboCoords |
|
725 |
* |
|
726 |
* @param comboCoordsArray |
|
727 |
*/ |
|
728 |
public void setComboCoords(com.iver.andami.plugins.config.generate.ComboCoords[] comboCoordsArray) |
|
729 |
{ |
|
730 |
//-- copy array |
|
731 |
_comboCoordsList.removeAllElements(); |
|
732 |
for (int i = 0; i < comboCoordsArray.length; i++) { |
|
733 |
_comboCoordsList.addElement(comboCoordsArray[i]); |
|
734 |
} |
|
735 |
} //-- void setComboCoords(com.iver.andami.plugins.config.generate.ComboCoords) |
|
736 |
|
|
737 |
/** |
|
614 | 738 |
* Method setComboScale |
615 | 739 |
* |
616 | 740 |
* @param index |
trunk/frameworks/_fwAndami/src/com/iver/andami/plugins/config/generate/SkinExtensionTypeDescriptor.java | ||
---|---|---|
238 | 238 |
{ //-- local scope |
239 | 239 |
} |
240 | 240 |
desc.setValidator(fieldValidator); |
241 |
//-- _comboCoordsList |
|
242 |
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(com.iver.andami.plugins.config.generate.ComboCoords.class, "_comboCoordsList", "combo-coords", org.exolab.castor.xml.NodeType.Element); |
|
243 |
handler = (new org.exolab.castor.xml.XMLFieldHandler() { |
|
244 |
public java.lang.Object getValue( java.lang.Object object ) |
|
245 |
throws IllegalStateException |
|
246 |
{ |
|
247 |
SkinExtensionType target = (SkinExtensionType) object; |
|
248 |
return target.getComboCoords(); |
|
249 |
} |
|
250 |
public void setValue( java.lang.Object object, java.lang.Object value) |
|
251 |
throws IllegalStateException, IllegalArgumentException |
|
252 |
{ |
|
253 |
try { |
|
254 |
SkinExtensionType target = (SkinExtensionType) object; |
|
255 |
target.addComboCoords( (com.iver.andami.plugins.config.generate.ComboCoords) value); |
|
256 |
} |
|
257 |
catch (java.lang.Exception ex) { |
|
258 |
throw new IllegalStateException(ex.toString()); |
|
259 |
} |
|
260 |
} |
|
261 |
public java.lang.Object newInstance( java.lang.Object parent ) { |
|
262 |
return new com.iver.andami.plugins.config.generate.ComboCoords(); |
|
263 |
} |
|
264 |
} ); |
|
265 |
desc.setHandler(handler); |
|
266 |
desc.setMultivalued(true); |
|
267 |
addFieldDescriptor(desc); |
|
268 |
|
|
269 |
//-- validation code for: _comboCoordsList |
|
270 |
fieldValidator = new org.exolab.castor.xml.FieldValidator(); |
|
271 |
fieldValidator.setMinOccurs(0); |
|
272 |
{ //-- local scope |
|
273 |
} |
|
274 |
desc.setValidator(fieldValidator); |
|
241 | 275 |
} //-- com.iver.andami.plugins.config.generate.SkinExtensionTypeDescriptor() |
242 | 276 |
|
243 | 277 |
|
trunk/frameworks/_fwAndami/src/com/iver/andami/plugins/config/generate/SkinExtensionType.java | ||
---|---|---|
60 | 60 |
*/ |
61 | 61 |
private java.util.Vector _comboScaleList; |
62 | 62 |
|
63 |
/** |
|
64 |
* Field _comboCoordsList |
|
65 |
*/ |
|
66 |
private java.util.Vector _comboCoordsList; |
|
63 | 67 |
|
68 |
|
|
64 | 69 |
//----------------/ |
65 | 70 |
//- Constructors -/ |
66 | 71 |
//----------------/ |
... | ... | |
71 | 76 |
_toolBarList = new Vector(); |
72 | 77 |
_comboButtonList = new Vector(); |
73 | 78 |
_comboScaleList = new Vector(); |
79 |
_comboCoordsList = new Vector(); |
|
74 | 80 |
} //-- com.iver.andami.plugins.config.generate.SkinExtensionType() |
75 | 81 |
|
76 | 82 |
|
... | ... | |
102 | 108 |
} //-- void addComboButton(int, com.iver.andami.plugins.config.generate.ComboButton) |
103 | 109 |
|
104 | 110 |
/** |
111 |
* Method addComboCoords |
|
112 |
* |
|
113 |
* @param vComboCoords |
|
114 |
*/ |
|
115 |
public void addComboCoords(com.iver.andami.plugins.config.generate.ComboCoords vComboCoords) |
|
116 |
throws java.lang.IndexOutOfBoundsException |
|
117 |
{ |
|
118 |
_comboCoordsList.addElement(vComboCoords); |
|
119 |
} //-- void addComboCoords(com.iver.andami.plugins.config.generate.ComboCoords) |
|
120 |
|
|
121 |
/** |
|
122 |
* Method addComboCoords |
|
123 |
* |
|
124 |
* @param index |
|
125 |
* @param vComboCoords |
|
126 |
*/ |
|
127 |
public void addComboCoords(int index, com.iver.andami.plugins.config.generate.ComboCoords vComboCoords) |
|
128 |
throws java.lang.IndexOutOfBoundsException |
|
129 |
{ |
|
130 |
_comboCoordsList.insertElementAt(vComboCoords, index); |
|
131 |
} //-- void addComboCoords(int, com.iver.andami.plugins.config.generate.ComboCoords) |
|
132 |
|
|
133 |
/** |
|
105 | 134 |
* Method addComboScale |
106 | 135 |
* |
107 | 136 |
* @param vComboScale |
... | ... | |
179 | 208 |
} //-- java.util.Enumeration enumerateComboButton() |
180 | 209 |
|
181 | 210 |
/** |
211 |
* Method enumerateComboCoords |
|
212 |
*/ |
|
213 |
public java.util.Enumeration enumerateComboCoords() |
|
214 |
{ |
|
215 |
return _comboCoordsList.elements(); |
|
216 |
} //-- java.util.Enumeration enumerateComboCoords() |
|
217 |
|
|
218 |
/** |
|
182 | 219 |
* Method enumerateComboScale |
183 | 220 |
*/ |
184 | 221 |
public java.util.Enumeration enumerateComboScale() |
... | ... | |
250 | 287 |
} //-- int getComboButtonCount() |
251 | 288 |
|
252 | 289 |
/** |
290 |
* Method getComboCoords |
|
291 |
* |
|
292 |
* @param index |
|
293 |
*/ |
|
294 |
public com.iver.andami.plugins.config.generate.ComboCoords getComboCoords(int index) |
|
295 |
throws java.lang.IndexOutOfBoundsException |
|
296 |
{ |
|
297 |
//-- check bounds for index |
|
298 |
if ((index < 0) || (index > _comboCoordsList.size())) { |
|
299 |
throw new IndexOutOfBoundsException(); |
|
300 |
} |
|
301 |
|
|
302 |
return (com.iver.andami.plugins.config.generate.ComboCoords) _comboCoordsList.elementAt(index); |
|
303 |
} //-- com.iver.andami.plugins.config.generate.ComboCoords getComboCoords(int) |
|
304 |
|
|
305 |
/** |
|
306 |
* Method getComboCoords |
|
307 |
*/ |
|
308 |
public com.iver.andami.plugins.config.generate.ComboCoords[] getComboCoords() |
|
309 |
{ |
|
310 |
int size = _comboCoordsList.size(); |
|
311 |
com.iver.andami.plugins.config.generate.ComboCoords[] mArray = new com.iver.andami.plugins.config.generate.ComboCoords[size]; |
|
312 |
for (int index = 0; index < size; index++) { |
|
313 |
mArray[index] = (com.iver.andami.plugins.config.generate.ComboCoords) _comboCoordsList.elementAt(index); |
|
314 |
} |
|
315 |
return mArray; |
|
316 |
} //-- com.iver.andami.plugins.config.generate.ComboCoords[] getComboCoords() |
|
317 |
|
|
318 |
/** |
|
319 |
* Method getComboCoordsCount |
|
320 |
*/ |
|
321 |
public int getComboCoordsCount() |
|
322 |
{ |
|
323 |
return _comboCoordsList.size(); |
|
324 |
} //-- int getComboCoordsCount() |
|
325 |
|
|
326 |
/** |
|
253 | 327 |
* Method getComboScale |
254 | 328 |
* |
255 | 329 |
* @param index |
... | ... | |
407 | 481 |
} //-- void removeAllComboButton() |
408 | 482 |
|
409 | 483 |
/** |
484 |
* Method removeAllComboCoords |
|
485 |
*/ |
|
486 |
public void removeAllComboCoords() |
|
487 |
{ |
|
488 |
_comboCoordsList.removeAllElements(); |
|
489 |
} //-- void removeAllComboCoords() |
|
490 |
|
|
491 |
/** |
|
410 | 492 |
* Method removeAllComboScale |
411 | 493 |
*/ |
412 | 494 |
public void removeAllComboScale() |
... | ... | |
443 | 525 |
} //-- com.iver.andami.plugins.config.generate.ComboButton removeComboButton(int) |
444 | 526 |
|
445 | 527 |
/** |
528 |
* Method removeComboCoords |
|
529 |
* |
|
530 |
* @param index |
|
531 |
*/ |
|
532 |
public com.iver.andami.plugins.config.generate.ComboCoords removeComboCoords(int index) |
|
533 |
{ |
|
534 |
java.lang.Object obj = _comboCoordsList.elementAt(index); |
|
535 |
_comboCoordsList.removeElementAt(index); |
|
536 |
return (com.iver.andami.plugins.config.generate.ComboCoords) obj; |
|
537 |
} //-- com.iver.andami.plugins.config.generate.ComboCoords removeComboCoords(int) |
|
538 |
|
|
539 |
/** |
|
446 | 540 |
* Method removeComboScale |
447 | 541 |
* |
448 | 542 |
* @param index |
... | ... | |
519 | 613 |
} //-- void setComboButton(com.iver.andami.plugins.config.generate.ComboButton) |
520 | 614 |
|
521 | 615 |
/** |
616 |
* Method setComboCoords |
|
617 |
* |
|
618 |
* @param index |
|
619 |
* @param vComboCoords |
|
620 |
*/ |
|
621 |
public void setComboCoords(int index, com.iver.andami.plugins.config.generate.ComboCoords vComboCoords) |
|
622 |
throws java.lang.IndexOutOfBoundsException |
|
623 |
{ |
|
624 |
//-- check bounds for index |
|
625 |
if ((index < 0) || (index > _comboCoordsList.size())) { |
|
626 |
throw new IndexOutOfBoundsException(); |
|
627 |
} |
|
628 |
_comboCoordsList.setElementAt(vComboCoords, index); |
|
629 |
} //-- void setComboCoords(int, com.iver.andami.plugins.config.generate.ComboCoords) |
|
630 |
|
|
631 |
/** |
|
632 |
* Method setComboCoords |
|
633 |
* |
|
634 |
* @param comboCoordsArray |
|
635 |
*/ |
|
636 |
public void setComboCoords(com.iver.andami.plugins.config.generate.ComboCoords[] comboCoordsArray) |
|
637 |
{ |
|
638 |
//-- copy array |
|
639 |
_comboCoordsList.removeAllElements(); |
|
640 |
for (int i = 0; i < comboCoordsArray.length; i++) { |
|
641 |
_comboCoordsList.addElement(comboCoordsArray[i]); |
|
642 |
} |
|
643 |
} //-- void setComboCoords(com.iver.andami.plugins.config.generate.ComboCoords) |
|
644 |
|
|
645 |
/** |
|
522 | 646 |
* Method setComboScale |
523 | 647 |
* |
524 | 648 |
* @param index |
trunk/frameworks/_fwAndami/src/com/iver/andami/config/generate/PluginDescriptor.java | ||
---|---|---|
11 | 11 |
//- Imported classes and packages -/ |
12 | 12 |
//---------------------------------/ |
13 | 13 |
|
14 |
import org.exolab.castor.xml.validators.BooleanValidator; |
|
15 |
import org.exolab.castor.xml.validators.NameValidator; |
|
14 |
import org.exolab.castor.mapping.AccessMode; |
|
15 |
import org.exolab.castor.xml.TypeValidator; |
|
16 |
import org.exolab.castor.xml.XMLFieldDescriptor; |
|
17 |
import org.exolab.castor.xml.validators.*; |
|
16 | 18 |
|
17 | 19 |
/** |
18 | 20 |
* Class PluginDescriptor. |
trunk/frameworks/_fwAndami/src/com/iver/andami/config/generate/AndamiConfigDescriptor.java | ||
---|---|---|
11 | 11 |
//- Imported classes and packages -/ |
12 | 12 |
//---------------------------------/ |
13 | 13 |
|
14 |
import org.exolab.castor.xml.validators.StringValidator; |
|
14 |
import org.exolab.castor.mapping.AccessMode; |
|
15 |
import org.exolab.castor.xml.TypeValidator; |
|
16 |
import org.exolab.castor.xml.XMLFieldDescriptor; |
|
17 |
import org.exolab.castor.xml.validators.*; |
|
15 | 18 |
|
16 | 19 |
/** |
17 | 20 |
* Class AndamiConfigDescriptor. |
trunk/frameworks/_fwAndami/src/com/iver/andami/config/generate/Plugin.java | ||
---|---|---|
11 | 11 |
//- Imported classes and packages -/ |
12 | 12 |
//---------------------------------/ |
13 | 13 |
|
14 |
import java.io.IOException; |
|
15 |
import java.io.Reader; |
|
16 |
import java.io.Serializable; |
|
17 |
import java.io.Writer; |
|
18 |
import org.exolab.castor.xml.MarshalException; |
|
14 | 19 |
import org.exolab.castor.xml.Marshaller; |
15 | 20 |
import org.exolab.castor.xml.Unmarshaller; |
21 |
import org.exolab.castor.xml.ValidationException; |
|
22 |
import org.xml.sax.ContentHandler; |
|
16 | 23 |
|
17 | 24 |
/** |
18 | 25 |
* Class Plugin. |
trunk/frameworks/_fwAndami/src/com/iver/andami/config/generate/AndamiConfig.java | ||
---|---|---|
11 | 11 |
//- Imported classes and packages -/ |
12 | 12 |
//---------------------------------/ |
13 | 13 |
|
14 |
import java.io.IOException; |
|
15 |
import java.io.Reader; |
|
16 |
import java.io.Serializable; |
|
17 |
import java.io.Writer; |
|
18 |
import java.util.Enumeration; |
|
14 | 19 |
import java.util.Vector; |
15 |
|
|
20 |
import org.exolab.castor.xml.MarshalException; |
|
16 | 21 |
import org.exolab.castor.xml.Marshaller; |
17 | 22 |
import org.exolab.castor.xml.Unmarshaller; |
23 |
import org.exolab.castor.xml.ValidationException; |
|
24 |
import org.xml.sax.ContentHandler; |
|
18 | 25 |
|
19 | 26 |
/** |
20 | 27 |
* Class AndamiConfig. |
trunk/frameworks/_fwAndami/src/com/iver/andami/config/generate/AndamiDescriptor.java | ||
---|---|---|
11 | 11 |
//- Imported classes and packages -/ |
12 | 12 |
//---------------------------------/ |
13 | 13 |
|
14 |
import org.exolab.castor.xml.validators.BooleanValidator; |
|
14 |
import org.exolab.castor.mapping.AccessMode; |
|
15 |
import org.exolab.castor.xml.TypeValidator; |
|
16 |
import org.exolab.castor.xml.XMLFieldDescriptor; |
|
17 |
import org.exolab.castor.xml.validators.*; |
|
15 | 18 |
|
16 | 19 |
/** |
17 | 20 |
* Class AndamiDescriptor. |
trunk/frameworks/_fwAndami/src/com/iver/andami/config/generate/Andami.java | ||
---|---|---|
11 | 11 |
//- Imported classes and packages -/ |
12 | 12 |
//---------------------------------/ |
13 | 13 |
|
14 |
import java.io.IOException; |
|
15 |
import java.io.Reader; |
|
16 |
import java.io.Serializable; |
|
17 |
import java.io.Writer; |
|
18 |
import org.exolab.castor.xml.MarshalException; |
|
14 | 19 |
import org.exolab.castor.xml.Marshaller; |
15 | 20 |
import org.exolab.castor.xml.Unmarshaller; |
21 |
import org.exolab.castor.xml.ValidationException; |
|
22 |
import org.xml.sax.ContentHandler; |
|
16 | 23 |
|
17 | 24 |
/** |
18 | 25 |
* Class Andami. |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/gui/DistanceUnitsConfig.java | ||
---|---|---|
1 |
package com.iver.cit.gvsig.project.documents.view.gui; |
|
2 |
|
|
3 |
import javax.swing.JComboBox; |
|
4 |
import javax.swing.JComponent; |
|
5 |
import javax.swing.JLabel; |
|
6 |
import javax.swing.JPanel; |
|
7 |
|
|
8 |
import org.gvsig.gui.beans.AcceptCancelPanel; |
|
9 |
|
|
10 |
import com.iver.andami.PluginServices; |
|
11 |
import com.iver.andami.ui.mdiManager.IWindow; |
|
12 |
import com.iver.andami.ui.mdiManager.WindowInfo; |
|
13 |
import com.iver.cit.gvsig.project.documents.layout.Attributes; |
|
14 |
import com.iver.cit.gvsig.project.documents.view.IProjectView; |
|
15 |
|
|
16 |
|
|
17 |
/** |
|
18 |
* DOCUMENT ME! |
|
19 |
* |
|
20 |
* @author Vicente Caballero Navarro |
|
21 |
*/ |
|
22 |
public class DistanceUnitsConfig extends JPanel implements IWindow { |
|
23 |
private static String[] unitsNames = null; |
|
24 |
private JLabel lblDistanceUnits = null; |
|
25 |
private JComboBox cmbDistanceUnits = null; |
|
26 |
private IProjectView view = null; |
|
27 |
private AcceptCancelPanel acceptCancel = null; |
|
28 |
private boolean isAcceppted = false; |
|
29 |
|
|
30 |
/** |
|
31 |
* This is the default constructor |
|
32 |
* |
|
33 |
* @param view DOCUMENT ME! |
|
34 |
*/ |
|
35 |
public DistanceUnitsConfig(IProjectView view) { |
|
36 |
super(); |
|
37 |
this.view = view; |
|
38 |
initialize(); |
|
39 |
} |
|
40 |
|
|
41 |
/** |
|
42 |
* This method initializes this |
|
43 |
*/ |
|
44 |
private void initialize() { |
|
45 |
this.setSize(331, 74); |
|
46 |
this.add(getLblDistanceUnits(), null); |
|
47 |
this.add(getCmbDistanceUnits(), null); |
|
48 |
this.add(getAcceptCancel(), null); |
|
49 |
} |
|
50 |
|
|
51 |
/** |
|
52 |
* This method initializes jLabel5 |
|
53 |
* |
|
54 |
* @return javax.swing.JLabel |
|
55 |
*/ |
|
56 |
private javax.swing.JLabel getLblDistanceUnits() { |
|
57 |
if (lblDistanceUnits == null) { |
|
58 |
lblDistanceUnits = new javax.swing.JLabel(); |
|
59 |
lblDistanceUnits.setText(PluginServices.getText(this, |
|
60 |
"distance_units") + ":"); |
|
61 |
} |
|
62 |
|
|
63 |
return lblDistanceUnits; |
|
64 |
} |
|
65 |
|
|
66 |
/** |
|
67 |
* This method initializes cmbDistanceUnits |
|
68 |
* |
|
69 |
* @return javax.swing.JComboBox |
|
70 |
*/ |
|
71 |
private javax.swing.JComboBox getCmbDistanceUnits() { |
|
72 |
if (cmbDistanceUnits == null) { |
|
73 |
cmbDistanceUnits = new javax.swing.JComboBox(getUnitsNames()); |
|
74 |
cmbDistanceUnits.setPreferredSize(new java.awt.Dimension(200, 20)); |
|
75 |
cmbDistanceUnits.setEditable(false); |
|
76 |
cmbDistanceUnits.setSelectedIndex(view.getMapContext().getViewPort() |
|
77 |
.getDistanceUnits()); |
|
78 |
cmbDistanceUnits.addActionListener(new java.awt.event.ActionListener() { |
|
79 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
|
80 |
//view.getMapContext().getViewPort().setDistanceUnits(cmbDistanceUnits.getSelectedIndex()); |
|
81 |
} |
|
82 |
}); |
|
83 |
} |
|
84 |
|
|
85 |
return cmbDistanceUnits; |
|
86 |
} |
|
87 |
|
|
88 |
/** |
|
89 |
* DOCUMENT ME! |
|
90 |
* |
|
91 |
* @return DOCUMENT ME! |
|
92 |
*/ |
|
93 |
private String[] getUnitsNames() { |
|
94 |
if (unitsNames == null) { |
|
95 |
unitsNames = new String[Attributes.NAMES.length]; |
|
96 |
|
|
97 |
int i = 0; |
|
98 |
|
|
99 |
for (i = 0; i < Attributes.NAMES.length; i++) { |
|
100 |
unitsNames[i] = PluginServices.getText(this, Attributes.NAMES[i]); |
|
101 |
} |
|
102 |
|
|
103 |
//unitsNames[i]=PluginServices.getText(this, Attributes.DEGREES); |
|
104 |
} |
|
105 |
|
|
106 |
return unitsNames; |
|
107 |
} |
|
108 |
|
|
109 |
/** |
|
110 |
* DOCUMENT ME! |
|
111 |
* |
|
112 |
* @return DOCUMENT ME! |
|
113 |
*/ |
|
114 |
public WindowInfo getWindowInfo() { |
|
115 |
WindowInfo wi = new WindowInfo(WindowInfo.MODALDIALOG); |
|
116 |
wi.setTitle(PluginServices.getText(this, "distance_units")); |
|
117 |
|
|
118 |
JComponent statusBar = PluginServices.getMainFrame().getStatusBar(); |
|
119 |
JComponent component = PluginServices.getMainFrame().getComponentByName("coords"); |
|
120 |
wi.setX(component.getX()); |
|
121 |
wi.setY(statusBar.getY()); |
|
122 |
|
|
123 |
return wi; |
|
124 |
} |
|
125 |
|
|
126 |
/** |
|
127 |
* DOCUMENT ME! |
|
128 |
* |
|
129 |
* @return DOCUMENT ME! |
|
130 |
*/ |
|
131 |
private AcceptCancelPanel getAcceptCancel() { |
|
132 |
if (this.acceptCancel == null) { |
|
133 |
this.acceptCancel = new AcceptCancelPanel(new java.awt.event.ActionListener() { |
|
134 |
public void actionPerformed( |
|
135 |
java.awt.event.ActionEvent e) { |
|
136 |
view.getMapContext().getViewPort().setDistanceUnits(cmbDistanceUnits.getSelectedIndex()); |
|
137 |
isAcceppted = true; |
|
138 |
PluginServices.getMDIManager().closeWindow(DistanceUnitsConfig.this); |
|
139 |
} |
|
140 |
}, |
|
141 |
new java.awt.event.ActionListener() { |
|
142 |
public void actionPerformed( |
|
143 |
java.awt.event.ActionEvent e) { |
|
144 |
PluginServices.getMDIManager().closeWindow(DistanceUnitsConfig.this); |
|
145 |
} |
|
146 |
}); |
|
147 |
this.acceptCancel.setBounds(5, 150, this.getWidth() - 10, 30); |
|
148 |
} |
|
149 |
|
|
150 |
return this.acceptCancel; |
|
151 |
} |
|
152 |
} // @jve:decl-index=0:visual-constraint="10,10" |
|
0 | 153 |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/gui/ViewProperties.java | ||
---|---|---|
49 | 49 |
import javax.swing.JColorChooser; |
50 | 50 |
import javax.swing.JPanel; |
51 | 51 |
|
52 |
import org.cresques.cts.IProjection; |
|
52 | 53 |
import org.gvsig.gui.beans.AcceptCancelPanel; |
53 | 54 |
import org.gvsig.gui.beans.swing.JButton; |
54 | 55 |
|
... | ... | |
277 | 278 |
if (cmbMapUnits == null) { |
278 | 279 |
cmbMapUnits = new javax.swing.JComboBox(getUnitsNames()); |
279 | 280 |
cmbMapUnits.setPreferredSize(new java.awt.Dimension(200, 20)); |
281 |
IProjection proj=view.getProjection(); |
|
282 |
if (!proj.isProjected()) { |
|
283 |
if (cmbMapUnits.getItemCount()==Attributes.NAMES.length) { |
|
284 |
cmbMapUnits.addItem(PluginServices.getText(this, Attributes.DEGREES)); |
|
285 |
} |
|
286 |
cmbMapUnits.setSelectedItem(PluginServices.getText(this, Attributes.DEGREES)); |
|
287 |
cmbMapUnits.setEnabled(false); |
|
288 |
}else { |
|
289 |
if (!(cmbMapUnits.getItemCount()==Attributes.NAMES.length)) { |
|
290 |
cmbMapUnits.removeItem(PluginServices.getText(this, Attributes.DEGREES)); |
|
291 |
} |
|
292 |
cmbMapUnits.setSelectedIndex(view.getMapContext().getViewPort().getMapUnits()); |
|
293 |
cmbMapUnits.setEnabled(true); |
|
294 |
} |
|
280 | 295 |
cmbMapUnits.setSelectedIndex(view.getMapContext().getViewPort().getMapUnits()); |
296 |
|
|
281 | 297 |
cmbMapUnits.addActionListener(new java.awt.event.ActionListener() { |
282 | 298 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
283 | 299 |
//view.getMapContext().getViewPort().setMapUnits(cmbMapUnits.getSelectedIndex()); |
... | ... | |
593 | 609 |
*/ |
594 | 610 |
private CRSSelectPanel getJPanelProj() { |
595 | 611 |
if (jPanelProj == null) { |
596 |
jPanelProj = CRSSelectPanel.getPanel(view.getProjection()); |
|
612 |
IProjection proj=view.getProjection(); |
|
613 |
jPanelProj = CRSSelectPanel.getPanel(proj); |
|
597 | 614 |
jPanelProj.setPreferredSize(new java.awt.Dimension(330,35)); |
598 | 615 |
jPanelProj.addActionListener(new java.awt.event.ActionListener() { |
599 | 616 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
600 | 617 |
if (jPanelProj.isOkPressed()) { |
618 |
if (!jPanelProj.getCurProj().isProjected()) { |
|
619 |
if (getCmbMapUnits().getItemCount()==Attributes.NAMES.length) { |
|
620 |
getCmbMapUnits().addItem(PluginServices.getText(this, Attributes.DEGREES)); |
|
621 |
} |
|
622 |
getCmbMapUnits().setSelectedItem(PluginServices.getText(this, Attributes.DEGREES)); |
|
623 |
getCmbMapUnits().setEnabled(false); |
|
624 |
}else { |
|
625 |
if (getCmbMapUnits().getSelectedItem().equals(PluginServices.getText(this, Attributes.DEGREES))) { |
|
626 |
getCmbMapUnits().setSelectedIndex(1); |
|
627 |
getCmbMapUnits().setEnabled(true); |
|
628 |
} |
|
629 |
if (!(getCmbMapUnits().getItemCount()==Attributes.NAMES.length)) { |
|
630 |
getCmbMapUnits().removeItem(PluginServices.getText(this, Attributes.DEGREES)); |
|
631 |
} |
|
632 |
} |
|
601 | 633 |
view.setProjection(jPanelProj.getCurProj()); |
602 | 634 |
} |
603 | 635 |
} |
... | ... | |
627 | 659 |
ActionListener okAction, cancelAction; |
628 | 660 |
okAction = new java.awt.event.ActionListener() { |
629 | 661 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
630 |
view.getMapContext().getViewPort().setDistanceUnits(cmbDistanceUnits.getSelectedIndex()); |
|
631 |
view.getMapContext().getViewPort().setMapUnits(cmbMapUnits.getSelectedIndex()); |
|
632 | 662 |
view.setName(txtName.getText()); |
633 | 663 |
view.setCreationDate(txtDate.getText()); |
634 | 664 |
view.setOwner(txtOwner.getText()); |
... | ... | |
658 | 688 |
private String[] getUnitsNames() { |
659 | 689 |
if (unitsNames == null) { |
660 | 690 |
unitsNames = new String[Attributes.NAMES.length]; |
661 |
for (int i=0;i<Attributes.NAMES.length;i++) { |
|
691 |
int i=0; |
|
692 |
for (i=0;i<Attributes.NAMES.length;i++) { |
|
662 | 693 |
unitsNames[i]=PluginServices.getText(this, Attributes.NAMES[i]); |
663 | 694 |
} |
695 |
//unitsNames[i]=PluginServices.getText(this, Attributes.DEGREES); |
|
664 | 696 |
} |
665 | 697 |
return unitsNames; |
666 | 698 |
} |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/toolListeners/StatusBarListener.java | ||
---|---|---|
45 | 45 |
import java.text.NumberFormat; |
46 | 46 |
|
47 | 47 |
import org.cresques.cts.IProjection; |
48 |
import org.gvsig.gui.beans.controls.combolabel.ComboCoords; |
|
48 | 49 |
|
49 | 50 |
import com.iver.andami.PluginServices; |
50 | 51 |
import com.iver.andami.ui.mdiFrame.MainFrame; |
... | ... | |
54 | 55 |
import com.iver.cit.gvsig.fmap.tools.BehaviorException; |
55 | 56 |
import com.iver.cit.gvsig.fmap.tools.Events.PointEvent; |
56 | 57 |
import com.iver.cit.gvsig.fmap.tools.Listeners.PointListener; |
58 |
import com.iver.cit.gvsig.project.documents.layout.Attributes; |
|
57 | 59 |
|
58 | 60 |
|
59 | 61 |
/** |
... | ... | |
105 | 107 |
axisText = setCoorDisplayText(axisText); |
106 | 108 |
MainFrame mF = PluginServices.getMainFrame(); |
107 | 109 |
|
108 |
if (mF != null) |
|
109 |
{ |
|
110 |
mF.getStatusBar().setMessage("units",
|
|
110 |
if (mF != null){
|
|
111 |
|
|
112 |
mF.getStatusBar().setMessage("units",
|
|
111 | 113 |
PluginServices.getText(this, FConstant.NAMES[mapControl.getMapContext().getViewPort().getDistanceUnits()])); |
112 | 114 |
// FJP: No se debe llamar a setControlValue desde aqu?, porque |
113 | 115 |
// cambia la escala, y con ella el viewPort (adem?s, de |
... | ... | |
117 | 119 |
mF.getStatusBar().setMessage("projection", mapControl.getViewPort().getProjection().getAbrev()); |
118 | 120 |
|
119 | 121 |
String[] coords=getCoords(p); |
120 |
mF.getStatusBar().setMessage("x", |
|
121 |
axisText[0] + coords[0]); |
|
122 |
mF.getStatusBar().setMessage("y", |
|
123 |
axisText[1] + coords[1]); |
|
122 |
// mF.getStatusBar().setMessage("x", |
|
123 |
// axisText[0] + coords[0]); |
|
124 |
// mF.getStatusBar().setMessage("y", |
|
125 |
// axisText[1] + coords[1]); |
|
126 |
ComboCoords combocoords=(ComboCoords)PluginServices.getMainFrame().getComponentByName("coords"); |
|
127 |
combocoords.setLabelX(axisText[0]); |
|
128 |
combocoords.setLabelY(axisText[1]); |
|
129 |
combocoords.setValueX(coords[0]); |
|
130 |
combocoords.setValueY(coords[1]); |
|
124 | 131 |
} |
125 | 132 |
} |
126 | 133 |
|
... | ... | |
131 | 138 |
* 050211, jmorell. |
132 | 139 |
* @param p |
133 | 140 |
*/ |
134 |
private void setFractionDigits(Point2D p) {
|
|
141 |
public void setFractionDigits(Point2D p) {
|
|
135 | 142 |
IProjection iProj = mapControl.getMapContext().getProjection(); |
136 | 143 |
if (!iProj.isProjected()) { |
137 | 144 |
nf.setMaximumFractionDigits(8); |
... | ... | |
146 | 153 |
* 050211, jmorell. |
147 | 154 |
* @param p |
148 | 155 |
*/ |
149 |
private String[] setCoorDisplayText(String[] axisText) {
|
|
156 |
public String[] setCoorDisplayText(String[] axisText) {
|
|
150 | 157 |
IProjection iProj = mapControl.getMapContext().getProjection(); |
151 |
if (!iProj.isProjected()) { |
|
158 |
if (!iProj.isProjected() || mapControl.getViewPort().getDistanceUnits()==Attributes.NAMES.length-1) {
|
|
152 | 159 |
axisText[0] = "Lon = "; |
153 | 160 |
axisText[1] = "Lat = "; |
154 | 161 |
} else { |
... | ... | |
172 | 179 |
// System.out.println("Segundos: " + segundo); |
173 | 180 |
return signo+grado+"? "+(long) minuto+"' "+(long)segundo+"''"; |
174 | 181 |
} |
175 |
private String[] getCoords(Point2D p) {
|
|
182 |
public String[] getCoords(Point2D p) {
|
|
176 | 183 |
String[] coords=new String[2]; |
177 | 184 |
IProjection iProj = mapControl.getMapContext().getProjection(); |
178 | 185 |
if (!iProj.isProjected()) { |
179 | 186 |
coords[0]=String.valueOf(formatDegrees(p.getX())); |
180 | 187 |
coords[1]=String.valueOf(formatDegrees(p.getY())); |
181 | 188 |
} else { |
182 |
coords[0]=String.valueOf(nf.format((p.getX()/MapContext.CHANGEM[mapControl.getViewPort().getDistanceUnits()])*MapContext.CHANGEM[mapControl.getViewPort().getMapUnits()])); |
|
183 |
coords[1]=String.valueOf(nf.format((p.getY()/MapContext.CHANGEM[mapControl.getViewPort().getDistanceUnits()])*MapContext.CHANGEM[mapControl.getViewPort().getMapUnits()])); |
|
189 |
if (mapControl.getViewPort().getDistanceUnits()==Attributes.NAMES.length-1) { |
|
190 |
Point2D pgeo=iProj.toGeo(p); |
|
191 |
coords[0]=String.valueOf(formatDegrees(pgeo.getX())); |
|
192 |
coords[1]=String.valueOf(formatDegrees(pgeo.getY())); |
|
193 |
}else { |
|
194 |
coords[0]=String.valueOf(nf.format((p.getX()/MapContext.CHANGEM[mapControl.getViewPort().getDistanceUnits()])*MapContext.CHANGEM[mapControl.getViewPort().getMapUnits()])); |
|
195 |
coords[1]=String.valueOf(nf.format((p.getY()/MapContext.CHANGEM[mapControl.getViewPort().getDistanceUnits()])*MapContext.CHANGEM[mapControl.getViewPort().getMapUnits()])); |
|
196 |
} |
|
184 | 197 |
} |
185 | 198 |
return coords; |
186 | 199 |
} |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/Attributes.java | ||
---|---|---|
72 | 72 |
* @author Vicente Caballero Navarro |
73 | 73 |
*/ |
74 | 74 |
public class Attributes { |
75 |
/** KILOMETROS,METROS,CENTIMETROS,MILIMETROS,MILLAS,YARDAS,PIES,PULGADAS */
|
|
75 |
/** KILOMETROS,METROS,CENTIMETROS,MILIMETROS,MILLAS,YARDAS,PIES,PULGADAS,GRADOS DECIMALES **/
|
|
76 | 76 |
public static final double[] CHANGE = { |
77 |
100000, 100, 1, 0.1, 160934.4, 91.44, 30.48, 2.54 |
|
77 |
100000, 100, 1, 0.1, 160934.4, 91.44, 30.48, 2.54, 8.983152841195214E-6
|
|
78 | 78 |
}; |
79 |
public static final String[] NAMES= {"Kilometros","Metros","Centimetros","Milimetros","Millas","Yardas","Pies","Pulgadas"}; |
|
79 |
public static final String[] NAMES= {"Kilometros","Metros","Centimetros","Milimetros","Millas","Yardas","Pies","Pulgadas","Grados"}; |
|
80 |
public static final String DEGREES="Coordenadas"; |
|
80 | 81 |
public static final double[] UNIT = { |
81 | 82 |
0.0000025, 0.0025, 0.25, 2.5, 0.0000025, 0.025, 0.025, 0.25 |
82 | 83 |
}; |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/ViewControls.java | ||
---|---|---|
46 | 46 |
*/ |
47 | 47 |
package com.iver.cit.gvsig; |
48 | 48 |
|
49 |
import javax.swing.JComponent; |
|
50 |
|
|
49 | 51 |
import org.apache.log4j.Logger; |
50 | 52 |
|
51 | 53 |
import com.iver.andami.PluginServices; |
... | ... | |
54 | 56 |
import com.iver.andami.preferences.IPreference; |
55 | 57 |
import com.iver.andami.preferences.IPreferenceExtension; |
56 | 58 |
import com.iver.andami.ui.mdiManager.IWindow; |
59 |
import com.iver.andami.ui.mdiManager.WindowInfo; |
|
57 | 60 |
import com.iver.cit.gvsig.fmap.DriverException; |
58 | 61 |
import com.iver.cit.gvsig.fmap.MapContext; |
59 | 62 |
import com.iver.cit.gvsig.fmap.MapControl; |
... | ... | |
64 | 67 |
import com.iver.cit.gvsig.project.documents.ProjectDocument; |
65 | 68 |
import com.iver.cit.gvsig.project.documents.view.Encuadrator; |
66 | 69 |
import com.iver.cit.gvsig.project.documents.view.IProjectView; |
70 |
import com.iver.cit.gvsig.project.documents.view.gui.DistanceUnitsConfig; |
|
67 | 71 |
import com.iver.cit.gvsig.project.documents.view.gui.ExtentListSelectorModel; |
68 | 72 |
import com.iver.cit.gvsig.project.documents.view.gui.FPanelExtentSelector; |
69 | 73 |
import com.iver.cit.gvsig.project.documents.view.gui.FPanelLocConfig; |
... | ... | |
166 | 170 |
long scale=Long.parseLong(scl); |
167 | 171 |
mapa.setScaleView(scale); |
168 | 172 |
((ProjectDocument)vista.getModel()).setModified(true); |
173 |
} else if (s.startsWith("CHANGE_UNITS")){ |
|
174 |
DistanceUnitsConfig duc=new DistanceUnitsConfig(model); |
|
175 |
PluginServices.getMDIManager().addWindow(duc); |
|
176 |
((ProjectDocument)vista.getModel()).setModified(true); |
|
169 | 177 |
} |
170 | 178 |
} |
171 | 179 |
|
trunk/applications/appgvSIG/config/config.xml | ||
---|---|---|
4 | 4 |
<resourceBundle name="text"/> |
5 | 5 |
<label-set class-name="com.iver.cit.gvsig.project.documents.view.gui.View"> |
6 | 6 |
<label id="units" size="85"/> |
7 |
<label id="x" size="120"/> |
|
8 |
<label id="y" size="120"/> |
|
9 | 7 |
<label id="4" size="120"/> |
10 | 8 |
<label id="5" size="130"/> |
11 | 9 |
<label id="projection" size="85"/> |
... | ... | |
126 | 124 |
elements="1000;2000;5000;10000;25000;50000;100000;200000;500000;1000000;2000000;5000000" |
127 | 125 |
value="10000" |
128 | 126 |
action-command="CHANGE_SCALE" /> |
Also available in: Unified diff