uic.widgets
Class WindowRepresenter

java.lang.Object
  extended byuic.widgets.WindowRepresenter

public class WindowRepresenter
extends Object

This class manages the 4 ToolBarContainer instances per window, there is one instance per Window. Use this to move toolbars between containers.


Constructor Summary
WindowRepresenter(Window parent)
          Create a new WindowRepresenter for a specific window, it is not adviced to create this manually; use the getInstance methods for this.
 
Method Summary
 void addExtraWindow(ExtraWindow floater)
           
 void addMenuEntries(JPopupMenu popup, UICToolBar toolbar)
          For a popup menu for UICToolBar toolbar generate relevant popup items.
 void addToolBar(UICToolBar toolbar)
           
 void addToolBarContainer(ToolBarContainer container)
           
 void addToolBarListener(ToolBarListener listener)
           
 void addToolBarMenuEntries(JMenu menu)
           
 void addToolBarMenuEntries(JPopupMenu popup)
           
protected static void connect(JCheckBoxMenuItem source, UICToolBar destination)
          create an event listener for the JCheckBoxMenuItem
protected static void connect(JMenuItem source, UICToolBar destination, int argument)
          create an event listener for the JMenuItem
 Vector getAllToolbars()
          Get all the toolbars registered with this WindowRepresenter, and since the registration is done automatically for ToolBarContainers this means that you get all the toolbars that belong to the Window.
 ExtraWindow getExtraWindow(Point screenPoint)
           
 ExtraWindow getExtraWindow(Point screenPoint, boolean visibleOnly)
           
static WindowRepresenter getInstance(ToolBarContainer child)
          Find the WindowRepresenter that contains the child ToolBarContainer
static WindowRepresenter getInstance(Window window)
          get WindowRepresenter for the Window; or create a fresh one if none exists.
 ToolBarContainer getToolBarContainer(int location)
          Return the ToolBarContainer at the specified Window side.
 Iterator getToolBarContainers()
           
 void moveToolBarTo(int destination, JToolBar toolbar)
           
 void moveToolBarTo(int destination, JToolBar toolbar, Point screenPoint)
          Take the toolbar and move it to the toolbarContainers at screen-side destination.
 void removeToolBarListener(ToolBarListener listener)
           
 TranslationInterface translate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WindowRepresenter

public WindowRepresenter(Window parent)
Create a new WindowRepresenter for a specific window, it is not adviced to create this manually; use the getInstance methods for this.

Method Detail

addToolBarContainer

public void addToolBarContainer(ToolBarContainer container)

addToolBar

public void addToolBar(UICToolBar toolbar)

getToolBarContainers

public Iterator getToolBarContainers()

getInstance

public static WindowRepresenter getInstance(Window window)
get WindowRepresenter for the Window; or create a fresh one if none exists.


getInstance

public static WindowRepresenter getInstance(ToolBarContainer child)
Find the WindowRepresenter that contains the child ToolBarContainer

Returns:
the WindowRepresenter instance with the ToolBarContainer child, or null if not found.

getToolBarContainer

public ToolBarContainer getToolBarContainer(int location)
Return the ToolBarContainer at the specified Window side.

Parameters:
location - the side of the window from the SwingConstants LEFT/RIGHT/TOP/BOTTOM

getAllToolbars

public Vector getAllToolbars()
Get all the toolbars registered with this WindowRepresenter, and since the registration is done automatically for ToolBarContainers this means that you get all the toolbars that belong to the Window.


addExtraWindow

public void addExtraWindow(ExtraWindow floater)

getExtraWindow

public ExtraWindow getExtraWindow(Point screenPoint)

getExtraWindow

public ExtraWindow getExtraWindow(Point screenPoint,
                                  boolean visibleOnly)

addMenuEntries

public void addMenuEntries(JPopupMenu popup,
                           UICToolBar toolbar)
For a popup menu for UICToolBar toolbar generate relevant popup items.


addToolBarMenuEntries

public void addToolBarMenuEntries(JPopupMenu popup)

addToolBarMenuEntries

public void addToolBarMenuEntries(JMenu menu)

connect

protected static void connect(JMenuItem source,
                              UICToolBar destination,
                              int argument)
create an event listener for the JMenuItem


connect

protected static void connect(JCheckBoxMenuItem source,
                              UICToolBar destination)
create an event listener for the JCheckBoxMenuItem


moveToolBarTo

public void moveToolBarTo(int destination,
                          JToolBar toolbar)

moveToolBarTo

public void moveToolBarTo(int destination,
                          JToolBar toolbar,
                          Point screenPoint)
Take the toolbar and move it to the toolbarContainers at screen-side destination.

Parameters:
destination - the side of the window from the SwingConstants LEFT/RIGHT/TOP/BOTTOM
toolbar - the toolbar to be moved
screenPoint - the optional point which is forwarded to the toolbarContainer which will use it to determine where in the toolbarContainer it will place the toolbar.

translate

public TranslationInterface translate()

addToolBarListener

public void addToolBarListener(ToolBarListener listener)

removeToolBarListener

public void removeToolBarListener(ToolBarListener listener)


Copyright © 2002,2003 Thomas Zander Available under the Free Apache licence