public class TLcyHypsometryGUIFactory extends ALcyGUIFactory<Component>
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 create layer action, override the createAction(int, com.luciad.lucy.util.properties.ALcyProperties)
method
to return a custom action for the CREATE_LAYER_ACTION
ID.
Similarly, one can override the createGUIContent method to produce a customized layout for the GUI elements.
ALcyGUIFactory
Modifier and Type | Field and Description |
---|---|
static int |
ACTION_PANEL
The id for creating the action panel.
|
static int |
ACTION_PANEL_CREATE_LAYER_COMPONENT
Part of
ACTION_PANEL that shows the create layer
button. |
static int |
CREATE_LAYER_ACTION
The id for creating the action that creates a new hypsometric layer.
|
static int |
VALUE_PROVIDER_CHOICE_PANEL
The id for creating the value provider choice panel.
|
static int |
VALUE_PROVIDER_CHOICE_PANEL_VALUE_PROVIDER_COMPONENT
Part of
VALUE_PROVIDER_CHOICE_PANEL that shows the
raster type component. |
static int |
VALUE_PROVIDER_SETTINGS_PANEL
The id for creating the value provider settings panel.
|
static int |
VALUE_PROVIDER_SETTINGS_PANEL_VALUE_PROVIDER_ORIENTATION_ANGLE_COMPONENT
Part of
VALUE_PROVIDER_SETTINGS_PANEL that shows the
settings specific to the orientation angle value provider. |
static int |
VALUE_PROVIDER_SETTINGS_PANEL_VALUE_PROVIDER_ORIENTATION_COMPONENT
Part of
VALUE_PROVIDER_SETTINGS_PANEL that shows the
settings specific to the orientation value provider. |
static int |
VALUE_PROVIDER_SETTINGS_PANEL_VALUE_PROVIDER_RIDGE_AND_VALLEY_COMPONENT
Part of
VALUE_PROVIDER_SETTINGS_PANEL that shows the
settings specific to the ridges and valley value provider. |
static int |
VALUE_PROVIDER_SETTINGS_PANEL_VALUE_PROVIDER_RIDGE_COMPONENT
Part of
VALUE_PROVIDER_SETTINGS_PANEL that shows the
settings specific to the ridge value provider. |
static int |
VALUE_PROVIDER_SETTINGS_PANEL_VALUE_PROVIDER_SLOPE_ANGLE_COMPONENT
Part of
VALUE_PROVIDER_SETTINGS_PANEL that shows the
settings specific to the slope angle value provider. |
static int |
VALUE_PROVIDER_SETTINGS_PANEL_VALUE_PROVIDER_SLOPE_COMPONENT
Part of
VALUE_PROVIDER_SETTINGS_PANEL that shows the
settings specific to the slope value provider. |
static int |
VALUE_PROVIDER_SETTINGS_PANEL_VALUE_PROVIDER_VALLEY_COMPONENT
Part of
VALUE_PROVIDER_SETTINGS_PANEL that shows the
settings specific to the valley value provider. |
Constructor and Description |
---|
TLcyHypsometryGUIFactory(ILcyLucyEnv aLucyEnv)
Default constructor that builds all actions, component and panels.
|
Modifier and Type | Method and Description |
---|---|
protected ILcdAction |
createAction(int aID,
ALcyProperties aProperties)
Creates an
ILcdAction for the given ID. |
protected ILcyActiveSettable |
createActiveSettable(int aActiveSettableID,
ALcyProperties aProperties)
Creates an
ILcyActiveSettable 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 a
java.awt.Component . |
protected Component |
createPanel(int aID,
ALcyProperties aProperties)
Creates a panel for the given ID.
|
cleanup, createGUI, getAction, getActionContext, getActionIDs, getActiveSettable, getActiveSettableContext, getActiveSettableIDs, getComponent, getComponentIDs, getLucyEnv, getPanel, getPanelIDs, isActiveSettableDeactivatePossible, setup
public static final int CREATE_LAYER_ACTION
This action interacts with the back-end as follows:
TLcyHypsometryAddon.SELECTED_VALUE_PROVIDER_KEY
.
The corresponding property value is used to retrieve the arguments for the method
TLcyHypsometryBackEnd.createHypsometricValueProvider(com.luciad.lucy.util.properties.ALcyProperties)
.
For example, the normal provider for the slope value provider with the name
TLcyHypsometryBackEnd.HYPSOMETRIC_VALUE_PROVIDER_SLOPE_ID
is retrieved from the property
TLcyHypsometryAddon.SHORT_PREFIX +
TLcyHypsometryBackEnd#HYPSOMETRIC_VALUE_PROVIDER_SLOPE_ID + "." +
TLcyHypsometryBackEnd#HYPSOMETRIC_NORMAL_PROVIDER_KEY.
TLcyHypsometryAddon.SELECTED_ACTION_KEY
property is set the shape action, a new
snapshot layer is created, based on the elevation layers that are visible in the view
and constrained to the currently selected objects.
public static final int VALUE_PROVIDER_CHOICE_PANEL
public static final int VALUE_PROVIDER_SETTINGS_PANEL
public static final int ACTION_PANEL
public static final int VALUE_PROVIDER_CHOICE_PANEL_VALUE_PROVIDER_COMPONENT
VALUE_PROVIDER_CHOICE_PANEL
that shows the
raster type component.
It uses the TLcyHypsometryAddon.VALUE_PROVIDER_LIST_KEY
property.public static final int VALUE_PROVIDER_SETTINGS_PANEL_VALUE_PROVIDER_SLOPE_COMPONENT
VALUE_PROVIDER_SETTINGS_PANEL
that shows the
settings specific to the slope value provider.
It uses the following sub-properties of the slope value provider:
public static final int VALUE_PROVIDER_SETTINGS_PANEL_VALUE_PROVIDER_SLOPE_ANGLE_COMPONENT
VALUE_PROVIDER_SETTINGS_PANEL
that shows the
settings specific to the slope angle value provider.
It uses the following sub-properties of the slope angle value provider:
public static final int VALUE_PROVIDER_SETTINGS_PANEL_VALUE_PROVIDER_ORIENTATION_COMPONENT
VALUE_PROVIDER_SETTINGS_PANEL
that shows the
settings specific to the orientation value provider.
It uses the following sub-properties of the orientation value provider:
public static final int VALUE_PROVIDER_SETTINGS_PANEL_VALUE_PROVIDER_ORIENTATION_ANGLE_COMPONENT
VALUE_PROVIDER_SETTINGS_PANEL
that shows the
settings specific to the orientation angle value provider.
It uses the following sub-properties of the orientation angle value provider:
public static final int VALUE_PROVIDER_SETTINGS_PANEL_VALUE_PROVIDER_RIDGE_COMPONENT
VALUE_PROVIDER_SETTINGS_PANEL
that shows the
settings specific to the ridge value provider.
It uses the value provider's TLcyHypsometryBackEnd.HYPSOMETRIC_NORMAL_PROVIDER_KEY
sub-property.public static final int VALUE_PROVIDER_SETTINGS_PANEL_VALUE_PROVIDER_VALLEY_COMPONENT
VALUE_PROVIDER_SETTINGS_PANEL
that shows the
settings specific to the valley value provider.
It uses the value provider's TLcyHypsometryBackEnd.HYPSOMETRIC_NORMAL_PROVIDER_KEY
sub-property.public static final int VALUE_PROVIDER_SETTINGS_PANEL_VALUE_PROVIDER_RIDGE_AND_VALLEY_COMPONENT
VALUE_PROVIDER_SETTINGS_PANEL
that shows the
settings specific to the ridges and valley value provider.
It uses the value provider's TLcyHypsometryBackEnd.HYPSOMETRIC_NORMAL_PROVIDER_KEY
sub-property.public static final int ACTION_PANEL_CREATE_LAYER_COMPONENT
ACTION_PANEL
that shows the create layer
button. It uses the CREATE_LAYER_ACTION
to create
that button.public TLcyHypsometryGUIFactory(ILcyLucyEnv aLucyEnv)
aLucyEnv
- the Lucy environment in which the GUI will be builtprotected Component createGUIContent(ALcyProperties aProperties)
Retrieves all panels and lays them out in a java.awt.Component
. Therefore, this
method uses ALcyGUIFactory.getPanel(int)
with all ID's that end in PANEL
, and lays out
those components in for example a javax.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;
}
createGUIContent
in class ALcyGUIFactory<Component>
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 in TLcyHypsometryAddon
.protected ILcdAction createAction(int aID, 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 ALcyGUIFactory<Component>
aID
- 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 createActiveSettable(int aActiveSettableID, ALcyProperties aProperties)
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
).
createActiveSettable
in class ALcyGUIFactory<Component>
aActiveSettableID
- the ID describing which active settable to create. This is normally a
constant that ends with ACTIVE_SETTABLE
.aProperties
- a properties object that can be used to tune the behavior of this
factory.ILcyActiveSettable
, or null
.protected Component createComponent(int aID, ALcyProperties aProperties)
ALcyGUIFactory
Creates a widget for the given ID. It is safe to use the ALcyGUIFactory.getAction(int)
and ALcyGUIFactory.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.
createComponent
in class ALcyGUIFactory<Component>
aID
- the ID describing which component to create. This is normally a constant
that ends with COMPONENT
.aProperties
- a properties object that can be used to tune the behavior of this factory.
state.java.awt.Component
, or null.protected Component createPanel(int aID, ALcyProperties aProperties)
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 == ... ) {
...
}
}
createPanel
in class ALcyGUIFactory<Component>
aID
- the ID describing which panel to create. This is normally a constant that
ends with PANEL
.aProperties
- a properties object that can be used to tune the behavior of this factory.java.awt.Component
, or null.