bibliothek.gui.dock
Class ToolbarContainerDockStation

java.lang.Object
  extended by bibliothek.gui.dock.dockable.AbstractDockable
      extended by bibliothek.gui.dock.station.AbstractDockableStation
          extended by bibliothek.gui.dock.ToolbarContainerDockStation
All Implemented Interfaces:
bibliothek.gui.dock.DockElement, bibliothek.gui.dock.DockElementRepresentative, OrientedDockStation, OrientingDockStation, bibliothek.gui.dock.station.support.PlaceholderListItem<bibliothek.gui.Dockable>, bibliothek.gui.Dockable, bibliothek.gui.DockStation
Direct Known Subclasses:
CommonToolbarContainerDockStation

public class ToolbarContainerDockStation
extends bibliothek.gui.dock.station.AbstractDockableStation
implements OrientingDockStation, OrientedDockStation

A Dockable and a DockStation which stands for a group of ToolbarGroupDockStation. As dockable it can be put in every DockStation. As DockStation it accepts only ToolbarElementInterfaces. When ToolbarElement are added, all the ComponentDockable extracted from the element are merged together and wrapped in a ToolbarGroupDockStation before to be added.

Author:
Herve Guillaume

Nested Class Summary
protected  class ToolbarContainerDockStation.OverpaintablePanelBase
          This panel is used as base of the station.
 
Field Summary
static Orientation DEFAULT_ORIENTATION
           
static String DISPLAYER_ID
          This id is forwarded to Extensions which load additional DisplayerFactorys
protected  ToolbarContainerDockStation.OverpaintablePanelBase mainPanel
          The graphical representation of this station: the pane which contains toolbars
static String TITLE_ID
          the id of the DockTitleFactory used with this station
 
Fields inherited from class bibliothek.gui.dock.station.AbstractDockableStation
listeners
 
Constructor Summary
ToolbarContainerDockStation(Orientation orientation)
          Constructs a new ContainerLineStation
ToolbarContainerDockStation(Orientation orientation, int maxNumberOfDockables)
          Creates a new station
 
Method Summary
 boolean accept(bibliothek.gui.Dockable child)
           
 boolean accept(bibliothek.gui.DockStation station)
           
protected  boolean add(bibliothek.gui.Dockable dockable, int index)
          Add one dockable at the index position.
protected  boolean add(bibliothek.gui.Dockable dockable, int index, bibliothek.util.Path placeholder)
           
 void addOrientingDockStationListener(OrientingDockStationListener listener)
          Adds the observer listener to this station.
 void aside(bibliothek.gui.dock.layout.location.AsideRequest request)
           
protected  void callDockUiUpdateTheme()
           
 boolean canDrag(bibliothek.gui.Dockable dockable)
           
 boolean canReplace(bibliothek.gui.Dockable old, bibliothek.gui.Dockable next)
           
protected  ToolbarContainerConverter createConverter()
          Creates a ToolbarContainerConverter which will be used for one call.
protected  void discard(bibliothek.gui.dock.station.DockableDisplayer displayer)
          Replaces displayer with a new DockableDisplayer.
 void drag(bibliothek.gui.Dockable dockable)
           
 void drop(bibliothek.gui.Dockable dockable)
          Adds dockable to this station.
 boolean drop(bibliothek.gui.Dockable dockable, bibliothek.gui.dock.layout.DockableProperty property)
           
protected  void fireOrientingEvent()
          Fires an OrientingDockStationEvent.
 Component getComponent()
           
 JPanel getContainerPanel()
          Gets the panel which contains dockables
 bibliothek.gui.Dockable getDockable(int index)
           
 int getDockableCount()
           
 bibliothek.gui.dock.layout.DockableProperty getDockableProperty(bibliothek.gui.Dockable child, bibliothek.gui.Dockable target)
           
 bibliothek.gui.dock.station.support.DockablePlaceholderList<bibliothek.gui.dock.station.StationChildHandle> getDockables()
          Gets the dockables in the station
 int getDockablesMaxNumber()
          Gets the number of dockables that this station will accept.
 String getFactoryID()
           
 bibliothek.gui.Dockable getFrontDockable()
           
 bibliothek.gui.dock.station.layer.DockStationDropLayer[] getLayers()
           
 Orientation getOrientation()
          Gets the orientation of dockables in the station
 Orientation getOrientationOf(bibliothek.gui.Dockable child)
          Tells what orientation child has.
 bibliothek.gui.dock.themes.DefaultStationPaintValue getPaint()
          Gets a StationPaint which is used to paint some lines onto this station.
 bibliothek.gui.dock.station.support.PlaceholderMap getPlaceholders()
           
 bibliothek.gui.dock.station.support.PlaceholderMap getPlaceholders(Map<bibliothek.gui.Dockable,Integer> children)
          Gets the layout of this station encoded as PlaceholderMap.
 bibliothek.gui.dock.station.support.PlaceholderStrategy getPlaceholderStrategy()
          Gets the PlaceholderStrategy that is currently in use.
 int getSideSnapSize()
          Gets the number of pixels outside the station where a drag and drop operation can still start
 ToolbarStrategy getToolbarStrategy()
          Gets the ToolbarStrategy that is currently used by this station.
 void move(bibliothek.gui.Dockable dockable, bibliothek.gui.dock.layout.DockableProperty property)
           
 bibliothek.gui.dock.station.StationDragOperation prepareDrag(bibliothek.gui.Dockable dockable)
           
 bibliothek.gui.dock.station.StationDropOperation prepareDrop(bibliothek.gui.dock.station.StationDropItem item)
           
 void removeOrientingDockStationListener(OrientingDockStationListener listener)
          Removes the observer listener from this station.
 void replace(bibliothek.gui.Dockable old, bibliothek.gui.Dockable next)
           
 void replace(bibliothek.gui.DockStation old, bibliothek.gui.Dockable next)
           
 void setController(bibliothek.gui.DockController controller)
           
 void setDockablesMaxNumber(int max)
          Sets the number of dockables that this station will accept (max = -1 indicates that there's no limit).
 void setDockParent(bibliothek.gui.DockStation station)
           
 void setFrontDockable(bibliothek.gui.Dockable dockable)
           
 void setOrientation(Orientation orientation)
          Sets the orientation of dockables in the station
 void setPlaceholders(bibliothek.gui.dock.station.support.PlaceholderMap placeholders)
           
 void setPlaceholders(bibliothek.gui.dock.station.support.PlaceholderMap placeholders, Map<Integer,bibliothek.gui.Dockable> children)
          Sets the layout of this station using the encoded layout from placeholders
 void setPlaceholderStrategy(bibliothek.gui.dock.station.support.PlaceholderStrategy strategy)
          Sets the PlaceholderStrategy to use, null will set the default strategy.
 void setSideSnapSize(int sideSnapSize)
          Sets the number of pixels outside the station where a drag and drop operation can still start.
 String toString()
           
 
Methods inherited from class bibliothek.gui.dock.station.AbstractDockableStation
acceptable, acceptable, addDockStationListener, asDockStation, changed, createTitleIcon, delegate, fireDockablesRepositioned, fireDockablesRepositioned, getDirectActionOffers, getIndirectActionOffers, getTheme, isChildShowing, isStationShowing, isStationVisible, isVisible, removeDockStationListener, requestChildDisplayer, requestChildDockTitle, updateTheme
 
Methods inherited from class bibliothek.gui.dock.dockable.AbstractDockable
accept, addDockableListener, addDockableStateListener, addDockHierarchyListener, addKeyListener, addMouseInputListener, asDockable, bind, configureDisplayerHints, fireTitleBound, fireTitleExchanged, fireTitleExchanged, fireTitleIconChanged, fireTitleTextChanged, fireTitleTooltipChanged, fireTitleUnbound, getConfigurableDisplayerHints, getController, getDockableStateListeners, getDockElementObserver, getDockParent, getElement, getGlobalActionOffers, getLocalActionOffers, getPopupLocation, getTitleIcon, getTitleIconHandling, getTitleText, getTitleToolTip, isDockableShowing, isDockableVisible, isUsedAsTitle, listBoundTitles, removeDockableListener, removeDockableStateListener, removeDockHierarchyListener, removeKeyListener, removeMouseInputListener, requestDisplayer, requestDockTitle, resetTitleIcon, setActionOffers, setTitleIcon, setTitleIconHandling, setTitleText, setTitleToolTip, shouldFocus, shouldTransfersFocus, unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface bibliothek.gui.DockStation
addDockStationListener, changed, getController, getDirectActionOffers, getIndirectActionOffers, getTheme, isChildShowing, isStationShowing, isStationVisible, isVisible, removeDockStationListener, requestChildDisplayer, requestChildDockTitle, updateTheme
 
Methods inherited from interface bibliothek.gui.dock.DockElement
asDockable, asDockStation
 

Field Detail

TITLE_ID

public static final String TITLE_ID
the id of the DockTitleFactory used with this station

See Also:
Constant Field Values

DISPLAYER_ID

public static final String DISPLAYER_ID
This id is forwarded to Extensions which load additional DisplayerFactorys

See Also:
Constant Field Values

DEFAULT_ORIENTATION

public static final Orientation DEFAULT_ORIENTATION

mainPanel

protected ToolbarContainerDockStation.OverpaintablePanelBase mainPanel
The graphical representation of this station: the pane which contains toolbars

Constructor Detail

ToolbarContainerDockStation

public ToolbarContainerDockStation(Orientation orientation)
Constructs a new ContainerLineStation


ToolbarContainerDockStation

public ToolbarContainerDockStation(Orientation orientation,
                                   int maxNumberOfDockables)
Creates a new station

Parameters:
orientation - the orientation of the content
maxNumberOfDockables - the maximum number of children or -1
Method Detail

getDockableCount

public int getDockableCount()
Specified by:
getDockableCount in interface bibliothek.gui.DockStation

getDockable

public bibliothek.gui.Dockable getDockable(int index)
Specified by:
getDockable in interface bibliothek.gui.DockStation

getFrontDockable

public bibliothek.gui.Dockable getFrontDockable()
Specified by:
getFrontDockable in interface bibliothek.gui.DockStation

setFrontDockable

public void setFrontDockable(bibliothek.gui.Dockable dockable)
Specified by:
setFrontDockable in interface bibliothek.gui.DockStation

getPlaceholders

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

getPlaceholders

public bibliothek.gui.dock.station.support.PlaceholderMap getPlaceholders(Map<bibliothek.gui.Dockable,Integer> children)
Gets the layout of this station encoded as PlaceholderMap.

Parameters:
children - identifiers for the children
Returns:
the encoded layout, not null

setPlaceholders

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

setPlaceholders

public void setPlaceholders(bibliothek.gui.dock.station.support.PlaceholderMap placeholders,
                            Map<Integer,bibliothek.gui.Dockable> children)
Sets the layout of this station using the encoded layout from placeholders

Parameters:
placeholders - the placeholders to read
children - the children to add

createConverter

protected ToolbarContainerConverter createConverter()
Creates a ToolbarContainerConverter which will be used for one call.

Returns:
the new converter, not null

getPlaceholderStrategy

public bibliothek.gui.dock.station.support.PlaceholderStrategy getPlaceholderStrategy()
Gets the PlaceholderStrategy that is currently in use.

Returns:
the current strategy, may be null

setPlaceholderStrategy

public void setPlaceholderStrategy(bibliothek.gui.dock.station.support.PlaceholderStrategy strategy)
Sets the PlaceholderStrategy to use, null will set the default strategy.

Parameters:
strategy - the new strategy, can be null

getDockableProperty

public bibliothek.gui.dock.layout.DockableProperty getDockableProperty(bibliothek.gui.Dockable child,
                                                                       bibliothek.gui.Dockable target)
Specified by:
getDockableProperty in interface bibliothek.gui.DockStation

aside

public void aside(bibliothek.gui.dock.layout.location.AsideRequest request)
Specified by:
aside in interface bibliothek.gui.DockStation

prepareDrag

public bibliothek.gui.dock.station.StationDragOperation prepareDrag(bibliothek.gui.Dockable dockable)
Specified by:
prepareDrag in interface bibliothek.gui.DockStation

setSideSnapSize

public void setSideSnapSize(int sideSnapSize)
Sets the number of pixels outside the station where a drag and drop operation can still start.

Parameters:
sideSnapSize - the size in pixels

getSideSnapSize

public int getSideSnapSize()
Gets the number of pixels outside the station where a drag and drop operation can still start

Returns:
the size in pixels

getLayers

public bibliothek.gui.dock.station.layer.DockStationDropLayer[] getLayers()
Specified by:
getLayers in interface bibliothek.gui.DockStation
Overrides:
getLayers in class bibliothek.gui.dock.station.AbstractDockableStation

prepareDrop

public bibliothek.gui.dock.station.StationDropOperation prepareDrop(bibliothek.gui.dock.station.StationDropItem item)
Specified by:
prepareDrop in interface bibliothek.gui.DockStation

addOrientingDockStationListener

public void addOrientingDockStationListener(OrientingDockStationListener listener)
Description copied from interface: OrientingDockStation
Adds the observer listener to this station. The observer receives an event if the orientation of a child of this station changed. The observer may or may not receive an event upon dropping a new Dockable onto this station.

Specified by:
addOrientingDockStationListener in interface OrientingDockStation
Parameters:
listener - the new observer, not null

removeOrientingDockStationListener

public void removeOrientingDockStationListener(OrientingDockStationListener listener)
Description copied from interface: OrientingDockStation
Removes the observer listener from this station.

Specified by:
removeOrientingDockStationListener in interface OrientingDockStation
Parameters:
listener - the listener to remove

getOrientationOf

public Orientation getOrientationOf(bibliothek.gui.Dockable child)
Description copied from interface: OrientingDockStation
Tells what orientation child has.

Specified by:
getOrientationOf in interface OrientingDockStation
Parameters:
child - a child of this station
Returns:
the orientation, never null

setDockablesMaxNumber

public void setDockablesMaxNumber(int max)
Sets the number of dockables that this station will accept (max = -1 indicates that there's no limit).

Parameters:
max - the number of dockables accepted

getDockablesMaxNumber

public int getDockablesMaxNumber()
Gets the number of dockables that this station will accept.

Returns:
the number of dockables accepted (-1 if there is no maximum number)

fireOrientingEvent

protected void fireOrientingEvent()
Fires an OrientingDockStationEvent.

Parameters:
dockables - the items whose orientation changed

drop

public boolean drop(bibliothek.gui.Dockable dockable,
                    bibliothek.gui.dock.layout.DockableProperty property)
Specified by:
drop in interface bibliothek.gui.DockStation

drop

public void drop(bibliothek.gui.Dockable dockable)
Adds dockable to this station. The dockable must be a ToolbarElementInterface : if not, do nothing. The dockable is added at the last position.

Specified by:
drop in interface bibliothek.gui.DockStation
Parameters:
dockable - a new child

move

public void move(bibliothek.gui.Dockable dockable,
                 bibliothek.gui.dock.layout.DockableProperty property)
Specified by:
move in interface bibliothek.gui.DockStation

canDrag

public boolean canDrag(bibliothek.gui.Dockable dockable)
Specified by:
canDrag in interface bibliothek.gui.DockStation

drag

public void drag(bibliothek.gui.Dockable dockable)
Specified by:
drag in interface bibliothek.gui.DockStation

canReplace

public boolean canReplace(bibliothek.gui.Dockable old,
                          bibliothek.gui.Dockable next)
Specified by:
canReplace in interface bibliothek.gui.DockStation

replace

public void replace(bibliothek.gui.Dockable old,
                    bibliothek.gui.Dockable next)
Specified by:
replace in interface bibliothek.gui.DockStation

replace

public void replace(bibliothek.gui.DockStation old,
                    bibliothek.gui.Dockable next)
Specified by:
replace in interface bibliothek.gui.DockStation

getFactoryID

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

getComponent

public Component getComponent()
Specified by:
getComponent in interface bibliothek.gui.dock.DockElementRepresentative
Specified by:
getComponent in interface bibliothek.gui.Dockable

callDockUiUpdateTheme

protected void callDockUiUpdateTheme()
                              throws IOException
Specified by:
callDockUiUpdateTheme in class bibliothek.gui.dock.station.AbstractDockableStation
Throws:
IOException

getContainerPanel

public JPanel getContainerPanel()
Gets the panel which contains dockables

Returns:
the panel which contains dockables

getToolbarStrategy

public ToolbarStrategy getToolbarStrategy()
Gets the ToolbarStrategy that is currently used by this station.

Returns:
the strategy, never null

accept

public boolean accept(bibliothek.gui.Dockable child)
Specified by:
accept in interface bibliothek.gui.DockStation
Overrides:
accept in class bibliothek.gui.dock.station.AbstractDockableStation

accept

public boolean accept(bibliothek.gui.DockStation station)
Specified by:
accept in interface bibliothek.gui.Dockable
Overrides:
accept in class bibliothek.gui.dock.dockable.AbstractDockable

toString

public String toString()
Overrides:
toString in class Object

getDockables

public bibliothek.gui.dock.station.support.DockablePlaceholderList<bibliothek.gui.dock.station.StationChildHandle> getDockables()
Gets the dockables in the station

Returns:
the dockables associated with the station

getOrientation

public Orientation getOrientation()
Gets the orientation of dockables in the station

Specified by:
getOrientation in interface OrientedDockStation
Returns:
the orientation

setOrientation

public void setOrientation(Orientation orientation)
Sets the orientation of dockables in the station

Specified by:
setOrientation in interface OrientedDockStation
Parameters:
orientation - the orientation

add

protected boolean add(bibliothek.gui.Dockable dockable,
                      int index)
Add one dockable at the index position. The dockable can be a ToolbarItemDockable, ToolbarDockStation or a ToolbarGroupDockStation (see method accept()). All the ComponentDockable extracted from the element are merged together and wrapped in a ToolbarDockStation before to be added at index position

Parameters:
dockable - Dockable to add
index - Index where add dockable
Returns:
true if dropping was successfull

add

protected boolean add(bibliothek.gui.Dockable dockable,
                      int index,
                      bibliothek.util.Path placeholder)

discard

protected void discard(bibliothek.gui.dock.station.DockableDisplayer displayer)
Replaces displayer with a new DockableDisplayer.

Parameters:
displayer - the displayer to replace, must actually be shown on this station

getPaint

public bibliothek.gui.dock.themes.DefaultStationPaintValue getPaint()
Gets a StationPaint which is used to paint some lines onto this station. Use a delegate to exchange the paint.

Returns:
the paint

setDockParent

public void setDockParent(bibliothek.gui.DockStation station)
Specified by:
setDockParent in interface bibliothek.gui.Dockable
Overrides:
setDockParent in class bibliothek.gui.dock.dockable.AbstractDockable

setController

public void setController(bibliothek.gui.DockController controller)
Specified by:
setController in interface bibliothek.gui.Dockable
Specified by:
setController in interface bibliothek.gui.DockStation
Overrides:
setController in class bibliothek.gui.dock.dockable.AbstractDockable