Revision 41400 trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.swing/org.gvsig.symbology.swing.api/src/main/java/org/gvsig/app/gui/styling/SymbolEditor.java
SymbolEditor.java | ||
---|---|---|
21 | 21 |
* For any additional information, do not hesitate to contact us |
22 | 22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
23 | 23 |
*/ |
24 |
/* CVS MESSAGES: |
|
25 |
* |
|
26 |
* $Id: SymbolEditor.java 30892 2009-09-21 12:02:19Z cordinyana $ |
|
27 |
* $Log$ |
|
28 |
* Revision 1.22 2007-09-19 15:36:36 jaume |
|
29 |
* removed unnecessary imports |
|
30 |
* |
|
31 |
* Revision 1.21 2007/09/17 09:21:45 jaume |
|
32 |
* refactored SymboSelector (added support for multishapedsymbol) |
|
33 |
* |
|
34 |
* Revision 1.20 2007/08/21 09:32:41 jvidal |
|
35 |
* javadoc |
|
36 |
* |
|
37 |
* Revision 1.19 2007/08/10 06:09:57 jaume |
|
38 |
* imports fixed |
|
39 |
* |
|
40 |
* Revision 1.18 2007/08/10 06:06:05 jaume |
|
41 |
* translations and error messages |
|
42 |
* |
|
43 |
* Revision 1.17 2007/08/03 11:29:13 jaume |
|
44 |
* refactored AbstractTypeSymbolEditorPanel class name to AbastractTypeSymbolEditor |
|
45 |
* |
|
46 |
* Revision 1.16 2007/08/01 13:01:43 jaume |
|
47 |
* refactored to be pluggable |
|
48 |
* |
|
49 |
* Revision 1.15 2007/07/30 12:56:04 jaume |
|
50 |
* organize imports, java 5 code downgraded to 1.4 and added PictureFillSymbol |
|
51 |
* |
|
52 |
* Revision 1.14 2007/07/30 06:59:51 jaume |
|
53 |
* finished (maybe) LineFillSymbol |
|
54 |
* |
|
55 |
* Revision 1.13 2007/07/26 12:28:29 jaume |
|
56 |
* maybe finished ArrowMarkerSymbol and ArrowDecoratorStyle |
|
57 |
* |
|
58 |
* Revision 1.12 2007/07/18 06:56:03 jaume |
|
59 |
* continuing with cartographic support |
|
60 |
* |
|
61 |
* Revision 1.11 2007/07/12 10:43:55 jaume |
|
62 |
* *** empty log message *** |
|
63 |
* |
|
64 |
* Revision 1.10 2007/06/29 13:07:33 jaume |
|
65 |
* +PictureLineSymbol |
|
66 |
* |
|
67 |
* Revision 1.9 2007/05/31 09:36:22 jaume |
|
68 |
* *** empty log message *** |
|
69 |
* |
|
70 |
* Revision 1.8 2007/05/29 15:47:06 jaume |
|
71 |
* *** empty log message *** |
|
72 |
* |
|
73 |
* Revision 1.7 2007/05/09 16:08:14 jaume |
|
74 |
* *** empty log message *** |
|
75 |
* |
|
76 |
* Revision 1.6 2007/05/08 15:44:07 jaume |
|
77 |
* *** empty log message *** |
|
78 |
* |
|
79 |
* Revision 1.5 2007/04/20 07:54:38 jaume |
|
80 |
* *** empty log message *** |
|
81 |
* |
|
82 |
* Revision 1.4 2007/03/28 16:44:08 jaume |
|
83 |
* *** empty log message *** |
|
84 |
* |
|
85 |
* Revision 1.3 2007/03/27 09:49:03 jaume |
|
86 |
* *** empty log message *** |
|
87 |
* |
|
88 |
* Revision 1.2 2007/03/09 11:25:00 jaume |
|
89 |
* Advanced symbology (start committing) |
|
90 |
* |
|
91 |
* Revision 1.1.2.4 2007/02/21 07:35:14 jaume |
|
92 |
* *** empty log message *** |
|
93 |
* |
|
94 |
* Revision 1.1.2.3 2007/02/09 11:00:03 jaume |
|
95 |
* *** empty log message *** |
|
96 |
* |
|
97 |
* Revision 1.1.2.2 2007/02/08 15:43:05 jaume |
|
98 |
* some bug fixes in the editor and removed unnecessary imports |
|
99 |
* |
|
100 |
* Revision 1.1.2.1 2007/01/26 13:49:03 jaume |
|
101 |
* *** empty log message *** |
|
102 |
* |
|
103 |
* Revision 1.1 2007/01/16 11:52:11 jaume |
|
104 |
* *** empty log message *** |
|
105 |
* |
|
106 |
* Revision 1.11 2007/01/10 17:05:05 jaume |
|
107 |
* moved to FMap and gvSIG |
|
108 |
* |
|
109 |
* Revision 1.10 2006/11/13 09:15:23 jaume |
|
110 |
* javadoc and some clean-up |
|
111 |
* |
|
112 |
* Revision 1.9 2006/11/06 17:08:45 jaume |
|
113 |
* *** empty log message *** |
|
114 |
* |
|
115 |
* Revision 1.8 2006/11/06 16:06:52 jaume |
|
116 |
* *** empty log message *** |
|
117 |
* |
|
118 |
* Revision 1.7 2006/11/06 07:33:54 jaume |
|
119 |
* javadoc, source style |
|
120 |
* |
|
121 |
* Revision 1.6 2006/11/02 17:19:28 jaume |
|
122 |
* *** empty log message *** |
|
123 |
* |
|
124 |
* Revision 1.5 2006/10/31 16:16:34 jaume |
|
125 |
* *** empty log message *** |
|
126 |
* |
|
127 |
* Revision 1.4 2006/10/30 19:30:35 jaume |
|
128 |
* *** empty log message *** |
|
129 |
* |
|
130 |
* Revision 1.3 2006/10/29 23:53:49 jaume |
|
131 |
* *** empty log message *** |
|
132 |
* |
|
133 |
* Revision 1.2 2006/10/27 12:41:09 jaume |
|
134 |
* GUI |
|
135 |
* |
|
136 |
* Revision 1.1 2006/10/26 16:31:21 jaume |
|
137 |
* GUI |
|
138 |
* |
|
139 |
* |
|
140 |
*/ |
|
141 | 24 |
package org.gvsig.app.gui.styling; |
142 | 25 |
|
143 | 26 |
import java.awt.BorderLayout; |
... | ... | |
151 | 34 |
import java.util.Hashtable; |
152 | 35 |
import java.util.Iterator; |
153 | 36 |
import java.util.List; |
37 |
import java.util.Map; |
|
154 | 38 |
import java.util.TreeSet; |
155 | 39 |
|
156 | 40 |
import javax.swing.BorderFactory; |
... | ... | |
180 | 64 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
181 | 65 |
import org.gvsig.gui.beans.AcceptCancelPanel; |
182 | 66 |
import org.gvsig.i18n.Messages; |
67 |
import org.gvsig.symbology.swing.SymbologySwingLocator; |
|
68 |
import org.gvsig.symbology.swing.SymbologySwingManager; |
|
183 | 69 |
|
184 | 70 |
/** |
185 | 71 |
* Creates the panel that is used to control the properties of a symbol in |
... | ... | |
197 | 83 |
private static final Logger LOG = |
198 | 84 |
LoggerFactory.getLogger(SymbolEditor.class); |
199 | 85 |
|
200 |
private static Hashtable editorsByType; |
|
201 | 86 |
private WindowInfo wi; |
202 | 87 |
private JPanel pnlWest = null; |
203 | 88 |
private JPanel pnlCenter = null; |
... | ... | |
304 | 189 |
* |
305 | 190 |
*/ |
306 | 191 |
private void initialize() { |
307 |
|
|
192 |
SymbologySwingManager symbologySwingManager = SymbologySwingLocator.getSwingManager(); |
|
308 | 193 |
cmbTypeActionListener = new ActionListener() { |
309 | 194 |
int prevIndex = -2; |
310 | 195 |
|
... | ... | |
357 | 242 |
|
358 | 243 |
|
359 | 244 |
TreeSet set = new TreeSet(tabComparator); |
360 |
List editors = getSymbolsByType(shapeType);
|
|
245 |
List editors = symbologySwingManager.getSymbolEditorClassesByGeometryType(shapeType);
|
|
361 | 246 |
Class[] constrLocator = new Class[] {SymbolEditor.class}; |
362 | 247 |
Object[] constrInitargs = new Object[] { this }; |
363 | 248 |
for (int i = 0; i < editors.size(); i++) { |
... | ... | |
703 | 588 |
return cmbUnitsReferenceSystem.getSelectedIndex(); |
704 | 589 |
} |
705 | 590 |
|
706 |
public static void addSymbolEditorPanel(Class abstractTypeSymbolEditorPanelClass, int shapeType) { |
|
707 |
if (editorsByType == null) { |
|
708 |
editorsByType = new Hashtable(); |
|
709 |
} |
|
710 |
|
|
711 |
Integer key = new Integer(shapeType); |
|
712 |
ArrayList l = (ArrayList) editorsByType.get(key); |
|
713 |
if (l == null) { |
|
714 |
l = new ArrayList(); |
|
715 |
} |
|
716 |
l.add(abstractTypeSymbolEditorPanelClass); |
|
717 |
|
|
718 |
editorsByType.put(key, l); |
|
591 |
/** |
|
592 |
* @deprecated use SymblogySwingManager |
|
593 |
*/ |
|
594 |
public static void addSymbolEditorPanel(Class<? extends TypeSymbolEditor> symbolEditor, int shapeType) { |
|
595 |
SymbologySwingManager manager = SymbologySwingLocator.getSwingManager(); |
|
596 |
manager.registerSymbolEditor(symbolEditor, shapeType); |
|
719 | 597 |
} |
720 | 598 |
|
599 |
/** |
|
600 |
* @deprecated use SymblogySwingManager |
|
601 |
*/ |
|
721 | 602 |
private static List getSymbolsByType(GeometryType geometryType){ |
722 |
Iterator it = editorsByType.keySet().iterator(); |
|
723 |
while (it.hasNext()){ |
|
724 |
int currentType = (Integer)it.next(); |
|
725 |
if (geometryType.isTypeOf(currentType)){ |
|
726 |
return (List)editorsByType.get(currentType); |
|
727 |
} |
|
728 |
} |
|
729 |
return new ArrayList(); |
|
603 |
SymbologySwingManager manager = SymbologySwingLocator.getSwingManager(); |
|
604 |
return manager.getSymbolEditorClassesByGeometryType(geometryType); |
|
730 | 605 |
} |
731 | 606 |
|
732 | 607 |
public Object getWindowProfile() { |
Also available in: Unified diff