public class TLcyLOSCoverageGUIFactory 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 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.
ALcyGUIFactory
Modifier and Type | Field and Description |
---|---|
static int |
ACTION_PANEL
The id for creating the action panel.
|
static int |
ACTION_PANEL_AUTO_UPDATE_COMPONENT
Part of
ACTION_PANEL that shows the auto-update
component. |
static int |
ACTION_PANEL_CREATE_LAYER_COMPONENT
Part of
ACTION_PANEL that shows the create layer
button. |
static int |
ACTION_PANEL_UPDATE_LAYER_COMPONENT
Part of
ACTION_PANEL that shows the update layer
button. |
static int |
COVERAGE_PANEL
The id for creating the coverage panel.
|
static int |
COVERAGE_PANEL_COVERAGE_COMPONENT
Part of
COVERAGE_PANEL that shows the settings
for the selected coverage. |
static int |
COVERAGE_PANEL_COVERAGE_LIST_COMPONENT
Part of
COVERAGE_PANEL that shows a list of
coverages that need to be computed. |
static int |
CREATE_LAYER_ACTION
The id for creating the action that creates a new layer.
|
static int |
OUTPUT_PANEL
The id for creating the output panel.
|
static int |
OUTPUT_PANEL_OUTPUT_FORMAT_COMPONENT
Part of
OUTPUT_PANEL that shows the output format
of the line-of-sight results. |
static int |
PROPAGATION_CHOICE_PANEL
The id for creating the propagation choice panel.
|
static int |
PROPAGATION_CHOICE_PANEL_CURRENT_QUALITY_COMPONENT
Part of
PROPAGATION_CHOICE_PANEL that shows a description for the
TLcyLOSCoverageAddOn.QUALITY_KEY property. |
static int |
PROPAGATION_CHOICE_PANEL_PROPAGATION_FUNCTION_COMPONENT
Part of
PROPAGATION_CHOICE_PANEL that shows the
computation mode component. |
static int |
PROPAGATION_CHOICE_PANEL_QUALITY_COMPONENT
Part of
PROPAGATION_CHOICE_PANEL that shows the
quality component. |
static int |
PROPAGATION_SETTINGS_PANEL
The id for creating the propagation settings panel.
|
static int |
PROPAGATION_SETTINGS_PANEL_PROPAGATION_FUNCTION_FIXED_HEIGHT_COMPONENT
Part of
PROPAGATION_CHOICE_PANEL that shows the
settings specific to the fixed height propagation function. |
static int |
PROPAGATION_SETTINGS_PANEL_PROPAGATION_FUNCTION_NORMAL_COMPONENT
Part of
PROPAGATION_CHOICE_PANEL that shows the
settings specific to the normal propagation function. |
static int |
PROPAGATION_SETTINGS_PANEL_PROPAGATION_FUNCTION_SKY_BACKGROUND_COMPONENT
Part of
PROPAGATION_CHOICE_PANEL that shows the
settings specific to the sky-in-background propagation
function. |
static int |
STYLE_PANEL
The id for creating the style panel.
|
static int |
STYLE_PANEL_COLOR_CONE_OF_SILENCE_COMPONENT
Part of
STYLE_PANEL that shows the settings for
line-of-sight results corresponding to the cone of silence. |
static int |
STYLE_PANEL_COLOR_INVISIBLE_COMPONENT
Part of
STYLE_PANEL that shows the settings for
invisible line-of-sight results. |
static int |
STYLE_PANEL_COLOR_MAP_COMPONENT
Part of
STYLE_PANEL that shows the color map for
the line-of-sight results. |
static int |
STYLE_PANEL_COLOR_UNKNOWN_COMPONENT
Part of
STYLE_PANEL that shows the settings for
unknown line-of-sight results. |
static int |
STYLE_PANEL_COLOR_VISIBLE_COMPONENT
Part of
STYLE_PANEL that shows the settings for
visible line-of-sight results. |
static int |
UPDATE_LAYER_ACTION
The ID for creating the action that computes the line-of-sight coverages.
|
Constructor and Description |
---|
TLcyLOSCoverageGUIFactory(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
public static final int UPDATE_LAYER_ACTION
TLcyLOSCoverageAddOn.LINKED_LAYER_KEY
), and a new line-of-sight coverage calculation starts.
This calculation interacts with the back-end as follows:
TLcyLOSCoverageAddOn.SELECTED_COVERAGE_KEY
property's sub-properties
TLcyLOSCoverageAddOn.QUALITY_KEY
property
TLcyLOSCoverageBackEnd.MIN_VERTICAL_ANGLE_KEY
, TLcyLOSCoverageBackEnd.MAX_VERTICAL_ANGLE_KEY
TLcyLOSCoverageAddOn.SELECTED_PROPAGATION_KEY
property and its sub-properties
TLspLOSProperties
is created,
containing ILcdLOSCoverage
properties,
meant to be used by a TLspLOSCalculator
TLcyLOSCoverageAddOn.OUTPUT_FORMAT_KEY
, the factory's TLcdLOSCoverageFactory.createLOSCoverageRaster(com.luciad.tea.ILcdLOSCoverageMatrix, com.luciad.tea.ILcdMatrixRasterValueMapper, com.luciad.reference.ILcdGeoReference, double, com.luciad.tea.TLcdCoverageFillMode)
or TLcdLOSCoverageFactory.createLOSCoverageContours(com.luciad.tea.ILcdLOSCoverageMatrix, com.luciad.reference.ILcdGeoReference, double[])
method is called
public static final int COVERAGE_PANEL
public static final int PROPAGATION_CHOICE_PANEL
public static final int PROPAGATION_SETTINGS_PANEL
public static final int STYLE_PANEL
public static final int OUTPUT_PANEL
public static final int ACTION_PANEL
public static final int COVERAGE_PANEL_COVERAGE_LIST_COMPONENT
COVERAGE_PANEL
that shows a list of
coverages that need to be computed.
It uses the properties TLcyLOSCoverageAddOn.COVERAGE_LIST_KEY
and
TLcyLOSCoverageAddOn.SELECTED_COVERAGE_KEY
, and the coverage's sub-property
TLcyLOSCoverageBackEnd.DOMAIN_OBJECT_CONTEXT_KEY
.public static final int COVERAGE_PANEL_COVERAGE_COMPONENT
COVERAGE_PANEL
that shows the settings
for the selected coverage.
It uses the following coverage sub-properties:
TLcyLOSCoverageBackEnd.LOCATION_KEY
TLcyLOSCoverageBackEnd.ALTITUDE_KEY
TLcyLOSCoverageBackEnd.ALTITUDE_MODE_KEY
TLcyLOSCoverageBackEnd.START_ANGLE_KEY
TLcyLOSCoverageBackEnd.ARC_ANGLE_KEY
TLcyLOSCoverageBackEnd.MAX_RADIUS_KEY
TLcyLOSCoverageBackEnd.MIN_VERTICAL_ANGLE_KEY
TLcyLOSCoverageBackEnd.MAX_VERTICAL_ANGLE_KEY
public static final int PROPAGATION_CHOICE_PANEL_QUALITY_COMPONENT
PROPAGATION_CHOICE_PANEL
that shows the
quality component.
It allows to choose the quality, storing it in the TLcyLOSCoverageAddOn.QUALITY_KEY
property.
The list to choose from is based on the property TLcyLOSCoverageAddOn.QUALITY_ITEMS_KEY
.public static final int PROPAGATION_CHOICE_PANEL_CURRENT_QUALITY_COMPONENT
PROPAGATION_CHOICE_PANEL
that shows a description for the
TLcyLOSCoverageAddOn.QUALITY_KEY
property.
The description is based on the property TLcyLOSCoverageAddOn.QUALITY_DESCRIPTIONS_KEY
.public static final int PROPAGATION_CHOICE_PANEL_PROPAGATION_FUNCTION_COMPONENT
PROPAGATION_CHOICE_PANEL
that shows the
computation mode component.
It uses the TLcyLOSCoverageAddOn.PROPAGATION_LIST_KEY
and
TLcyLOSCoverageAddOn.SELECTED_PROPAGATION_KEY
properties, as well as
TLcyLOSCoverageBackEnd.retrievePropagationFunctionLabel(java.lang.String)
.public static final int PROPAGATION_SETTINGS_PANEL_PROPAGATION_FUNCTION_NORMAL_COMPONENT
PROPAGATION_CHOICE_PANEL
that shows the
settings specific to the normal propagation function.
It uses the selected propagation's TLcyLOSCoverageBackEnd.ALTITUDE_MODE_KEY
sub-property.public static final int PROPAGATION_SETTINGS_PANEL_PROPAGATION_FUNCTION_SKY_BACKGROUND_COMPONENT
PROPAGATION_CHOICE_PANEL
that shows the
settings specific to the sky-in-background propagation
function.
It uses the selected propagation's TLcyLOSCoverageBackEnd.ALTITUDE_MODE_KEY
sub-property.public static final int PROPAGATION_SETTINGS_PANEL_PROPAGATION_FUNCTION_FIXED_HEIGHT_COMPONENT
PROPAGATION_CHOICE_PANEL
that shows the
settings specific to the fixed height propagation function.
It uses the selected propagation's TLcyLOSCoverageBackEnd.FIXED_HEIGHT_KEY
and TLcyLOSCoverageBackEnd.FIXED_HEIGHT_MODE_KEY
sub-properties.public static final int STYLE_PANEL_COLOR_MAP_COMPONENT
STYLE_PANEL
that shows the color map for
the line-of-sight results.
It is propagation function specific.
For the fixed height function, it uses the selected propagation function's "colorMap" sub-property.
For other propagation functions, it uses the "colorMap" sub-property of the selected propagation's
TLcyLOSCoverageBackEnd.ALTITUDE_MODE_KEY
sub-property.
public static final int STYLE_PANEL_COLOR_UNKNOWN_COMPONENT
STYLE_PANEL
that shows the settings for
unknown line-of-sight results.
It is propagation function specific.
For the fixed height function, it uses the selected propagation function's "colorUnknown" sub-property.
For other propagation functions, it uses the "colorUnknown" sub-property of the selected propagation's
TLcyLOSCoverageBackEnd.ALTITUDE_MODE_KEY
sub-property.
public static final int STYLE_PANEL_COLOR_CONE_OF_SILENCE_COMPONENT
STYLE_PANEL
that shows the settings for
line-of-sight results corresponding to the cone of silence.
It is propagation function specific.
For the fixed height function, it uses the selected propagation function's "colorConeOfSilence" sub-property.
For other propagation functions, it uses the "colorConeOfSilence" sub-property of the selected propagation's
TLcyLOSCoverageBackEnd.ALTITUDE_MODE_KEY
sub-property.
public static final int STYLE_PANEL_COLOR_INVISIBLE_COMPONENT
STYLE_PANEL
that shows the settings for
invisible line-of-sight results.
It is propagation function specific.
For the fixed height function, it uses the selected propagation function's "colorInvisible" sub-property.
For other propagation functions, it uses the "colorInvisible" sub-property of the selected propagation's
TLcyLOSCoverageBackEnd.ALTITUDE_MODE_KEY
sub-property.
public static final int STYLE_PANEL_COLOR_VISIBLE_COMPONENT
STYLE_PANEL
that shows the settings for
visible line-of-sight results.
It is propagation function specific.
For the fixed height function, it uses the selected propagation function's "colorVisible" sub-property.
For other propagation functions, it uses the "colorVisible" sub-property of the selected propagation's
TLcyLOSCoverageBackEnd.ALTITUDE_MODE_KEY
sub-property.
public static final int OUTPUT_PANEL_OUTPUT_FORMAT_COMPONENT
OUTPUT_PANEL
that shows the output format
of the line-of-sight results.
It uses the TLcyLOSCoverageAddOn.OUTPUT_FORMAT_KEY
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 static final int ACTION_PANEL_UPDATE_LAYER_COMPONENT
ACTION_PANEL
that shows the update layer
button. It uses the UPDATE_LAYER_ACTION
to create
that button.public static final int ACTION_PANEL_AUTO_UPDATE_COMPONENT
ACTION_PANEL
that shows the auto-update
component. It uses the UPDATE_LAYER_ACTION
to
create that component.public TLcyLOSCoverageGUIFactory(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 TLcyLOSCoverageAddOn
.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.