public class TLcyDrawingToolBarFactory extends ALcyDrawingToolBarFactory<ILcdGXYView,ILcdGXYLayer>
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).
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 and Description |
---|
TLcyDrawingToolBarFactory(TLcyDrawingAddOn aDrawingAddOn)
private TLcyDrawingAddOn fDrawingAddOn;
/** Constructs a new factory able to create a drawing tool bar which can be used on
ILcyMapComponent 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 |
createActiveSettableForDomainObjectSupplier(ALcyDomainObjectSupplier aDomainObjectSupplier,
ALcyProperties aProperties)
Creates an
ILcyActiveSettable for the given domain object supplier. |
protected TLcyToolBar |
createEmptyToolBar(ALcyProperties aProperties)
Returns an empty toolbar
|
protected ALcdGXYNewControllerModel2 |
createNewControllerModelForDomainObjectSupplier(ALcyDomainObjectSupplier aDomainObjectSupplier,
ALcyProperties aProperties)
Creates an
ALcdGXYNewControllerModel2 for the given
ALcyDomainObjectSupplier . |
protected Object |
getActiveSettableContextForDomainObjectSupplier(ALcyDomainObjectSupplier 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(ALcyDomainObjectSupplier aDomainObjectSupplier)
Returns the
ILcyActiveSettable for the given domain object supplier. |
protected Enumeration<ALcyDomainObjectSupplier> |
getAvailableDomainObjectSuppliers()
Returns an enumeration of all available domain object suppliers.
|
TLcyDrawingAddOn |
getDrawingAddOn()
Returns the drawing add-on
|
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. |
protected ILcyMapComponent |
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 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.
|
createActiveSettable, createComponent, createEmptyToolBar, createGUI, createGUIContent, createPanel, createToolBarID, getActionContext, getActiveSettableContext, getFormatBar, getPropertyPrefix, getToolBar, getToolBarID
getAction, getActionIDs, getActiveSettable, getActiveSettableIDs, getComponent, getComponentIDs, getLucyEnv, getPanel, getPanelIDs, isActiveSettableDeactivatePossible
public TLcyDrawingToolBarFactory(TLcyDrawingAddOn aDrawingAddOn)
ILcyMapComponent
instancesaDrawingAddOn
- the 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<ILcdGXYView,ILcdGXYLayer>
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<ILcdGXYView,ILcdGXYLayer>
aProperties
- a properties object that can be used to tune the behavior of this factory.protected ILcyMapComponent getMapComponent(ALcyProperties aProperties)
ALcyDrawingToolBarFactory
ALcyDrawingToolBarFactory.getMapComponentPropertiesKey()
.getMapComponent
in class ALcyDrawingToolBarFactory<ILcdGXYView,ILcdGXYLayer>
aProperties
- The properties in which to look for a map componentpublic TLcyDrawingAddOn getDrawingAddOn()
protected final String getMapComponentPropertiesKey()
ALcyProperties
passed to the ALcyDrawingToolBarFactory.createGUI(com.luciad.lucy.util.properties.ALcyProperties)
method.getMapComponentPropertiesKey
in class ALcyDrawingToolBarFactory<ILcdGXYView,ILcdGXYLayer>
TLcyDrawingFormat.MAP_COMPONENT_KEY
TLcyDrawingFormat.MAP_COMPONENT_KEY
protected final String getFormatBarPropertiesKey()
ALcyProperties
passed to the ALcyDrawingToolBarFactory.createGUI(com.luciad.lucy.util.properties.ALcyProperties)
method.getFormatBarPropertiesKey
in class ALcyDrawingToolBarFactory<ILcdGXYView,ILcdGXYLayer>
TLcyDrawingFormat.FORMAT_BAR_KEY
TLcyDrawingFormat.FORMAT_BAR_KEY
protected final Enumeration<ALcyDomainObjectSupplier> getAvailableDomainObjectSuppliers()
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<ILcdGXYView,ILcdGXYLayer>
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 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 using getNewControllerModelForDomainObjectSupplier
.
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 ALcdGXYNewControllerModel2 createNewControllerModelForDomainObjectSupplier(ALcyDomainObjectSupplier aDomainObjectSupplier, ALcyProperties aProperties)
ALcdGXYNewControllerModel2
for the given
ALcyDomainObjectSupplier
. This new 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.format.ALcyDomainObjectSupplier,
com.luciad.lucy.util.properties.ALcyProperties)
protected TLcyToolBar createEmptyToolBar(ALcyProperties aProperties)
ALcyDrawingToolBarFactory
createEmptyToolBar
in class ALcyDrawingToolBarFactory<ILcdGXYView,ILcdGXYLayer>
aProperties
- a properties object that can be used to tune the behavior of this factory.protected ALcdGXYNewControllerModel2 getNewControllerModelForDomainObjectSupplier(ALcyDomainObjectSupplier aDomainObjectSupplier)
Returns the new controller model for the given domain object supplier.
aDomainObjectSupplier
- The domain object supplier describing which new controller
model to returnnull
.protected ILcyActiveSettable getActiveSettableForDomainObjectSupplier(ALcyDomainObjectSupplier 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(ALcyDomainObjectSupplier 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)