bibliothek.gui.dock.station.toolbar.menu
Class AbstractCustomizationMenu

java.lang.Object
  extended by bibliothek.gui.dock.station.toolbar.menu.AbstractCustomizationMenu
All Implemented Interfaces:
CustomizationMenu
Direct Known Subclasses:
DefaultCustomizationMenu

public abstract class AbstractCustomizationMenu
extends Object
implements CustomizationMenu

The abstract implementation of CustomizationMenu offers fields to store standard data required by all menus.

Author:
Benjamin Sigg

Constructor Summary
AbstractCustomizationMenu()
           
 
Method Summary
 void close()
          Closes this menu.
protected  void closed()
           
protected abstract  void doClose()
          Closes this menu.
protected abstract  void doOpen(int x, int y, Component content)
          Shows this menu.
 CustomizationMenuCallback getCallback()
          Gets the callback for retreiving more information about the station that opened this menu.
 CustomizationMenuContent getContent()
          Gets the contents of this menu.
 bibliothek.gui.DockController getController()
          Gets the controller in whose realm this menu is used.
 boolean isOpen()
          Tells whether this menu currently is visible.
 void open(int x, int y, CustomizationMenuCallback callback)
          Opens the menu for station.
 void setContent(CustomizationMenuContent content)
          Sets the contents of this menu.
 void setController(bibliothek.gui.DockController controller)
          Sets the controller in whose realm this menu is used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCustomizationMenu

public AbstractCustomizationMenu()
Method Detail

getContent

public CustomizationMenuContent getContent()
Description copied from interface: CustomizationMenu
Gets the contents of this menu.

Specified by:
getContent in interface CustomizationMenu
Returns:
the contents, can be null

setContent

public void setContent(CustomizationMenuContent content)
Description copied from interface: CustomizationMenu
Sets the contents of this menu.

Specified by:
setContent in interface CustomizationMenu
Parameters:
content - the new contents, can be null

setController

public void setController(bibliothek.gui.DockController controller)
Description copied from interface: CustomizationMenu
Sets the controller in whose realm this menu is used.

Specified by:
setController in interface CustomizationMenu
Parameters:
controller - the new controller, can be null

getController

public bibliothek.gui.DockController getController()
Gets the controller in whose realm this menu is used.

Returns:
the controller, can be null

isOpen

public boolean isOpen()
Tells whether this menu currently is visible.

Returns:
whether the menu is open

getCallback

public CustomizationMenuCallback getCallback()
Gets the callback for retreiving more information about the station that opened this menu.

Returns:
the callback, will be null if this menu is not open.

open

public void open(int x,
                 int y,
                 CustomizationMenuCallback callback)
Description copied from interface: CustomizationMenu
Opens the menu for station. The menus top left corner should be at coordinates x,y.

Specified by:
open in interface CustomizationMenu
Parameters:
x - the x coordinate
y - the y coordinate
callback - allows communication with the station that opened this menu

close

public void close()
Description copied from interface: CustomizationMenu
Closes this menu.

Specified by:
close in interface CustomizationMenu

closed

protected void closed()

doOpen

protected abstract void doOpen(int x,
                               int y,
                               Component content)
Shows this menu. This method is only called if the menu is not yet open. Note that the Component content will never be replaced while the menu is open.

Parameters:
x - the preferred x coordinate of the menu
y - the preferred y coordinate of the menu
content - the content of the menu, not null

doClose

protected abstract void doClose()
Closes this menu. There are no calls to the CustomizationMenuCallback required. Subclasses should not call this method directly, instead they should always call close()