harmonic.mz.manager
Class GUIManager

java.lang.Object
  |
  +--harmonic.mz.manager.GUIManager
All Implemented Interfaces:
harmonic.viewer3D.event.ViewportListener

public class GUIManager
extends java.lang.Object
implements harmonic.viewer3D.event.ViewportListener

This manages the user interface at the global scale. It is a set of farily specific functions that one would normally not care about.


Field Summary
static int BOTTOM_PANE
           
static int LEFT_PANE
           
static int RIGHT_PANE
           
static int TOP_PANE
           
 
Method Summary
 void addBottomPanel(java.lang.String name, javax.swing.Icon icon, java.awt.Component c)
           
 void addInputPanel(java.lang.String name, javax.swing.Icon icon, java.awt.Component c)
           
 void addModulePanel(java.lang.String name, javax.swing.Icon icon, java.awt.Component c)
          Add panel in the area for module control panels.
 void addReadoutUpdater(ReadoutUpdater ru)
          Add a ReadoutUpdater to the list of updaters to be called by the update timer.
 void addToPulldownMenu(HWM_GroupData menu, Module mod)
          Function alows modules to embed a menu in the main pull down menu.
 void addUIField(java.lang.String name, ModelNode field)
           
 boolean dropObject(java.lang.Object obj, java.awt.Point p)
          Try to drop the object (what ever it is) at given screen coordinate point into a welcome place in the user interface.
 void finishInit()
           
 ModelViewport getCurrentView()
          Return viewport user has set as current, for relevent operations.
 java.util.Vector getFloatedToolbars()
          Return toolbars that are in floating frames
 java.awt.Component getFocusWindow()
          Return window that is supposed to have keyboard focus
 java.awt.Frame getFrame()
          Return the application main frame
 java.awt.Image getFrameIconImage()
          Returns the image for the frame corner
 java.lang.String getFrameTitle()
          Get the frame title.
 HWM_GroupData getGlobalMenu()
          Return the menu data for the application menu
 HWSplitPane getHorizontalSplit()
           
 javax.swing.ImageIcon getImageIcon(FunctionStarter action)
          Create's the icons for FunctionStarter.
 HWM_PulldownMenu getPulldownMenu()
          Return the main pulldown menu
 HWToolbarHolder getToolbarHolder(java.lang.String key)
          Return the HWToolbarHolder at the given key
 harmonic.mz.docnode.UILookAndFeelField getUIData()
          Returns the data node used to keep user interface settings.
 HWSplitPane getVerticalSplit()
           
 boolean keyblock(java.awt.event.KeyEvent e)
           
 ModelViewport newViewport()
           
 void postAppMenu(int mouseX, int mouseY)
          Post the global controls menu in the viewport at the given point
 void postContextMenu(ModelNode node, java.awt.Component cmp, int x, int y)
          Post a context meny for the given node in the viewport
 void removeBottomPanel(java.awt.Component c)
           
 void removeFromPulldownMenu(Module mod)
          Remove the module's controls from the global menus
 void removeInputPanel(java.awt.Component c)
           
 void removeModulePanel(java.awt.Component c)
           
 void removeReadoutUpdater(ReadoutUpdater ru)
           
 void removeViewport_Pre(ModelViewport viewport)
           
 void removeViewport(ModelViewport viewport)
           
 void setFocusWindow(java.awt.Component fe)
          This is a semi-klude for taking the keyboard focus so that the mouse does not have to be over the frame with text input.
 void setOwnedVisibility(boolean b)
          Controls whether windows owned by main frame are visible
 void setUIDefaults()
          Set the user interface settings to some hard-coded defaults.
 boolean trySplitPaneDrop(int paneIndex, int subindex, java.awt.Component cmp, java.awt.Point _p)
          Try dropping the component in the split panes that line the viewport
 void unpostMenus()
          Removes any menus that are floating about
 void updateFileTitle()
          Update the frame title to follow current file from FileManager
 void updateUIVariables()
           
 void viewportChanged(harmonic.viewer3D.event.ViewportEvent e)
           
 harmonic.viewer3D.Viewport viewportUnderMouse(java.awt.Point p)
          Returns the Viewport under the screen coordinate
 void windowHidden(java.awt.Window wnd)
          This was added when SGI was having trouble getting repaint msg to viewport.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEFT_PANE

public static final int LEFT_PANE
See Also:
Constant Field Values

TOP_PANE

public static final int TOP_PANE
See Also:
Constant Field Values

RIGHT_PANE

public static final int RIGHT_PANE
See Also:
Constant Field Values

BOTTOM_PANE

public static final int BOTTOM_PANE
See Also:
Constant Field Values
Method Detail

finishInit

public void finishInit()

updateUIVariables

public void updateUIVariables()

addUIField

public void addUIField(java.lang.String name,
                       ModelNode field)

setUIDefaults

public void setUIDefaults()
Set the user interface settings to some hard-coded defaults. These are usually found from a data file.
The widgets have a settings system that is independant of the system of the 3D graphics framework. However, we keep the widget settings in the framework's database by supplying a subclass of GUISettings that writes to the database in the set() methods, and retrieves from the database in the get() methods.


setOwnedVisibility

public void setOwnedVisibility(boolean b)
Controls whether windows owned by main frame are visible


viewportChanged

public void viewportChanged(harmonic.viewer3D.event.ViewportEvent e)
Specified by:
viewportChanged in interface harmonic.viewer3D.event.ViewportListener

getUIData

public harmonic.mz.docnode.UILookAndFeelField getUIData()
Returns the data node used to keep user interface settings.


getImageIcon

public javax.swing.ImageIcon getImageIcon(FunctionStarter action)
Create's the icons for FunctionStarter. This may be pulled out of a large image resource.


getFrameIconImage

public java.awt.Image getFrameIconImage()
Returns the image for the frame corner


trySplitPaneDrop

public boolean trySplitPaneDrop(int paneIndex,
                                int subindex,
                                java.awt.Component cmp,
                                java.awt.Point _p)
Try dropping the component in the split panes that line the viewport


addToPulldownMenu

public void addToPulldownMenu(HWM_GroupData menu,
                              Module mod)
Function alows modules to embed a menu in the main pull down menu.


removeFromPulldownMenu

public void removeFromPulldownMenu(Module mod)
Remove the module's controls from the global menus


getFrameTitle

public java.lang.String getFrameTitle()
Get the frame title. The value is keeped appart from the Frame in case it has not been created yet or is never created.


updateFileTitle

public void updateFileTitle()
Update the frame title to follow current file from FileManager


getGlobalMenu

public HWM_GroupData getGlobalMenu()
Return the menu data for the application menu


getCurrentView

public ModelViewport getCurrentView()
Return viewport user has set as current, for relevent operations. This just calls through to ViewerCore.ViewportManager.


newViewport

public ModelViewport newViewport()

removeViewport

public void removeViewport(ModelViewport viewport)

removeViewport_Pre

public void removeViewport_Pre(ModelViewport viewport)

getPulldownMenu

public HWM_PulldownMenu getPulldownMenu()
Return the main pulldown menu


getToolbarHolder

public HWToolbarHolder getToolbarHolder(java.lang.String key)
Return the HWToolbarHolder at the given key


addModulePanel

public void addModulePanel(java.lang.String name,
                           javax.swing.Icon icon,
                           java.awt.Component c)
Add panel in the area for module control panels. This is supposed to make it easier to keep track of the control panels of the various modules. Modules are free to make floating frames, however this was tried and it proved a pain to use because the frame would get lost.


removeModulePanel

public void removeModulePanel(java.awt.Component c)

addInputPanel

public void addInputPanel(java.lang.String name,
                          javax.swing.Icon icon,
                          java.awt.Component c)

removeInputPanel

public void removeInputPanel(java.awt.Component c)

addBottomPanel

public void addBottomPanel(java.lang.String name,
                           javax.swing.Icon icon,
                           java.awt.Component c)

removeBottomPanel

public void removeBottomPanel(java.awt.Component c)

getVerticalSplit

public HWSplitPane getVerticalSplit()

getHorizontalSplit

public HWSplitPane getHorizontalSplit()

keyblock

public boolean keyblock(java.awt.event.KeyEvent e)

viewportUnderMouse

public harmonic.viewer3D.Viewport viewportUnderMouse(java.awt.Point p)
Returns the Viewport under the screen coordinate


postAppMenu

public void postAppMenu(int mouseX,
                        int mouseY)
Post the global controls menu in the viewport at the given point


unpostMenus

public void unpostMenus()
Removes any menus that are floating about


postContextMenu

public void postContextMenu(ModelNode node,
                            java.awt.Component cmp,
                            int x,
                            int y)
Post a context meny for the given node in the viewport

Parameters:
node - Node that generates context menu
cmp - Component point is relative to
x - x component of point
y - y component of point

addReadoutUpdater

public void addReadoutUpdater(ReadoutUpdater ru)
Add a ReadoutUpdater to the list of updaters to be called by the update timer. This system is used to make interactive updates in the viewport smooth. Several data entry devices including import.PointEntry don't change the text in the text box right away when they get a mouse message. Although they may process the mouse input and send it on to the next interested party, the text box text is only invalidated and left alone. import.PointEntry implements ReadoutUpdater to validate the text box when the global readout update timer is fired. This makes the viewport updates smoother.


removeReadoutUpdater

public void removeReadoutUpdater(ReadoutUpdater ru)
See Also:
addReadoutUpdater()

getFloatedToolbars

public java.util.Vector getFloatedToolbars()
Return toolbars that are in floating frames


getFocusWindow

public java.awt.Component getFocusWindow()
Return window that is supposed to have keyboard focus


dropObject

public boolean dropObject(java.lang.Object obj,
                          java.awt.Point p)
Try to drop the object (what ever it is) at given screen coordinate point into a welcome place in the user interface.


getFrame

public java.awt.Frame getFrame()
Return the application main frame


setFocusWindow

public void setFocusWindow(java.awt.Component fe)
This is a semi-klude for taking the keyboard focus so that the mouse does not have to be over the frame with text input.


windowHidden

public void windowHidden(java.awt.Window wnd)
This was added when SGI was having trouble getting repaint msg to viewport. Call when a frame disappears. This may do nothing, or it may post a repaint for the viewports the window is over. A potential life saver. This is called by Monolog and a couple other library gui classes, so there should be no need to call this from an extension.