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 String |
DISPLAYER_ID
This id is forwarded to
Extensions which load additional
DisplayerFactorys |
protected DockablePlaceholderList<StationChildHandle> |
dockables
A list of all children
|
static PropertyKey<Integer> |
GAP
Key for setting the size of the gap between the children of a
ToolbarDockStation. |
static PropertyKey<Integer> |
SIDE_GAP
Key for setting the size of the gap between the children of a station and the border of the station
|
static String |
TITLE_ID
the id of the
DockTitleFactory which is used by this station |
displayerFactory, displayers, ON_CONFLICT_ENABLE, orientation, paint, titlelisteners| Constructor and Description |
|---|
ToolbarDockStation()
Creates a new
ToolbarDockStation. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(Dockable child) |
boolean |
accept(DockStation station) |
boolean |
accept(DockStation base,
Dockable neighbor) |
protected void |
add(Dockable dockable,
int index) |
protected void |
add(Dockable dockable,
int index,
Path placeholder) |
void |
aside(AsideRequest request) |
protected void |
callDockUiUpdateTheme() |
void |
configureDisplayerHints(DockableDisplayerHints hints) |
protected JPanel |
createBackgroundPanel()
Creates the parent
JComponent of the Dockables that are shown in this
station. |
protected DefaultDisplayerFactoryValue |
createDisplayerFactory()
Creates a new
DefaultDisplayerFactoryValue, a factory used to
create new DockableDisplayers. |
protected ToolbarDockStation.OverpaintablePanelBase |
createMainPanel()
Called by the constructor, this method creates the main component of this station.
|
protected DockComponentRootHandler |
createRootHandler() |
protected void |
discard(DockableDisplayer displayer)
Replaces
displayer with a new DockableDisplayer. |
void |
drag(Dockable dockable) |
void |
drop(Dockable dockable) |
boolean |
drop(Dockable dockable,
DockableProperty property) |
boolean |
drop(Dockable dockable,
int index)
Drops
dockable at location index. |
protected boolean |
drop(Dockable dockable,
int index,
boolean force) |
Component |
getComponent() |
protected String |
getDisplayerId()
Gets a unique identifier used to get the
DisplayerFactory for this station. |
Dockable |
getDockable(int index) |
int |
getDockableCount() |
DockableProperty |
getDockableProperty(Dockable child,
Dockable target) |
protected DockableProperty |
getDockableProperty(Dockable child,
Dockable target,
int index,
Path placeholder)
Creates a new
DockableProperty describing the location of
child on this station. |
protected PlaceholderList.Filter<StationChildHandle> |
getDockables()
Grants direct access to the list of
Dockables, subclasses should
not modify the list unless the fire the appropriate events. |
String |
getFactoryID() |
protected int |
getIndex(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).
|
DockStationDropLayer[] |
getLayers() |
protected Path |
getPlaceholder(DockableProperty property) |
PlaceholderMapping |
getPlaceholderMapping() |
PlaceholderMap |
getPlaceholders() |
PlaceholderMap |
getPlaceholders(Map<Dockable,Integer> children)
Gets the placeholders of this station using a
PlaceholderListItemConverter to encode the children. |
PlaceholderStrategy |
getPlaceholderStrategy()
Gets the
PlaceholderStrategy that is currently in use. |
protected void |
init() |
protected void |
insertAt(StationChildHandle handle,
int index) |
protected boolean |
isValidProperty(DockableProperty property)
Tells whether the subclass knows how to handle
property. |
void |
move(Dockable dockable,
DockableProperty property) |
protected void |
move(Dockable dockable,
int index)
Adds dockable at the specified index.
|
StationDropOperation |
prepareDrop(StationDropItem item) |
protected DockTitleVersion |
registerTitle(DockController controller)
Registers the default
DockTitleFactory of this station at
controller and returns the associated
DockTitleVersion. |
protected void |
remove(Dockable dockable)
Removes
dockable from this station. |
protected void |
remove(int index)
Removes the child with the given
index from this station. |
void |
replace(Dockable old,
Dockable next) |
void |
setController(DockController controller) |
void |
setDockParent(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(PlaceholderMap placeholders) |
void |
setPlaceholders(PlaceholderMap map,
Map<Integer,Dockable> children)
Sets a new layout on this station, this method assumes that
map was created by the method getPlaceholders(Map). |
void |
setPlaceholderStrategy(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, toStringacceptable, acceptable, addDockStationListener, asDockStation, changed, createTitleIcon, delegate, fireDockablesRepositioned, fireDockablesRepositioned, getDirectActionOffers, getIndirectActionOffers, getTheme, isChildShowing, isStationShowing, isStationVisible, isVisible, removeDockStationListener, requestChildDisplayer, requestChildDockTitle, updateThemeaddDockableListener, 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, unbindclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddDockStationListener, changed, getController, getDirectActionOffers, getIndirectActionOffers, getTheme, isChildShowing, isStationShowing, isStationVisible, isVisible, removeDockStationListener, requestChildDisplayer, requestChildDockTitle, updateThemeasDockable, asDockStationgetComponentConfiguration, setComponentConfigurationaddDockableListener, addDockableStateListener, addDockHierarchyListener, addMouseInputListener, bind, getController, getDockParent, getGlobalActionOffers, getLocalActionOffers, getTitleIcon, getTitleText, getTitleToolTip, isDockableShowing, isDockableVisible, listBoundTitles, removeDockableListener, removeDockableStateListener, removeDockHierarchyListener, removeMouseInputListener, requestDisplayer, requestDockTitle, unbindgetElement, getPopupLocation, isUsedAsTitle, shouldFocus, shouldTransfersFocusasDockablepublic static final String TITLE_ID
DockTitleFactory which is used by this stationpublic static final String DISPLAYER_ID
Extensions which load additional
DisplayerFactoryspublic static final PropertyKey<Integer> GAP
ToolbarDockStation.public static final PropertyKey<Integer> SIDE_GAP
protected DockablePlaceholderList<StationChildHandle> dockables
public ToolbarDockStation()
ToolbarDockStation.protected void init()
protected DockComponentRootHandler createRootHandler()
createRootHandler in class AbstractDockablepublic Component getComponent()
public void configureDisplayerHints(DockableDisplayerHints hints)
configureDisplayerHints in interface DockableconfigureDisplayerHints in class AbstractDockablepublic int getDockableCount()
public Dockable getDockable(int index)
public String getFactoryID()
public void setLateralNodropZoneSize(int lateralNodropZoneSize)
lateralNodropZoneSize - the size of the rectangular lateral zones (in pixel)IllegalArgumentException - if the size is smaller than 0public int getLateralNodropZoneSize()
public void setDockParent(DockStation station)
setDockParent in interface DockablesetDockParent in class AbstractDockablepublic void setController(DockController controller)
setController in interface DockablesetController in interface DockStationsetController in class AbstractToolbarDockStationpublic void setOrientation(Orientation orientation)
OrientedDockStationpublic DockStationDropLayer[] getLayers()
getLayers in interface DockStationgetLayers in class AbstractDockableStationpublic boolean accept(Dockable child)
accept in interface DockStationaccept in class AbstractDockableStationpublic boolean accept(DockStation station)
accept in interface Dockableaccept in class AbstractDockablepublic boolean accept(DockStation base, Dockable neighbor)
accept in interface Dockableaccept in class AbstractDockablepublic StationDropOperation prepareDrop(StationDropItem item)
public void drop(Dockable dockable)
public boolean drop(Dockable dockable, int index)
dockable at location index.dockable - the element to addindex - the location of dockableprotected boolean drop(Dockable dockable, int index, boolean force)
protected void move(Dockable dockable, int index)
dockable - the dockable to insertindex - the index where insert the dockableprotected void add(Dockable dockable, int index)
protected void insertAt(StationChildHandle handle, int index)
public void drag(Dockable dockable)
protected void remove(Dockable dockable)
dockable from this station.DockController.freezeLayout()
and DockController.meltLayout() to ensure none else adds or
removes Dockables.remove in class AbstractToolbarDockStationdockable - 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 Dockables.index - the index of the child that will be removedprotected void callDockUiUpdateTheme()
throws IOException
callDockUiUpdateTheme in class AbstractDockableStationIOExceptionprotected DefaultDisplayerFactoryValue createDisplayerFactory()
AbstractToolbarDockStationDefaultDisplayerFactoryValue, a factory used to
create new DockableDisplayers.createDisplayerFactory in class AbstractToolbarDockStationnullprotected String getDisplayerId()
DisplayerFactory for this station.nullprotected DockTitleVersion registerTitle(DockController controller)
AbstractToolbarDockStationDockTitleFactory of this station at
controller and returns the associated
DockTitleVersion.registerTitle in class AbstractToolbarDockStationcontroller - the controller at which the default title factory has to be
registeredprotected void discard(DockableDisplayer displayer)
displayer with a new DockableDisplayer.discard in class AbstractToolbarDockStationdisplayer - the displayer to replaceIllegalArgumentException - if displayer is not a child of this stationprotected ToolbarDockStation.OverpaintablePanelBase createMainPanel()
nullprotected JPanel createBackgroundPanel()
JComponent of the Dockables 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 AbstractToolbarDockStationprotected DockableProperty getDockableProperty(Dockable child, Dockable target, int index, 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 childplaceholder - the placeholder for target or childDockableProperty that stores index,
placeholder and any other information a subclass
deems necessary to storeprotected boolean isValidProperty(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 propertyprotected int getIndex(DockableProperty property)
Dockable on this station. Called only if
property passed isValidProperty(DockableProperty).property - some property created by
getDockableProperty(Dockable, Dockable, int, Path)protected Path getPlaceholder(DockableProperty property)
protected PlaceholderList.Filter<StationChildHandle> getDockables()
Dockables, subclasses should
not modify the list unless the fire the appropriate events.public PlaceholderMap getPlaceholders(Map<Dockable,Integer> children)
PlaceholderListItemConverter to encode the children. The
converter puts the following parameters for each Dockable into
the map:
childrenchildren - a unique identifier for each child of this stationpublic void setPlaceholders(PlaceholderMap map, Map<Integer,Dockable> children)
map was created by the method getPlaceholders(Map).map - the map to readchildren - the new children of this stationIllegalStateException - if there are children left on this stationpublic PlaceholderMap getPlaceholders()
public PlaceholderMapping getPlaceholderMapping()
public void setPlaceholders(PlaceholderMap placeholders)
public PlaceholderStrategy getPlaceholderStrategy()
PlaceholderStrategy that is currently in use.nullpublic void setPlaceholderStrategy(PlaceholderStrategy strategy)
PlaceholderStrategy to use, null will set
the default strategy.strategy - the new strategy, can be nullpublic DockableProperty getDockableProperty(Dockable child, Dockable target)
public void aside(AsideRequest request)
public boolean drop(Dockable dockable, DockableProperty property)
public void move(Dockable dockable, DockableProperty property)
Copyright © 2018. All rights reserved.