bibliothek.gui.dock.station.toolbar
Class ToolbarGroupDockPerspective

java.lang.Object
  extended by bibliothek.gui.dock.station.toolbar.ToolbarGroupDockPerspective
All Implemented Interfaces:
bibliothek.gui.dock.perspective.PerspectiveDockable, bibliothek.gui.dock.perspective.PerspectiveElement, bibliothek.gui.dock.perspective.PerspectiveStation, bibliothek.gui.dock.station.support.PlaceholderListItem<bibliothek.gui.dock.perspective.PerspectiveDockable>

public class ToolbarGroupDockPerspective
extends Object
implements bibliothek.gui.dock.perspective.PerspectiveStation, bibliothek.gui.dock.perspective.PerspectiveDockable

A PerspectiveStation representing a ToolbarGroupDockStation.

Author:
Benjamin Sigg

Constructor Summary
ToolbarGroupDockPerspective()
          Creates a new, empty station.
ToolbarGroupDockPerspective(ToolbarGroupDockStationLayout layout, Map<Integer,bibliothek.gui.dock.perspective.PerspectiveDockable> children)
          Creates a new station.
 
Method Summary
 void add(int column, bibliothek.gui.dock.perspective.PerspectiveDockable dockable)
          Adds dockable at the end of column column.
 bibliothek.gui.dock.perspective.PerspectiveDockable asDockable()
           
 bibliothek.gui.dock.perspective.PerspectiveStation asStation()
           
 int getColumnCount()
          Gets the number of columns, only includes columns that contain at least one child.
 bibliothek.gui.dock.perspective.PerspectiveDockable getDockable(int index)
           
 bibliothek.gui.dock.perspective.PerspectiveDockable getDockable(int column, int line)
          Gets the item that is stored in column column at line line.
 int getDockableCount()
           
 bibliothek.gui.dock.layout.DockableProperty getDockableProperty(bibliothek.gui.dock.perspective.PerspectiveDockable child, bibliothek.gui.dock.perspective.PerspectiveDockable target)
           
 PerspectivePlaceholderToolbarGrid getDockables()
          Allows access to the internal data structure of this station.
 ExpandedState getExpandedState()
          Gets the default size of this station.
 String getFactoryID()
           
 int getLineCount(int column)
          Gets the number of items in column.
 ToolbarColumnModel<bibliothek.gui.dock.perspective.PerspectiveDockable,bibliothek.gui.dock.perspective.PerspectiveDockable> getModel()
          Gets access to an abstraction of the model of this station.
 Orientation getOrientation()
          Gets the orientation of this station.
 bibliothek.gui.dock.perspective.PerspectiveStation getParent()
           
 bibliothek.util.Path getPlaceholder()
           
 bibliothek.gui.dock.station.support.PlaceholderMap getPlaceholders()
           
 void insert(int column, int line, bibliothek.gui.dock.perspective.PerspectiveDockable dockable)
          Adds dockable to column column at position line.
 void insert(int column, bibliothek.gui.dock.perspective.PerspectiveDockable dockable)
          Adds a new column to the grid and inserts dockable as first child.
 void read(ToolbarGroupDockStationLayout layout, Map<Integer,bibliothek.gui.dock.perspective.PerspectiveDockable> children)
          Updates the layout of this station by reading layout.
 void remove(int column, int line)
          Removes the item at column/line.
 boolean remove(bibliothek.gui.dock.perspective.PerspectiveDockable dockable)
           
 void replace(bibliothek.gui.dock.perspective.PerspectiveDockable oldDockable, bibliothek.gui.dock.perspective.PerspectiveDockable newDockable)
           
 void setExpandedtState(ExpandedState state)
          Sets the default size of this station
 void setOrientation(Orientation orientation)
          Sets the orientation of this station.
 void setParent(bibliothek.gui.dock.perspective.PerspectiveStation parent)
           
 void setPlaceholders(bibliothek.gui.dock.station.support.PlaceholderMap placeholders)
           
 bibliothek.gui.dock.station.support.PlaceholderMap toMap(Map<bibliothek.gui.dock.perspective.PerspectiveDockable,Integer> children)
          Converts this station into a map of PerspectiveDockables.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToolbarGroupDockPerspective

public ToolbarGroupDockPerspective()
Creates a new, empty station.


ToolbarGroupDockPerspective

public ToolbarGroupDockPerspective(ToolbarGroupDockStationLayout layout,
                                   Map<Integer,bibliothek.gui.dock.perspective.PerspectiveDockable> children)
Creates a new station.

Parameters:
layout - the layout of the station
children - the unique identifiers of the children
Method Detail

read

public void read(ToolbarGroupDockStationLayout layout,
                 Map<Integer,bibliothek.gui.dock.perspective.PerspectiveDockable> children)
Updates the layout of this station by reading layout.

Parameters:
layout - the new layout
children - the new children of this station

getDockables

public PerspectivePlaceholderToolbarGrid getDockables()
Allows access to the internal data structure of this station. Clients should be very carefull when using this structure, as there are no options to ensure the validity of the structure. If possible, clients should only read data from the structure, and should not execute any write operations.

Returns:
the internal data structure

toMap

public bibliothek.gui.dock.station.support.PlaceholderMap toMap(Map<bibliothek.gui.dock.perspective.PerspectiveDockable,Integer> children)
Converts this station into a map of PerspectiveDockables.

Parameters:
children - the unique identifiers of the children
Returns:
the map of dockables

setExpandedtState

public void setExpandedtState(ExpandedState state)
Sets the default size of this station

Parameters:
state - the size, not null

getExpandedState

public ExpandedState getExpandedState()
Gets the default size of this station.

Returns:
the size, not null

setOrientation

public void setOrientation(Orientation orientation)
Sets the orientation of this station. Please note that the orientation can be overriden by the parent DockStation.

Parameters:
orientation - the orientation, must not be null

getOrientation

public Orientation getOrientation()
Gets the orientation of this station.

Returns:
the orientation, not null

getModel

public ToolbarColumnModel<bibliothek.gui.dock.perspective.PerspectiveDockable,bibliothek.gui.dock.perspective.PerspectiveDockable> getModel()
Gets access to an abstraction of the model of this station. This is the same class that is used by the ToolbarGroupDockStation, hence it's behavior is identical.

Returns:
the model, can be monitored to receive information about changes

getDockable

public bibliothek.gui.dock.perspective.PerspectiveDockable getDockable(int column,
                                                                       int line)
Gets the item that is stored in column column at line line.

Parameters:
column - the column in which to search
line - the line in which the dockable should be found
Returns:
the item at column/line

getColumnCount

public int getColumnCount()
Gets the number of columns, only includes columns that contain at least one child.

Returns:
the number of non-empty columns

getLineCount

public int getLineCount(int column)
Gets the number of items in column.

Parameters:
column - the column whose size is asked
Returns:
the number of children in column

add

public void add(int column,
                bibliothek.gui.dock.perspective.PerspectiveDockable dockable)
Adds dockable at the end of column column. This method may create a new column.

Parameters:
column - the index of a column
dockable - the item to add to column

insert

public void insert(int column,
                   int line,
                   bibliothek.gui.dock.perspective.PerspectiveDockable dockable)
Adds dockable to column column at position line. This method may create a new column.

Parameters:
column - the column in which to insert the new item
line - the position in the column
dockable - the new item

insert

public void insert(int column,
                   bibliothek.gui.dock.perspective.PerspectiveDockable dockable)
Adds a new column to the grid and inserts dockable as first child. This method will try to reuse existing but empty columns if possible.

Parameters:
column - The index of the new column, can be -1 to create a column at the beginning of the list
dockable - the new item

remove

public void remove(int column,
                   int line)
Removes the item at column/line.

Parameters:
column - the column from which the dockable should be removed
line - the line in which the dockable is currently stored

getFactoryID

public String getFactoryID()
Specified by:
getFactoryID in interface bibliothek.gui.dock.perspective.PerspectiveElement

asStation

public bibliothek.gui.dock.perspective.PerspectiveStation asStation()
Specified by:
asStation in interface bibliothek.gui.dock.perspective.PerspectiveElement

asDockable

public bibliothek.gui.dock.perspective.PerspectiveDockable asDockable()
Specified by:
asDockable in interface bibliothek.gui.dock.perspective.PerspectiveElement
Specified by:
asDockable in interface bibliothek.gui.dock.station.support.PlaceholderListItem<bibliothek.gui.dock.perspective.PerspectiveDockable>

getPlaceholder

public bibliothek.util.Path getPlaceholder()
Specified by:
getPlaceholder in interface bibliothek.gui.dock.perspective.PerspectiveDockable

getParent

public bibliothek.gui.dock.perspective.PerspectiveStation getParent()
Specified by:
getParent in interface bibliothek.gui.dock.perspective.PerspectiveDockable

setParent

public void setParent(bibliothek.gui.dock.perspective.PerspectiveStation parent)
Specified by:
setParent in interface bibliothek.gui.dock.perspective.PerspectiveDockable

getDockableCount

public int getDockableCount()
Specified by:
getDockableCount in interface bibliothek.gui.dock.perspective.PerspectiveStation

getDockable

public bibliothek.gui.dock.perspective.PerspectiveDockable getDockable(int index)
Specified by:
getDockable in interface bibliothek.gui.dock.perspective.PerspectiveStation

getDockableProperty

public bibliothek.gui.dock.layout.DockableProperty getDockableProperty(bibliothek.gui.dock.perspective.PerspectiveDockable child,
                                                                       bibliothek.gui.dock.perspective.PerspectiveDockable target)
Specified by:
getDockableProperty in interface bibliothek.gui.dock.perspective.PerspectiveStation

getPlaceholders

public bibliothek.gui.dock.station.support.PlaceholderMap getPlaceholders()
Specified by:
getPlaceholders in interface bibliothek.gui.dock.perspective.PerspectiveStation

setPlaceholders

public void setPlaceholders(bibliothek.gui.dock.station.support.PlaceholderMap placeholders)
Specified by:
setPlaceholders in interface bibliothek.gui.dock.perspective.PerspectiveStation

remove

public boolean remove(bibliothek.gui.dock.perspective.PerspectiveDockable dockable)
Specified by:
remove in interface bibliothek.gui.dock.perspective.PerspectiveStation

replace

public void replace(bibliothek.gui.dock.perspective.PerspectiveDockable oldDockable,
                    bibliothek.gui.dock.perspective.PerspectiveDockable newDockable)
Specified by:
replace in interface bibliothek.gui.dock.perspective.PerspectiveStation