bibliothek.gui.dock.station.split
Class PutInfo

java.lang.Object
  extended by bibliothek.gui.dock.station.split.PutInfo

public class PutInfo
extends Object

Carries information where to put a Dockable onto a SplitDockStation.

Author:
Benjamin Sigg

Nested Class Summary
static class PutInfo.Put
          Information where the mouse is.
 
Constructor Summary
PutInfo(SplitNode node, PutInfo.Put put, Dockable dockable, boolean combining)
          Creates a new PutInfo.
 
Method Summary
 CombinerSource getCombinerSource()
          Gets information about the two Dockables that are going to be merged.
 CombinerTarget getCombinerTarget()
          Gets information about how to merge the two Dockables.
 double getDivider()
          Gets the preferred location of the divider.
 Dockable getDockable()
          Gets the Dockable which will be added to the station.
 Leaf getLeaf()
          Gets the leaf which contains dockable
 SplitNode getNode()
          Gets the future neighbor or parent.
 int getOldSize()
          Gets the old size of the dockable.
 PutInfo.Put getPut()
          Gets the location of the mouse.
 boolean isCombining()
          Tells whether the mouse position alone would result in getPut() equaling PutInfo.Put.CENTER or PutInfo.Put.TITLE.
 void setCombination(CombinerSource source, CombinerTarget target)
          Sets combination information that can be used for Combiner.combine(CombinerSource, CombinerTarget).
 void setDivider(double divider)
          Sets the preferred location that a divider should have if the dockable will have a neighbor.
 void setDockable(Dockable dockable)
          Sets the Dockable which will be added to the station.
 void setLeaf(Leaf leaf)
          Sets the leaf which contains dockable
 void setNode(SplitNode node)
          Sets the node which might become neighbor or parent of the new child.
 void setOldSize(int oldSize)
          Sets the size that the dockable had before it was dragged around.
 void setPut(PutInfo.Put put)
          Tells where the mouse is, in respect to node.
 boolean willHaveNoEffect()
          If this PutInfo describes the current layout, then nothing will happen if it is applied.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PutInfo

public PutInfo(SplitNode node,
               PutInfo.Put put,
               Dockable dockable,
               boolean combining)
Creates a new PutInfo.

Parameters:
node - the node to which put belongs
put - where to put the Dockable in respect to node
dockable - the element that will be dropped
combining - whether the mouse position alone would set put to PutInfo.Put.CENTER or PutInfo.Put.TITLE
Method Detail

willHaveNoEffect

public boolean willHaveNoEffect()
If this PutInfo describes the current layout, then nothing will happen if it is applied.

Returns:
whether this info describes the current layout

setDockable

public void setDockable(Dockable dockable)
Sets the Dockable which will be added to the station.

Parameters:
dockable - the Dockable or null

getDockable

public Dockable getDockable()
Gets the Dockable which will be added to the station.

Returns:
the Dockable or null

setNode

public void setNode(SplitNode node)
Sets the node which might become neighbor or parent of the new child.

Parameters:
node - the node or null

getNode

public SplitNode getNode()
Gets the future neighbor or parent.

Returns:
the node or null

setPut

public void setPut(PutInfo.Put put)
Tells where the mouse is, in respect to node.

Parameters:
put - the location of the mouse or null

getPut

public PutInfo.Put getPut()
Gets the location of the mouse.

Returns:
the location or null

isCombining

public boolean isCombining()
Tells whether the mouse position alone would result in getPut() equaling PutInfo.Put.CENTER or PutInfo.Put.TITLE.

Returns:
whether the mouse is in the center position

setDivider

public void setDivider(double divider)
Sets the preferred location that a divider should have if the dockable will have a neighbor.

Parameters:
divider - the location of the divider

getDivider

public double getDivider()
Gets the preferred location of the divider.

Returns:
the location

setOldSize

public void setOldSize(int oldSize)
Sets the size that the dockable had before it was dragged around.

Parameters:
oldSize - the size (width or height, the interpretation depends on the value of put)

getOldSize

public int getOldSize()
Gets the old size of the dockable.

Returns:
the size
See Also:
setOldSize(int)

setLeaf

public void setLeaf(Leaf leaf)
Sets the leaf which contains dockable

Parameters:
leaf - the leaf

getLeaf

public Leaf getLeaf()
Gets the leaf which contains dockable

Returns:
the leaf or null

setCombination

public void setCombination(CombinerSource source,
                           CombinerTarget target)
Sets combination information that can be used for Combiner.combine(CombinerSource, CombinerTarget).

Parameters:
source - information about the two Dockables to merge
target - information about how to merge the Dockables

getCombinerSource

public CombinerSource getCombinerSource()
Gets information about the two Dockables that are going to be merged.

Returns:
the merge information, can be null

getCombinerTarget

public CombinerTarget getCombinerTarget()
Gets information about how to merge the two Dockables.

Returns:
the merge information, can be null