bibliothek.gui.dock.facile.mode.station
Class FlapDockStationHandle

java.lang.Object
  extended by bibliothek.gui.dock.facile.mode.station.FlapDockStationHandle
All Implemented Interfaces:
MinimizedModeArea, ModeArea, StationModeArea
Direct Known Subclasses:
CFlapDockStationHandle

public class FlapDockStationHandle
extends Object
implements MinimizedModeArea

A connection between a FlapDockStation and the MinimizedModeArea interface.

Author:
Benjamin Sigg

Constructor Summary
FlapDockStationHandle(String id, FlapDockStation station)
          Creates a new handle.
 
Method Summary
 void addModeAreaListener(ModeAreaListener listener)
          Adds a listener to this area.
 boolean autoDefaultArea()
          Tells whether this ModeArea can automatically become the default area of some mode.
 DockableProperty getLocation(Dockable child)
          Gets the location of dockable which is a child of this station.
 FlapDockStation getStation()
          Gets the station which is managed by this handle.
 String getUniqueId()
          Gets a unique identifier for this area.
 boolean isChild(Dockable dockable)
          Tells whether dockable is a direct child of this station.
 boolean isLocationRoot()
          Tells whether this area can be used as root in a Location.
 void removeModeAreaListener(ModeAreaListener listener)
          Removes a listener from this area.
 boolean respectWorkingAreas()
           
 void setController(DockController controller)
          Connects this area with a controller.
 boolean setLocation(Dockable dockable, DockableProperty location, AffectedSet set)
          Sets the location of dockable to location and tries to ensure that dockable is a child of this station.
This method may completely fail to change the location of dockable, for example because a DockAcceptance does not allow the dockable to be moved.
 void setMode(LocationMode mode)
          Informs this area about the mode that uses it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlapDockStationHandle

public FlapDockStationHandle(String id,
                             FlapDockStation station)
Creates a new handle.

Parameters:
id - unique id of this handle
station - the station managed by this handle
Method Detail

autoDefaultArea

public boolean autoDefaultArea()
Description copied from interface: ModeArea
Tells whether this ModeArea can automatically become the default area of some mode.

Specified by:
autoDefaultArea in interface ModeArea
Returns:
true if this can be a default area, false if not

isLocationRoot

public boolean isLocationRoot()
Description copied from interface: ModeArea
Tells whether this area can be used as root in a Location. An area that is not a location root will (usually) not be used to set the location of a child.
Most implementations of ModeArea should return true.

Specified by:
isLocationRoot in interface ModeArea
Returns:
whether this ModeArea agrees on seeing its ModeArea.getUniqueId() in a Location

addModeAreaListener

public void addModeAreaListener(ModeAreaListener listener)
Description copied from interface: ModeArea
Adds a listener to this area.

Specified by:
addModeAreaListener in interface ModeArea
Parameters:
listener - the new listener

removeModeAreaListener

public void removeModeAreaListener(ModeAreaListener listener)
Description copied from interface: ModeArea
Removes a listener from this area.

Specified by:
removeModeAreaListener in interface ModeArea
Parameters:
listener - the listener to remove

setController

public void setController(DockController controller)
Description copied from interface: ModeArea
Connects this area with a controller. It's up to the area to add or remove listeners if necessary.

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

setMode

public void setMode(LocationMode mode)
Description copied from interface: ModeArea
Informs this area about the mode that uses it.

Specified by:
setMode in interface ModeArea
Parameters:
mode - the owner of this area, can be null

getStation

public FlapDockStation getStation()
Gets the station which is managed by this handle.

Specified by:
getStation in interface ModeArea
Returns:
the station

getLocation

public DockableProperty getLocation(Dockable child)
Description copied from interface: StationModeArea
Gets the location of dockable which is a child of this station.

Specified by:
getLocation in interface StationModeArea
Parameters:
child - the child
Returns:
the location, may be null

getUniqueId

public String getUniqueId()
Description copied from interface: ModeArea
Gets a unique identifier for this area.

Specified by:
getUniqueId in interface ModeArea
Returns:
the unique identifier
See Also:
CStation.getUniqueId()

isChild

public boolean isChild(Dockable dockable)
Description copied from interface: ModeArea
Tells whether dockable is a direct child of this station.

Specified by:
isChild in interface ModeArea
Parameters:
dockable - some element
Returns:
true if and only if the parent of dockable is identical to this station

respectWorkingAreas

public boolean respectWorkingAreas()

setLocation

public boolean setLocation(Dockable dockable,
                           DockableProperty location,
                           AffectedSet set)
Description copied from interface: StationModeArea
Sets the location of dockable to location and tries to ensure that dockable is a child of this station.
This method may completely fail to change the location of dockable, for example because a DockAcceptance does not allow the dockable to be moved. In such cases false is returned.

Specified by:
setLocation in interface StationModeArea
Parameters:
dockable - the new or old child
location - the new location, may be null
set - this method has to store all Dockables which might have changed their mode in the set.
Returns:
true if docakble is now a child of this StationModeArea, false if not