bibliothek.gui.dock
Class SplitDockStation.Access

java.lang.Object
  extended by bibliothek.gui.dock.SplitDockStation.Access
All Implemented Interfaces:
SplitDockAccess
Enclosing class:
SplitDockStation

protected class SplitDockStation.Access
extends Object
implements SplitDockAccess

Access to this SplitDockStation.

Author:
Benjamin Sigg

Constructor Summary
protected SplitDockStation.Access()
           
 
Method Summary
 void addHandle(StationChildHandle dockable, DockHierarchyLock.Token token)
          Adds the new handle to the station and adds the displayer to the station.
 void arm()
          Prepares this to fire an event to DockStationListener.dockablesRepositioned(DockStation, Dockable[]).
 Leaf createLeaf(long id)
          Creates a new Leaf.
 Node createNode(long id)
          Creates a new Node.
 Placeholder createPlaceholder(long id)
          Creates a new Placeholder.
 Root createRoot(long id)
          Creates a new Root.
 void dockableSelected(Dockable dockable)
           
 boolean drop(Dockable dockable, SplitDockProperty property, SplitNode root)
          Tries to add Dockable such that the boundaries given by property are full filled.
 void drop(DockHierarchyLock.Token token, PutInfo putInfo, StationDropItem item)
          Adds the Dockable given by putInfo to this station.
 void fire()
          Fires an event to DockStationListener.dockablesRepositioned(DockStation, Dockable[]).
 StationChildHandle getFullScreenDockable()
          Gets the DockableDisplayer which is currently in fullscreen-mode.
 SplitDockStation getOwner()
          Gets the station to which this object grants access.
 SplitPlaceholderSet getPlaceholderSet()
          Gets the set which keeps track of all placeholders and makes sure that no placeholder is used twice.
 SplitSpanStrategy getSpanStrategy()
          Gets the object that manages all Spans.
 DockTitleVersion getTitleVersion()
          Gets the kind of title owner uses.
 boolean isArmed()
          Tells whether this SplitDockStation.Access currently is withholding events.
 boolean isTreeAutoCleanupEnabled()
          Tells whether nodes can currently be automatically removed from the tree.
 void move(PutInfo putInfo, StationDropItem item)
          Moves the dockable described by putInfo at a new location
 StationChildHandle newHandle(Dockable dockable)
          Creates a new handle but does not take any other action.
 void removeHandle(StationChildHandle handle, DockHierarchyLock.Token token)
          Removes an element from the station.
 void repositioned(SplitNode node)
          Invoked whenever a node changes its shape.
 void setDropInfo(PutInfo putInfo)
          Sets the current information telling where and how an item is to be dropped.
 long uniqueID()
          Creates a unique id for a SplitNode.
 void unsetDropInfo()
          Resets the information telling where and how an item is to be dropped.
 double validateDivider(double divider, Node node)
          Tests whether the given value of the divider is a legal value or not.
 PutInfo validatePutInfo(PutInfo putInfo)
          Checks whether info is valid or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SplitDockStation.Access

protected SplitDockStation.Access()
Method Detail

getFullScreenDockable

public StationChildHandle getFullScreenDockable()
Description copied from interface: SplitDockAccess
Gets the DockableDisplayer which is currently in fullscreen-mode.

Specified by:
getFullScreenDockable in interface SplitDockAccess
Returns:
the displayer, may be null

getTitleVersion

public DockTitleVersion getTitleVersion()
Description copied from interface: SplitDockAccess
Gets the kind of title owner uses.

Specified by:
getTitleVersion in interface SplitDockAccess
Returns:
the kind of title, can be null

getOwner

public SplitDockStation getOwner()
Description copied from interface: SplitDockAccess
Gets the station to which this object grants access.

Specified by:
getOwner in interface SplitDockAccess
Returns:
the owner

validateDivider

public double validateDivider(double divider,
                              Node node)
Description copied from interface: SplitDockAccess
Tests whether the given value of the divider is a legal value or not.

Specified by:
validateDivider in interface SplitDockAccess
Parameters:
divider - The value of the divider
node - the node for which the divider is validated
Returns:
a legal value, as near as possible to divider.

newHandle

public StationChildHandle newHandle(Dockable dockable)
Description copied from interface: SplitDockAccess
Creates a new handle but does not take any other action.

Specified by:
newHandle in interface SplitDockAccess
Parameters:
dockable - the target for the new handle
Returns:
the new handle

addHandle

public void addHandle(StationChildHandle dockable,
                      DockHierarchyLock.Token token)
Description copied from interface: SplitDockAccess
Adds the new handle to the station and adds the displayer to the station. Binds the dockable.

Specified by:
addHandle in interface SplitDockAccess
Parameters:
dockable - the new handle
token - if null, then a token will be acquired by this method and this method will fire events, otherwise this methods is executed silently

removeHandle

public void removeHandle(StationChildHandle handle,
                         DockHierarchyLock.Token token)
Description copied from interface: SplitDockAccess
Removes an element from the station.

Specified by:
removeHandle in interface SplitDockAccess
Parameters:
handle - the element to remove
token - if null, then a token will be acquired by this method and this method will fire events, otherwise this methods is executed silently

drop

public boolean drop(Dockable dockable,
                    SplitDockProperty property,
                    SplitNode root)
Description copied from interface: SplitDockAccess
Tries to add Dockable such that the boundaries given by property are full filled.

Specified by:
drop in interface SplitDockAccess
Parameters:
dockable - a new child of this station
property - the preferred location of the child
root - the root of all possible parents where the child could be inserted
Returns:
true if the child could be added, false if no location could be found

validatePutInfo

public PutInfo validatePutInfo(PutInfo putInfo)
Description copied from interface: SplitDockAccess
Checks whether info is valid or not.

Specified by:
validatePutInfo in interface SplitDockAccess
Parameters:
putInfo - the preferred drop location
Returns:
info if it is valid, null otherwise

repositioned

public void repositioned(SplitNode node)
Description copied from interface: SplitDockAccess
Invoked whenever a node changes its shape. Leads to a call to DockStationListener.dockablesRepositioned(bibliothek.gui.DockStation, Dockable[]) for all Dockables that are in node or children of node.

Specified by:
repositioned in interface SplitDockAccess
Parameters:
node - the source of the event

isArmed

public boolean isArmed()
Tells whether this SplitDockStation.Access currently is withholding events.

Returns:
whether events are currently disabled

dockableSelected

public void dockableSelected(Dockable dockable)

arm

public void arm()
Prepares this to fire an event to DockStationListener.dockablesRepositioned(DockStation, Dockable[]).


fire

public void fire()
Fires an event to DockStationListener.dockablesRepositioned(DockStation, Dockable[]).


uniqueID

public long uniqueID()
Description copied from interface: SplitDockAccess
Creates a unique id for a SplitNode.

Specified by:
uniqueID in interface SplitDockAccess
Returns:
the new unique id

isTreeAutoCleanupEnabled

public boolean isTreeAutoCleanupEnabled()
Description copied from interface: SplitDockAccess
Tells whether nodes can currently be automatically removed from the tree.

Specified by:
isTreeAutoCleanupEnabled in interface SplitDockAccess
Returns:
true if auto-removal is enabled

getPlaceholderSet

public SplitPlaceholderSet getPlaceholderSet()
Description copied from interface: SplitDockAccess
Gets the set which keeps track of all placeholders and makes sure that no placeholder is used twice.

Specified by:
getPlaceholderSet in interface SplitDockAccess
Returns:
the placeholder set

getSpanStrategy

public SplitSpanStrategy getSpanStrategy()
Description copied from interface: SplitDockAccess
Gets the object that manages all Spans.

Specified by:
getSpanStrategy in interface SplitDockAccess
Returns:
access to the current SpanFactory

createLeaf

public Leaf createLeaf(long id)
Description copied from interface: SplitDockAccess
Creates a new Leaf.

Specified by:
createLeaf in interface SplitDockAccess
Parameters:
id - the unique identifier of the leaf
Returns:
the new leaf

createNode

public Node createNode(long id)
Description copied from interface: SplitDockAccess
Creates a new Node.

Specified by:
createNode in interface SplitDockAccess
Parameters:
id - the unique identifier of the node
Returns:
the new node

createPlaceholder

public Placeholder createPlaceholder(long id)
Description copied from interface: SplitDockAccess
Creates a new Placeholder.

Specified by:
createPlaceholder in interface SplitDockAccess
Parameters:
id - the unique identifier of this placeholder
Returns:
the new placeholder

createRoot

public Root createRoot(long id)
Creates a new Root.

Parameters:
id - the unique identifier of the new root
Returns:
the new root

setDropInfo

public void setDropInfo(PutInfo putInfo)
Description copied from interface: SplitDockAccess
Sets the current information telling where and how an item is to be dropped.

Specified by:
setDropInfo in interface SplitDockAccess
Parameters:
putInfo - the current drop information

unsetDropInfo

public void unsetDropInfo()
Description copied from interface: SplitDockAccess
Resets the information telling where and how an item is to be dropped.

Specified by:
unsetDropInfo in interface SplitDockAccess

drop

public void drop(DockHierarchyLock.Token token,
                 PutInfo putInfo,
                 StationDropItem item)
Description copied from interface: SplitDockAccess
Adds the Dockable given by putInfo to this station.

Specified by:
drop in interface SplitDockAccess
Parameters:
token - if null, then a token will be acquired by this method and this method will fire events, otherwise this methods is executed silently
putInfo - information about where to drop the new Dockable
item - detailed information about the drag and drop operation that is going on

move

public void move(PutInfo putInfo,
                 StationDropItem item)
Description copied from interface: SplitDockAccess
Moves the dockable described by putInfo at a new location

Specified by:
move in interface SplitDockAccess
Parameters:
putInfo - description of the new location
item - more information about the drag and drop operation that is currently happening