Interface ILcdAction
- All Superinterfaces:
ActionListener
,EventListener
,ILcdPropertyChangeSource
,Serializable
- All Known Subinterfaces:
ILcyCustomizableRepresentationAction
- All Known Implementing Classes:
ALcdAction
,ALcdActionWrapper
,ALcdKML22ViewFitAction
,ALcdObjectSelectionAction
,ALcyCreateLayersAction
,ALcyObjectSelectionAction
,TLcdBeanEditAction
,TLcdBeanPropertyEditAction
,TLcdDeleteSelectionAction
,TLcdExitAction
,TLcdFitGXYLayerInViewClipAction
,TLcdFitSelectionInViewClipAction
,TLcdGXYSetControllerAction
,TLcdGXYViewFitAction
,TLcdGXYViewPanAction
,TLcdGXYViewZoomAction
,TLcdKML22GXYViewFitAction
,TLcdMoveLayerAction
,TLcdNoopAction
,TLcdOpenAction
,TLcdPrintComponentAction
,TLcdRedoAction
,TLcdRemoveLayerAction
,TLcdSaveAction
,TLcdSaveGXYViewAsGIFAction
,TLcdSetProjectionAction
,TLcdUndoAction
,TLcdUpdateTerrainModelAction
,TLcyCreateGXYLayerAction
,TLcyInterruptTaskAction
,TLcyLspCreateLayerAction
,TLcyStartNewMapComponentAction
,TLspKML22ViewFitAction
,TLspSetControllerAction
An ILcdAction
has a set of key-value pairs associated.
These key-value pairs can be used to build up dynamically a set of
properties of the action.
An ILcdAction
can be associated to zero or more Invokers.
An ILcdAction
is listenable by PropertyChangeListeners (from java.beans).
(refer to existing pattern?)
The class also provides constants that can be used as the storage-retrieval key when setting or getting one of this object's properties (text or icon).
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Useful constants that can be used as the storage-retrieval key when setting or getting one of this object's properties (text or icon).static final String
Constant key for LongDescription property.static final String
Constant key for Name property.static final String
The key used for storing aBoolean
that corresponds to the selected state.static final String
Constant key for ShortDescription property.static final String
Defines if the action would preferably show or hide its action name to the end user.static final String
Constant key for SmallIcon property.static final String
Constant key for the Visible property. -
Method Summary
Modifier and TypeMethodDescriptionReturns one of this object's properties using the associated key.boolean
void
Sets one of this objects properties.void
setEnabled
(boolean b) Sets/tests the enabled state of theILcdAction
.Methods inherited from interface java.awt.event.ActionListener
actionPerformed
Methods inherited from interface com.luciad.util.ILcdPropertyChangeSource
addPropertyChangeListener, removePropertyChangeListener
-
Field Details
-
DEFAULT
Useful constants that can be used as the storage-retrieval key when setting or getting one of this object's properties (text or icon).- See Also:
-
NAME
Constant key for Name property. Its associated value should be of typeString
.- See Also:
-
SHORT_DESCRIPTION
Constant key for ShortDescription property. Its associated value should be of typeString
.- See Also:
-
LONG_DESCRIPTION
Constant key for LongDescription property. Its associated value should be of typeString
.- See Also:
-
SMALL_ICON
Constant key for SmallIcon property. Its associated value should be of typeILcdIcon
.- See Also:
-
VISIBLE
Constant key for the Visible property. Its associated value should be of type
Boolean
.Note that this key is not automatically recognized by Swing. For example, when creating a visual representation for an
ILcdAction
changing the associated value of this key will not affect the Swing component:ILcdAction action = ... JButton button = new JButton( new TLcdSWAction( action ) ); action.putValue( ILcdAction.VISIBLE, false );//by default this will not change //the visibility of button
In Lucy, the
ALcyActionBar
and its extension do respect this property and adjust the visibility of the component representing theILcdAction
. A possible use-case for this property is to create context-sensitive pop-up menu items.- See Also:
-
SHOW_ACTION_NAME
Defines if the action would preferably show or hide its action name to the end user. The value is of type
Boolean
.Note that this key is not automatically recognized by Swing. For example, when creating a visual representation for an
ILcdAction
changing the associated value of this key will not affect the Swing component (see alsoVISIBLE
).In Lucy, the
TLcyToolBar
respects this property. This allows for some actions to show both their icon and text on a tool bar, and for others to only show their icon.TLcyMenuBar
for example ignores this property, and always displays the action name and icon.The default value depends on the particular tool bar implementation.
TLcyToolBar
by default hides all action names, so only displays the icons.- See Also:
-
SELECTED_KEY
The key used for storing aBoolean
that corresponds to the selected state. This is typically used for components with a meaningful selection state, such as a toggle button. This property differs from the others in that it is both read by the component and set by the component. For example,TLcdGXYSetControllerAction
automatically updates the value based on whether its controller is active or not. When developing toggle actions in Lucy, use ALcyActiveSettable instead of ILcdAction.- See Also:
-
-
Method Details
-
getValue
Returns one of this object's properties using the associated key. If the value has changed, aPropertyChangeEvent
will be sent to listeners. -
putValue
Sets one of this objects properties.- Parameters:
key
- one of NAME, SHORT_DESCRIPTION, LONG_DESCRIPTION, SMALL_ICON.value
- the value to be used for this action to display it textually using the name, short description or long description or to display it graphically using the icon. Values for NAME, SHORT_DESCRIPTION and LONG_DESCRIPTION should be String objects, values for SMALL_ICON should be ILcdIcon implementations.
-
setEnabled
void setEnabled(boolean b) Sets/tests the enabled state of theILcdAction
. When enabled, any component associated with this object is active and able to fire this object'sactionPerformed
method. -
isEnabled
boolean isEnabled()
-