|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.wisc.ssec.mcidasv.ui.McvToolbarEditor
public class McvToolbarEditor
Nested Class Summary | |
---|---|
private static class |
McvToolbarEditor.IconCellRenderer
Renders a toolbar action and its icon within the TwoListPanel 's
JList s. |
private static class |
McvToolbarEditor.SpaceIcon
SpaceIcon is a class that represents a "space" entry
in the TwoListPanel that holds the current toolbar actions. |
Field Summary | |
---|---|
private static String |
CMD_ADDSPACE
Add a "space" entry |
private static String |
CMD_EXPORTMENUPLUGIN
action command |
private static String |
CMD_EXPORTPLUGIN
action command |
private static String |
CMD_RELOAD
Action command for reloading the toolbar list with original items |
private JComponent |
contents
All of the toolbar editor's GUI components. |
protected static int |
ICON_SIZE
Size of the icons to be shown in the TwoListPanel . |
private static String |
MENU_PLUGINEXPORT
|
private JComboBox |
menuIdBox
Used to export toolbars to plugin. |
private JTextField |
menuNameFld
Used to export toolbars to plugin. |
private JCheckBox |
menuOverwriteCbx
Used to export toolbars to plugin. |
private static String |
MSG_ENTER_NAME
|
private static String |
MSG_SELECT_ENTRIES
|
(package private) XmlResourceCollection |
resources
The toolbar XML resources. |
private static String |
SPACE
ID that represents a "space" in the toolbar. |
private int |
spaceCount
Provides simple IDs for the space entries. |
private static String |
TT_EXPORT_SELECT
|
private static String |
TT_EXPORT_SELECTMENU
|
private static String |
TT_OVERWRITE
|
private TwoListPanel |
twoListPanel
The GUI component that stores both available and selected actions. |
private UIManager |
uiManager
Used to notify the application that a toolbar update should occur. |
Constructor Summary | |
---|---|
McvToolbarEditor(UIManager mngr)
Builds a toolbar editor and associates it with the UIManager . |
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent ae)
Handles events such as exporting plugins, reloading contents, and adding spaces. |
boolean |
anyChanges()
Has twoListPanel been changed? |
void |
doApply()
Writes out the toolbar xml. |
private void |
doExport(Object[] tfos)
Export the actions |
private void |
doExportToMenu(Object[] tfos)
Export the selected actions as a menu to the plugin manager. |
protected Icon |
getActionIcon(String actionId)
Returns the icon associated with actionId . |
private List<TwoFacedObject> |
getAllActions()
Returns a List of TwoFacedObject s containing all of the
actions known to McIDAS-V. |
JComponent |
getContents()
Returns the JComponent that contains all of the toolbar editor's
UI components. |
private List<TwoFacedObject> |
getCurrentToolbar()
|
TwoListPanel |
getTLP()
Returns the TwoListPanel 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 a TwoFacedObject ) represents a space. |
private List<TwoFacedObject> |
sortTwoFaced(List<TwoFacedObject> objs)
Sorts a List of
TwoFacedObject s by label. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int ICON_SIZE
TwoListPanel
.
private static final String MENU_PLUGINEXPORT
private static final String MSG_ENTER_NAME
private static final String MSG_SELECT_ENTRIES
private static final String CMD_ADDSPACE
private static final String CMD_RELOAD
private static final String CMD_EXPORTPLUGIN
private static final String CMD_EXPORTMENUPLUGIN
private static final String TT_EXPORT_SELECT
private static final String TT_EXPORT_SELECTMENU
private static final String TT_OVERWRITE
private static final String SPACE
private int spaceCount
private UIManager uiManager
private JComponent contents
private TwoListPanel twoListPanel
XmlResourceCollection resources
private JTextField menuNameFld
private JComboBox menuIdBox
private JCheckBox menuOverwriteCbx
Constructor Detail |
---|
public McvToolbarEditor(UIManager mngr)
UIManager
.
mngr
- The application's UI Manager.Method Detail |
---|
protected Icon getActionIcon(String actionId)
actionId
.
public static boolean isSpace(TwoFacedObject tfo)
TwoFacedObject
) represents a space.
tfo
- The entry to test.
private List<TwoFacedObject> getCurrentToolbar()
private List<TwoFacedObject> getAllActions()
List
of TwoFacedObject
s containing all of the
actions known to McIDAS-V.
public TwoListPanel getTLP()
TwoListPanel
being used to store
the lists of available and selected actions.
public JComponent getContents()
JComponent
that contains all of the toolbar editor's
UI components.
private void init()
private void doExportToMenu(Object[] tfos)
tfos
- selected actionsprivate void doExport(Object[] tfos)
tfos
- the actionspublic void actionPerformed(ActionEvent ae)
actionPerformed
in interface ActionListener
ae
- The event that invoked this method.public boolean anyChanges()
twoListPanel
been changed?
true
if there have been changes, false
otherwise.public void doApply()
private List<TwoFacedObject> sortTwoFaced(List<TwoFacedObject> objs)
Sorts a List
of
TwoFacedObject
s by label. Case is ignored.
objs
- The list that needs some sortin' out.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |