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 classRenders a toolbar action and its icon within theTwoListPanel'sJLists.private static classSpaceIconis a class that represents a "space" entry in theTwoListPanelthat holds the current toolbar actions. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final StringAdd a "space" entryprivate static final Stringaction commandprivate static final Stringaction commandprivate static final StringAction command for reloading the toolbar list with original itemsprivate JComponentAll of the toolbar editor's GUI components.protected static final intSize of the icons to be shown in theTwoListPanel.private static final Stringprivate JComboBoxUsed to export toolbars to plugin.private JTextFieldUsed to export toolbars to plugin.private JCheckBoxUsed to export toolbars to plugin.private static final Stringprivate static final String(package private) XmlResourceCollectionThe toolbar XML resources.private static final StringID that represents a "space" in the toolbar.private intProvides simple IDs for the space entries.private static final Stringprivate static final Stringprivate static final Stringprivate TwoListPanelThe GUI component that stores both available and selected actions.private UIManagerUsed to notify the application that a toolbar update should occur.private static final StringIcon 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 TypeMethodDescriptionvoidHandles events such as exporting plugins, reloading contents, and adding spaces.booleanHastwoListPanelbeen changed?voiddoApply()Writes out the toolbar xml.private voidExport the actionsprivate voiddoExportToMenu(List<Object> tfos) Export the selected actions as a menu to the plugin manager.protected IcongetActionIcon(String actionId) Returns the icon associated withactionId.private List<TwoFacedObject> Returns aListofTwoFacedObjectscontaining all of the actions known to McIDAS-V.Returns theJComponentthat contains all of the toolbar editor's UI components.private List<TwoFacedObject> getTLP()Returns theTwoListPanelbeing used to store the lists of available and selected actions.private voidinit()Initializes the editor window contents.static booleanisSpace(TwoFacedObject tfo) Determines if a given toolbar entry (in the form of aTwoFacedObject) represents a space.private List<TwoFacedObject> sortTwoFaced(List<TwoFacedObject> objs) Sorts aListofTwoFacedObjectsby 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 aListofTwoFacedObjectscontaining all of the actions known to McIDAS-V. -
getTLP
Returns theTwoListPanelbeing used to store the lists of available and selected actions. -
getContents
Returns theJComponentthat 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:
actionPerformedin interfaceActionListener- Parameters:
ae- The event that invoked this method.
-
anyChanges
HastwoListPanelbeen changed?- Returns:
trueif there have been changes,falseotherwise.
-
doApply
Writes out the toolbar xml. -
sortTwoFaced
Sorts a
ListofTwoFacedObjectsby label. Case is ignored.- Parameters:
objs- The list that needs some sortin' out.- Returns:
- The sorted contents of
objs.
-