bibliothek.gui.dock.station.support
Class CombinerSourceWrapper

java.lang.Object
  extended by bibliothek.gui.dock.station.support.CombinerSourceWrapper
All Implemented Interfaces:
CombinerSource

public class CombinerSourceWrapper
extends java.lang.Object
implements CombinerSource

A wrapper around a CombinerSource, can be used to easily override methods of some source.

Author:
Benjamin Sigg

Constructor Summary
CombinerSourceWrapper(CombinerSource delegate)
          Creates a new wrapper.
 
Method Summary
 CombinerSource getDelegate()
          Gets the source which is hidden by this wrapper.
 java.awt.Point getMousePosition()
          Gets the position of the mouse.
 Dockable getNew()
          Gets the new Dockable, the one Dockable which is currently dragged around by the user and which is about to be dropped over old.
 Dockable getOld()
          Gets the old Dockable, the one Dockable which is already a child of the future parent.
 DockStation getParent()
          Gets the station which will be the new parent station of the combined Dockable.
 PlaceholderMap getPlaceholders()
          Gets a map of placeholders which are to be used for creating the combined Dockable.
 java.awt.Dimension getSize()
          Gets the estimated size of the combined Dockable.
 boolean isMouseOverTitle()
          Tells whether the mouse currently is over the title of the old Dockable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CombinerSourceWrapper

public CombinerSourceWrapper(CombinerSource delegate)
Creates a new wrapper.

Parameters:
delegate - the source to hide
Method Detail

getDelegate

public CombinerSource getDelegate()
Gets the source which is hidden by this wrapper.

Returns:
the source, not null

getMousePosition

public java.awt.Point getMousePosition()
Description copied from interface: CombinerSource
Gets the position of the mouse. A value of 0/0 indicates that the mouse is at the top left edge of the old Dockable, a value equal to the estimated size means that the mouse is at the lower right edge of the old dockable. The mouse may be outside the of these boundaries.
A value of null indicates that the mouse position should not be used for deciding of how to combine the two Dockables. This can happen for example if the mouse hovers directly over the title of the old Dockable.

Specified by:
getMousePosition in interface CombinerSource
Returns:
the position of the mouse, may be null

getNew

public Dockable getNew()
Description copied from interface: CombinerSource
Gets the new Dockable, the one Dockable which is currently dragged around by the user and which is about to be dropped over old. The parent of this Dockable may or may not be the old ones parent

Specified by:
getNew in interface CombinerSource
Returns:
the new Dockable, never null

getOld

public Dockable getOld()
Description copied from interface: CombinerSource
Gets the old Dockable, the one Dockable which is already a child of the future parent.

Specified by:
getOld in interface CombinerSource
Returns:
the old Dockable, never null

getParent

public DockStation getParent()
Description copied from interface: CombinerSource
Gets the station which will be the new parent station of the combined Dockable.

Specified by:
getParent in interface CombinerSource
Returns:
the parent station, never null

getPlaceholders

public PlaceholderMap getPlaceholders()
Description copied from interface: CombinerSource
Gets a map of placeholders which are to be used for creating the combined Dockable. These placeholders have been created by a DockStation that was removed because its children count dropped to one.

Specified by:
getPlaceholders in interface CombinerSource
Returns:
existing placeholders, may be null

getSize

public java.awt.Dimension getSize()
Description copied from interface: CombinerSource
Gets the estimated size of the combined Dockable. In most cases the size will be equal to the current size of the old Dockable.
If the size is unknown, then null is returned. A value of null also means that the mouse is currently not over the old dockable.

Specified by:
getSize in interface CombinerSource
Returns:
the estimated size, can be null

isMouseOverTitle

public boolean isMouseOverTitle()
Description copied from interface: CombinerSource
Tells whether the mouse currently is over the title of the old Dockable.

Specified by:
isMouseOverTitle in interface CombinerSource
Returns:
true if the mouse hovers over the title, false otherwise