P
- the type of object that represents a Dockable
C
- 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 DockActionSource
s.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<bibliothek.gui.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(bibliothek.gui.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<bibliothek.gui.Dockable,P> |
getModel()
Gets the model which is currently observed by this object
|
Orientation |
getOrientation()
Gets the orientation of this source.
|
bibliothek.gui.dock.action.DockActionSource |
getSource(int index)
Gets the
index 'th source of this ColumnDockActionSource . |
int |
getSourceCount()
Gets the total number of
DockActionSource s 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<bibliothek.gui.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)
ColumnDockActionSource
listener
to this source.addListener
in interface ColumnDockActionSource
listener
- the new observerpublic void removeListener(ColumnDockActionSourceListener listener)
ColumnDockActionSource
listener
from this source.removeListener
in interface ColumnDockActionSource
listener
- the observer to removeprotected ColumnDockActionSourceListener[] listeners()
public void setModel(ToolbarColumnModel<bibliothek.gui.Dockable,P> model)
AbstractToolbarGroupActions
, all existing columns
will be removed by this method.model
- the new model or null
public ToolbarColumnModel<bibliothek.gui.Dockable,P> getModel()
null
protected List<C> getColumns()
public int getColumnCount()
public int getSourceCount()
ColumnDockActionSource
DockActionSource
s that are currently available.getSourceCount
in interface ColumnDockActionSource
public bibliothek.gui.dock.action.DockActionSource getSource(int index)
ColumnDockActionSource
index
'th source of this ColumnDockActionSource
.getSource
in interface ColumnDockActionSource
index
- the index of the sourceDockActionSource
, must not be null
but may be emptypublic Orientation getOrientation()
ColumnDockActionSource
ColumnDockActionSource.getSourceOffset(int)
points: either along the x, or along the y axis.getOrientation
in interface ColumnDockActionSource
null
public C getColumn(int index)
index
'th column.index
- the location of the columnnull
protected C getColumn(bibliothek.gui.Dockable dockable)
dockable
.dockable
- the element to searchdockable
or null
if not foundpublic int getSourceOffset(int index)
ColumnDockActionSource
index
'th source in pixel. The offset is relative to
the Dockable
to which this ColumnDockActionSource
belongs.getSourceOffset
in interface ColumnDockActionSource
index
- the index of the sourcepublic int getSourceLength(int index)
ColumnDockActionSource
index
'th source.getSourceLength
in interface ColumnDockActionSource
index
- the index of the sourceprotected abstract C createColumn(ToolbarColumn<bibliothek.gui.Dockable,P> column)
AbstractToolbarGroupActions.Column
which will be filled with content later.column
- the column that is represented by the new objectnull
protected 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 remove