Revision 47476 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/SimpleMarker.java
SimpleMarker.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: SimpleMarker.java 30289 2009-07-31 11:10:41Z jpiera $ |
|
27 |
* $Log$ |
|
28 |
* Revision 1.15 2007-08-14 11:10:20 jvidal |
|
29 |
* javadoc updated |
|
30 |
* |
|
31 |
* Revision 1.14 2007/08/08 11:49:15 jaume |
|
32 |
* refactored to avoid provide more than one EditorTool |
|
33 |
* |
|
34 |
* Revision 1.13 2007/08/07 11:20:11 jvidal |
|
35 |
* javadoc |
|
36 |
* |
|
37 |
* Revision 1.12 2007/08/03 11:29:13 jaume |
|
38 |
* refactored AbstractTypeSymbolEditorPanel class name to AbastractTypeSymbolEditor |
|
39 |
* |
|
40 |
* Revision 1.11 2007/07/18 06:56:03 jaume |
|
41 |
* continuing with cartographic support |
|
42 |
* |
|
43 |
* Revision 1.10 2007/07/12 10:43:55 jaume |
|
44 |
* *** empty log message *** |
|
45 |
* |
|
46 |
* Revision 1.9 2007/05/31 09:36:22 jaume |
|
47 |
* *** empty log message *** |
|
48 |
* |
|
49 |
* Revision 1.8 2007/05/29 15:47:06 jaume |
|
50 |
* *** empty log message *** |
|
51 |
* |
|
52 |
* Revision 1.7 2007/05/21 10:38:27 jaume |
|
53 |
* *** empty log message *** |
|
54 |
* |
|
55 |
* Revision 1.6 2007/05/09 16:08:14 jaume |
|
56 |
* *** empty log message *** |
|
57 |
* |
|
58 |
* Revision 1.5 2007/04/27 12:10:17 jaume |
|
59 |
* *** empty log message *** |
|
60 |
* |
|
61 |
* Revision 1.4 2007/04/05 16:08:34 jaume |
|
62 |
* Styled labeling stuff |
|
63 |
* |
|
64 |
* Revision 1.3 2007/04/04 16:01:14 jaume |
|
65 |
* *** empty log message *** |
|
66 |
* |
|
67 |
* Revision 1.2 2007/03/09 11:25:00 jaume |
|
68 |
* Advanced symbology (start committing) |
|
69 |
* |
|
70 |
* Revision 1.1.2.4 2007/02/21 07:35:14 jaume |
|
71 |
* *** empty log message *** |
|
72 |
* |
|
73 |
* Revision 1.1.2.3 2007/02/08 15:43:04 jaume |
|
74 |
* some bug fixes in the editor and removed unnecessary imports |
|
75 |
* |
|
76 |
* Revision 1.1.2.2 2007/01/30 18:10:10 jaume |
|
77 |
* start commiting labeling stuff |
|
78 |
* |
|
79 |
* Revision 1.1.2.1 2007/01/26 13:49:03 jaume |
|
80 |
* *** empty log message *** |
|
81 |
* |
|
82 |
* |
|
83 |
*/ |
|
84 | 24 |
package org.gvsig.app.gui.styling; |
85 | 25 |
|
86 | 26 |
import java.awt.Color; |
... | ... | |
92 | 32 |
import java.awt.event.FocusListener; |
93 | 33 |
import java.awt.geom.Point2D; |
94 | 34 |
import java.util.ArrayList; |
95 |
|
|
96 | 35 |
import javax.swing.JCheckBox; |
97 | 36 |
import javax.swing.JPanel; |
98 |
|
|
99 | 37 |
import org.gvsig.andami.messages.NotificationManager; |
100 | 38 |
import org.gvsig.app.gui.panels.ColorChooserPanel; |
101 | 39 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
... | ... | |
126 | 64 |
*/ |
127 | 65 |
public class SimpleMarker extends AbstractTypeSymbolEditor implements ActionListener, FocusListener{ |
128 | 66 |
|
129 |
private ArrayList tabs = new ArrayList(); |
|
67 |
private final ArrayList tabs = new ArrayList();
|
|
130 | 68 |
private ColorChooserPanel jccColor; |
131 | 69 |
private JNumberSpinner txtSize; |
132 | 70 |
private JNumberSpinner txtXOffset; |
... | ... | |
157 | 95 |
jccColor = new ColorChooserPanel(true); |
158 | 96 |
jccColor.setAlpha(255); |
159 | 97 |
|
160 |
aux.addComponent(Messages.getText("color")+":",
|
|
98 |
aux.addComponent(Messages.getText("Color")+":",
|
|
161 | 99 |
jccColor ); |
162 | 100 |
|
163 | 101 |
// marker width |
164 | 102 |
txtSize = new JNumberSpinner(5.0, 25, 0.0, Double.MAX_VALUE, 1.0, 2); |
165 | 103 |
aux.addComponent(Messages.getText("size")+":", |
166 | 104 |
txtSize ); |
167 |
// txtSize.setDouble(5.0); |
|
168 | 105 |
|
169 | 106 |
// marker xOffset |
170 | 107 |
txtXOffset = new JNumberSpinner(0.0, 25, 0.0, Double.MAX_VALUE, 1.0, 2); |
... | ... | |
211 | 148 |
jccOutlineColor.addActionListener(this); |
212 | 149 |
|
213 | 150 |
tabs.add(myTab); |
214 |
|
|
215 |
// mask = new Mask(this); |
|
216 |
// tabs.add(mask); |
|
217 | 151 |
} |
218 | 152 |
|
153 |
@Override |
|
219 | 154 |
public ISymbol getLayer() { |
220 | 155 |
ISimpleMarkerSymbol layer = SymbologyLocator.getSymbologyManager().createSimpleMarkerSymbol(); |
221 | 156 |
layer.setColor(jccColor.getColor()); |
222 |
// layer.setIsShapeVisible(true); //true is the default value for this property |
|
223 | 157 |
layer.setSize(txtSize.getDouble()); |
224 |
// layer.setUnit(owner.getUnit()); |
|
225 |
// layer.setReferenceSystem(owner.getUnitsReferenceSystem()); |
|
226 | 158 |
layer.setOffset(new Point2D.Double( |
227 | 159 |
txtXOffset.getDouble(), |
228 | 160 |
txtYOffset.getDouble())); |
229 |
// layer.setMask(mask.getMask()); |
|
230 |
layer.setStyle(((Integer) cmbStyle.getSelectedItem()).intValue()); |
|
161 |
layer.setStyle(((Integer) cmbStyle.getSelectedItem())); |
|
231 | 162 |
layer.setOutlined(chkUseOutline.isSelected()); |
232 | 163 |
layer.setOutlineColor(jccOutlineColor.getColor()); |
233 | 164 |
return layer; |
234 | 165 |
} |
235 | 166 |
|
167 |
@Override |
|
236 | 168 |
public String getName() { |
237 | 169 |
return Messages.getText("simple_marker_symbol"); |
238 | 170 |
} |
239 | 171 |
|
172 |
@Override |
|
240 | 173 |
public JPanel[] getTabs() { |
241 | 174 |
return (JPanel[]) tabs.toArray(new JPanel[0]); |
242 | 175 |
} |
243 | 176 |
|
177 |
@Override |
|
244 | 178 |
public void refreshControls(ISymbol layer) { |
245 | 179 |
ISimpleMarkerSymbol sym; |
246 | 180 |
try { |
... | ... | |
262 | 196 |
cmbStyle.setSymbolColor(sym.getColor()); |
263 | 197 |
chkUseOutline.setSelected(sym.hasOutline()); |
264 | 198 |
cmbStyle.setOutlineColor(sym.getOutlineColor()); |
265 |
cmbStyle.setSelectedItem(new Integer(sym.getStyle()));
|
|
199 |
cmbStyle.setSelectedItem(sym.getStyle());
|
|
266 | 200 |
} |
267 | 201 |
} catch (IndexOutOfBoundsException ioEx) { |
268 | 202 |
NotificationManager.addWarning("Symbol layer index out of bounds", ioEx); |
... | ... | |
273 | 207 |
} |
274 | 208 |
} |
275 | 209 |
|
210 |
@Override |
|
276 | 211 |
public void actionPerformed(ActionEvent e) { |
277 | 212 |
fireSymbolChangedEvent(); |
278 | 213 |
} |
279 | 214 |
|
215 |
@Override |
|
280 | 216 |
public EditorTool[] getEditorTools() { |
281 | 217 |
return null; |
282 | 218 |
} |
219 |
@Override |
|
283 | 220 |
public void focusGained(FocusEvent arg0) { |
284 | 221 |
// TODO Auto-generated method stub |
285 | 222 |
|
286 | 223 |
} |
224 |
@Override |
|
287 | 225 |
public void focusLost(FocusEvent arg0) { |
288 | 226 |
fireSymbolChangedEvent(); |
289 | 227 |
|
290 | 228 |
} |
229 |
@Override |
|
291 | 230 |
public boolean canManageSymbol(ISymbol symbol) { |
292 | 231 |
return symbol instanceof ISimpleMarkerSymbol; |
293 | 232 |
|
Also available in: Unified diff