Package edu.wisc.ssec.mcidasv.ui
Class UIManager.IdvAction
java.lang.Object
edu.wisc.ssec.mcidasv.ui.UIManager.IdvAction
- Enclosing class:
UIManager
Represents an individual IDV action. Should be fairly adaptable to
unforeseen changes from Unidata?
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map
<UIManager.ActionAttribute, String> Mapping of (known) XML attributes to values for this individual action.private final Map
<UIManager.ToolbarStyle, Icon> Simple "cache" for the different icons this action has displayed.private final Element
The XMLElement
that represents this IDV action. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value associated with a givenUIManager.ActionAttribute
for this action.Representation of thisIdvAction
as an "IDV action call".Returns theIcon
associated with this action and the givenUIManager.ToolbarStyle
.getId()
toString()
Returns a brief description of this action.
-
Field Details
-
originalElement
The XMLElement
that represents this IDV action. -
attributes
Mapping of (known) XML attributes to values for this individual action. -
iconCache
Simple "cache" for the different icons this action has displayed. This is "lazy", so the cache does not contain icons forUIManager.ToolbarStyle
s that haven't been used.
-
-
Constructor Details
-
IdvAction
Creates a representation of an IDV action using a givenElement
.- Parameters:
element
- XML representation of an IDV action. Cannot benull
.- Throws:
NullPointerException
- ifelement
isnull
.IllegalArgumentException
- ifelement
is not a valid IDV action.- See Also:
-
-
Method Details
-
getRawIconPath
- Returns:
- Returns the "raw" path to the icon associated with this action. Remember that this is actually a "format string" and should not be considered a valid path!
- See Also:
-
getMenuIcon
- Returns:
- Returns the
Icon
associated withUIManager.ToolbarStyle.SMALL
.
-
getIconForStyle
Returns theIcon
associated with this action and the givenUIManager.ToolbarStyle
.- Parameters:
style
- "Style" of theIcon
to be returned. Cannot benull
.- Returns:
- This action's
Icon
withstyle
"applied." - See Also:
-
getId
- Returns:
- Returns the identifier of this
IdvAction
.
-
getCommand
Representation of thisIdvAction
as an "IDV action call".- Returns:
- String that is suitable to hand off to the IDV for execution.
-
getAttribute
Returns the value associated with a givenUIManager.ActionAttribute
for this action.- Parameters:
attr
- ActionAttribute whose value you want. Cannot benull
.- Returns:
- Value associated with
attr
. - Throws:
NullPointerException
- ifattr
isnull
.
-
getElement
- Returns:
- The XML
Element
used to create thisIdvAction
.
-
toString
Returns a brief description of this action. Please note that the format is subject to change and is not intended for serialization.
-