Class TLcyLspDrawingToolBarFactory
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).
- Since:
- 2012.1
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDetermines terrain-follow behavior.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
ConstructorsConstructorDescriptionTLcyLspDrawingToolBarFactory(TLcyLspDrawingAddOn aLspDrawingAddOn) Constructs a new factory able to create a drawing tool bar which can be use onILcyLspMapComponentinstances. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcleanup(ALcyProperties aProperties) Performs cleanup operations, such as nullifying fields that are no longer needed.protected ILcdActioncreateAction(int aActionID, ALcyProperties aProperties) Creates anILcdActionfor the given ID.protected ILcyActiveSettablecreateActiveSettable(int aActiveSettableID, ALcyProperties aProperties) Creates anILcyActiveSettablefor the given ID.protected ILcyActiveSettablecreateActiveSettableForDomainObjectSupplier(ALcyLspDomainObjectSupplier aDomainObjectSupplier, ALcyProperties aProperties) Creates anILcyActiveSettablefor the given domain object supplier.protected ALspCreateControllerModelcreateCreateControllerModelForDomainObjectSupplier(ALcyLspDomainObjectSupplier aDomainObjectSupplier, ALcyProperties aProperties) Creates anALspCreateControllerModelfor the givenALcyLspDomainObjectSupplier.protected ObjectgetActiveSettableContextForDomainObjectSupplier(ALcyLspDomainObjectSupplier aDomainObjectSupplier, ALcyProperties aProperties) Returns the context with which the dynamic active settable for the domain object supplieraDomainObjectSupplierwill be inserted in the configured action bars.protected ILcyActiveSettablegetActiveSettableForDomainObjectSupplier(ALcyLspDomainObjectSupplier aDomainObjectSupplier) Returns theILcyActiveSettablefor the given domain object supplier.protected final Enumeration<ALcyLspDomainObjectSupplier> Returns an enumeration of all available domain object suppliers.protected final ALspCreateControllerModelgetCreateControllerModelForDomainObjectSupplier(ALcyLspDomainObjectSupplier aDomainObjectSupplier) Returns theALspCreateControllerModelfor the givenALcyLspDomainObjectSupplier.protected final StringReturns the complete key (including the prefix) which was used to store the format bar in theALcyPropertiespassed to theALcyDrawingToolBarFactory.createGUI(com.luciad.lucy.util.properties.ALcyProperties)method.final TLcyLspDrawingAddOnReturns the Lightspeed drawing add-onprotected ILcyLspMapComponentgetMapComponent(ALcyProperties aProperties) Convenience method to return the map component contained in the properties with keyALcyDrawingToolBarFactory.getMapComponentPropertiesKey().protected final StringReturns the complete key (including the prefix) which was used to store the map component in theALcyPropertiespassed to theALcyDrawingToolBarFactory.createGUI(com.luciad.lucy.util.properties.ALcyProperties)method.protected voidsetup(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
createComponent, createEmptyToolBar, createEmptyToolBar, createGUI, createGUIContent, createPanel, createToolBarID, getActionContext, getActiveSettableContext, getFormatBar, getPropertyPrefix, getToolBar, getToolBarIDMethods inherited from class com.luciad.lucy.gui.ALcyGUIFactory
getAction, getActionIDs, getActiveSettable, getActiveSettableIDs, getComponent, getComponentIDs, getLucyEnv, getPanel, getPanelIDs, isActiveSettableDeactivatePossible
-
Field Details
-
TERRAIN_FOLLOW_ACTIVE_SETTABLE
public static final int TERRAIN_FOLLOW_ACTIVE_SETTABLEDetermines terrain-follow behavior. If this active settable is active, interactive shape translations retain the height above the terrain. For example, if you drag a point with height H from a location with height Z1 to a location with height Z2, the new height will be H - Z1 + Z2.- See Also:
-
-
Constructor Details
-
TLcyLspDrawingToolBarFactory
Constructs a new factory able to create a drawing tool bar which can be use onILcyLspMapComponentinstances.- Parameters:
aLspDrawingAddOn- The Lightspeed drawing add-on
-
-
Method Details
-
setup
Description copied from class:ALcyGUIFactoryThis functions creates all the components for the user interface, in a certain order. It
- creates all actions using
createActionwith 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
createActiveSettablewith 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:
setupin classALcyDrawingToolBarFactory<ILspView,ILspLayer> - 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:ALcyGUIFactoryPerforms cleanup operations, such as nullifying fields that are no longer needed.
Warning: Should not be overridden without calling the super function.
- Overrides:
cleanupin classALcyDrawingToolBarFactory<ILspView,ILspLayer> - Parameters:
aProperties- a properties object that can be used to tune the behavior of this factory.
-
getMapComponent
Description copied from class:ALcyDrawingToolBarFactoryConvenience method to return the map component contained in the properties with keyALcyDrawingToolBarFactory.getMapComponentPropertiesKey().- Overrides:
getMapComponentin classALcyDrawingToolBarFactory<ILspView,ILspLayer> - Parameters:
aProperties- The properties in which to look for a map component- Returns:
- The map component
-
getLspDrawingAddOn
Returns the Lightspeed drawing add-on- Returns:
- the Lightspeed drawing add-on
-
getMapComponentPropertiesKey
Returns the complete key (including the prefix) which was used to store the map component in theALcyPropertiespassed to theALcyDrawingToolBarFactory.createGUI(com.luciad.lucy.util.properties.ALcyProperties)method.- Specified by:
getMapComponentPropertiesKeyin classALcyDrawingToolBarFactory<ILspView,ILspLayer> - Returns:
TLcyLspDrawingFormat.MAP_COMPONENT_KEY- See Also:
-
getFormatBarPropertiesKey
Returns the complete key (including the prefix) which was used to store the format bar in theALcyPropertiespassed to theALcyDrawingToolBarFactory.createGUI(com.luciad.lucy.util.properties.ALcyProperties)method.- Specified by:
getFormatBarPropertiesKeyin classALcyDrawingToolBarFactory<ILspView,ILspLayer> - Returns:
TLcyLspDrawingFormat.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
-
createActiveSettable
protected ILcyActiveSettable createActiveSettable(int aActiveSettableID, ALcyProperties aProperties) Description copied from class:ALcyGUIFactoryCreates an
ILcyActiveSettablefor 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).- Overrides:
createActiveSettablein classALcyDrawingToolBarFactory<ILspView,ILspLayer> - Parameters:
aActiveSettableID- the ID describing which active settable to create. This is normally a constant that ends withACTIVE_SETTABLE.aProperties- a properties object that can be used to tune the behavior of this factory.- Returns:
- the newly created
ILcyActiveSettable, ornull.
-
getCreateControllerModelForDomainObjectSupplier
protected final ALspCreateControllerModel getCreateControllerModelForDomainObjectSupplier(ALcyLspDomainObjectSupplier aDomainObjectSupplier) Returns the
ALspCreateControllerModelfor the givenALcyLspDomainObjectSupplier.- Parameters:
aDomainObjectSupplier- TheALcyLspDomainObjectSupplierdescribing whichALspCreateControllerModelto return- Returns:
- The
ALspCreateControllerModelfor the givenALcyLspDomainObjectSupplier.
-
createCreateControllerModelForDomainObjectSupplier
protected ALspCreateControllerModel createCreateControllerModelForDomainObjectSupplier(ALcyLspDomainObjectSupplier aDomainObjectSupplier, ALcyProperties aProperties) Creates anALspCreateControllerModelfor the givenALcyLspDomainObjectSupplier. This create 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:
-
createActiveSettableForDomainObjectSupplier
protected ILcyActiveSettable createActiveSettableForDomainObjectSupplier(ALcyLspDomainObjectSupplier aDomainObjectSupplier, ALcyProperties aProperties) Creates an
ILcyActiveSettablefor the given domain object supplier. Typically, the active settable is based on the create controller model which can be retrieved usinggetCreateControllerModelForDomainObjectSupplier.- 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
ILcyActiveSettablefor the given domain object supplier. May benull.
-
createAction
Description copied from class:ALcyGUIFactoryCreates an
ILcdActionfor 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:
createActionin classALcyDrawingToolBarFactory<ILspView,ILspLayer> - 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:
-
getActiveSettableForDomainObjectSupplier
protected ILcyActiveSettable getActiveSettableForDomainObjectSupplier(ALcyLspDomainObjectSupplier aDomainObjectSupplier) Returns the
ILcyActiveSettablefor the given domain object supplier.- Parameters:
aDomainObjectSupplier- The domain object supplier describing whichILcyActiveSettableto return.- Returns:
- The
ILcyActiveSettablefor the given domain object supplier. Can benull.
-
getActiveSettableContextForDomainObjectSupplier
protected Object getActiveSettableContextForDomainObjectSupplier(ALcyLspDomainObjectSupplier aDomainObjectSupplier, ALcyProperties aProperties) Returns the context with which the dynamic active settable for the domain object supplieraDomainObjectSupplierwill 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:
-