bibliothek.gui.dock.common
Class CGridArea

java.lang.Object
  extended by bibliothek.gui.dock.common.CGridArea
All Implemented Interfaces:
CStation

public class CGridArea
extends Object
implements CStation

In a CGridArea normalized CDockable can be shown. Clients should use getComponent() to gain access to a JComponent that represents this area.

Author:
Benjamin Sigg

Constructor Summary
CGridArea(CControl control, String uniqueId, boolean workingArea)
          Creates a new grid area.
 
Method Summary
 CDockable asDockable()
          If this station is a CDockable as well, then this method returns the representation of this station as CDockable.
 void deploy(CGrid grid)
          Adds all the elements in grid to this area.
 JComponent getComponent()
          Gets the JComponent which represents this station.
 SplitDockStation getStation()
          Gets the internal representation of this CStation.
 CLocation getStationLocation()
          Gets a location which represents directly CStation.getStation().
 String getUniqueId()
          Gets the unique id of this area.
 boolean isWorkingArea()
          Tells whether this station is a special working area or not.
 void setControl(CControlAccess access)
          Called by CControl when this CStation is added or removed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CGridArea

public CGridArea(CControl control,
                 String uniqueId,
                 boolean workingArea)
Creates a new grid area.

Parameters:
control - the control for which this area will be used
uniqueId - a unique uniqueId
workingArea - whether this is a working area
Method Detail

getComponent

public JComponent getComponent()
Gets the JComponent which represents this station.

Returns:
the component

setControl

public void setControl(CControlAccess access)
Description copied from interface: CStation
Called by CControl when this CStation is added or removed. There are two actions which most stations might want to do:

Specified by:
setControl in interface CStation
Parameters:
access - access to the internals of the CControl that uses this station or null to remove all ties from a control

getUniqueId

public String getUniqueId()
Gets the unique id of this area.

Specified by:
getUniqueId in interface CStation
Returns:
the unique id

getStation

public SplitDockStation getStation()
Description copied from interface: CStation
Gets the internal representation of this CStation.

Specified by:
getStation in interface CStation
Returns:
the interal representation

getStationLocation

public CLocation getStationLocation()
Description copied from interface: CStation
Gets a location which represents directly CStation.getStation().

Specified by:
getStationLocation in interface CStation
Returns:
the location that will always represent the station

isWorkingArea

public boolean isWorkingArea()
Description copied from interface: CStation
Tells whether this station is a special working area or not. It is not possible drag a child from a working area if it is registered there, or to drop a child onto a working area if it is not registered there.

Specified by:
isWorkingArea in interface CStation
Returns:
true if this is a working area, false otherwise

asDockable

public CDockable asDockable()
Description copied from interface: CStation
If this station is a CDockable as well, then this method returns the representation of this station as CDockable.

Specified by:
asDockable in interface CStation
Returns:
this as dockable or null

deploy

public void deploy(CGrid grid)
Adds all the elements in grid to this area.

Parameters:
grid - the new layout of this area