Class TLcyVisibilityGUIFactory
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 From shape panel.static final int
Part ofFROM_SHAPE_PANEL
that shows the shape list from which the visibility needs to be computed.static final int
The id for creating the output panel.static final int
Part ofOUTPUT_PANEL
that shows the output format of the visibility results.static final int
The id for creating the propagation choice panel.static final int
Part ofPROPAGATION_CHOICE_PANEL
that shows a description for theTLcyVisibilityAddOn.QUALITY_KEY
property.static final int
Part ofPROPAGATION_CHOICE_PANEL
that shows the computation mode component.static final int
Part ofPROPAGATION_CHOICE_PANEL
that shows the quality component.static final int
The id for creating the propagation settings panel.static final int
Part ofPROPAGATION_CHOICE_PANEL
that shows the settings specific to the normal propagation function.static final int
Part ofPROPAGATION_CHOICE_PANEL
that shows the settings specific to the sky-in-background propagation function.static final int
The id for creating the style panel.static final int
Part ofSTYLE_PANEL
that shows the settings for invisible visibility results.static final int
Part ofSTYLE_PANEL
that shows the settings for unknown visibility results.static final int
Part ofSTYLE_PANEL
that shows the settings for visible visibility results.static final int
The id for creating the Swap shapes panel.static final int
Part ofSWAP_PANEL
that swaps the shapes in the From list with the shapes in the To list.static final int
Part ofSWAP_PANEL
that swaps the shapes in the From list with the shapes in the To list.static final int
Part ofSWAP_PANEL
that swaps the shapes in the From list with the shapes in the To list.static final int
The id for creating the action that swaps the selected shape from the From list to the To list.static final int
The id for creating the action that swaps the selected shape from the To list to the From list.static final int
The id for creating the action that swaps all shapes from the From list to the To list.static final int
The id for creating the To shape panel.static final int
Part ofTO_SHAPE_PANEL
that shows the shape list to which the visibility needs to be computed.static final int
The ID for creating the action that computes the visibility. -
Constructor Summary
ConstructorDescriptionTLcyVisibilityGUIFactory
(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 visibility. When the Update button is pressed, the GUI properties starting with "TLcyVisibilityAddOn.layer.tea." are stored for the selected TEA layer (seeTLcyVisibilityAddOn.LINKED_LAYER_KEY
), and a new visibility calculation starts.This calculation interacts with the back-end as follows:
- a propagation function is created using the
TLcyVisibilityAddOn.SELECTED_PROPAGATION_KEY
property and its sub-properties; - an altitude provider is retrieved using the
TLcyVisibilityAddOn.QUALITY_KEY
property; - the altitude provider and quality value is used to create raster matrix view's of all FROM and TO shapes
in the
TLcyVisibilityAddOn.FROM_SHAPE_LIST_KEY
andTLcyVisibilityAddOn.TO_SHAPE_LIST_KEY
lists; - a visibility descriptor is created;
- a visibility factory is obtained;
- the matrix views, visibility descriptor, altitude provider, quality value and propagation function are used to create a visibility matrix view;
- depending on the
TLcyVisibilityAddOn.OUTPUT_FORMAT_KEY
property,TLcyVisibilityBackEnd.createContourFinder(com.luciad.lucy.util.properties.ALcyProperties)
orTLcyVisibilityBackEnd.createMatrixViewRasterFactory(com.luciad.lucy.util.properties.ALcyProperties)
is called.
- See Also:
- a propagation function is created using the
-
SWAP_SELECTED_FROM_SHAPE_ACTION
public static final int SWAP_SELECTED_FROM_SHAPE_ACTIONThe id for creating the action that swaps the selected shape from the From list to the To list.- See Also:
-
SWAP_SELECTED_TO_SHAPE_ACTION
public static final int SWAP_SELECTED_TO_SHAPE_ACTIONThe id for creating the action that swaps the selected shape from the To list to the From list.- See Also:
-
SWAP_SHAPES_ACTION
public static final int SWAP_SHAPES_ACTIONThe id for creating the action that swaps all shapes from the From list to the To list.- See Also:
-
FROM_SHAPE_PANEL
public static final int FROM_SHAPE_PANELThe id for creating the From shape panel. It allows to choose the shapes from which the visibility needs to be computed.- See Also:
-
TO_SHAPE_PANEL
public static final int TO_SHAPE_PANELThe id for creating the To shape panel. It allows to choose the shapes to which the visibility needs to be computed.- See Also:
-
PROPAGATION_CHOICE_PANEL
public static final int PROPAGATION_CHOICE_PANELThe id for creating the propagation choice panel. It allows to choose the quality and the propagation function.- See Also:
-
PROPAGATION_SETTINGS_PANEL
public static final int PROPAGATION_SETTINGS_PANELThe id for creating the propagation settings panel. It allows to choose the propagation function specific settings.- See Also:
-
STYLE_PANEL
public static final int STYLE_PANELThe id for creating the style panel. It allows to choose the style settings.- See Also:
-
OUTPUT_PANEL
public static final int OUTPUT_PANELThe id for creating the output panel. It allows to choose the output type.- See Also:
-
ACTION_PANEL
public static final int ACTION_PANELThe id for creating the action panel. It shows the action components.- See Also:
-
SWAP_PANEL
public static final int SWAP_PANELThe id for creating the Swap shapes panel. It allows to swap the shapes between the to and from panel.- See Also:
-
FROM_SHAPE_PANEL_SHAPE_LIST_COMPONENT
public static final int FROM_SHAPE_PANEL_SHAPE_LIST_COMPONENTPart ofFROM_SHAPE_PANEL
that shows the shape list from which the visibility needs to be computed. It uses the propertiesTLcyVisibilityAddOn.FROM_SHAPE_LIST_KEY
,TLcyVisibilityAddOn.FROM_SELECTED_SHAPE_KEY
, and the shape's sub-propertyTLcyVisibilityBackEnd.DOMAIN_OBJECT_CONTEXT_KEY
.- See Also:
-
TO_SHAPE_PANEL_SHAPE_LIST_COMPONENT
public static final int TO_SHAPE_PANEL_SHAPE_LIST_COMPONENTPart ofTO_SHAPE_PANEL
that shows the shape list to which the visibility needs to be computed. It uses the propertiesTLcyVisibilityAddOn.TO_SHAPE_LIST_KEY
,TLcyVisibilityAddOn.TO_SELECTED_SHAPE_KEY
, and the shape's sub-propertyTLcyVisibilityBackEnd.DOMAIN_OBJECT_CONTEXT_KEY
.- See Also:
-
PROPAGATION_CHOICE_PANEL_QUALITY_COMPONENT
public static final int PROPAGATION_CHOICE_PANEL_QUALITY_COMPONENTPart ofPROPAGATION_CHOICE_PANEL
that shows the quality component. It allows to choose the quality, storing it in theTLcyVisibilityAddOn.QUALITY_KEY
property. The list to choose from is based on the propertyTLcyVisibilityAddOn.QUALITY_ITEMS_KEY
.- See Also:
-
PROPAGATION_CHOICE_PANEL_CURRENT_QUALITY_COMPONENT
public static final int PROPAGATION_CHOICE_PANEL_CURRENT_QUALITY_COMPONENTPart ofPROPAGATION_CHOICE_PANEL
that shows a description for theTLcyVisibilityAddOn.QUALITY_KEY
property. The description is based on the propertyTLcyVisibilityAddOn.QUALITY_DESCRIPTIONS_KEY
.- See Also:
-
PROPAGATION_CHOICE_PANEL_PROPAGATION_FUNCTION_COMPONENT
public static final int PROPAGATION_CHOICE_PANEL_PROPAGATION_FUNCTION_COMPONENTPart ofPROPAGATION_CHOICE_PANEL
that shows the computation mode component. It uses theTLcyVisibilityAddOn.PROPAGATION_LIST_KEY
andTLcyVisibilityAddOn.SELECTED_PROPAGATION_KEY
properties, as well asTLcyVisibilityBackEnd.retrievePropagationFunctionLabel(java.lang.String)
.- See Also:
-
PROPAGATION_SETTINGS_PROPAGATION_FUNCTION_NORMAL_COMPONENT
public static final int PROPAGATION_SETTINGS_PROPAGATION_FUNCTION_NORMAL_COMPONENTPart ofPROPAGATION_CHOICE_PANEL
that shows the settings specific to the normal propagation function.- See Also:
-
PROPAGATION_SETTINGS_PROPAGATION_FUNCTION_SKY_BACKGROUND_COMPONENT
public static final int PROPAGATION_SETTINGS_PROPAGATION_FUNCTION_SKY_BACKGROUND_COMPONENTPart ofPROPAGATION_CHOICE_PANEL
that shows the settings specific to the sky-in-background propagation function. It uses the selection propagation'sTLcyVisibilityBackEnd.SKY_DISTANCE_KEY
sub-property.- See Also:
-
STYLE_PANEL_COLOR_UNKNOWN_COMPONENT
public static final int STYLE_PANEL_COLOR_UNKNOWN_COMPONENTPart ofSTYLE_PANEL
that shows the settings for unknown visibility results. It uses theTLcyVisibilityAddOn.COLOR_UNKNOWN_KEY
property.- See Also:
-
STYLE_PANEL_COLOR_INVISIBLE_COMPONENT
public static final int STYLE_PANEL_COLOR_INVISIBLE_COMPONENTPart ofSTYLE_PANEL
that shows the settings for invisible visibility results. It uses theTLcyVisibilityAddOn.COLOR_INVISIBLE_KEY
property.- See Also:
-
STYLE_PANEL_COLOR_VISIBLE_COMPONENT
public static final int STYLE_PANEL_COLOR_VISIBLE_COMPONENTPart ofSTYLE_PANEL
that shows the settings for visible visibility results. It uses theTLcyVisibilityAddOn.COLOR_VISIBLE_KEY
property.- See Also:
-
OUTPUT_PANEL_OUTPUT_FORMAT_COMPONENT
public static final int OUTPUT_PANEL_OUTPUT_FORMAT_COMPONENTPart ofOUTPUT_PANEL
that shows the output format of the visibility results. It uses theTLcyVisibilityAddOn.OUTPUT_FORMAT_KEY
property.- 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:
-
SWAP_PANEL_SWAP_SELECTED_FROM_SHAPE_COMPONENT
public static final int SWAP_PANEL_SWAP_SELECTED_FROM_SHAPE_COMPONENTPart ofSWAP_PANEL
that swaps the shapes in the From list with the shapes in the To list. It uses theSWAP_SELECTED_FROM_SHAPE_ACTION
to create that component.- See Also:
-
SWAP_PANEL_SWAP_SELECTED_TO_SHAPE_COMPONENT
public static final int SWAP_PANEL_SWAP_SELECTED_TO_SHAPE_COMPONENTPart ofSWAP_PANEL
that swaps the shapes in the From list with the shapes in the To list. It uses theSWAP_SELECTED_TO_SHAPE_ACTION
to create that component.- See Also:
-
SWAP_PANEL_SWAP_SHAPES_COMPONENT
public static final int SWAP_PANEL_SWAP_SHAPES_COMPONENTPart ofSWAP_PANEL
that swaps the shapes in the From list with the shapes in the To list. It uses theSWAP_SHAPES_ACTION
to create that component.- See Also:
-
-
Constructor Details
-
TLcyVisibilityGUIFactory
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 inTLcyVisibilityAddOn
.- 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.
-