P - the type of object that represents a DockableC - the type of this subclasspublic abstract class AbstractToolbarGroupActions<P,C extends AbstractToolbarGroupActions.Column> extends Object implements ColumnDockActionSource
DockActionSource for each ToolbarColumn a ToolbarGroupDockStation
has. This class is built such that subclasses can easily access or modify the DockActionSources.| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractToolbarGroupActions.Column
Represents one column of the
ToolbarGroupDockStation. |
| Constructor and Description |
|---|
AbstractToolbarGroupActions(ToolbarGroupDockStation station)
Creates a new object
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(ColumnDockActionSourceListener listener)
Adds the observer
listener to this source. |
protected abstract C |
createColumn(ToolbarColumn<Dockable,P> column)
Creates a new, empty
AbstractToolbarGroupActions.Column which will be filled with content later. |
protected abstract Rectangle |
getBoundaries(P item)
Gets the bounds of the
Component item. |
protected C |
getColumn(Dockable dockable)
Searches the column which contains
dockable. |
C |
getColumn(int index)
Gets the
index'th column. |
int |
getColumnCount()
Gets the current number of columns.
|
protected List<C> |
getColumns()
Gets all the column that are currently known to this object.
|
ToolbarColumnModel<Dockable,P> |
getModel()
Gets the model which is currently observed by this object
|
Orientation |
getOrientation()
Gets the orientation of this source.
|
DockActionSource |
getSource(int index)
Gets the
index'th source of this ColumnDockActionSource. |
int |
getSourceCount()
Gets the total number of
DockActionSources that are currently available. |
int |
getSourceLength(int index)
Gets the available length in pixel for the
index'th source. |
int |
getSourceOffset(int index)
Gets the offset of the
index'th source in pixel. |
protected abstract void |
installListener(P item,
ComponentListener listener)
Installs the
ComponentListener listener such that changes on item that lead to
columns shifting position or size are recognized. |
protected ColumnDockActionSourceListener[] |
listeners()
Gets all the listeners that are currently registered.
|
void |
removeListener(ColumnDockActionSourceListener listener)
Removes the observer
listener from this source. |
void |
setModel(ToolbarColumnModel<Dockable,P> model)
Sets the model which should be observed by this
AbstractToolbarGroupActions, all existing columns
will be removed by this method. |
protected abstract void |
uninstallListener(P item,
ComponentListener listener)
Removes the listener
listener from item. |
public AbstractToolbarGroupActions(ToolbarGroupDockStation station)
station - the station which uses this set of actionspublic void addListener(ColumnDockActionSourceListener listener)
ColumnDockActionSourcelistener to this source.addListener in interface ColumnDockActionSourcelistener - the new observerpublic void removeListener(ColumnDockActionSourceListener listener)
ColumnDockActionSourcelistener from this source.removeListener in interface ColumnDockActionSourcelistener - the observer to removeprotected ColumnDockActionSourceListener[] listeners()
public void setModel(ToolbarColumnModel<Dockable,P> model)
AbstractToolbarGroupActions, all existing columns
will be removed by this method.model - the new model or nullpublic ToolbarColumnModel<Dockable,P> getModel()
nullprotected List<C> getColumns()
public int getColumnCount()
public int getSourceCount()
ColumnDockActionSourceDockActionSources that are currently available.getSourceCount in interface ColumnDockActionSourcepublic DockActionSource getSource(int index)
ColumnDockActionSourceindex'th source of this ColumnDockActionSource.getSource in interface ColumnDockActionSourceindex - the index of the sourceDockActionSource, must not be null but may be emptypublic Orientation getOrientation()
ColumnDockActionSourceColumnDockActionSource.getSourceOffset(int) points: either along the x, or along the y axis.getOrientation in interface ColumnDockActionSourcenullpublic C getColumn(int index)
index'th column.index - the location of the columnnullprotected C getColumn(Dockable dockable)
dockable.dockable - the element to searchdockable or null if not foundpublic int getSourceOffset(int index)
ColumnDockActionSourceindex'th source in pixel. The offset is relative to
the Dockable to which this ColumnDockActionSource belongs.getSourceOffset in interface ColumnDockActionSourceindex - the index of the sourcepublic int getSourceLength(int index)
ColumnDockActionSourceindex'th source.getSourceLength in interface ColumnDockActionSourceindex - the index of the sourceprotected abstract C createColumn(ToolbarColumn<Dockable,P> column)
AbstractToolbarGroupActions.Column which will be filled with content later.column - the column that is represented by the new objectnullprotected abstract Rectangle getBoundaries(P item)
Component item.item - the item whose boundaries are requiredprotected abstract void installListener(P item, ComponentListener listener)
ComponentListener listener such that changes on item that lead to
columns shifting position or size are recognized.item - the item which gets a new listenerlistener - the new listenerprotected abstract void uninstallListener(P item, ComponentListener listener)
listener from item.item - the item where the listener is to be removedlistener - the listener to removeCopyright © 2018. All rights reserved.