Package edu.wisc.ssec.mcidasv.ui
Class McvToolbarEditor
java.lang.Object
edu.wisc.ssec.mcidasv.ui.McvToolbarEditor
- All Implemented Interfaces:
ActionListener
,EventListener
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
Renders a toolbar action and its icon within theTwoListPanel's
JLists
.private static class
SpaceIcon
is a class that represents a "space" entry in theTwoListPanel
that holds the current toolbar actions. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
Add a "space" entryprivate static final String
action commandprivate static final String
action commandprivate static final String
Action command for reloading the toolbar list with original itemsprivate JComponent
All of the toolbar editor's GUI components.protected static final int
Size of the icons to be shown in theTwoListPanel
.private static final String
private JComboBox
Used to export toolbars to plugin.private JTextField
Used to export toolbars to plugin.private JCheckBox
Used to export toolbars to plugin.private static final String
private static final String
(package private) XmlResourceCollection
The toolbar XML resources.private static final String
ID that represents a "space" in the toolbar.private int
Provides simple IDs for the space entries.private static final String
private static final String
private static final String
private TwoListPanel
The GUI component that stores both available and selected actions.private UIManager
Used to notify the application that a toolbar update should occur.private static final String
Icon used when an action does not have one set (monkey!). -
Constructor Summary
ConstructorsConstructorDescriptionMcvToolbarEditor
(UIManager mngr) Builds a toolbar editor and associates it with theUIManager
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Handles events such as exporting plugins, reloading contents, and adding spaces.boolean
HastwoListPanel
been changed?void
doApply()
Writes out the toolbar xml.private void
Export the actionsprivate void
doExportToMenu
(List<Object> tfos) Export the selected actions as a menu to the plugin manager.protected Icon
getActionIcon
(String actionId) Returns the icon associated withactionId
.private List
<TwoFacedObject> Returns aList
ofTwoFacedObjects
containing all of the actions known to McIDAS-V.Returns theJComponent
that contains all of the toolbar editor's UI components.private List
<TwoFacedObject> getTLP()
Returns theTwoListPanel
being used to store the lists of available and selected actions.private void
init()
Initializes the editor window contents.static boolean
isSpace
(TwoFacedObject tfo) Determines if a given toolbar entry (in the form of aTwoFacedObject
) represents a space.private List
<TwoFacedObject> sortTwoFaced
(List<TwoFacedObject> objs) Sorts aList
ofTwoFacedObjects
by label.
-
Field Details
-
UNKNOWN_ICON
Icon used when an action does not have one set (monkey!).- See Also:
-
ICON_SIZE
Size of the icons to be shown in theTwoListPanel
.- See Also:
-
MENU_PLUGINEXPORT
- See Also:
-
MSG_ENTER_NAME
- See Also:
-
MSG_SELECT_ENTRIES
- See Also:
-
CMD_ADDSPACE
Add a "space" entry- See Also:
-
CMD_RELOAD
Action command for reloading the toolbar list with original items- See Also:
-
CMD_EXPORTPLUGIN
action command- See Also:
-
CMD_EXPORTMENUPLUGIN
action command- See Also:
-
TT_EXPORT_SELECT
- See Also:
-
TT_EXPORT_SELECTMENU
- See Also:
-
TT_OVERWRITE
- See Also:
-
SPACE
ID that represents a "space" in the toolbar.- See Also:
-
spaceCount
Provides simple IDs for the space entries. -
uiManager
Used to notify the application that a toolbar update should occur. -
contents
All of the toolbar editor's GUI components. -
twoListPanel
The GUI component that stores both available and selected actions. -
resources
The toolbar XML resources.
-
-
Constructor Details
-
McvToolbarEditor
Builds a toolbar editor and associates it with theUIManager
.- Parameters:
mngr
- The application's UI Manager.
-
-
Method Details
-
getActionIcon
Returns the icon associated withactionId
. -
isSpace
Determines if a given toolbar entry (in the form of aTwoFacedObject
) represents a space.- Parameters:
tfo
- The entry to test.- Returns:
- Whether or not the entry represents a space.
-
getCurrentToolbar
- Returns:
- Current toolbar contents as action IDs mapped to labels.
-
getAllActions
Returns aList
ofTwoFacedObjects
containing all of the actions known to McIDAS-V. -
getTLP
Returns theTwoListPanel
being used to store the lists of available and selected actions. -
getContents
Returns theJComponent
that contains all of the toolbar editor's UI components. -
init
Initializes the editor window contents. -
doExportToMenu
Export the selected actions as a menu to the plugin manager.- Parameters:
tfos
- selected actions
-
doExport
Export the actions- Parameters:
tfos
- the actions
-
actionPerformed
Handles events such as exporting plugins, reloading contents, and adding spaces.- Specified by:
actionPerformed
in interfaceActionListener
- Parameters:
ae
- The event that invoked this method.
-
anyChanges
HastwoListPanel
been changed?- Returns:
true
if there have been changes,false
otherwise.
-
doApply
Writes out the toolbar xml. -
sortTwoFaced
Sorts a
List
ofTwoFacedObjects
by label. Case is ignored.- Parameters:
objs
- The list that needs some sortin' out.- Returns:
- The sorted contents of
objs
.
-