public abstract class AbstractToolbarDockStation extends AbstractDockableStation implements OrientedDockStation, ExpandableToolbarItem
DockStation behaving like a typical toolbar: the
children are ordered in a list, an optional title and border may be shown.| Modifier and Type | Field and Description |
|---|---|
protected DefaultDisplayerFactoryValue |
displayerFactory
a factory used by
displayers to create new
DockableDisplayers |
protected DisplayerCollection |
displayers
a helper class ensuring that all properties of the
DockableDisplayers are set correctly |
static PropertyKey<Boolean> |
ON_CONFLICT_ENABLE
If it is not clear whether an
ExpandedState is enabled, because the involved Dockables offer different
enabled-states, then the value of this boolean is the result of the operation. |
protected Orientation |
orientation
Alignment of the content of this station
|
protected DefaultStationPaintValue |
paint
A paint to draw lines
|
protected DockTitleVersion |
title
a factory creating new
DockTitles |
listeners| Constructor and Description |
|---|
AbstractToolbarDockStation()
Constructs a new ToolbarDockStation.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addExpandableListener(ExpandableToolbarItemListener listener)
Adds the observer
listener to this item. |
void |
addOrientingDockStationListener(OrientingDockStationListener listener)
Adds the observer
listener to this station. |
boolean |
canDrag(Dockable dockable) |
boolean |
canReplace(Dockable old,
Dockable next) |
protected JPanel |
createBackgroundPanel()
Creates a new
JPanel which uses the background algorithm to
paint its content. |
protected abstract DefaultDisplayerFactoryValue |
createDisplayerFactory()
Creates a new
DefaultDisplayerFactoryValue, a factory used to
create new DockableDisplayers. |
protected abstract void |
discard(DockableDisplayer displayer)
Replaces
displayer with a new DockableDisplayer. |
protected ExpandableToolbarItemListener[] |
expandableListeners()
Gets all the
ExpandableToolbarItemListeners that are currently
registered. |
protected void |
fireOrientingEvent()
Fires an
OrientingDockStationEvent. |
protected BackgroundAlgorithm |
getBackgroundAlgorithm()
Gets the algorithm which should be used to paint this station.
|
ExpandedState |
getExpandedState()
Gets the current state of this item.
|
Dockable |
getFrontDockable() |
Orientation |
getOrientation()
Gets the orientation of dockables in this station.
|
Orientation |
getOrientationOf(Dockable child)
Tells what orientation
child has. |
DefaultStationPaintValue |
getPaint()
Gets a
StationPaint which is used to paint some lines onto this
station. |
protected Dockable |
getRemoval()
Gets the child of this station that is about to be removed.
|
ToolbarStrategy |
getToolbarStrategy()
Gets the
ToolbarStrategy that is currently used by this station. |
int |
indexOf(Dockable dockable)
Gets the location of
dockable in the component-panel. |
protected void |
init(String backgroundId)
Initializes the properties that depend on the subclasses
|
boolean |
isEnabled(ExpandedState state)
Tells whether this
ExpandableToolbarItem likes to be in state state. |
StationDragOperation |
prepareDrag(Dockable dockable) |
protected abstract DockTitleVersion |
registerTitle(DockController controller)
Registers the default
DockTitleFactory of this station at
controller and returns the associated
DockTitleVersion. |
protected abstract void |
remove(Dockable dockable)
Removes
dockable from this station. |
void |
removeExpandableListener(ExpandableToolbarItemListener listener)
Removes the observer
listener from this item. |
void |
removeOrientingDockStationListener(OrientingDockStationListener listener)
Removes the observer
listener from this station. |
void |
replace(DockStation old,
Dockable next) |
void |
setController(DockController controller) |
void |
setExpandedState(ExpandedState state)
Changes the state of this item to
state. |
void |
setExpandedState(ExpandedState state,
boolean action)
Sets the
ExpandedState of this station. |
void |
setFrontDockable(Dockable dockable) |
void |
shrink(ExpandedState state) |
void |
stretch() |
String |
toString() |
accept, acceptable, acceptable, addDockStationListener, asDockStation, callDockUiUpdateTheme, changed, createTitleIcon, delegate, fireDockablesRepositioned, fireDockablesRepositioned, getDirectActionOffers, getIndirectActionOffers, getLayers, getTheme, isChildShowing, isStationShowing, isStationVisible, isVisible, removeDockStationListener, requestChildDisplayer, requestChildDockTitle, updateThemeaccept, accept, addDockableListener, addDockableStateListener, addDockHierarchyListener, addKeyListener, addMouseInputListener, asDockable, bind, configureDisplayerHints, createRootHandler, 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, setDockParent, setTitleIcon, setTitleIconHandling, setTitleText, setTitleToolTip, shouldFocus, shouldTransfersFocus, unbindclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsetOrientationaccept, addDockStationListener, aside, changed, drag, drop, drop, getController, getDirectActionOffers, getDockable, getDockableCount, getDockableProperty, getIndirectActionOffers, getLayers, getPlaceholderMapping, getPlaceholders, getTheme, isChildShowing, isStationShowing, isStationVisible, isVisible, move, prepareDrop, removeDockStationListener, replace, requestChildDisplayer, requestChildDockTitle, setPlaceholders, updateThemeasDockable, asDockStation, getFactoryIDgetComponentConfiguration, setComponentConfigurationaccept, accept, addDockableListener, addDockableStateListener, addDockHierarchyListener, addMouseInputListener, bind, configureDisplayerHints, getComponent, getController, getDockParent, getGlobalActionOffers, getLocalActionOffers, getTitleIcon, getTitleText, getTitleToolTip, isDockableShowing, isDockableVisible, listBoundTitles, removeDockableListener, removeDockableStateListener, removeDockHierarchyListener, removeMouseInputListener, requestDisplayer, requestDockTitle, setDockParent, unbindgetElement, getPopupLocation, isUsedAsTitle, shouldFocus, shouldTransfersFocusasDockablepublic static final PropertyKey<Boolean> ON_CONFLICT_ENABLE
ExpandedState is enabled, because the involved Dockables offer different
enabled-states, then the value of this boolean is the result of the operation.protected DisplayerCollection displayers
DockableDisplayers are set correctlyprotected DefaultDisplayerFactoryValue displayerFactory
displayers to create new
DockableDisplayersprotected DockTitleVersion title
DockTitlesprotected DefaultStationPaintValue paint
protected Orientation orientation
public AbstractToolbarDockStation()
#init()
once the constructor has been executed.public void setController(DockController controller)
setController in interface DockablesetController in interface DockStationsetController in class AbstractDockableprotected void init(String backgroundId)
backgroundId - the identifier used for registering a BackgroundComponentprotected JPanel createBackgroundPanel()
JPanel which uses the background algorithm to
paint its content.protected BackgroundAlgorithm getBackgroundAlgorithm()
null until init(String) was calledpublic Dockable getFrontDockable()
getFrontDockable in interface DockStationpublic void setFrontDockable(Dockable dockable)
setFrontDockable in interface DockStationpublic int indexOf(Dockable dockable)
dockable in the component-panel.dockable - the Dockable to searchpublic Orientation getOrientation()
OrientedDockStationgetOrientation in interface OrientedDockStationpublic void addOrientingDockStationListener(OrientingDockStationListener listener)
OrientingDockStationlistener 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.addOrientingDockStationListener in interface OrientingDockStationlistener - the new observer, not nullpublic void removeOrientingDockStationListener(OrientingDockStationListener listener)
OrientingDockStationlistener from this station.removeOrientingDockStationListener in interface OrientingDockStationlistener - the listener to removepublic Orientation getOrientationOf(Dockable child)
OrientingDockStationchild has.getOrientationOf in interface OrientingDockStationchild - a child of this stationnullprotected void fireOrientingEvent()
OrientingDockStationEvent.public ExpandedState getExpandedState()
ExpandableToolbarItemgetExpandedState in interface ExpandableToolbarItem@FrameworkOnly public void setExpandedState(ExpandedState state, boolean action)
ExpandedState of this station.state - the new state, not nullaction - if true, then
setExpandedState(ExpandedState) is called. Otherwise
the property is changed without actually performing any
actions. The later option should only be used while loading a
layout.public void setExpandedState(ExpandedState state)
ExpandableToolbarItemstate. Note that state
can be any state, including those for which ExpandableToolbarItem.isEnabled(ExpandedState) returned
false.setExpandedState in interface ExpandableToolbarItemstate - the new statepublic boolean isEnabled(ExpandedState state)
ExpandableToolbarItemExpandableToolbarItem likes to be in state state.isEnabled in interface ExpandableToolbarItemstate - a possible statethis item likes to be in statepublic void stretch()
public void shrink(ExpandedState state)
public void addExpandableListener(ExpandableToolbarItemListener listener)
ExpandableToolbarItemlistener to this item.addExpandableListener in interface ExpandableToolbarItemlistener - the new listener, not nullpublic void removeExpandableListener(ExpandableToolbarItemListener listener)
ExpandableToolbarItemlistener from this item.removeExpandableListener in interface ExpandableToolbarItemlistener - the listener to removeprotected ExpandableToolbarItemListener[] expandableListeners()
ExpandableToolbarItemListeners that are currently
registered.public ToolbarStrategy getToolbarStrategy()
ToolbarStrategy that is currently used by this station.nullpublic boolean canDrag(Dockable dockable)
canDrag in interface DockStationprotected abstract void remove(Dockable dockable)
dockable from this station.DockController.freezeLayout()
and DockController.meltLayout() to ensure none else adds or
removes Dockables.dockable - the child to removepublic boolean canReplace(Dockable old, Dockable next)
canReplace in interface DockStationpublic void replace(DockStation old, Dockable next)
replace in interface DockStationpublic StationDragOperation prepareDrag(Dockable dockable)
prepareDrag in interface DockStationprotected Dockable getRemoval()
nullprotected abstract DefaultDisplayerFactoryValue createDisplayerFactory()
DefaultDisplayerFactoryValue, a factory used to
create new DockableDisplayers.nullpublic DefaultStationPaintValue getPaint()
StationPaint which is used to paint some lines onto this
station. Use a delegate to exchange the paint.protected abstract DockTitleVersion registerTitle(DockController controller)
DockTitleFactory of this station at
controller and returns the associated
DockTitleVersion.controller - the controller at which the default title factory has to be
registeredprotected abstract void discard(DockableDisplayer displayer)
displayer with a new DockableDisplayer.displayer - the displayer to replaceIllegalArgumentException - if displayer is not a child of this stationCopyright © 2018. All rights reserved.