public class ToolbarDockStation extends AbstractToolbarDockStation
Dockable
and a DockStation
which stands for a group of
ToolbarItemDockable
. As dockable it can be put in DockStation
which implements marker interface ToolbarInterface
. As DockStation it
accept a ToolbarItemDockable
or a ToolbarDockStation
Modifier and Type | Class and Description |
---|---|
protected class |
ToolbarDockStation.OverpaintablePanelBase
This panel is used as base of the station.
|
protected class |
ToolbarDockStation.SizeFixedPanel
A panel with a fixed size (minimum, maximum and preferred size have
same values).
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DISPLAYER_ID
This id is forwarded to
Extension s which load additional
DisplayerFactory s |
protected bibliothek.gui.dock.station.support.DockablePlaceholderList<bibliothek.gui.dock.station.StationChildHandle> |
dockables
A list of all children
|
static bibliothek.gui.dock.util.PropertyKey<java.lang.Integer> |
GAP
Key for setting the size of the gap between the children of a
ToolbarDockStation . |
static bibliothek.gui.dock.util.PropertyKey<java.lang.Integer> |
SIDE_GAP
Key for setting the size of the gap between the children of a station and the border of the station
|
static java.lang.String |
TITLE_ID
the id of the
DockTitleFactory which is used by this station |
displayerFactory, displayers, ON_CONFLICT_ENABLE, orientation, paint, title
Constructor and Description |
---|
ToolbarDockStation()
Creates a new
ToolbarDockStation . |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(bibliothek.gui.Dockable child) |
boolean |
accept(bibliothek.gui.DockStation station) |
boolean |
accept(bibliothek.gui.DockStation base,
bibliothek.gui.Dockable neighbor) |
protected void |
add(bibliothek.gui.Dockable dockable,
int index) |
protected void |
add(bibliothek.gui.Dockable dockable,
int index,
bibliothek.util.Path placeholder) |
void |
aside(bibliothek.gui.dock.layout.location.AsideRequest request) |
protected void |
callDockUiUpdateTheme() |
void |
configureDisplayerHints(bibliothek.gui.dock.displayer.DockableDisplayerHints hints) |
protected javax.swing.JPanel |
createBackgroundPanel()
Creates the parent
JComponent of the Dockable s that are shown in this
station. |
protected bibliothek.gui.dock.themes.DefaultDisplayerFactoryValue |
createDisplayerFactory()
Creates a new
DefaultDisplayerFactoryValue , a factory used to
create new DockableDisplayer s. |
protected ToolbarDockStation.OverpaintablePanelBase |
createMainPanel()
Called by the constructor, this method creates the main component of this station.
|
protected bibliothek.gui.dock.component.DockComponentRootHandler |
createRootHandler() |
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) |
boolean |
drop(bibliothek.gui.Dockable dockable,
bibliothek.gui.dock.layout.DockableProperty property) |
boolean |
drop(bibliothek.gui.Dockable dockable,
int index)
Drops
dockable at location index . |
protected boolean |
drop(bibliothek.gui.Dockable dockable,
int index,
boolean force) |
java.awt.Component |
getComponent() |
protected java.lang.String |
getDisplayerId()
Gets a unique identifier used to get the
DisplayerFactory for this station. |
bibliothek.gui.Dockable |
getDockable(int index) |
int |
getDockableCount() |
bibliothek.gui.dock.layout.DockableProperty |
getDockableProperty(bibliothek.gui.Dockable child,
bibliothek.gui.Dockable target) |
protected bibliothek.gui.dock.layout.DockableProperty |
getDockableProperty(bibliothek.gui.Dockable child,
bibliothek.gui.Dockable target,
int index,
bibliothek.util.Path placeholder)
Creates a new
DockableProperty describing the location of
child on this station. |
protected bibliothek.gui.dock.station.support.PlaceholderList.Filter<bibliothek.gui.dock.station.StationChildHandle> |
getDockables()
Grants direct access to the list of
Dockable s, subclasses should
not modify the list unless the fire the appropriate events. |
java.lang.String |
getFactoryID() |
protected int |
getIndex(bibliothek.gui.dock.layout.DockableProperty property)
Gets the location of a
Dockable on this station. |
int |
getLateralNodropZoneSize()
Gets the size of the two lateral zones where no drop action can be done
(Measured in pixel).
|
bibliothek.gui.dock.station.layer.DockStationDropLayer[] |
getLayers() |
protected bibliothek.util.Path |
getPlaceholder(bibliothek.gui.dock.layout.DockableProperty property) |
bibliothek.gui.dock.station.PlaceholderMapping |
getPlaceholderMapping() |
bibliothek.gui.dock.station.support.PlaceholderMap |
getPlaceholders() |
bibliothek.gui.dock.station.support.PlaceholderMap |
getPlaceholders(java.util.Map<bibliothek.gui.Dockable,java.lang.Integer> children)
Gets the placeholders of this station using a
PlaceholderListItemConverter to encode the children. |
bibliothek.gui.dock.station.support.PlaceholderStrategy |
getPlaceholderStrategy()
Gets the
PlaceholderStrategy that is currently in use. |
protected void |
init() |
protected void |
insertAt(bibliothek.gui.dock.station.StationChildHandle handle,
int index) |
protected boolean |
isValidProperty(bibliothek.gui.dock.layout.DockableProperty property)
Tells whether the subclass knows how to handle
property . |
void |
move(bibliothek.gui.Dockable dockable,
bibliothek.gui.dock.layout.DockableProperty property) |
protected void |
move(bibliothek.gui.Dockable dockable,
int index)
Adds dockable at the specified index.
|
bibliothek.gui.dock.station.StationDropOperation |
prepareDrop(bibliothek.gui.dock.station.StationDropItem item) |
protected bibliothek.gui.dock.title.DockTitleVersion |
registerTitle(bibliothek.gui.DockController controller)
Registers the default
DockTitleFactory of this station at
controller and returns the associated
DockTitleVersion . |
protected void |
remove(bibliothek.gui.Dockable dockable)
Removes
dockable from this station.Note: clients may need to invoke DockController.freezeLayout()
and DockController.meltLayout() to ensure none else adds or
removes Dockable s. |
protected void |
remove(int index)
Removes the child with the given
index from this station.Note: clients may need to invoke DockController.freezeLayout()
and DockController.meltLayout() to ensure no-one else adds or
removes Dockable s. |
void |
replace(bibliothek.gui.Dockable old,
bibliothek.gui.Dockable next) |
void |
setController(bibliothek.gui.DockController controller) |
void |
setDockParent(bibliothek.gui.DockStation station) |
void |
setLateralNodropZoneSize(int lateralNodropZoneSize)
Sets the size of the two lateral zones where no drop action can be done
(Measured in pixel).
|
void |
setOrientation(Orientation orientation)
Sets the orientation of dockables in this station.
|
void |
setPlaceholders(bibliothek.gui.dock.station.support.PlaceholderMap placeholders) |
void |
setPlaceholders(bibliothek.gui.dock.station.support.PlaceholderMap map,
java.util.Map<java.lang.Integer,bibliothek.gui.Dockable> children)
Sets a new layout on this station, this method assumes that
map was created by the method getPlaceholders(Map) . |
void |
setPlaceholderStrategy(bibliothek.gui.dock.station.support.PlaceholderStrategy strategy)
Sets the
PlaceholderStrategy to use, null will set
the default strategy. |
addExpandableListener, addOrientingDockStationListener, canDrag, canReplace, expandableListeners, fireOrientingEvent, getBackgroundAlgorithm, getExpandedState, getFrontDockable, getOrientation, getOrientationOf, getPaint, getRemoval, getToolbarStrategy, indexOf, init, isEnabled, prepareDrag, removeExpandableListener, removeOrientingDockStationListener, replace, setExpandedState, setExpandedState, setFrontDockable, shrink, stretch, toString
acceptable, acceptable, addDockStationListener, asDockStation, changed, createTitleIcon, delegate, fireDockablesRepositioned, fireDockablesRepositioned, getDirectActionOffers, getIndirectActionOffers, getTheme, isChildShowing, isStationShowing, isStationVisible, isVisible, removeDockStationListener, requestChildDisplayer, requestChildDockTitle, updateTheme
addDockableListener, addDockableStateListener, addDockHierarchyListener, addKeyListener, addMouseInputListener, asDockable, bind, fireTitleBound, fireTitleExchanged, fireTitleExchanged, fireTitleIconChanged, fireTitleTextChanged, fireTitleTooltipChanged, fireTitleUnbound, getComponentConfiguration, getConfigurableDisplayerHints, getController, getDockableStateListeners, getDockElementObserver, getDockParent, getElement, getGlobalActionOffers, getLocalActionOffers, getPopupLocation, getRootHandler, getTitleIcon, getTitleIconHandling, getTitleText, getTitleToolTip, isDockableShowing, isDockableVisible, isUsedAsTitle, listBoundTitles, removeDockableListener, removeDockableStateListener, removeDockHierarchyListener, removeKeyListener, removeMouseInputListener, requestDisplayer, requestDockTitle, resetTitleIcon, setActionOffers, setComponentConfiguration, setTitleIcon, setTitleIconHandling, setTitleText, setTitleToolTip, shouldFocus, shouldTransfersFocus, unbind
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addDockStationListener, changed, getController, getDirectActionOffers, getIndirectActionOffers, getTheme, isChildShowing, isStationShowing, isStationVisible, isVisible, removeDockStationListener, requestChildDisplayer, requestChildDockTitle, updateTheme
getComponentConfiguration, setComponentConfiguration
addDockableListener, addDockableStateListener, addDockHierarchyListener, addMouseInputListener, bind, getController, getDockParent, getGlobalActionOffers, getLocalActionOffers, getTitleIcon, getTitleText, getTitleToolTip, isDockableShowing, isDockableVisible, listBoundTitles, removeDockableListener, removeDockableStateListener, removeDockHierarchyListener, removeMouseInputListener, requestDisplayer, requestDockTitle, unbind
public static final java.lang.String TITLE_ID
DockTitleFactory
which is used by this stationpublic static final java.lang.String DISPLAYER_ID
Extension
s which load additional
DisplayerFactory
spublic static final bibliothek.gui.dock.util.PropertyKey<java.lang.Integer> GAP
ToolbarDockStation
.public static final bibliothek.gui.dock.util.PropertyKey<java.lang.Integer> SIDE_GAP
protected bibliothek.gui.dock.station.support.DockablePlaceholderList<bibliothek.gui.dock.station.StationChildHandle> dockables
public ToolbarDockStation()
ToolbarDockStation
.protected void init()
protected bibliothek.gui.dock.component.DockComponentRootHandler createRootHandler()
createRootHandler
in class bibliothek.gui.dock.dockable.AbstractDockable
public java.awt.Component getComponent()
public void configureDisplayerHints(bibliothek.gui.dock.displayer.DockableDisplayerHints hints)
configureDisplayerHints
in interface bibliothek.gui.Dockable
configureDisplayerHints
in class bibliothek.gui.dock.dockable.AbstractDockable
public int getDockableCount()
public bibliothek.gui.Dockable getDockable(int index)
public java.lang.String getFactoryID()
public void setLateralNodropZoneSize(int lateralNodropZoneSize)
lateralNodropZoneSize
- the size of the rectangular lateral zones (in pixel)java.lang.IllegalArgumentException
- if the size is smaller than 0public int getLateralNodropZoneSize()
public void setDockParent(bibliothek.gui.DockStation station)
setDockParent
in interface bibliothek.gui.Dockable
setDockParent
in class bibliothek.gui.dock.dockable.AbstractDockable
public void setController(bibliothek.gui.DockController controller)
setController
in interface bibliothek.gui.Dockable
setController
in interface bibliothek.gui.DockStation
setController
in class AbstractToolbarDockStation
public void setOrientation(Orientation orientation)
OrientedDockStation
public bibliothek.gui.dock.station.layer.DockStationDropLayer[] getLayers()
getLayers
in interface bibliothek.gui.DockStation
getLayers
in class bibliothek.gui.dock.station.AbstractDockableStation
public boolean accept(bibliothek.gui.Dockable child)
accept
in interface bibliothek.gui.DockStation
accept
in class bibliothek.gui.dock.station.AbstractDockableStation
public boolean accept(bibliothek.gui.DockStation station)
accept
in interface bibliothek.gui.Dockable
accept
in class bibliothek.gui.dock.dockable.AbstractDockable
public boolean accept(bibliothek.gui.DockStation base, bibliothek.gui.Dockable neighbor)
accept
in interface bibliothek.gui.Dockable
accept
in class bibliothek.gui.dock.dockable.AbstractDockable
public bibliothek.gui.dock.station.StationDropOperation prepareDrop(bibliothek.gui.dock.station.StationDropItem item)
public void drop(bibliothek.gui.Dockable dockable)
public boolean drop(bibliothek.gui.Dockable dockable, int index)
dockable
at location index
.dockable
- the element to addindex
- the location of dockable
protected boolean drop(bibliothek.gui.Dockable dockable, int index, boolean force)
protected void move(bibliothek.gui.Dockable dockable, int index)
dockable
- the dockable to insertindex
- the index where insert the dockableprotected void add(bibliothek.gui.Dockable dockable, int index)
protected void add(bibliothek.gui.Dockable dockable, int index, bibliothek.util.Path placeholder)
protected void insertAt(bibliothek.gui.dock.station.StationChildHandle handle, int index)
public void drag(bibliothek.gui.Dockable dockable)
protected void remove(bibliothek.gui.Dockable dockable)
dockable
from this station.DockController.freezeLayout()
and DockController.meltLayout()
to ensure none else adds or
removes Dockable
s.remove
in class AbstractToolbarDockStation
dockable
- the child to removeprotected void remove(int index)
index
from this station.DockController.freezeLayout()
and DockController.meltLayout()
to ensure no-one else adds or
removes Dockable
s.index
- the index of the child that will be removedpublic void replace(bibliothek.gui.Dockable old, bibliothek.gui.Dockable next)
protected void callDockUiUpdateTheme() throws java.io.IOException
callDockUiUpdateTheme
in class bibliothek.gui.dock.station.AbstractDockableStation
java.io.IOException
protected bibliothek.gui.dock.themes.DefaultDisplayerFactoryValue createDisplayerFactory()
AbstractToolbarDockStation
DefaultDisplayerFactoryValue
, a factory used to
create new DockableDisplayer
s.createDisplayerFactory
in class AbstractToolbarDockStation
null
protected java.lang.String getDisplayerId()
DisplayerFactory
for this station.null
protected bibliothek.gui.dock.title.DockTitleVersion registerTitle(bibliothek.gui.DockController controller)
AbstractToolbarDockStation
DockTitleFactory
of this station at
controller
and returns the associated
DockTitleVersion
.registerTitle
in class AbstractToolbarDockStation
controller
- the controller at which the default title factory has to be
registeredprotected void discard(bibliothek.gui.dock.station.DockableDisplayer displayer)
displayer
with a new DockableDisplayer
.discard
in class AbstractToolbarDockStation
displayer
- the displayer to replacejava.lang.IllegalArgumentException
- if displayer
is not a child of this stationprotected ToolbarDockStation.OverpaintablePanelBase createMainPanel()
null
protected javax.swing.JPanel createBackgroundPanel()
JComponent
of the Dockable
s that are shown in this
station. The default behavior is to create a new ToolbarDockStation.SizeFixedPanel
, using
AbstractToolbarDockStation.getBackgroundAlgorithm()
for managing painting.createBackgroundPanel
in class AbstractToolbarDockStation
protected bibliothek.gui.dock.layout.DockableProperty getDockableProperty(bibliothek.gui.Dockable child, bibliothek.gui.Dockable target, int index, bibliothek.util.Path placeholder)
DockableProperty
describing the location of
child
on this station. This method is called by
getDockableProperty(Dockable, Dockable)
once the location and
placeholder of child
or target
have been
calculatedchild
- a child of this stationtarget
- the item whose position is searchedindex
- the location of child
placeholder
- the placeholder for target
or child
DockableProperty
that stores index
,
placeholder
and any other information a subclass
deems necessary to storeprotected boolean isValidProperty(bibliothek.gui.dock.layout.DockableProperty property)
property
.
This means that the type of property
is the same type as the
result of getDockableProperty(Dockable, Dockable, int, Path)
property
- the property to checktrue
if this subclass knows how to handle the type
of property
protected int getIndex(bibliothek.gui.dock.layout.DockableProperty property)
Dockable
on this station. Called only if
property
passed isValidProperty(DockableProperty)
.property
- some property created by
getDockableProperty(Dockable, Dockable, int, Path)
protected bibliothek.util.Path getPlaceholder(bibliothek.gui.dock.layout.DockableProperty property)
protected bibliothek.gui.dock.station.support.PlaceholderList.Filter<bibliothek.gui.dock.station.StationChildHandle> getDockables()
Dockable
s, subclasses should
not modify the list unless the fire the appropriate events.public bibliothek.gui.dock.station.support.PlaceholderMap getPlaceholders(java.util.Map<bibliothek.gui.Dockable,java.lang.Integer> children)
PlaceholderListItemConverter
to encode the children. The
converter puts the following parameters for each Dockable
into
the map:
children
children
- a unique identifier for each child of this stationpublic void setPlaceholders(bibliothek.gui.dock.station.support.PlaceholderMap map, java.util.Map<java.lang.Integer,bibliothek.gui.Dockable> children)
map
was created by the method getPlaceholders(Map)
.map
- the map to readchildren
- the new children of this stationjava.lang.IllegalStateException
- if there are children left on this stationpublic bibliothek.gui.dock.station.support.PlaceholderMap getPlaceholders()
public bibliothek.gui.dock.station.PlaceholderMapping getPlaceholderMapping()
public void setPlaceholders(bibliothek.gui.dock.station.support.PlaceholderMap placeholders)
public bibliothek.gui.dock.station.support.PlaceholderStrategy getPlaceholderStrategy()
PlaceholderStrategy
that is currently in use.null
public void setPlaceholderStrategy(bibliothek.gui.dock.station.support.PlaceholderStrategy strategy)
PlaceholderStrategy
to use, null
will set
the default strategy.strategy
- the new strategy, can be null
public bibliothek.gui.dock.layout.DockableProperty getDockableProperty(bibliothek.gui.Dockable child, bibliothek.gui.Dockable target)
public void aside(bibliothek.gui.dock.layout.location.AsideRequest request)
public boolean drop(bibliothek.gui.Dockable dockable, bibliothek.gui.dock.layout.DockableProperty property)
public void move(bibliothek.gui.Dockable dockable, bibliothek.gui.dock.layout.DockableProperty property)