Class TLcyDrawingToolBarFactory
GXY 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 new 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 new 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 new controller models can be obtained through the getNewControllerModelForDomainObjectSupplier
method and the active settables using getActiveSettableForDomainObjectSupplier
. The new controller modes are created before the active
settables, and the active settables are created before the components (see also the setup
method).
- Since:
- 8.2
- See Also:
-
Field Summary
Fields inherited from class com.luciad.lucy.addons.drawing.gui.ALcyDrawingToolBarFactory
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 Summary
ConstructorDescriptionTLcyDrawingToolBarFactory
(TLcyDrawingAddOn aDrawingAddOn) private TLcyDrawingAddOn fDrawingAddOn; /** Constructs a new factory able to create a drawing tool bar which can be used onILcyMapComponent
instances -
Method Summary
Modifier and TypeMethodDescriptionprotected void
cleanup
(ALcyProperties aProperties) Performs cleanup operations, such as nullifying fields that are no longer needed.protected ILcdAction
createAction
(int aActionID, ALcyProperties aProperties) Creates anILcdAction
for the given ID.protected ILcyActiveSettable
createActiveSettableForDomainObjectSupplier
(ALcyDomainObjectSupplier aDomainObjectSupplier, ALcyProperties aProperties) Creates anILcyActiveSettable
for the given domain object supplier.protected TLcyToolBar
createEmptyToolBar
(ALcyProperties aProperties) Returns an empty toolbarprotected ALcdGXYNewControllerModel2
createNewControllerModelForDomainObjectSupplier
(ALcyDomainObjectSupplier aDomainObjectSupplier, ALcyProperties aProperties) Creates anALcdGXYNewControllerModel2
for the givenALcyDomainObjectSupplier
.protected Object
getActiveSettableContextForDomainObjectSupplier
(ALcyDomainObjectSupplier aDomainObjectSupplier, ALcyProperties aProperties) Returns the context with which the dynamic active settable for the domain object supplieraDomainObjectSupplier
will be inserted in the configured action bars.protected ILcyActiveSettable
getActiveSettableForDomainObjectSupplier
(ALcyDomainObjectSupplier aDomainObjectSupplier) Returns theILcyActiveSettable
for the given domain object supplier.protected final Enumeration
<ALcyDomainObjectSupplier> Returns an enumeration of all available domain object suppliers.Returns the drawing add-onprotected final String
Returns the complete key (including the prefix) which was used to store the format bar in theALcyProperties
passed to theALcyDrawingToolBarFactory.createGUI(com.luciad.lucy.util.properties.ALcyProperties)
method.protected ILcyMapComponent
getMapComponent
(ALcyProperties aProperties) Convenience method to return the map component contained in the properties with keyALcyDrawingToolBarFactory.getMapComponentPropertiesKey()
.protected final String
Returns the complete key (including the prefix) which was used to store the map component in theALcyProperties
passed to theALcyDrawingToolBarFactory.createGUI(com.luciad.lucy.util.properties.ALcyProperties)
method.protected ALcdGXYNewControllerModel2
getNewControllerModelForDomainObjectSupplier
(ALcyDomainObjectSupplier aDomainObjectSupplier) Returns the new controller model for the given domain object supplier.protected void
setup
(ALcyProperties aProperties) This functions creates all the components for the user interface, in a certain order.Methods inherited from class com.luciad.lucy.addons.drawing.gui.ALcyDrawingToolBarFactory
createActiveSettable, createComponent, createEmptyToolBar, createGUI, createGUIContent, createPanel, createToolBarID, getActionContext, getActiveSettableContext, getFormatBar, getPropertyPrefix, getToolBar, getToolBarID
Methods inherited from class com.luciad.lucy.gui.ALcyGUIFactory
getAction, getActionIDs, getActiveSettable, getActiveSettableIDs, getComponent, getComponentIDs, getLucyEnv, getPanel, getPanelIDs, isActiveSettableDeactivatePossible
-
Constructor Details
-
TLcyDrawingToolBarFactory
private TLcyDrawingAddOn fDrawingAddOn; /** Constructs a new factory able to create a drawing tool bar which can be used onILcyMapComponent
instances- Parameters:
aDrawingAddOn
- the drawing add-on
-
-
Method Details
-
setup
Description copied from class:ALcyGUIFactory
This functions creates all the components for the user interface, in a certain order. It
- creates all actions using
createAction
with all given action ID's (seeALcyGUIFactory.getActionIDs()
) and insert them in all configured action bars usingTLcyActionBarUtil.insertInConfiguredActionBars(com.luciad.gui.ILcdAction, Object, TLcyActionBarManager, com.luciad.lucy.util.properties.ALcyProperties)
with the specified properties. The context is determined by callingALcyGUIFactory.getActionContext(int, com.luciad.lucy.util.properties.ALcyProperties)
.
Only actions where the ID_KEY is specified will be inserted (seeTLcyActionBarUtil.ID_KEY
). - creates all active settables
createActiveSettable
with all given active settable ID's (seeALcyGUIFactory.getActiveSettableIDs()
and insert them in all configured action bars usingTLcyActionBarUtil.insertInConfiguredActionBars(ILcyActiveSettable, Object, TLcyActionBarManager, com.luciad.lucy.util.properties.ALcyProperties)
with the specified properties. The context is determined by callingALcyGUIFactory.getActiveSettableContext(int, com.luciad.lucy.util.properties.ALcyProperties)
.
Only active settables where the ID_KEY is specified will be inserted (seeTLcyActionBarUtil.ID_KEY
). - creates all components using
ALcyGUIFactory.createComponent(int, com.luciad.lucy.util.properties.ALcyProperties)
with all given component ID's (seeALcyGUIFactory.getComponentIDs()
). - creates all panels using
ALcyGUIFactory.createPanel(int, com.luciad.lucy.util.properties.ALcyProperties)
with all given panel ID's (seeALcyGUIFactory.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 useALcyGUIFactory.getComponent(int)
to retrieve its sub components, and theALcyGUIFactory.createComponent(int, com.luciad.lucy.util.properties.ALcyProperties)
method can useALcyGUIFactory.getAction(int)
andALcyGUIFactory.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.- Overrides:
setup
in classALcyDrawingToolBarFactory<ILcdGXYView,
ILcdGXYLayer> - Parameters:
aProperties
- a properties object that can be used to tune the behavior of this factory.
- creates all actions using
-
cleanup
Description copied from class:ALcyGUIFactory
Performs cleanup operations, such as nullifying fields that are no longer needed.
Warning: Should not be overridden without calling the super function.
- Overrides:
cleanup
in classALcyDrawingToolBarFactory<ILcdGXYView,
ILcdGXYLayer> - Parameters:
aProperties
- a properties object that can be used to tune the behavior of this factory.
-
getMapComponent
Description copied from class:ALcyDrawingToolBarFactory
Convenience method to return the map component contained in the properties with keyALcyDrawingToolBarFactory.getMapComponentPropertiesKey()
.- Overrides:
getMapComponent
in classALcyDrawingToolBarFactory<ILcdGXYView,
ILcdGXYLayer> - Parameters:
aProperties
- The properties in which to look for a map component- Returns:
- The map component
-
getDrawingAddOn
Returns the drawing add-on- Returns:
- The drawing add-on
-
getMapComponentPropertiesKey
Returns the complete key (including the prefix) which was used to store the map component in theALcyProperties
passed to theALcyDrawingToolBarFactory.createGUI(com.luciad.lucy.util.properties.ALcyProperties)
method.- Specified by:
getMapComponentPropertiesKey
in classALcyDrawingToolBarFactory<ILcdGXYView,
ILcdGXYLayer> - Returns:
TLcyDrawingFormat.MAP_COMPONENT_KEY
- See Also:
-
getFormatBarPropertiesKey
Returns the complete key (including the prefix) which was used to store the format bar in theALcyProperties
passed to theALcyDrawingToolBarFactory.createGUI(com.luciad.lucy.util.properties.ALcyProperties)
method.- Specified by:
getFormatBarPropertiesKey
in classALcyDrawingToolBarFactory<ILcdGXYView,
ILcdGXYLayer> - Returns:
TLcyDrawingFormat.FORMAT_BAR_KEY
- See Also:
-
getAvailableDomainObjectSuppliers
Returns an enumeration of all available domain object suppliers. This enumeration will be used to automatically create active settables which allow to construct new shapes for the domain object suppliers. Consult the class javadoc for more information.- Returns:
- an enumeration of all available domain object suppliers
-
createAction
Description copied from class: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
).- Overrides:
createAction
in classALcyDrawingToolBarFactory<ILcdGXYView,
ILcdGXYLayer> - Parameters:
aActionID
- the ID describing which action to create. This is normally a constant that ends withACTION
.aProperties
- a properties object that can be used to tune the behavior of this factory.- Returns:
- the newly created
ILcdAction
, ornull
. - See Also:
-
createActiveSettableForDomainObjectSupplier
protected ILcyActiveSettable createActiveSettableForDomainObjectSupplier(ALcyDomainObjectSupplier 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 usinggetNewControllerModelForDomainObjectSupplier
.- Parameters:
aDomainObjectSupplier
- The domain object supplier for which to create the active settableaProperties
- The properties. Can be used to tune the behavior of this factory- Returns:
- am
ILcyActiveSettable
for the given domain object supplier. May benull
.
-
createNewControllerModelForDomainObjectSupplier
protected ALcdGXYNewControllerModel2 createNewControllerModelForDomainObjectSupplier(ALcyDomainObjectSupplier aDomainObjectSupplier, ALcyProperties aProperties) Creates anALcdGXYNewControllerModel2
for the givenALcyDomainObjectSupplier
. This new controller model is typically used by the active settable.- Parameters:
aDomainObjectSupplier
- The ALcyDomainObjectSupplier for which to create theALcdGXYNewControllerModel2
.aProperties
- The ALcyProperties containing the configuration of the addon and the ALcyDomainObjectSupplier.- Returns:
- The newly created
ALcdGXYNewControllerModel2
- See Also:
-
createEmptyToolBar
Description copied from class:ALcyDrawingToolBarFactory
Returns an empty toolbar- Overrides:
createEmptyToolBar
in classALcyDrawingToolBarFactory<ILcdGXYView,
ILcdGXYLayer> - Parameters:
aProperties
- a properties object that can be used to tune the behavior of this factory.- Returns:
- an empty tool bar
-
getNewControllerModelForDomainObjectSupplier
protected ALcdGXYNewControllerModel2 getNewControllerModelForDomainObjectSupplier(ALcyDomainObjectSupplier aDomainObjectSupplier) Returns the new controller model for the given domain object supplier.
- Parameters:
aDomainObjectSupplier
- The domain object supplier describing which new controller model to return- Returns:
- the new controller model for the given domain object supplier. Can be
null
.
-
getActiveSettableForDomainObjectSupplier
protected ILcyActiveSettable getActiveSettableForDomainObjectSupplier(ALcyDomainObjectSupplier aDomainObjectSupplier) Returns the
ILcyActiveSettable
for the given domain object supplier.- Parameters:
aDomainObjectSupplier
- The domain object supplier describing whichILcyActiveSettable
to return.- Returns:
- The
ILcyActiveSettable
for the given domain object supplier. Can benull
.
-
getActiveSettableContextForDomainObjectSupplier
protected Object getActiveSettableContextForDomainObjectSupplier(ALcyDomainObjectSupplier aDomainObjectSupplier, ALcyProperties aProperties) Returns the context with which the dynamic active settable for the domain object supplieraDomainObjectSupplier
will be inserted in the configured action bars.- Parameters:
aDomainObjectSupplier
- The domain object supplieraProperties
- The properties. Can be used to tune the behavior of this factory- Returns:
- the context with which the dynamic active settable will be inserted in the configured action bars.
- See Also:
-