Class ALcyDrawingSettings<S extends ILcdView & ILcdTreeLayered,T extends ILcdLayer>
- All Implemented Interfaces:
ILcdPropertyChangeSource
- Direct Known Subclasses:
TLcyDrawingSettings
,TLcyLspDrawingSettings
This class provides access to the drawing settings of a drawing layer.
PropertyChangeListener
instances can be registered to this class which will be
notified when the current drawing layer changes.
Typically an instance of this class is retrieved by using the corresponding getter on the
drawing add-on (see TLcyDrawingAddOn#getDrawingSettingsForMap
and TLcyLspDrawingAddOn#getDrawingSettingsForMap
).
- Since:
- 2012.1
-
Constructor Summary
ModifierConstructorDescriptionprotected
ALcyDrawingSettings
(ILcyLucyEnv aLucyEnv) Creates drawing settings based on the lucy environment. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPropertyChangeListener
(PropertyChangeListener aListener) Registers the givenPropertyChangeListener
to be notified when this object's properties change.void
addPropertyChangeListener
(String aProperty, PropertyChangeListener aListener) Adds the given listener to the list of listeners, so that it will receive notifications about changes inaProperty
.protected void
firePropertyChange
(String aProperty, Object aOldValue, Object aNewValue) Fires the given event to the associated listeners.Returns the current active drawing layer.Returns the Lucy environmentvoid
De-registers the givenPropertyChangeListener
from receiving property change events for this object.void
removePropertyChangeListener
(String aProperty, PropertyChangeListener aListener) Removes the given listener for the given property, so that it no longer receives those change events.void
setDrawingLayer
(T aDrawingLayer) Sets the active drawing layer
-
Constructor Details
-
ALcyDrawingSettings
Creates drawing settings based on the lucy environment.
Note: typically you should not create any instances of this class yourself. Retrieve them from the drawing add-ons instead.
- Parameters:
aLucyEnv
- the Lucy environment- See Also:
-
-
Method Details
-
addPropertyChangeListener
Description copied from interface:ILcdPropertyChangeSource
Registers the given
PropertyChangeListener
to be notified when this object's properties change.In case you need to register a listener which keeps a reference to an object with a shorter life-time than this change source, you can use a
ALcdWeakPropertyChangeListener
instance as property change listener.- Specified by:
addPropertyChangeListener
in interfaceILcdPropertyChangeSource
- Parameters:
aListener
- The listener to be notified- See Also:
-
addPropertyChangeListener
Adds the given listener to the list of listeners, so that it will receive notifications about changes inaProperty
.- Parameters:
aProperty
- The property to watch for changes.aListener
- The listener to add.
-
removePropertyChangeListener
Description copied from interface:ILcdPropertyChangeSource
De-registers the given
PropertyChangeListener
from receiving property change events for this object.If the listener was added more than once, it will be notified one less time after being removed. If the listener is
null
, or was never added, no exception is thrown and no action is taken.- Specified by:
removePropertyChangeListener
in interfaceILcdPropertyChangeSource
- Parameters:
aListener
- the listener that should no longer be notified of changes of this object's properties- See Also:
-
removePropertyChangeListener
Removes the given listener for the given property, so that it no longer receives those change events.- Parameters:
aProperty
- The property to stop listening to.aListener
- The listener to remove.
-
firePropertyChange
Fires the given event to the associated listeners.- Parameters:
aProperty
- The property that was changed.aOldValue
- The old value.aNewValue
- The new value.
-
getLucyEnv
Returns the Lucy environment- Returns:
- the Lucy environment
-
getDrawingLayer
Returns the current active drawing layer.- Returns:
- the current active drawing layer. Can be
null
when for example no drawing layers are available.
-
setDrawingLayer
Sets the active drawing layer- Parameters:
aDrawingLayer
- the new active drawing layer. May benull
when no drawing layer is active.
-