Class TLcyContourGUIFactory
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
FieldsModifier and TypeFieldDescriptionstatic final intThe ID for creating the action panel.static final intPart ofACTION_PANELthat shows the auto-update component.static final intPart ofACTION_PANELthat shows the create layer button.static final intPart ofACTION_PANELthat shows the update layer button.static final intThe ID for creating the action that creates a new layer.static final intThe ID for creating the input panel.static final intPart ofINPUT_PANELthat shows a description for theTLcyContourAddOn.QUALITY_KEYproperty.static final intPart ofINPUT_PANELthat shows the quality component.static final intThe id for creating the output panel.static final intPart ofOUTPUT_PANELthat shows the output format.static final intThe id for creating the shape panel.static final intPart ofSHAPE_PANELthat shows the shape list for which the contours need to be computed.static final intThe ID for creating the style panel.static final intPart ofSTYLE_PANELthat shows and changes the contour level and color settings, using the propertyTLcyContourAddOn.COLOR_MAP_KEY.static final intPart ofSTYLE_PANELthat shows the level and color settings for unknown contours, using the propertyTLcyContourAddOn.COLOR_MAP_KEY.static final intThe ID for creating the action that computes the contours. -
Constructor Summary
ConstructorsConstructorDescriptionTLcyContourGUIFactory(ILcyLucyEnv aLucyEnv) Default constructor that builds all actions, component and panels. -
Method Summary
Modifier and TypeMethodDescriptionprotected ILcdActioncreateAction(int aID, ALcyProperties aProperties) Creates anILcdActionfor the given ID.protected ILcyActiveSettablecreateActiveSettable(int aActiveSettableID, ALcyProperties aProperties) Creates anILcyActiveSettablefor the given ID.protected ComponentcreateComponent(int aID, ALcyProperties aProperties) Creates a widget for the given ID.protected ComponentcreateGUIContent(ALcyProperties aProperties) Retrieves all panels and lays them out in ajava.awt.Component.protected ComponentcreatePanel(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 "TLcyContourAddOn.layer.tea." are stored for the selected TEA layer (seeTLcyContourAddOn.LINKED_LAYER_KEY), and a new contour calculation starts.This calculation interacts with the back-end as follows:
- an altitude provider is retrieved using the GUI's
TLcyContourAddOn.QUALITY_KEYproperty - a referenced matrix view is created for the map's selected objects, using the GUI's
TLcyContourAddOn.QUALITY_KEYproperty - a contour finder is created and used to insert contours in the linked layer;
the GUI's
TLcyContourAddOn.COLOR_MAP_KEYis used to define the contours
- 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 contours 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 quality of the calculations.- See Also:
-
STYLE_PANEL
public static final int STYLE_PANELThe ID for creating the style panel. The style panel allows to choose the contour levels and colors.- See Also:
-
ACTION_PANEL
public static final int ACTION_PANELThe ID for creating the action panel. It shows the action components.- See Also:
-
SHAPE_PANEL_SHAPE_LIST_COMPONENT
public static final int SHAPE_PANEL_SHAPE_LIST_COMPONENTPart ofSHAPE_PANELthat shows the shape list for which the contours need to be computed. It uses the propertiesTLcyContourAddOn.SHAPE_LIST_KEYandTLcyContourAddOn.SELECTED_SHAPE_KEY, and the coverage's sub-propertyTLcyContourBackEnd.DOMAIN_OBJECT_CONTEXT_KEY.- See Also:
-
INPUT_PANEL_QUALITY_COMPONENT
public static final int INPUT_PANEL_QUALITY_COMPONENTPart ofINPUT_PANELthat shows the quality component. It allows to choose the quality, storing it in theTLcyContourAddOn.QUALITY_KEYproperty. The list to choose from is based on the propertyTLcyContourAddOn.QUALITY_ITEMS_KEY.- See Also:
-
INPUT_PANEL_CURRENT_QUALITY_COMPONENT
public static final int INPUT_PANEL_CURRENT_QUALITY_COMPONENTPart ofINPUT_PANELthat shows a description for theTLcyContourAddOn.QUALITY_KEYproperty. The description is based on the propertyTLcyContourAddOn.QUALITY_DESCRIPTIONS_KEY.- See Also:
-
STYLE_PANEL_COLOR_MAP_COMPONENT
public static final int STYLE_PANEL_COLOR_MAP_COMPONENTPart ofSTYLE_PANELthat shows and changes the contour level and color settings, using the propertyTLcyContourAddOn.COLOR_MAP_KEY.- See Also:
-
STYLE_PANEL_COLOR_UNKNOWN_COMPONENT
public static final int STYLE_PANEL_COLOR_UNKNOWN_COMPONENTPart ofSTYLE_PANELthat shows the level and color settings for unknown contours, using the propertyTLcyContourAddOn.COLOR_MAP_KEY.- See Also:
-
ACTION_PANEL_CREATE_LAYER_COMPONENT
public static final int ACTION_PANEL_CREATE_LAYER_COMPONENTPart ofACTION_PANELthat shows the create layer button. It uses theCREATE_LAYER_ACTIONto create that button.- See Also:
-
ACTION_PANEL_UPDATE_LAYER_COMPONENT
public static final int ACTION_PANEL_UPDATE_LAYER_COMPONENTPart ofACTION_PANELthat shows the update layer button. It uses theUPDATE_LAYER_ACTIONto create that button.- See Also:
-
ACTION_PANEL_AUTO_UPDATE_COMPONENT
public static final int ACTION_PANEL_AUTO_UPDATE_COMPONENTPart ofACTION_PANELthat shows the auto-update component. It uses theUPDATE_LAYER_ACTIONto create that component.- 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:
-
OUTPUT_PANEL_OUTPUT_FORMAT_COMPONENT
public static final int OUTPUT_PANEL_OUTPUT_FORMAT_COMPONENTPart ofOUTPUT_PANELthat shows the output format. It uses theTLcyContourAddOn.OUTPUT_FORMAT_KEYproperty.- See Also:
-
-
Constructor Details
-
TLcyContourGUIFactory
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:
createGUIContentin 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 inTLcyContourAddOn.- Returns:
- the component containing all panels, layed out appropriately.
-
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).- Specified by:
createActionin 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: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).- Specified by:
createActiveSettablein 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:ALcyGUIFactoryCreates 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:
createComponentin 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:ALcyGUIFactoryCreates 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:
createPanelin 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.
-