Class TLcyExtremePointGUIFactory
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 layer update action, override the createAction(int, com.luciad.lucy.util.properties.ALcyProperties)
method
to return a custom action for the UPDATE_LAYER_ACTION
ID.
Similarly, one can override the createGUIContent method to produce a customized layout for the GUI elements.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The id for creating the action panel.static final int
Part ofACTION_PANEL
that shows the auto-update component.static final int
Part ofACTION_PANEL
that shows the create layer button.static final int
Part ofACTION_PANEL
that shows the update layer button.static final int
The id for creating the action that creates a new layer.static final int
The id for creating the input panel.static final int
Part ofINPUT_PANEL
that shows a description for theTLcyExtremePointAddOn.QUALITY_KEY
property.static final int
Part ofINPUT_PANEL
that shows the extreme point count component.static final int
Part ofINPUT_PANEL
that shows the extreme point mode component.static final int
Part ofINPUT_PANEL
that shows the quality component.static final int
Part ofINPUT_PANEL
that shows the separation distance component.static final int
Part ofINPUT_PANEL
that shows the separation height component.static final int
The id for creating the shape panel.static final int
Part ofSHAPE_PANEL
that shows the shape list for which the extreme points need to be computed.static final int
The id for creating the action that computes the contours. -
Constructor Summary
ConstructorDescriptionTLcyExtremePointGUIFactory
(ILcyLucyEnv aLucyEnv) Default constructor that builds all actions, component and panels. -
Method Summary
Modifier and TypeMethodDescriptionprotected ILcdAction
createAction
(int aID, 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 aID, ALcyProperties aProperties) Creates a widget for the given ID.protected Component
createGUIContent
(ALcyProperties aProperties) Retrieves all panels and lays them out in ajava.awt.Component
.protected Component
createPanel
(int aID, ALcyProperties aProperties) Creates a panel for the given ID.Methods inherited from class com.luciad.lucy.gui.ALcyGUIFactory
cleanup, createGUI, getAction, getActionContext, getActionIDs, getActiveSettable, getActiveSettableContext, getActiveSettableIDs, getComponent, getComponentIDs, getLucyEnv, getPanel, getPanelIDs, isActiveSettableDeactivatePossible, setup
-
Field Details
-
CREATE_LAYER_ACTION
public static final int CREATE_LAYER_ACTIONThe id for creating the action that creates a new layer.- See Also:
-
UPDATE_LAYER_ACTION
public static final int UPDATE_LAYER_ACTIONThe id for creating the action that computes the contours. When the Update button is pressed, the GUI properties starting with "TLcyExtremePointAddOn.layer.tea." are stored for the selected TEA layer (seeTLcyExtremePointAddOn.LINKED_LAYER_KEY
), and a new extreme point calculation starts.This calculation interacts with the back-end as follows:
- an altitude provider is retrieved using the GUI's
TLcyExtremePointAddOn.QUALITY_KEY
property - a referenced matrix view is created for the map's selected objects, using the GUI's
TLcyExtremePointAddOn.QUALITY_KEY
property - an extreme point finder is created and used to insert the extreme points in the linked layer.
- See Also:
- an altitude provider is retrieved using the GUI's
-
SHAPE_PANEL
public static final int SHAPE_PANELThe id for creating the shape panel. It allows to choose the shapes for which the extreme points need to be computed.- See Also:
-
INPUT_PANEL
public static final int INPUT_PANELThe id for creating the input panel. The input panel allows to choose the quality and the extreme point calculation settings.- See Also:
-
ACTION_PANEL
public static final int ACTION_PANELThe id for creating the action panel. The action panel shows the action components.- See Also:
-
SHAPE_PANEL_SHAPE_LIST_COMPONENT
public static final int SHAPE_PANEL_SHAPE_LIST_COMPONENTPart ofSHAPE_PANEL
that shows the shape list for which the extreme points need to be computed. It uses the propertiesTLcyExtremePointAddOn.SHAPE_LIST_KEY
andTLcyExtremePointAddOn.SELECTED_SHAPE_KEY
, and the coverage's sub-propertyTLcyExtremePointBackEnd.DOMAIN_OBJECT_CONTEXT_KEY
.- See Also:
-
INPUT_PANEL_EXTREME_POINT_MODE_COMPONENT
public static final int INPUT_PANEL_EXTREME_POINT_MODE_COMPONENTPart ofINPUT_PANEL
that shows the extreme point mode component. It uses theTLcyExtremePointAddOn.EXTREME_POINT_MODE_KEY
property.- See Also:
-
INPUT_PANEL_EXTREME_POINT_COUNT_COMPONENT
public static final int INPUT_PANEL_EXTREME_POINT_COUNT_COMPONENTPart ofINPUT_PANEL
that shows the extreme point count component. It uses theTLcyExtremePointAddOn.EXTREME_POINT_COUNT_KEY
property.- See Also:
-
INPUT_PANEL_QUALITY_COMPONENT
public static final int INPUT_PANEL_QUALITY_COMPONENTPart ofINPUT_PANEL
that shows the quality component. It allows to choose the quality, storing it in theTLcyExtremePointAddOn.QUALITY_KEY
property. The list to choose from is based on the propertyTLcyExtremePointAddOn.QUALITY_ITEMS_KEY
.- See Also:
-
INPUT_PANEL_CURRENT_QUALITY_COMPONENT
public static final int INPUT_PANEL_CURRENT_QUALITY_COMPONENTPart ofINPUT_PANEL
that shows a description for theTLcyExtremePointAddOn.QUALITY_KEY
property. The description is based on the propertyTLcyExtremePointAddOn.QUALITY_DESCRIPTIONS_KEY
.- See Also:
-
INPUT_PANEL_SEPARATION_HEIGHT_COMPONENT
public static final int INPUT_PANEL_SEPARATION_HEIGHT_COMPONENTPart ofINPUT_PANEL
that shows the separation height component. The separation value uses the propertyTLcyExtremePointAddOn.SEPARATION_HEIGHT_KEY
.- See Also:
-
INPUT_PANEL_SEPARATION_DISTANCE_COMPONENT
public static final int INPUT_PANEL_SEPARATION_DISTANCE_COMPONENTPart ofINPUT_PANEL
that shows the separation distance component. The separation value uses the propertyTLcyExtremePointAddOn.SEPARATION_DISTANCE_KEY
.- See Also:
-
ACTION_PANEL_CREATE_LAYER_COMPONENT
public static final int ACTION_PANEL_CREATE_LAYER_COMPONENTPart ofACTION_PANEL
that shows the create layer button. It uses theCREATE_LAYER_ACTION
to create that button.- See Also:
-
ACTION_PANEL_UPDATE_LAYER_COMPONENT
public static final int ACTION_PANEL_UPDATE_LAYER_COMPONENTPart ofACTION_PANEL
that shows the update layer button. It uses theUPDATE_LAYER_ACTION
to create that button.- See Also:
-
ACTION_PANEL_AUTO_UPDATE_COMPONENT
public static final int ACTION_PANEL_AUTO_UPDATE_COMPONENTPart ofACTION_PANEL
that shows the auto-update component. It uses theUPDATE_LAYER_ACTION
to create that component.- See Also:
-
-
Constructor Details
-
TLcyExtremePointGUIFactory
Default constructor that builds all actions, component and panels.- Parameters:
aLucyEnv
- the Lucy environment in which the GUI will be built
-
-
Method Details
-
createGUIContent
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
- properties that define the default preferences and values of the GUI elements. The properties are also changed by the GUI elements, according to the property names defined inTLcyExtremePointAddOn
.- 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:
aID
- 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:
-
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
.
-
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:
aID
- 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:
aID
- 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.
-