bibliothek.gui.dock.station.flap
Class DefaultFlapWindow

java.lang.Object
  extended by bibliothek.gui.dock.station.flap.DefaultFlapWindow
All Implemented Interfaces:
FlapWindow, MouseListener, MouseMotionListener, EventListener

public class DefaultFlapWindow
extends Object
implements FlapWindow, MouseListener, MouseMotionListener

This window pops up if the user presses one of the buttons of a FlapDockStation. The window shows one Dockable


Nested Class Summary
static class DefaultFlapWindow.DialogParent
          A parent of a DefaultFlapWindow that is a JDialog.
static interface DefaultFlapWindow.Parent
          The parent container of a DefaultFlapWindow.
 
Constructor Summary
DefaultFlapWindow(FlapDockStation station, ButtonPane buttonPane, DefaultFlapWindow.Parent window)
          Constructs a new window.
 
Method Summary
 boolean containsScreenPoint(Point point)
          Tells whether this window contains point which is a point of the screen.
 void destroy()
          Informs this window that it is no longer used by its owner and will never be used again.
protected  void discardDisplayer()
          Replaces the current DockableDisplayer with a new instance.
 Component getComponent()
          Gets the root Component of this FlapWindow
 DockableDisplayer getDisplayer()
          Gets the displayer used to show a Dockable.
protected  Container getDisplayerParent()
          Gets the container that will become the parent of a DockableDisplayer.
 Dockable getDockable()
          Gets the Dockable which is shown on this window.
 Insets getDockableInsets()
          Makes a guess how big the insets around the current Dockable of this window are.
 DockTitle getDockTitle()
          Gets the title which is currently displayed
 FlapDockStation getStation()
          Gets the station for which this window is shown.
 Rectangle getWindowBounds()
          Gets the current boundaries of this window in screen coordinates.
 boolean isWindowValid()
          Tells whether this window is still valid, e.g whether the window can be shown in front of its station.
 boolean isWindowVisible()
          Tells whether this window is shown or hidden.
 void mouseClicked(MouseEvent e)
           
 void mouseDragged(MouseEvent e)
           
 void mouseEntered(MouseEvent e)
           
 void mouseExited(MouseEvent e)
           
 void mouseMoved(MouseEvent e)
           
 void mousePressed(MouseEvent e)
           
 void mouseReleased(MouseEvent e)
           
 void repaint()
          Tells this window that is should redraw its entire content.
 void setController(DockController controller)
          Informs this FlapWindow about the DockController in whose realm
 void setDockable(Dockable dockable)
          Sets the Dockable which will be shown on this window.
 void setDockTitle(DockTitleVersion title)
          Sets the title which should be displayed.
 void setDropInfo(FlapDropInfo dropInfo)
          Sets information where a Dockable will be dropped.
 void setRemoval(boolean removal)
          Tells this window whether a drag and drop operation is currently removing its child.
 void setWindowVisible(boolean flag)
          Shows or hides this window.
 void updateBounds()
          Recalculates the size and the location of this window.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultFlapWindow

public DefaultFlapWindow(FlapDockStation station,
                         ButtonPane buttonPane,
                         DefaultFlapWindow.Parent window)
Constructs a new window.

Parameters:
station - the station which manages this window
buttonPane - the buttons on the station
window - the window on which to paint this DefaultFlapWindow
Method Detail

setWindowVisible

public void setWindowVisible(boolean flag)
Description copied from interface: FlapWindow
Shows or hides this window.

Specified by:
setWindowVisible in interface FlapWindow
Parameters:
flag - whether to show this window

isWindowVisible

public boolean isWindowVisible()
Description copied from interface: FlapWindow
Tells whether this window is shown or hidden.

Specified by:
isWindowVisible in interface FlapWindow
Returns:
true if the window is shown

getWindowBounds

public Rectangle getWindowBounds()
Description copied from interface: FlapWindow
Gets the current boundaries of this window in screen coordinates.

Specified by:
getWindowBounds in interface FlapWindow
Returns:
the boundaries

destroy

public void destroy()
Description copied from interface: FlapWindow
Informs this window that it is no longer used by its owner and will never be used again.

Specified by:
destroy in interface FlapWindow

repaint

public void repaint()
Description copied from interface: FlapWindow
Tells this window that is should redraw its entire content.

Specified by:
repaint in interface FlapWindow

getComponent

public Component getComponent()
Description copied from interface: FlapWindow
Gets the root Component of this FlapWindow

Specified by:
getComponent in interface FlapWindow
Returns:
the root component, may be null after FlapWindow.destroy() was called

isWindowValid

public boolean isWindowValid()
Tells whether this window is still valid, e.g whether the window can be shown in front of its station.

Returns:
whether this window is still valid

containsScreenPoint

public boolean containsScreenPoint(Point point)
Description copied from interface: FlapWindow
Tells whether this window contains point which is a point of the screen.

Specified by:
containsScreenPoint in interface FlapWindow
Parameters:
point - a point on the screen
Returns:
true if this window contains point

getStation

public FlapDockStation getStation()
Gets the station for which this window is shown.

Returns:
the owner of this window

setDropInfo

public void setDropInfo(FlapDropInfo dropInfo)
Sets information where a Dockable will be dropped.

Specified by:
setDropInfo in interface FlapWindow
Parameters:
dropInfo - the information or null

setRemoval

public void setRemoval(boolean removal)
Description copied from interface: FlapWindow
Tells this window whether a drag and drop operation is currently removing its child.

Specified by:
setRemoval in interface FlapWindow
Parameters:
removal - whether the child of this window is removed

setDockTitle

public void setDockTitle(DockTitleVersion title)
Sets the title which should be displayed.

Specified by:
setDockTitle in interface FlapWindow
Parameters:
title - the title or null

getDockTitle

public DockTitle getDockTitle()
Gets the title which is currently displayed

Specified by:
getDockTitle in interface FlapWindow
Returns:
the title or null

getDockable

public Dockable getDockable()
Gets the Dockable which is shown on this window.

Specified by:
getDockable in interface FlapWindow
Returns:
The Dockable or null

getDisplayer

public DockableDisplayer getDisplayer()
Gets the displayer used to show a Dockable.

Specified by:
getDisplayer in interface FlapWindow
Returns:
the displayer, might be null

setDockable

public void setDockable(Dockable dockable)
Sets the Dockable which will be shown on this window.

Specified by:
setDockable in interface FlapWindow
Parameters:
dockable - The Dockable or null

discardDisplayer

protected void discardDisplayer()
Replaces the current DockableDisplayer with a new instance.


getDisplayerParent

protected Container getDisplayerParent()
Gets the container that will become the parent of a DockableDisplayer.

Returns:
the parent

setController

public void setController(DockController controller)
Description copied from interface: FlapWindow
Informs this FlapWindow about the DockController in whose realm

Specified by:
setController in interface FlapWindow
Parameters:
controller - the controller or null

getDockableInsets

public Insets getDockableInsets()
Makes a guess how big the insets around the current Dockable of this window are.

Specified by:
getDockableInsets in interface FlapWindow
Returns:
a guess of the insets

updateBounds

public void updateBounds()
Recalculates the size and the location of this window.

Specified by:
updateBounds in interface FlapWindow
See Also:
FlapDockStation.getWindowSize(Dockable), FlapDockStation.getWindowMinSize(), FlapDockStation.getExpansionBounds()

mouseExited

public void mouseExited(MouseEvent e)
Specified by:
mouseExited in interface MouseListener

mouseEntered

public void mouseEntered(MouseEvent e)
Specified by:
mouseEntered in interface MouseListener

mousePressed

public void mousePressed(MouseEvent e)
Specified by:
mousePressed in interface MouseListener

mouseReleased

public void mouseReleased(MouseEvent e)
Specified by:
mouseReleased in interface MouseListener

mouseDragged

public void mouseDragged(MouseEvent e)
Specified by:
mouseDragged in interface MouseMotionListener

mouseClicked

public void mouseClicked(MouseEvent e)
Specified by:
mouseClicked in interface MouseListener

mouseMoved

public void mouseMoved(MouseEvent e)
Specified by:
mouseMoved in interface MouseMotionListener