|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectucar.unidata.ui.WindowHolder
ucar.unidata.idv.IdvManager
ucar.unidata.idv.VMManager
edu.wisc.ssec.mcidasv.ViewManagerManager
public class ViewManagerManager
McIDAS-V needs to manage ViewManagers in a slightly different way than the IDV. The key differences between the two are the way previously active ViewManagers are ordered and a (hopefully) more consistent way of handling active ViewManagers.
The IDV only keeps track of the ViewManager used immediately before the current one. McV keeps track of the previously active ViewManagers in a stack. This mimics window z-ordering and always returns the user to the most recently active ViewManager upon removal of the active ViewManager.
Newly created ViewManagers and their first layer now become the active ViewManager and layer. If there is only one ViewManager, it is now displayed as active instead of just implying it. When the active ViewManager is removed, the last active ViewManager and its first layer become active.
A note to the future: McV/IDV supports two notions of active and selected ViewManagers. Say you have NxN ViewManagers in a ComponentHolder, and you want to share views among some of these ViewManagers. When one of these shared ViewManagers is activated, should all of them become the active ViewManager? We're going to have to work out how to convey which ViewManagers are shared and active, and maybe more? Good luck!
Field Summary | |
---|---|
private boolean |
DEBUG
Whether or not to display debug messages. |
private static org.slf4j.Logger |
logger
|
private Stack<ViewManager> |
previousVMs
The stack that stores the order of previously active ViewManagers. |
private UIManager |
uiManager
Convenient reference back to the UIManager. |
Fields inherited from class ucar.unidata.ui.WindowHolder |
---|
contents, dialog, frame, window |
Constructor Summary | |
---|---|
ViewManagerManager(IntegratedDataViewer idv)
Yet another constructor. |
Method Summary | |
---|---|
void |
addViewManager(ViewManager newViewManager)
Add the new view manager into the list if we don't have one with the ViewDescriptor of the new view manager
already. |
protected void |
disableAllLayerVizAnimations()
Turns off layer visibility animation for all ViewManager s. |
private void |
focusLayerControlsOn(ViewManager vm,
boolean doShow)
Sets the active tab of the dashboard to the layer controls and makes the first layer (TODO: fix that!) |
int |
getComponentGroupCount()
|
int |
getComponentHolderCount()
|
int |
getViewManagerCount()
|
Stack<ViewManager> |
getViewManagerOrder()
|
boolean |
haveMoreThanOneMainViewManager()
Overridden so that McV can set the active ViewManager even if there is only one ViewManager. |
private void |
inspectStack(String msg)
Helper method that'll display the ordering of the stack and a helpful debug message! |
void |
removeViewManager(ViewManager viewManager)
Handles the removal of a ViewManager. |
void |
setLastActiveViewManager(ViewManager vm)
This method is a bit strange. |
void |
setViewManagerOrder(Stack<ViewManager> newOrder)
Overwrite the stack containing the ordering of previously active ViewManagers. |
Methods inherited from class ucar.unidata.ui.WindowHolder |
---|
actionPerformed, close, doMakeContents, getContents, getDialog, getFrame, getWindow, getWindowTitle, isShowing, removeAll, setMenuBar, setWindowTitle, shouldMakeDialog, show, show, showModal, toFront, windowIsClosing |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.slf4j.Logger logger
private final boolean DEBUG
private final Stack<ViewManager> previousVMs
private UIManager uiManager
Constructor Detail |
---|
public ViewManagerManager(IntegratedDataViewer idv)
Method Detail |
---|
public int getViewManagerCount()
public void addViewManager(ViewManager newViewManager)
ViewDescriptor
of the new view manager
already.
addViewManager
in class VMManager
newViewManager
- The new view managerpublic Stack<ViewManager> getViewManagerOrder()
public boolean haveMoreThanOneMainViewManager()
haveMoreThanOneMainViewManager
in class VMManager
public void removeViewManager(ViewManager viewManager)
removeViewManager
in class VMManager
viewManager
- The ViewManager being removed.public void setLastActiveViewManager(ViewManager vm)
This method is a bit strange. If the given ViewManager is null, then the IDV has removed the active ViewManager. McV will use the stack of last active ViewManagers to make the last active ViewManager active once again.
If the given ViewManager is not null, but cannot be found in the stack of previously active ViewManagers, the IDV has created a new ViewManager and McV must push it on the stack.
If the given ViewManager is not null and has been found in the stack, then the user has selected an inactive ViewManager. McV must remove the ViewManager from the stack and then push it back on top.
These steps allow McV to make the behavior of closing tabs a bit more user-friendly. The user is always returned to whichever ViewManager was last active.
setLastActiveViewManager
in class VMManager
vm
- See above. :(public void setViewManagerOrder(Stack<ViewManager> newOrder)
Overwrite the stack containing the ordering of previously active ViewManagers.
Use this if you want to mess with the user's mind a little bit.
newOrder
- The stack containing the new ordering of ViewManagers.public int getComponentHolderCount()
public int getComponentGroupCount()
private void focusLayerControlsOn(ViewManager vm, boolean doShow)
vm
- The ViewManager to make active.doShow
- Whether or not the layer controls should become the active
tab in the dashboard.private void inspectStack(String msg)
protected void disableAllLayerVizAnimations()
ViewManager
s. This
is typically only useful for when the user has removed all layers
without turning off the layer animation setting.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |