Revision 36005 branches/v2_0_0_prep/extensions/extEditing/src/org/gvsig/editing/gui/preferences/EditingPage.java
EditingPage.java | ||
---|---|---|
186 | 186 |
import javax.swing.event.ChangeListener; |
187 | 187 |
|
188 | 188 |
import org.gvsig.andami.PluginServices; |
189 |
import org.gvsig.andami.PluginsLocator; |
|
190 |
import org.gvsig.andami.PluginsManager; |
|
189 | 191 |
import org.gvsig.andami.preferences.AbstractPreferencePage; |
190 | 192 |
import org.gvsig.andami.preferences.StoreException; |
191 | 193 |
import org.gvsig.app.gui.panels.ColorChooserPanel; |
194 |
import org.gvsig.editing.CADExtension; |
|
192 | 195 |
import org.gvsig.fmap.geom.Geometry; |
193 | 196 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
194 | 197 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
195 | 198 |
import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolManager; |
196 | 199 |
import org.gvsig.fmap.mapcontrol.MapControlLocator; |
197 | 200 |
import org.gvsig.fmap.mapcontrol.MapControlManager; |
201 |
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IFillSymbol; |
|
198 | 202 |
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.line.ILineSymbol; |
199 |
import org.gvsig.utils.StringUtilities; |
|
200 |
import org.gvsig.utils.XMLEntity; |
|
203 |
import org.gvsig.tools.dynobject.DynObject; |
|
201 | 204 |
|
202 | 205 |
|
206 |
|
|
203 | 207 |
/** |
204 | 208 |
* Editing configuration page. |
205 | 209 |
* <b><b> |
... | ... | |
210 | 214 |
* @author Vicente Caballero Navarro |
211 | 215 |
*/ |
212 | 216 |
public class EditingPage extends AbstractPreferencePage { |
217 |
private static final long serialVersionUID = -6126280933781398092L; |
|
213 | 218 |
|
214 |
public static String DEFAULT_HANDLER_COLOR = "default_editing_handler_color"; |
|
215 |
public static String DEFAULT_HANDLER_OUTLINE_COLOR = "default_editing_handler_outline_color"; |
|
219 |
public static String DEFAULT_HANDLER_SYMBOL = "default_editing_handler_symbol"; |
|
220 |
public static String DEFAULT_AXIS_REFERENCES_SYMBOL = "default_editing_axis_references_symbol"; |
|
221 |
public static String DEFAULT_RECTANGLE_SELECTION_SYMBOL = "default_editing_rectangle_selection_symbol"; |
|
216 | 222 |
|
217 |
public static String DEFAULT_SELECTION_COLOR = "default_editing_selection_color"; |
|
218 |
// public static String DEFAULT_SELECTION_OUTLINE_COLOR = "default_editing_selection_outline_color"; |
|
219 |
|
|
220 |
public static String DEFAULT_AXIS_REFERENCES_COLOR = "default_editing_axis_references_color"; |
|
221 |
// public static String DEFAULT_AXIS_REFERENCES_OUTLINE_COLOR = "default_editing_axis_references_outline_color"; |
|
222 |
|
|
223 |
public static String DEFAULT_RECTANGLE_SELECTION_COLOR = "default_editing_rectangle_selection_color"; |
|
224 |
// public static String DEFAULT_GEOMETRY_SELECTION_OUTLINE_COLOR = "default_editing_geometry_selection_outline_color"; |
|
225 |
|
|
226 | 223 |
protected String id; |
227 |
private ImageIcon icon; |
|
228 |
private ColorChooserPanel jccDefaultSelectionColor; |
|
229 |
// private ColorChooserPanel jccDefaultSelectionOutLineColor; |
|
224 |
private ImageIcon icon; |
|
230 | 225 |
private ColorChooserPanel jccDefaultAxisReferencesColor; |
231 |
// private ColorChooserPanel jccDefaultAxisReferencesOutLineColor; |
|
232 | 226 |
private ColorChooserPanel jccDefaultGeometrySelectionColor; |
233 |
// private ColorChooserPanel jccDefaultGeometrySelectionOutLineColor; |
|
234 |
|
|
235 | 227 |
private ColorChooserPanel jccDefaultHandlerColor; |
236 |
private ColorChooserPanel jccDefaultHandlerOutLineColor; |
|
237 | 228 |
|
238 |
private boolean panelStarted = false; |
|
239 |
private JSlider jsDefaultSelectionAlpha; |
|
229 |
private boolean panelStarted = false; |
|
240 | 230 |
private JSlider jsDefaultAxisReferencesAlpha; |
241 | 231 |
private JSlider jsDefaultGeometrySelectionAlpha; |
242 | 232 |
private JSlider jsDefaultHandlerAlpha; |
... | ... | |
257 | 247 |
public void initializeValues() { |
258 | 248 |
if (!panelStarted) getPanel(); |
259 | 249 |
|
260 |
PluginServices ps = PluginServices.getPluginServices(this); |
|
261 |
XMLEntity xml = ps.getPersistentXML(); |
|
250 |
//The values has beed retrieved in the CADExtension. |
|
262 | 251 |
|
263 |
// Default selection color |
|
264 |
if (xml.contains(DEFAULT_SELECTION_COLOR)) { |
|
265 |
Color color=StringUtilities.string2Color(xml.getStringProperty(DEFAULT_SELECTION_COLOR)); |
|
266 |
jccDefaultSelectionColor.setColor(color); |
|
267 |
jccDefaultSelectionColor.setAlpha(color.getAlpha()); |
|
268 |
// Color colorOutLine=StringUtilities.string2Color(xml.getStringProperty(DEFAULT_SELECTION_OUTLINE_COLOR)); |
|
269 |
// jccDefaultSelectionOutLineColor.setColor(colorOutLine); |
|
270 |
// jccDefaultSelectionOutLineColor.setAlpha(color.getAlpha()); |
|
271 |
jsDefaultSelectionAlpha.setValue(color.getAlpha()); |
|
272 |
mapControlManager.setSelectionSymbol(symbolManager.createSymbol( |
|
273 |
Geometry.TYPES.GEOMETRY, color)); |
|
274 |
// DefaultCADTool.selectionSymbol.setOutlineColor(colorOutLine); |
|
275 |
}else{ |
|
276 |
Color color=Color.RED; |
|
277 |
jccDefaultSelectionColor.setColor(color); |
|
278 |
jccDefaultSelectionColor.setAlpha(color.getAlpha()); |
|
279 |
// jccDefaultSelectionOutLineColor.setColor(color.darker()); |
|
280 |
// jccDefaultSelectionOutLineColor.setAlpha(color.getAlpha()); |
|
281 |
jsDefaultSelectionAlpha.setValue(color.getAlpha()); |
|
282 |
mapControlManager.setSelectionSymbol(symbolManager.createSymbol( |
|
283 |
Geometry.TYPES.GEOMETRY, color)); |
|
284 |
// DefaultCADTool.selectionSymbol.setOutlineColor(color.darker()); |
|
285 |
} |
|
286 |
|
|
287 |
|
|
288 | 252 |
// Default axis references color |
289 |
if (xml.contains(DEFAULT_AXIS_REFERENCES_COLOR)) { |
|
290 |
Color color=StringUtilities.string2Color(xml.getStringProperty(DEFAULT_AXIS_REFERENCES_COLOR)); |
|
291 |
jccDefaultAxisReferencesColor.setColor(color); |
|
292 |
jccDefaultAxisReferencesColor.setAlpha(color.getAlpha()); |
|
293 |
// Color colorOutLine=StringUtilities.string2Color(xml.getStringProperty(DEFAULT_AXIS_REFERENCES_OUTLINE_COLOR)); |
|
294 |
// jccDefaultAxisReferencesOutLineColor.setColor(colorOutLine); |
|
295 |
// jccDefaultAxisReferencesOutLineColor.setAlpha(color.getAlpha()); |
|
296 |
jsDefaultAxisReferencesAlpha.setValue(color.getAlpha()); |
|
297 |
ISymbol symbol = |
|
298 |
symbolManager.createSymbol(Geometry.TYPES.GEOMETRY, color); |
|
299 |
mapControlManager.setAxisReferenceSymbol(symbol); |
|
300 |
}else{ |
|
301 |
Color color=new Color(100, 100, 100, 100); |
|
302 |
jccDefaultAxisReferencesColor.setColor(color); |
|
303 |
jccDefaultAxisReferencesColor.setAlpha(color.getAlpha()); |
|
304 |
// jccDefaultAxisReferencesOutLineColor.setColor(color.darker()); |
|
305 |
// jccDefaultAxisReferencesOutLineColor.setAlpha(color.getAlpha()); |
|
306 |
jsDefaultAxisReferencesAlpha.setValue(color.getAlpha()); |
|
307 |
ISymbol symbol = |
|
308 |
symbolManager.createSymbol(Geometry.TYPES.GEOMETRY, color); |
|
309 |
mapControlManager.setAxisReferenceSymbol(symbol); |
|
310 |
} |
|
253 |
ISymbol axisReferenceSymbol = mapControlManager.getAxisReferenceSymbol(); |
|
254 |
jccDefaultAxisReferencesColor.setColor(axisReferenceSymbol.getColor()); |
|
255 |
jccDefaultAxisReferencesColor.setAlpha(axisReferenceSymbol.getColor().getAlpha()); |
|
256 |
jsDefaultAxisReferencesAlpha.setValue(axisReferenceSymbol.getColor().getAlpha()); |
|
311 | 257 |
|
312 | 258 |
// Default geometry selection color |
313 |
if (xml.contains(DEFAULT_RECTANGLE_SELECTION_COLOR)) { |
|
314 |
Color color=StringUtilities.string2Color(xml.getStringProperty(DEFAULT_RECTANGLE_SELECTION_COLOR)); |
|
315 |
jccDefaultGeometrySelectionColor.setColor(color); |
|
316 |
jccDefaultGeometrySelectionColor.setAlpha(color.getAlpha()); |
|
317 |
// Color colorOutLine=StringUtilities.string2Color(xml.getStringProperty(DEFAULT_GEOMETRY_SELECTION_OUTLINE_COLOR)); |
|
318 |
// jccDefaultGeometrySelectionOutLineColor.setColor(colorOutLine); |
|
319 |
// jccDefaultGeometrySelectionOutLineColor.setAlpha(color.getAlpha()); |
|
320 |
jsDefaultGeometrySelectionAlpha.setValue(color.getAlpha()); |
|
321 |
ISymbol symbol = |
|
322 |
symbolManager.createSymbol(Geometry.TYPES.GEOMETRY, color); |
|
323 |
mapControlManager.setGeometrySelectionSymbol(symbol); |
|
324 |
}else{ |
|
325 |
Color color=new Color(255, 0,0, 100); |
|
326 |
jccDefaultGeometrySelectionColor.setColor(color); |
|
327 |
jccDefaultGeometrySelectionColor.setAlpha(color.getAlpha()); |
|
328 |
// jccDefaultGeometrySelectionOutLineColor.setColor(color.darker()); |
|
329 |
// jccDefaultGeometrySelectionOutLineColor.setAlpha(color.getAlpha()); |
|
330 |
jsDefaultGeometrySelectionAlpha.setValue(color.getAlpha()); |
|
331 |
ISymbol symbol = |
|
332 |
symbolManager.createSymbol(Geometry.TYPES.GEOMETRY, color); |
|
333 |
mapControlManager.setGeometrySelectionSymbol(symbol); |
|
334 |
} |
|
259 |
ISymbol geometrySelectionSymbol = mapControlManager.getGeometrySelectionSymbol(); |
|
260 |
jccDefaultGeometrySelectionColor.setColor(geometrySelectionSymbol.getColor()); |
|
261 |
jccDefaultGeometrySelectionColor.setAlpha(geometrySelectionSymbol.getColor().getAlpha()); |
|
262 |
jsDefaultGeometrySelectionAlpha.setValue(geometrySelectionSymbol.getColor().getAlpha()); |
|
335 | 263 |
|
336 | 264 |
// Default handler color |
337 |
if (xml.contains(DEFAULT_HANDLER_COLOR)) { |
|
338 |
Color color=StringUtilities.string2Color(xml.getStringProperty(DEFAULT_HANDLER_COLOR)); |
|
339 |
jccDefaultHandlerColor.setColor(color); |
|
340 |
jccDefaultHandlerColor.setAlpha(color.getAlpha()); |
|
341 |
Color colorOutLine=StringUtilities.string2Color(xml.getStringProperty(DEFAULT_HANDLER_OUTLINE_COLOR)); |
|
342 |
jccDefaultHandlerOutLineColor.setColor(colorOutLine); |
|
343 |
jccDefaultHandlerOutLineColor.setAlpha(color.getAlpha()); |
|
344 |
jsDefaultGeometrySelectionAlpha.setValue(color.getAlpha()); |
|
345 |
ISymbol symbol = |
|
346 |
symbolManager.createSymbol(Geometry.TYPES.GEOMETRY, color); |
|
347 |
mapControlManager.setHandlerSymbol(symbol); |
|
348 |
if (mapControlManager.getHandlerSymbol()instanceof ILineSymbol) { |
|
349 |
((ILineSymbol)mapControlManager.getHandlerSymbol()).setLineColor(colorOutLine); |
|
350 |
} |
|
351 |
}else{ |
|
352 |
Color color=Color.ORANGE; |
|
353 |
jccDefaultHandlerColor.setColor(color); |
|
354 |
jccDefaultHandlerColor.setAlpha(color.getAlpha()); |
|
355 |
jccDefaultHandlerOutLineColor.setColor(color.darker()); |
|
356 |
jccDefaultHandlerOutLineColor.setAlpha(color.getAlpha()); |
|
357 |
jsDefaultHandlerAlpha.setValue(color.getAlpha()); |
|
358 |
ISymbol symbol = |
|
359 |
symbolManager.createSymbol(Geometry.TYPES.GEOMETRY, color); |
|
360 |
mapControlManager.setHandlerSymbol(symbol); |
|
361 |
if (mapControlManager.getHandlerSymbol() instanceof ILineSymbol) { |
|
362 |
((ILineSymbol)mapControlManager.getHandlerSymbol()).setLineColor(color.darker()); |
|
363 |
} |
|
364 |
} |
|
265 |
ISymbol handlerSymbol = mapControlManager.getHandlerSymbol(); |
|
266 |
jccDefaultHandlerColor.setColor(((IFillSymbol)handlerSymbol).getColor()); |
|
267 |
jccDefaultHandlerColor.setAlpha(((IFillSymbol)handlerSymbol).getColor().getAlpha()); |
|
268 |
jsDefaultHandlerAlpha.setValue(geometrySelectionSymbol.getColor().getAlpha()); |
|
269 |
|
|
365 | 270 |
} |
366 | 271 |
|
367 | 272 |
public String getID() { |
... | ... | |
380 | 285 |
addComponent(new JLabel(" ")); |
381 | 286 |
|
382 | 287 |
addComponent(new JLabel(PluginServices.getText(this,"change_the_editing_colors"))); |
383 |
// default selection color chooser |
|
384 |
JPanel selectionPanel = new JPanel(); |
|
385 |
selectionPanel.setBorder(new TitledBorder(PluginServices.getText(this, "options.editing.default_selection_color"))); |
|
386 |
selectionPanel.setLayout(new GridBagLayout()); |
|
387 |
selectionPanel.add(new JLabel(PluginServices.getText(this,"fill"))); |
|
388 |
selectionPanel.add(jccDefaultSelectionColor = new ColorChooserPanel()); |
|
389 |
// selectionPanel.add(new JLabel(PluginServices.getText(this,"outline"))); |
|
390 |
// selectionPanel.add(jccDefaultSelectionOutLineColor=new ColorChooserPanel()); |
|
391 | 288 |
|
392 | 289 |
|
393 |
// JPanel alphaSelectionPanel= new JPanel(); |
|
394 |
selectionPanel.add(new JLabel(PluginServices.getText(this,"alpha"))); |
|
395 |
selectionPanel.add(jsDefaultSelectionAlpha = new JSlider(0,255)); |
|
396 |
jsDefaultSelectionAlpha.setPreferredSize(new Dimension(100,30)); |
|
397 |
|
|
398 |
jsDefaultSelectionAlpha.addChangeListener(new ChangeListener(){ |
|
399 |
public void stateChanged(ChangeEvent e) { |
|
400 |
jccDefaultSelectionColor.setAlpha(((JSlider)e.getSource()).getValue()); |
|
401 |
// jccDefaultSelectionOutLineColor.setAlpha(((JSlider)e.getSource()).getValue()); |
|
402 |
|
|
403 |
}}); |
|
404 |
|
|
405 |
addComponent(selectionPanel); |
|
406 |
addComponent(new JLabel(" ")); |
|
407 |
|
|
408 | 290 |
// default selection color chooser |
409 | 291 |
JPanel modifyPanel = new JPanel(); |
410 | 292 |
modifyPanel.setBorder(new TitledBorder(PluginServices.getText(this, "options.editing.default_axis_references_color"))); |
411 | 293 |
modifyPanel.setLayout(new GridBagLayout()); |
412 | 294 |
modifyPanel.add(new JLabel(PluginServices.getText(this,"fill"))); |
413 | 295 |
modifyPanel.add(jccDefaultAxisReferencesColor = new ColorChooserPanel()); |
414 |
// modifyPanel.add(new JLabel(PluginServices.getText(this,"outline"))); |
|
415 |
// modifyPanel.add(jccDefaultAxisReferencesOutLineColor=new ColorChooserPanel()); |
|
416 | 296 |
|
417 | 297 |
// JPanel alphaModifyPanel= new JPanel(); |
418 |
// alphaModifyPanel.setPreferredSize(new Dimension(120,30)); |
|
419 | 298 |
modifyPanel.add(new JLabel(PluginServices.getText(this,"alpha"))); |
420 | 299 |
modifyPanel.add(jsDefaultAxisReferencesAlpha = new JSlider(0,255)); |
421 | 300 |
jsDefaultAxisReferencesAlpha.setPreferredSize(new Dimension(100,30)); |
... | ... | |
423 | 302 |
jsDefaultAxisReferencesAlpha.addChangeListener(new ChangeListener(){ |
424 | 303 |
public void stateChanged(ChangeEvent e) { |
425 | 304 |
jccDefaultAxisReferencesColor.setAlpha(((JSlider)e.getSource()).getValue()); |
426 |
// jccDefaultAxisReferencesOutLineColor.setAlpha(((JSlider)e.getSource()).getValue()); |
|
427 | 305 |
|
428 | 306 |
}}); |
429 | 307 |
|
... | ... | |
436 | 314 |
drawingPanel.setLayout(new GridBagLayout()); |
437 | 315 |
drawingPanel.add(new JLabel(PluginServices.getText(this,"fill"))); |
438 | 316 |
drawingPanel.add(jccDefaultGeometrySelectionColor = new ColorChooserPanel()); |
439 |
// drawingPanel.add(new JLabel(PluginServices.getText(this,"outline"))); |
|
440 |
// drawingPanel.add(jccDefaultGeometrySelectionOutLineColor=new ColorChooserPanel()); |
|
441 | 317 |
|
442 | 318 |
// JPanel alphaDrawingPanel= new JPanel(); |
443 |
// alphaDrawingPanel.setPreferredSize(new Dimension(120,30)); |
|
444 | 319 |
drawingPanel.add(new JLabel(PluginServices.getText(this,"alpha"))); |
445 | 320 |
drawingPanel.add(jsDefaultGeometrySelectionAlpha = new JSlider(0,255)); |
446 | 321 |
jsDefaultGeometrySelectionAlpha.setPreferredSize(new Dimension(100,30)); |
... | ... | |
448 | 323 |
jsDefaultGeometrySelectionAlpha.addChangeListener(new ChangeListener(){ |
449 | 324 |
public void stateChanged(ChangeEvent e) { |
450 | 325 |
jccDefaultGeometrySelectionColor.setAlpha(((JSlider)e.getSource()).getValue()); |
451 |
// jccDefaultGeometrySelectionOutLineColor.setAlpha(((JSlider)e.getSource()).getValue()); |
|
452 |
|
|
453 | 326 |
}}); |
454 | 327 |
|
455 | 328 |
addComponent(drawingPanel); |
... | ... | |
460 | 333 |
handlerPanel.setBorder(new TitledBorder(PluginServices.getText(this, "options.editing.default_handler_color"))); |
461 | 334 |
handlerPanel.setLayout(new GridBagLayout()); |
462 | 335 |
handlerPanel.add(new JLabel(PluginServices.getText(this,"fill"))); |
463 |
handlerPanel.add(jccDefaultHandlerColor = new ColorChooserPanel()); |
|
464 |
handlerPanel.add(new JLabel(PluginServices.getText(this,"outline"))); |
|
465 |
handlerPanel.add(jccDefaultHandlerOutLineColor=new ColorChooserPanel()); |
|
336 |
handlerPanel.add(jccDefaultHandlerColor = new ColorChooserPanel()); |
|
466 | 337 |
|
467 |
// JPanel alphaModifyPanel= new JPanel(); |
|
468 |
// alphaModifyPanel.setPreferredSize(new Dimension(120,30)); |
|
469 | 338 |
handlerPanel.add(new JLabel(PluginServices.getText(this,"alpha"))); |
470 | 339 |
handlerPanel.add(jsDefaultHandlerAlpha = new JSlider(0,255)); |
471 | 340 |
jsDefaultHandlerAlpha.setPreferredSize(new Dimension(100,30)); |
472 | 341 |
|
473 | 342 |
jsDefaultHandlerAlpha.addChangeListener(new ChangeListener(){ |
474 | 343 |
public void stateChanged(ChangeEvent e) { |
475 |
jccDefaultHandlerColor.setAlpha(((JSlider)e.getSource()).getValue()); |
|
476 |
jccDefaultHandlerOutLineColor.setAlpha(((JSlider)e.getSource()).getValue()); |
|
477 |
|
|
344 |
jccDefaultHandlerColor.setAlpha(((JSlider)e.getSource()).getValue()); |
|
478 | 345 |
}}); |
479 | 346 |
|
480 | 347 |
addComponent(handlerPanel); |
... | ... | |
485 | 352 |
} |
486 | 353 |
|
487 | 354 |
public void storeValues() throws StoreException { |
488 |
Color selectionColor, modifyColor, drawingColor, handlerColor, handlerOutLineColor;// selectionOutLineColor, modifyOutLineColor, drawingOutLineColor; |
|
489 |
selectionColor = jccDefaultSelectionColor.getColor(); |
|
490 |
// selectionOutLineColor = jccDefaultSelectionOutLineColor.getColor(); |
|
491 |
modifyColor = jccDefaultAxisReferencesColor.getColor(); |
|
492 |
// modifyOutLineColor = jccDefaultAxisReferencesOutLineColor.getColor(); |
|
493 |
drawingColor = jccDefaultGeometrySelectionColor.getColor(); |
|
494 |
// drawingOutLineColor = jccDefaultGeometrySelectionOutLineColor.getColor(); |
|
355 |
Color axisReferencesColor, geometrySelectionColor, handlerColor, handlerOutLineColor; |
|
356 |
axisReferencesColor = jccDefaultAxisReferencesColor.getColor(); |
|
357 |
geometrySelectionColor = jccDefaultGeometrySelectionColor.getColor(); |
|
358 |
handlerColor = jccDefaultHandlerColor.getColor(); |
|
495 | 359 |
|
496 |
handlerColor = jccDefaultHandlerColor.getColor();
|
|
497 |
handlerOutLineColor = jccDefaultHandlerOutLineColor.getColor();
|
|
360 |
PluginsManager pluginsManager = PluginsLocator.getManager();
|
|
361 |
DynObject dynObject = pluginsManager.getPlugin(CADExtension.class).getPluginProperties();
|
|
498 | 362 |
|
363 |
//Symbol for the AxisReferences |
|
364 |
ISymbol axisReferencesSymbol = |
|
365 |
symbolManager.createSymbol(Geometry.TYPES.GEOMETRY, axisReferencesColor); |
|
366 |
if (axisReferencesSymbol instanceof IFillSymbol){ |
|
367 |
((IFillSymbol)axisReferencesSymbol).setFillColor(axisReferencesColor); |
|
368 |
} |
|
369 |
mapControlManager.setAxisReferenceSymbol(axisReferencesSymbol); |
|
370 |
dynObject.setDynValue(DEFAULT_AXIS_REFERENCES_SYMBOL, axisReferencesSymbol); |
|
499 | 371 |
|
500 |
PluginServices ps = PluginServices.getPluginServices(this); |
|
501 |
XMLEntity xml = ps.getPersistentXML(); |
|
502 |
xml.putProperty(DEFAULT_SELECTION_COLOR, |
|
503 |
StringUtilities.color2String(selectionColor)); |
|
504 |
// xml.putProperty(DEFAULT_SELECTION_OUTLINE_COLOR, |
|
505 |
// StringUtilities.color2String(selectionOutLineColor)); |
|
506 |
ISymbol symbol = |
|
507 |
symbolManager.createSymbol(Geometry.TYPES.GEOMETRY, |
|
508 |
selectionColor); |
|
509 |
mapControlManager.setSelectionSymbol(symbol); |
|
510 |
|
|
511 |
// DefaultCADTool.selectionSymbol.setOutlineColor(selectionOutLineColor); |
|
512 |
|
|
513 |
xml.putProperty(DEFAULT_AXIS_REFERENCES_COLOR, |
|
514 |
StringUtilities.color2String(modifyColor)); |
|
515 |
// xml.putProperty(DEFAULT_AXIS_REFERENCES_OUTLINE_COLOR, |
|
516 |
// StringUtilities.color2String(modifyOutLineColor)); |
|
517 |
ISymbol symbol2 = |
|
518 |
symbolManager.createSymbol(Geometry.TYPES.GEOMETRY, modifyColor); |
|
519 |
mapControlManager.setAxisReferenceSymbol(symbol2); |
|
520 |
// DefaultCADTool.axisReferencesSymbol.setOutlineColor(modifyOutLineColor); |
|
521 |
|
|
522 |
xml.putProperty(DEFAULT_RECTANGLE_SELECTION_COLOR, |
|
523 |
StringUtilities.color2String(drawingColor)); |
|
524 |
// xml.putProperty(DEFAULT_GEOMETRY_SELECTION_OUTLINE_COLOR, |
|
525 |
// StringUtilities.color2String(drawingOutLineColor)); |
|
526 |
ISymbol symbol3 = |
|
527 |
symbolManager.createSymbol(Geometry.TYPES.GEOMETRY, |
|
528 |
drawingColor); |
|
529 |
mapControlManager.setGeometrySelectionSymbol(symbol3); |
|
530 |
|
|
531 |
// DefaultCADTool.geometrySelectSymbol.setOutlineColor(drawingOutLineColor); |
|
532 |
|
|
533 |
xml.putProperty(DEFAULT_HANDLER_COLOR, |
|
534 |
StringUtilities.color2String(handlerColor)); |
|
535 |
xml.putProperty(DEFAULT_HANDLER_OUTLINE_COLOR, |
|
536 |
StringUtilities.color2String(handlerOutLineColor)); |
|
537 |
|
|
538 |
ISymbol symbol4 = |
|
539 |
symbolManager.createSymbol(Geometry.TYPES.GEOMETRY, |
|
540 |
handlerColor); |
|
541 |
mapControlManager.setHandlerSymbol(symbol4); |
|
542 |
|
|
543 |
if (mapControlManager.getHandlerSymbol() instanceof ILineSymbol) { |
|
544 |
((ILineSymbol)mapControlManager.getHandlerSymbol()).setLineColor(handlerOutLineColor); |
|
372 |
//Symbol for the geometry used in the edition selection |
|
373 |
ISymbol geometrySelectionSymbol = |
|
374 |
symbolManager.createSymbol(Geometry.TYPES.GEOMETRY, geometrySelectionColor); |
|
375 |
if (geometrySelectionSymbol instanceof IFillSymbol){ |
|
376 |
((IFillSymbol)geometrySelectionSymbol).setFillColor(geometrySelectionColor); |
|
545 | 377 |
} |
378 |
if (geometrySelectionSymbol instanceof ILineSymbol){ |
|
379 |
((ILineSymbol)geometrySelectionSymbol).setLineColor(geometrySelectionColor); |
|
380 |
} |
|
381 |
mapControlManager.setGeometrySelectionSymbol(geometrySelectionSymbol); |
|
382 |
dynObject.setDynValue(DEFAULT_RECTANGLE_SELECTION_SYMBOL, geometrySelectionSymbol); |
|
383 |
|
|
384 |
//Symbol for the handlers |
|
385 |
ISymbol handlerSymbol = |
|
386 |
symbolManager.createSymbol(Geometry.TYPES.GEOMETRY, handlerColor); |
|
387 |
if (axisReferencesSymbol instanceof IFillSymbol){ |
|
388 |
((IFillSymbol)handlerSymbol).setFillColor(handlerColor); |
|
389 |
} |
|
390 |
mapControlManager.setHandlerSymbol(handlerSymbol); |
|
391 |
dynObject.setDynValue(DEFAULT_HANDLER_SYMBOL, handlerSymbol); |
|
546 | 392 |
} |
547 | 393 |
|
548 |
|
|
549 |
public void initializeDefaults() { |
|
550 |
jccDefaultSelectionColor.setColor(Color.ORANGE); |
|
551 |
// jccDefaultSelectionOutLineColor.setColor(Color.ORANGE.darker()); |
|
552 |
jsDefaultSelectionAlpha.setValue(255); |
|
553 |
|
|
394 |
public void initializeDefaults() { |
|
554 | 395 |
jccDefaultAxisReferencesColor.setColor(new Color(100, 100, 100, 100)); |
555 |
// jccDefaultAxisReferencesOutLineColor.setColor(new Color(100, 100, 100, 100).darker()); |
|
556 | 396 |
jsDefaultAxisReferencesAlpha.setValue(100); |
557 | 397 |
|
558 | 398 |
jccDefaultGeometrySelectionColor.setColor(new Color(255, 0,0, 100)); |
559 |
// jccDefaultGeometrySelectionOutLineColor.setColor(new Color(255, 0, 0, 100).darker()); |
|
560 | 399 |
jsDefaultGeometrySelectionAlpha.setValue(100); |
561 | 400 |
|
562 |
jccDefaultHandlerColor.setColor(new Color(255, 0,0, 100)); |
|
563 |
jccDefaultHandlerOutLineColor.setColor(new Color(255, 0, 0, 100).darker()); |
|
401 |
jccDefaultHandlerColor.setColor(new Color(255, 0,0, 100)); |
|
564 | 402 |
jsDefaultHandlerAlpha.setValue(100); |
565 |
|
|
566 | 403 |
} |
567 | 404 |
|
568 | 405 |
public ImageIcon getIcon() { |
Also available in: Unified diff