public class TLcyLspDrawingToolBarFactory extends ALcyDrawingToolBarFactory<ILspView,ILspLayer>
Lightspeed version of the ALcyDrawingToolBarFactory
.
Consult the class javadoc of that class for more information about the customization options of this class.
This class also creates create controller models and matching active settables for each of the domain object suppliers registered to the drawing format. The active settable allows to activate the create controller through the UI, providing the Lucy end-user with the ability to draw new shapes on the map.The active settable is only added to the tool bar if this is indicated in the configuration.
The create controller models can be obtained through the getCreateControllerModelForDomainObjectSupplier
method and the active settables using getActiveSettableForDomainObjectSupplier
. The create controller modes are created before the
active settables, and the active settables are created before the components (see also the setup
method).
ALcyDrawingToolBarFactory
Modifier and Type | Field and Description |
---|---|
static int |
TERRAIN_FOLLOW_ACTIVE_SETTABLE
Determines terrain-follow behavior.
|
ARROW_COMPONENT, BUFFER_3D_ACTION, BUFFER_ACTION, CHANGE_ARROW_STYLE_ACTION, CHANGE_FILL_COLOR_ACTION, CHANGE_LINE_SIZE_ACTION, CHANGE_LINE_STYLE_ACTION, CHANGE_POINT_STYLE_ACTION, COPY_STYLE_ACTION, DELETE_ACTION, DOME_ACTION, DRAWING_TOOL_BAR_ID, DUPLICATE_ACTION, EXTRUDE_ACTION, FILL_COLOR_COMPONENT, FONT_ACTION, GROUP_ACTION, INTERSECTION_ACTION, LINE_COLOR_ACTION, LINE_SIZE_COMPONENT, LINE_STYLE_COMPONENT, LOAD_ACTION, MAIN_PANEL, NEW_LAYER_ACTION, PARALLEL_ACTION, PERPENDICULAR_ACTION, POINT_ACTION, POINT_COMPONENT, POLYGON_CONVEX_HULL_ACTION, POLYGON_DIFFERENCE_ACTION, POLYGON_INTERSECTION_ACTION, POLYGON_INVERTED_DIFFERENCE_ACTION, POLYGON_SYMMETRIC_DIFFERENCE_ACTION, POLYGON_UNION_ACTION, SAVE_ACTION, SPHERE_ACTION, TRANSLATE_ACTION, UNEXTRUDE_ACTION, UNGROUP_ACTION, VARIABLE_BUFFER_3D_ACTION
Constructor and Description |
---|
TLcyLspDrawingToolBarFactory(TLcyLspDrawingAddOn aLspDrawingAddOn)
Constructs a new factory able to create a drawing tool bar which can be use on
ILcyLspMapComponent instances. |
Modifier and Type | Method and Description |
---|---|
protected void |
cleanup(ALcyProperties aProperties)
Performs cleanup operations, such as nullifying fields that are no longer needed.
|
protected ILcdAction |
createAction(int aActionID,
ALcyProperties aProperties)
Creates an
ILcdAction for the given ID. |
protected ILcyActiveSettable |
createActiveSettable(int aActiveSettableID,
ALcyProperties aProperties)
Creates an
ILcyActiveSettable for the given ID. |
protected ILcyActiveSettable |
createActiveSettableForDomainObjectSupplier(ALcyLspDomainObjectSupplier aDomainObjectSupplier,
ALcyProperties aProperties)
Creates an
ILcyActiveSettable for the given domain object supplier. |
protected ALspCreateControllerModel |
createCreateControllerModelForDomainObjectSupplier(ALcyLspDomainObjectSupplier aDomainObjectSupplier,
ALcyProperties aProperties)
Creates an
ALspCreateControllerModel for the given ALcyLspDomainObjectSupplier . |
protected Object |
getActiveSettableContextForDomainObjectSupplier(ALcyLspDomainObjectSupplier aDomainObjectSupplier,
ALcyProperties aProperties)
Returns the context with which the dynamic active settable for the domain object supplier
aDomainObjectSupplier will be inserted in the configured action bars. |
protected ILcyActiveSettable |
getActiveSettableForDomainObjectSupplier(ALcyLspDomainObjectSupplier aDomainObjectSupplier)
Returns the
ILcyActiveSettable for the given domain object supplier. |
protected Enumeration<ALcyLspDomainObjectSupplier> |
getAvailableDomainObjectSuppliers()
Returns an enumeration of all available domain object suppliers.
|
protected ALspCreateControllerModel |
getCreateControllerModelForDomainObjectSupplier(ALcyLspDomainObjectSupplier aDomainObjectSupplier)
Returns the
ALspCreateControllerModel for the given ALcyLspDomainObjectSupplier . |
protected String |
getFormatBarPropertiesKey()
Returns the complete key (including the prefix) which was used to store the format bar in the
ALcyProperties passed to the ALcyDrawingToolBarFactory.createGUI(com.luciad.lucy.util.properties.ALcyProperties)
method. |
TLcyLspDrawingAddOn |
getLspDrawingAddOn()
Returns the Lightspeed drawing add-on
|
protected ILcyLspMapComponent |
getMapComponent(ALcyProperties aProperties)
Convenience method to return the map component contained in the properties with key
ALcyDrawingToolBarFactory.getMapComponentPropertiesKey() . |
protected String |
getMapComponentPropertiesKey()
Returns the complete key (including the prefix) which was used to store the map component in
the
ALcyProperties passed to the ALcyDrawingToolBarFactory.createGUI(com.luciad.lucy.util.properties.ALcyProperties)
method. |
protected void |
setup(ALcyProperties aProperties)
This functions creates all the components for the user interface, in a certain order.
|
createComponent, createEmptyToolBar, createEmptyToolBar, createGUI, createGUIContent, createPanel, createToolBarID, getActionContext, getActiveSettableContext, getFormatBar, getPropertyPrefix, getToolBar, getToolBarID
getAction, getActionIDs, getActiveSettable, getActiveSettableIDs, getComponent, getComponentIDs, getLucyEnv, getPanel, getPanelIDs, isActiveSettableDeactivatePossible
public static final int TERRAIN_FOLLOW_ACTIVE_SETTABLE
public TLcyLspDrawingToolBarFactory(TLcyLspDrawingAddOn aLspDrawingAddOn)
ILcyLspMapComponent
instances.aLspDrawingAddOn
- The Lightspeed drawing add-onprotected void setup(ALcyProperties aProperties)
ALcyGUIFactory
This functions creates all the components for the user interface, in a certain order. It
createAction
with all given action ID's (see
ALcyGUIFactory.getActionIDs()
) and insert them in all configured action bars using TLcyActionBarUtil.insertInConfiguredActionBars(com.luciad.gui.ILcdAction,
Object, TLcyActionBarManager, com.luciad.lucy.util.properties.ALcyProperties)
with the
specified properties. The context is determined by calling ALcyGUIFactory.getActionContext(int, com.luciad.lucy.util.properties.ALcyProperties)
. TLcyActionBarUtil.ID_KEY
).createActiveSettable
with all
given active settable ID's (see ALcyGUIFactory.getActiveSettableIDs()
and insert them in all
configured action bars using TLcyActionBarUtil.insertInConfiguredActionBars(ILcyActiveSettable,
Object, TLcyActionBarManager, com.luciad.lucy.util.properties.ALcyProperties)
with the
specified properties. The context is determined by calling ALcyGUIFactory.getActiveSettableContext(int, com.luciad.lucy.util.properties.ALcyProperties)
.TLcyActionBarUtil.ID_KEY
).ALcyGUIFactory.createComponent(int, com.luciad.lucy.util.properties.ALcyProperties)
with all given component ID's (see
ALcyGUIFactory.getComponentIDs()
).ALcyGUIFactory.createPanel(int, com.luciad.lucy.util.properties.ALcyProperties)
with all given panel ID's (see ALcyGUIFactory.getPanelIDs()
). Note that because of this order, panels can be composed of components, and components can
use the active settables and actions. So the ALcyGUIFactory.createPanel(int, com.luciad.lucy.util.properties.ALcyProperties)
method can use ALcyGUIFactory.getComponent(int)
to retrieve its sub components, and the ALcyGUIFactory.createComponent(int, com.luciad.lucy.util.properties.ALcyProperties)
method can use
ALcyGUIFactory.getAction(int)
and ALcyGUIFactory.getActiveSettable(int)
to retrieve needed actions and active
settables.
Warning: It is possible that this method is called on a worker thread. When
overriding this method, care should be taken to ensure that all code that should be run on the
EDT thread (Swing code etc...) is invoked using for example TLcdAWTUtil.invokeAndWait(java.lang.Runnable)
.
Also, don't override this method without calling the super function.
setup
in class ALcyDrawingToolBarFactory<ILspView,ILspLayer>
aProperties
- a properties object that can be used to tune the behavior of this factory.protected void cleanup(ALcyProperties aProperties)
ALcyGUIFactory
Performs cleanup operations, such as nullifying fields that are no longer needed.
Warning: Should not be overridden without calling the super function.
cleanup
in class ALcyDrawingToolBarFactory<ILspView,ILspLayer>
aProperties
- a properties object that can be used to tune the behavior of this factory.protected ILcyLspMapComponent getMapComponent(ALcyProperties aProperties)
ALcyDrawingToolBarFactory
ALcyDrawingToolBarFactory.getMapComponentPropertiesKey()
.getMapComponent
in class ALcyDrawingToolBarFactory<ILspView,ILspLayer>
aProperties
- The properties in which to look for a map componentpublic final TLcyLspDrawingAddOn getLspDrawingAddOn()
protected final String getMapComponentPropertiesKey()
ALcyProperties
passed to the ALcyDrawingToolBarFactory.createGUI(com.luciad.lucy.util.properties.ALcyProperties)
method.getMapComponentPropertiesKey
in class ALcyDrawingToolBarFactory<ILspView,ILspLayer>
TLcyLspDrawingFormat.MAP_COMPONENT_KEY
TLcyLspDrawingFormat.MAP_COMPONENT_KEY
protected final String getFormatBarPropertiesKey()
ALcyProperties
passed to the ALcyDrawingToolBarFactory.createGUI(com.luciad.lucy.util.properties.ALcyProperties)
method.getFormatBarPropertiesKey
in class ALcyDrawingToolBarFactory<ILspView,ILspLayer>
TLcyLspDrawingFormat.FORMAT_BAR_KEY
TLcyLspDrawingFormat.FORMAT_BAR_KEY
protected final Enumeration<ALcyLspDomainObjectSupplier> getAvailableDomainObjectSuppliers()
protected ILcyActiveSettable createActiveSettable(int aActiveSettableID, ALcyProperties aProperties)
ALcyGUIFactory
Creates an ILcyActiveSettable
for the given ID.
Note: if the active settable should be inserted in the configured action bars, the ID_KEY of
the returned active settable must be set (see TLcyActionBarUtil.ID_KEY
).
createActiveSettable
in class ALcyDrawingToolBarFactory<ILspView,ILspLayer>
aActiveSettableID
- the ID describing which active settable to create. This is normally a
constant that ends with ACTIVE_SETTABLE
.aProperties
- a properties object that can be used to tune the behavior of this
factory.ILcyActiveSettable
, or null
.protected final ALspCreateControllerModel getCreateControllerModelForDomainObjectSupplier(ALcyLspDomainObjectSupplier aDomainObjectSupplier)
Returns the ALspCreateControllerModel
for the given ALcyLspDomainObjectSupplier
.
aDomainObjectSupplier
- The ALcyLspDomainObjectSupplier
describing which ALspCreateControllerModel
to returnALspCreateControllerModel
for the given ALcyLspDomainObjectSupplier
.protected ALspCreateControllerModel createCreateControllerModelForDomainObjectSupplier(ALcyLspDomainObjectSupplier aDomainObjectSupplier, ALcyProperties aProperties)
ALspCreateControllerModel
for the given ALcyLspDomainObjectSupplier
.
This create controller model is typically used by the active settable.aDomainObjectSupplier
- The ALcyDomainObjectSupplier for which to create the
ALcdGXYNewControllerModel2
.aProperties
- The ALcyProperties containing the configuration of the addon and
the ALcyDomainObjectSupplier.ALcdGXYNewControllerModel2
createActiveSettableForDomainObjectSupplier(com.luciad.lucy.addons.drawing.lightspeed.ALcyLspDomainObjectSupplier,
com.luciad.lucy.util.properties.ALcyProperties)
protected ILcyActiveSettable createActiveSettableForDomainObjectSupplier(ALcyLspDomainObjectSupplier aDomainObjectSupplier, ALcyProperties aProperties)
Creates an ILcyActiveSettable
for the given domain object supplier. Typically, the
active settable is based on the create controller model which can be retrieved using getCreateControllerModelForDomainObjectSupplier
.
aDomainObjectSupplier
- The domain object supplier for which to create the active
settableaProperties
- The properties. Can be used to tune the behavior of this factoryILcyActiveSettable
for the given domain object supplier. May be null
.protected ILcdAction createAction(int aActionID, ALcyProperties aProperties)
ALcyGUIFactory
Creates an ILcdAction
for the given ID.
Note: if the action should be inserted in the configured action bars, the ID_KEY of the
returned action must be set (see TLcyActionBarUtil.ID_KEY
).
createAction
in class ALcyDrawingToolBarFactory<ILspView,ILspLayer>
aActionID
- the ID describing which action to create. This is normally a constant that
ends with ACTION
.aProperties
- a properties object that can be used to tune the behavior of this factory.ILcdAction
, or null
.ALcyGUIFactory.setup(com.luciad.lucy.util.properties.ALcyProperties)
protected ILcyActiveSettable getActiveSettableForDomainObjectSupplier(ALcyLspDomainObjectSupplier aDomainObjectSupplier)
Returns the ILcyActiveSettable
for the given domain object supplier.
aDomainObjectSupplier
- The domain object supplier describing which ILcyActiveSettable
to return.ILcyActiveSettable
for the given domain object supplier. Can be null
.protected Object getActiveSettableContextForDomainObjectSupplier(ALcyLspDomainObjectSupplier aDomainObjectSupplier, ALcyProperties aProperties)
aDomainObjectSupplier
will be inserted in the configured action bars.aDomainObjectSupplier
- The domain object supplieraProperties
- The properties. Can be used to tune the behavior of this factoryALcyDrawingToolBarFactory.getActiveSettableContext(int, com.luciad.lucy.util.properties.ALcyProperties)