|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.ucsb.nceas.morpho.framework.UIController
The UIController handles the state of the morpho menu and toolbars so that they are synchronized across the various plugins. This is a singleton class because only one instance is ever needed. Plugins that need a new frame for a window should call UIController.newWindow(). The single instance of UIController can be obtained statically using getInstance().
Field Summary | |
static java.lang.String |
MENU_PATH
|
static java.lang.String |
PULL_RIGHT_MENU
|
static java.lang.String |
SEPARATOR_FOLLOWING
|
static java.lang.String |
SEPARATOR_PRECEDING
|
static java.lang.String |
YES
|
Method Summary | |
void |
addGuiAction(GUIAction action)
Add a menu item and optionally a toolbar button by registering an instance of GUIAction. |
MorphoFrame |
addHiddenWindow(java.lang.String windowName)
|
MorphoFrame |
addWindow(java.lang.String windowName)
This method is called by plugins to get a new window that is an instance of MorphoFrame. |
AbstractDataPackage |
getCurrentAbstractDataPackage()
get AbstractDataPackage from currently active window |
MorphoFrame |
getCurrentActiveWindow()
get currently active window |
AbstractDataPackage |
getCurrentExistingAbstractDataPackage()
get AbstractDataPackage from currently active window. |
static GUIAction |
getGUIActionCloneUsedByMorphoFrame(GUIAction action,
MorphoFrame frame)
This method can be used if you have the original GUIAction instance and want to get the existing clone of it that was put into a particular MorphoFrame by UIController. |
static UIController |
getInstance()
Get the single instance of the UIController, creating it if needed. |
static Morpho |
getMorpho()
get Morpho |
static MorphoFrame |
getMorphoFrameContainingGUIAction(GUIAction clone)
return the MorphoFrame that contains the GUIAction clone provided |
static UIController |
initialize(Morpho morpho)
Initialize the single instance of the UIController, creating it if needed. |
boolean |
isWizardRunning()
called by DataPackageWizardPlugin whenever wizard starts running, and is passed a temporary AbstractDataPackage that is used to store wizard data (for references use) - this ADP will be returned by any calls to getCurrentAbstractDataPackage() while the wizard is running |
void |
launchEditorAtSubtreeForCurrentFrame(java.lang.String subtreeRootNodeName,
int subtreeRootIndex)
launches the XML tree editor, rooted at the subtree node denoted by the passed string and index, to edit the datapackage associated with the current MorphoFrame |
void |
refreshWindows()
refresh all visible the windows that are in the windowList. |
void |
removeAllWindows()
Method to remove all windows in window list |
java.util.Vector |
removeCleanWindows()
|
void |
removeGuiAction(GUIAction action)
Remove a menu item and its toolbar button for a particular instance of GUIAction. |
void |
removeWindow(MorphoFrame window)
This method is called to de-register a Window that the plugin has created. |
void |
setCurrentActiveWindow(MorphoFrame window)
set currently active window |
void |
setWizardIsRunning(AbstractDataPackage tempDataPackage)
called by DataPackageWizardPlugin whenever wizard starts running, and is passed a temporary AbstractDataPackage that is used to store wizard data (for references use) - this ADP will be returned by any calls to getCurrentAbstractDataPackage() while the wizard is running. |
void |
setWizardNotRunning()
called by DataPackageWizardPlugin whenever wizard starts running, and is passed a temporary AbstractDataPackage that is used to store wizard data (for references use) - this ADP will be returned by any calls to getCurrentAbstractDataPackage() while the wizard is running. |
static void |
showNewPackage(AbstractDataPackage adp)
method to display the new package after changes have been made |
static void |
showNewPackageNoLocChange(AbstractDataPackage adp)
method to display the new package after changes have been made with no change in location |
void |
updateAllStatusBars()
updates status bar in response to changes in connection parameters |
void |
updateWindow(MorphoFrame window,
java.lang.String title)
This method is called by plugins to update window that is an instance of MorphoFrame. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String SEPARATOR_PRECEDING
public static final java.lang.String SEPARATOR_FOLLOWING
public static final java.lang.String PULL_RIGHT_MENU
public static final java.lang.String YES
public static final java.lang.String MENU_PATH
Method Detail |
public static UIController initialize(Morpho morpho)
morpho
- Morpho
public static UIController getInstance()
public MorphoFrame addWindow(java.lang.String windowName)
windowName
- the initial title for the window
public MorphoFrame addHiddenWindow(java.lang.String windowName)
public void updateWindow(MorphoFrame window, java.lang.String title)
window
- the window will be given new nametitle
- the new name will give to windowpublic void removeWindow(MorphoFrame window)
window
- the window to be removed from the frameworkpublic void removeAllWindows()
public java.util.Vector removeCleanWindows()
public void addGuiAction(GUIAction action)
action
- the GUIAction instance describing the menu itempublic void removeGuiAction(GUIAction action)
action
- the GUIAction instance to be removedpublic static MorphoFrame getMorphoFrameContainingGUIAction(GUIAction clone)
clone
- the GUIAction clone for which the parent MorphoFrame
will be returned
public static GUIAction getGUIActionCloneUsedByMorphoFrame(GUIAction action, MorphoFrame frame)
action
- the GUIAction whose clone is soughtframe
- the MorphoFrame in which the clone is nested
public void refreshWindows()
public void updateAllStatusBars()
public void setCurrentActiveWindow(MorphoFrame window)
window
- the currently active MorphoFrame windowpublic MorphoFrame getCurrentActiveWindow()
public AbstractDataPackage getCurrentAbstractDataPackage()
public AbstractDataPackage getCurrentExistingAbstractDataPackage()
public void setWizardIsRunning(AbstractDataPackage tempDataPackage)
tempDataPackage
- AbstractDataPackage -
a temporary AbstractDataPackage that is used to store wizard data
(for references use) - this ADP will be returned by any calls to
getCurrentAbstractDataPackage() while the wizard is running. NOTE
that this datapackage will be discarded when the wizard is done, because it
may not be complete. It is not used to create the new datapackage!!public void setWizardNotRunning()
public boolean isWizardRunning()
public static Morpho getMorpho()
public void launchEditorAtSubtreeForCurrentFrame(java.lang.String subtreeRootNodeName, int subtreeRootIndex)
subtreeRootNodeName
- StringsubtreeRootIndex
- int (zero-relative)public static void showNewPackageNoLocChange(AbstractDataPackage adp)
adp
- AbstractDataPackagepublic static void showNewPackage(AbstractDataPackage adp)
adp
- AbstractDataPackage
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |