Class ALcyDrawingToolBarFactory<S extends ILcdView & ILcdTreeLayered,T extends ILcdLayer>
- Type Parameters:
S
- The type of the view used in the map component for which this factory creates a drawing toolbar (ILcdGXYView
for GXY andILspView
for Lightspeed)T
- The type of the layers contained in the view of the map component (ILcdGXYLayer
for GXY andILspLayer
for Lightspeed)
- Direct Known Subclasses:
TLcyDrawingToolBarFactory
,TLcyLspDrawingToolBarFactory
Abstract base class to create the default tool bar for editing a drawing model. It has concrete subclasses for a GXY and a Lightspeed view. It is recommended to extend one of those subclasses directly and not extend from this class.
The tool bar is constructed in the same manner a GUI panel is constructed in an
ALcyGUIFactory
. The main create function createGUI
first creates all actions and active settables, then all the components and finally
all the panels. Then it calls createGUIContent
, which will create the content of the tool bar using the created panels by
calling ALcyGUIFactory.getPanel(int)
.
Each GUI element can be replaced by overriding the respective create* method to return a
custom element for the respective GUI ID. For example, to change the functionality of the load
action, override the createAction
method to return a custom action for the LOAD_ACTION
ID. All the default
IDs are available as public static fields in this class.
Similarly, one can override the createGUIContent
method to produce a customized layout for the GUI elements.
The default actions and active settables can be removed from the tool bar by removing them for the drawing config file.
Adding items to the tool bar can be achieved by overriding the createGUIContent
method,
retrieving the tool bar and inserting actions or components into it.
If items needs to be added from for example another add-on, it might be convenient to use TLcyActionBarUtil
with action bar id DRAWING_TOOL_BAR_ID
.
- Since:
- 2012.1
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Deprecated.static final int
Converts a polyline into a lonlatheightbuffer with a certain width and height.static final int
Converts a polyline into a buffer with a certain width.static final int
Adds or removes arrows at the beginning and/or end of lines.static final int
Changes the fill color of a shape.static final int
Changes the line size of a shape.static final int
Changes the line style of a shape.static final int
Changes the icon used to display points on the mapstatic final int
Copies the style of an object to other objectsstatic final int
Deletes all the selected shapes.static final int
Converts an existing circle into a dome.static final String
The ID of theILcyActionBar
that is created by this factory.static final int
Makes a copy of the selected objects, and pastes every copy in the layer of the original object.static final int
Converts an existing 2D shape into an extruded 3D version with a minimal and maximal altitude.static final int
Deprecated.The component is replaced by an action, which can be configured into anyILcyActionBar
.static final int
Changes the font of text shapes.static final int
Groups the selected shapes, after which they are threaded as one.static final int
Calculates the intersection point(s) between two or more shapes.static final int
Changes the line color of shapes.static final int
Deprecated.The component is replaced by an action, which can be configured into anyILcyActionBar
.static final int
Deprecated.The component is replaced by an action, which can be configured into anyILcyActionBar
.static final int
Loads an external file into Lucy as an editable layer.static final int
The only panel of the drawing toolbar containing all the default components, actions and active settables which are included in the drawing config file.static final int
Adds an extra drawing layer to the map.static final int
Creates a polyline parallel at an existing polyline.static final int
Makes two polylines, containing only two points, perpendicular to each other.static final int
Adds a point at a certain distance from the beginning or the end of an existing polyline.static final int
Deprecated.The component is replaced by an action, which can be configured into anyILcyActionBar
.static final int
Calculates the convex hull of one or more shapes.static final int
Calculates the difference between two or more shapes.static final int
Calculates the intersection between two or more shapes.static final int
Calculates the inverted difference between two or more shapes.static final int
Calculates the symmetric difference between two or more shapes.static final int
Calculates the union between two or more shapes.static final int
Saves a drawing layer to disk.static final int
Converts an existing circle into a sphere.static final int
Translates the selected shapes over a certain distance and azimuth.static final int
Converts an extruded 3D shape into its base shape.static final int
Restores a group of shapes as individual objects.static final int
Converts a polyline into a lonlatheightvariablegeobuffer with a certain width and height. -
Constructor Summary
ModifierConstructorDescriptionprotected
ALcyDrawingToolBarFactory
(String aPropertyPrefix, ILcyLucyEnv aLucyEnv) Constructs a new drawing tool bar factory which will create all actions, active settables, components and panels which are specified in the class as static fields. -
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
createActiveSettable
(int aActiveSettableID, ALcyProperties aProperties) Creates anILcyActiveSettable
for the given ID.protected Component
createComponent
(int aComponentID, ALcyProperties aProperties) Creates a widget for the given ID.protected TLcyToolBar
Deprecated.OverridecreateEmptyToolBar(ALcyProperties)
insteadprotected TLcyToolBar
createEmptyToolBar
(ALcyProperties aProperties) Returns an empty toolbarcreateGUI
(ALcyProperties aProperties) This function callssetup
, which creates all sub-parts such as actions, components and panels.protected Component
createGUIContent
(ALcyProperties aProperties) Retrieves all panels and lays them out in ajava.awt.Component
.protected Component
createPanel
(int aPanelID, ALcyProperties aProperties) Creates a panel for the given ID.protected String
Creates the action bar ID of the drawing tool bar.protected Object
getActionContext
(int aActionID, ALcyProperties aProperties) Returns the context of the action bars in which the action with the specified ID should be inserted.protected Object
getActiveSettableContext
(int aActiveSettableID, ALcyProperties aProperties) Returns the context of the action bars in which the active settable with the specified ID should be inserted.protected ALcyFormatBar
getFormatBar
(ALcyProperties aProperties) Convenience method to return the format bar contained in the properties with keygetFormatBarPropertiesKey()
.protected abstract String
Returns the complete key (including the prefix) which was used to store the format bar in theALcyProperties
passed to thecreateGUI(com.luciad.lucy.util.properties.ALcyProperties)
method.protected ILcyGenericMapComponent
<S, T> getMapComponent
(ALcyProperties aProperties) Convenience method to return the map component contained in the properties with keygetMapComponentPropertiesKey()
.protected abstract String
Returns the complete key (including the prefix) which was used to store the map component in theALcyProperties
passed to thecreateGUI(com.luciad.lucy.util.properties.ALcyProperties)
method.protected final String
Returns the prefix used in the properties as passed in the constructorprotected TLcyToolBar
Returns the tool bar that is under constructionprotected String
Returns the action bar ID of the drawing tool bar, as created bycreateToolBarID()
.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.gui.ALcyGUIFactory
getAction, getActionIDs, getActiveSettable, getActiveSettableIDs, getComponent, getComponentIDs, getLucyEnv, getPanel, getPanelIDs, isActiveSettableDeactivatePossible
-
Field Details
-
DRAWING_TOOL_BAR_ID
The ID of theILcyActionBar
that is created by this factory. The context for this action bar is the map component to which this action bar belongs.- See Also:
-
MAIN_PANEL
public static final int MAIN_PANELThe only panel of the drawing toolbar containing all the default components, actions and active settables which are included in the drawing config file.- See Also:
-
LOAD_ACTION
public static final int LOAD_ACTIONLoads an external file into Lucy as an editable layer.- See Also:
-
SAVE_ACTION
public static final int SAVE_ACTIONSaves a drawing layer to disk.- See Also:
-
LINE_COLOR_ACTION
public static final int LINE_COLOR_ACTIONChanges the line color of shapes.- See Also:
-
FONT_ACTION
public static final int FONT_ACTIONChanges the font of text shapes.- See Also:
-
INTERSECTION_ACTION
public static final int INTERSECTION_ACTIONCalculates the intersection point(s) between two or more shapes.- See Also:
-
POLYGON_INTERSECTION_ACTION
public static final int POLYGON_INTERSECTION_ACTIONCalculates the intersection between two or more shapes. The following shapes are supported:ILcdPoint
ILcdPolypoint
ILcdPolyline
ILcdPolygon
ILcdComplexPolygon
ILcdShapeList
containing any of the supported shapes
- See Also:
-
POLYGON_UNION_ACTION
public static final int POLYGON_UNION_ACTIONCalculates the union between two or more shapes. The following shapes are supported:ILcdPoint
ILcdPolypoint
ILcdPolyline
ILcdPolygon
ILcdComplexPolygon
ILcdShapeList
containing any of the supported shapes
- See Also:
-
PERPENDICULAR_ACTION
public static final int PERPENDICULAR_ACTIONMakes two polylines, containing only two points, perpendicular to each other.- See Also:
-
BUFFER_ACTION
public static final int BUFFER_ACTIONConverts a polyline into a buffer with a certain width.- See Also:
-
BUFFER_3D_ACTION
public static final int BUFFER_3D_ACTIONConverts a polyline into a lonlatheightbuffer with a certain width and height.- See Also:
-
POLYGON_DIFFERENCE_ACTION
public static final int POLYGON_DIFFERENCE_ACTIONCalculates the difference between two or more shapes. The following shapes are supported:ILcdPoint
ILcdPolypoint
ILcdPolyline
ILcdPolygon
ILcdComplexPolygon
ILcdShapeList
containing any of the supported shapes
- See Also:
-
POLYGON_INVERTED_DIFFERENCE_ACTION
public static final int POLYGON_INVERTED_DIFFERENCE_ACTIONCalculates the inverted difference between two or more shapes. The following shapes are supported:ILcdPoint
ILcdPolypoint
ILcdPolyline
ILcdPolygon
ILcdComplexPolygon
ILcdShapeList
containing any of the supported shapes
- See Also:
-
POLYGON_SYMMETRIC_DIFFERENCE_ACTION
public static final int POLYGON_SYMMETRIC_DIFFERENCE_ACTIONCalculates the symmetric difference between two or more shapes. The following shapes are supported:ILcdPoint
ILcdPolypoint
ILcdPolyline
ILcdPolygon
ILcdComplexPolygon
ILcdShapeList
containing any of the supported shapes
- See Also:
-
POLYGON_CONVEX_HULL_ACTION
public static final int POLYGON_CONVEX_HULL_ACTIONCalculates the convex hull of one or more shapes. The following shapes are supported:ILcdPoint
ILcdPolypoint
ILcdPolyline
ILcdPolygon
ILcdComplexPolygon
ILcdShapeList
containing any of the supported shapes
- See Also:
-
VARIABLE_BUFFER_3D_ACTION
public static final int VARIABLE_BUFFER_3D_ACTIONConverts a polyline into a lonlatheightvariablegeobuffer with a certain width and height.- See Also:
-
PARALLEL_ACTION
public static final int PARALLEL_ACTIONCreates a polyline parallel at an existing polyline.- See Also:
-
POINT_ACTION
public static final int POINT_ACTIONAdds a point at a certain distance from the beginning or the end of an existing polyline.- See Also:
-
EXTRUDE_ACTION
public static final int EXTRUDE_ACTIONConverts an existing 2D shape into an extruded 3D version with a minimal and maximal altitude.- See Also:
-
DOME_ACTION
public static final int DOME_ACTIONConverts an existing circle into a dome.- See Also:
-
SPHERE_ACTION
public static final int SPHERE_ACTIONConverts an existing circle into a sphere.- See Also:
-
DELETE_ACTION
public static final int DELETE_ACTIONDeletes all the selected shapes.- See Also:
-
GROUP_ACTION
public static final int GROUP_ACTIONGroups the selected shapes, after which they are threaded as one.- See Also:
-
UNGROUP_ACTION
public static final int UNGROUP_ACTIONRestores a group of shapes as individual objects.- See Also:
-
DUPLICATE_ACTION
public static final int DUPLICATE_ACTIONMakes a copy of the selected objects, and pastes every copy in the layer of the original object.- See Also:
-
NEW_LAYER_ACTION
public static final int NEW_LAYER_ACTIONAdds an extra drawing layer to the map.- See Also:
-
TRANSLATE_ACTION
public static final int TRANSLATE_ACTIONTranslates the selected shapes over a certain distance and azimuth.- See Also:
-
COPY_STYLE_ACTION
public static final int COPY_STYLE_ACTIONCopies the style of an object to other objects- See Also:
-
UNEXTRUDE_ACTION
public static final int UNEXTRUDE_ACTIONConverts an extruded 3D shape into its base shape.- See Also:
-
CHANGE_LINE_SIZE_ACTION
public static final int CHANGE_LINE_SIZE_ACTIONChanges the line size of a shape.- Since:
- 2016.0
- See Also:
-
CHANGE_LINE_STYLE_ACTION
public static final int CHANGE_LINE_STYLE_ACTIONChanges the line style of a shape. For example from a solid line to a dotted one.- Since:
- 2016.0
- See Also:
-
CHANGE_ARROW_STYLE_ACTION
public static final int CHANGE_ARROW_STYLE_ACTIONAdds or removes arrows at the beginning and/or end of lines.- Since:
- 2016.0
- See Also:
-
CHANGE_POINT_STYLE_ACTION
public static final int CHANGE_POINT_STYLE_ACTIONChanges the icon used to display points on the map- Since:
- 2016.0
- See Also:
-
CHANGE_FILL_COLOR_ACTION
public static final int CHANGE_FILL_COLOR_ACTIONChanges the fill color of a shape.- Since:
- 2016.0
- See Also:
-
LINE_SIZE_COMPONENT
Deprecated.The component is replaced by an action, which can be configured into anyILcyActionBar
. SeeCHANGE_LINE_SIZE_ACTION
andcreateAction(int, ALcyProperties)
Changes the line size of a shape.- See Also:
-
LINE_STYLE_COMPONENT
Deprecated.The component is replaced by an action, which can be configured into anyILcyActionBar
. SeeCHANGE_LINE_STYLE_ACTION
andcreateAction(int, ALcyProperties)
Changes the line style of a shape. For example from a solid line to a dotted one.- See Also:
-
ARROW_COMPONENT
Deprecated.The component is replaced by an action, which can be configured into anyILcyActionBar
. SeeCHANGE_ARROW_STYLE_ACTION
andcreateAction(int, ALcyProperties)
Adds or removes arrows at the beginning and/or end of lines.- See Also:
-
POINT_COMPONENT
Deprecated.The component is replaced by an action, which can be configured into anyILcyActionBar
. SeeCHANGE_POINT_STYLE_ACTION
andcreateAction(int, ALcyProperties)
Changes the icon used to display points on the map.- See Also:
-
FILL_COLOR_COMPONENT
Deprecated.The component is replaced by an action, which can be configured into anyILcyActionBar
. SeeCHANGE_FILL_COLOR_ACTION
andcreateAction(int, ALcyProperties)
Changes the fill color of a shape.- See Also:
-
-
Constructor Details
-
ALcyDrawingToolBarFactory
Constructs a new drawing tool bar factory which will create all actions, active settables, components and panels which are specified in the class as static fields.
Use the
get*IDs
methods if you want to modify the available IDs.- Parameters:
aPropertyPrefix
- The prefix which will be used in theALcyProperties
instance passed to thecreateGUI
methodaLucyEnv
- The Lucy back-end
-
-
Method Details
-
getMapComponent
Convenience method to return the map component contained in the properties with keygetMapComponentPropertiesKey()
.- Parameters:
aProperties
- The properties in which to look for a map component- Returns:
- The map component
-
getMapComponentPropertiesKey
Returns the complete key (including the prefix) which was used to store the map component in theALcyProperties
passed to thecreateGUI(com.luciad.lucy.util.properties.ALcyProperties)
method.- Returns:
- the map component property key
-
getFormatBar
Convenience method to return the format bar contained in the properties with keygetFormatBarPropertiesKey()
.- Parameters:
aProperties
- The properties in which to look for a format bar- Returns:
- The format bar
-
getFormatBarPropertiesKey
Returns the complete key (including the prefix) which was used to store the format bar in theALcyProperties
passed to thecreateGUI(com.luciad.lucy.util.properties.ALcyProperties)
method.- Returns:
- the format bar property key
-
getToolBarID
Returns the action bar ID of the drawing tool bar, as created bycreateToolBarID()
.- Returns:
- the action bar ID of the drawing tool bar.
-
createToolBarID
Creates the action bar ID of the drawing tool bar. The action bar ID is used to parse the actions from the configuration file, and is defined as in
TLcyActionBarUtil
.The default implementation returns
DRAWING_TOOL_BAR_ID
.Overriding this method is useful when multiple drawing bars need to be created for a single
ILcyMapComponent
(that for example work on different layers). Multiple bars (for a single map) need different ID's to avoid that their actions get mixed up.- Returns:
- The action bar ID of the tool bar.
-
createGUI
This function- calls
setup
, which creates all sub-parts such as actions, components and panels. - calls
createGUIContent
, which creates the content of the panel by laying out all panels created in the previous step. - calls
cleanup
to perform some cleanup tasks.
The
Component
created in the second step is returned. It is up to the user of this factory to make the returnedComponent
visible in for example anILcyApplicationPane
or a dialog.Warning: There is normally no need to override this method, instead overwrite one of the three methods that it calls. Also note that it is possible that this method is called an a worker thread. If you override it, be sure to call the super function and to invoke any Swing or other EDT dependent code on the EDT thread.
The
ALcyProperties
passed to this method must contain a valid value for themap component properties key
and theformat bar properties key
.- Overrides:
createGUI
in classALcyGUIFactory<Component>
- Parameters:
aProperties
- a properties object that can be used to tune the behavior of this factory.- Returns:
- the GUI, as created by
ALcyGUIFactory.createGUIContent(com.luciad.lucy.util.properties.ALcyProperties)
.
- calls
-
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 classALcyGUIFactory<Component>
- 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 classALcyGUIFactory<Component>
- Parameters:
aProperties
- a properties object that can be used to tune the behavior of this factory.
-
createGUIContent
Description copied from class:ALcyGUIFactory
Retrieves all panels and lays them out in a
java.awt.Component
. Therefore, this method usesALcyGUIFactory.getPanel(int)
with all ID's that end inPANEL
, and lays out those components in for example ajavax.swing.JPanel
.This function should be overridden when the global layout of the panel needs to be changed, for example when the main panels need to be rearranged, or when a new panel needs to be added.
An example implementation could be:
public Component createGUIContent( ALcyProperties aProperties ) { JPanel content = new JPanel( new BorderLayout() ); Component somePanel = getPanel( SOME_PANEL ); if ( somePanel != null ) content.add( somePanel, BorderLayout.NORTH ); Component otherPanel = getPanel( OTHER_PANEL ); if ( otherPanel != null ) content.add( otherPanel, BorderLayout.CENTER ); return content; }
- Specified by:
createGUIContent
in classALcyGUIFactory<Component>
- Parameters:
aProperties
- a properties object that can be used to tune the behavior of this factory.- Returns:
- the component containing all panels, layed out appropriately.
-
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
).- Specified by:
createAction
in classALcyGUIFactory<Component>
- 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:
-
getActionContext
Description copied from class:ALcyGUIFactory
Returns the context of the action bars in which the action with the specified ID should be inserted.
All actions are inserted in the action bars by
TLcyActionBarUtil.insertInConfiguredActionBars(com.luciad.gui.ILcdAction, Object, com.luciad.lucy.gui.TLcyActionBarManager, com.luciad.lucy.util.properties.ALcyProperties)
. This method specifies the context for which the action with IDaActionID
is inserted.By default this method returns
null
.- Overrides:
getActionContext
in classALcyGUIFactory<Component>
- Parameters:
aActionID
- the ID of the action.aProperties
- The properties. Can be used to tune the behavior of this factory.- Returns:
- the context of the action with the specified ID
-
createActiveSettable
protected ILcyActiveSettable createActiveSettable(int aActiveSettableID, ALcyProperties aProperties) Description copied from class: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
).- Specified by:
createActiveSettable
in classALcyGUIFactory<Component>
- 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
.
-
getActiveSettableContext
Description copied from class:ALcyGUIFactory
Returns the context of the action bars in which the active settable with the specified ID should be inserted.
All active settables are inserted in the action bars by
TLcyActionBarUtil#insertInConfiguredActionBars
. This method specifies the context for which the active settable with IDaActiveSettableID
is inserted.By default this method returns
null
.- Overrides:
getActiveSettableContext
in classALcyGUIFactory<Component>
- Parameters:
aActiveSettableID
- the ID of the active settableaProperties
- The properties. Can be used to tune the behavior of this factory.- Returns:
- the context of the active settable with the specified ID.
-
createComponent
Description copied from class:ALcyGUIFactory
Creates a widget for the given ID. It is safe to use the
ALcyGUIFactory.getAction(int)
andALcyGUIFactory.getActiveSettable(int)
methods in this method, to build widgets that use an action or active settable.These widgets might interact with the given properties object, to retrieve or store some state. Such a widget could for example be a check box whose 'selected' state is synchronized with some property.
- Specified by:
createComponent
in classALcyGUIFactory<Component>
- Parameters:
aComponentID
- the ID describing which component to create. This is normally a constant that ends withCOMPONENT
.aProperties
- a properties object that can be used to tune the behavior of this factory. state.- Returns:
- the newly created
java.awt.Component
, or null.
-
createPanel
Description copied from class:ALcyGUIFactory
Creates a panel for the given ID. It is safe to use
ALcyGUIFactory.getComponent(int)
in this method, to build panels that are composed of components.An example implementation could be:
protected Component createPanel( int aPanelID, ALcyProperties aProperties ) { if ( aPanelID == SOME_PANEL ) { JPanel content = new JPanel( new BorderLayout() ); Component someComponent = getComponent( SOME_COMPONENT ); if ( someComponent != null ) content.add( someComponent, BorderLayout.NORTH ); Component otherComponent = getComponent( OTHER_COMPONENT ); if ( otherComponent != null ) content.add( otherComponent, BorderLayout.CENTER ); return content; } else if ( aPanelID == ... ) { ... } }
- Specified by:
createPanel
in classALcyGUIFactory<Component>
- Parameters:
aPanelID
- the ID describing which panel to create. This is normally a constant that ends withPANEL
.aProperties
- a properties object that can be used to tune the behavior of this factory.- Returns:
- the newly created
java.awt.Component
, or null.
-
createEmptyToolBar
Deprecated.OverridecreateEmptyToolBar(ALcyProperties)
insteadReturns an empty tool bar.- Returns:
- an empty tool bar.
-
createEmptyToolBar
Returns an empty toolbar- Parameters:
aProperties
- a properties object that can be used to tune the behavior of this factory.- Returns:
- an empty tool bar
-
getToolBar
Returns the tool bar that is under construction- Returns:
- the tool bar that is under construction
- See Also:
-
getPropertyPrefix
Returns the prefix used in the properties as passed in the constructor- Returns:
- the prefix used in the properties as passed in the constructor
-
ILcyActionBar
.