public abstract class ToolbarGroupSpanStrategy<P extends bibliothek.gui.dock.station.support.PlaceholderListItem<bibliothek.gui.Dockable>> extends Object
Span
s of a ToolbarGroupDockStation
. To
be exact: the class offers a Span
for each gap between columns or lines, and is able to update
the size of the spans when knowing the current drag and drop operation.Constructor and Description |
---|
ToolbarGroupSpanStrategy(DockablePlaceholderToolbarGrid<P> grid,
ToolbarGroupDockStation station)
Creates a new strategy
|
Modifier and Type | Method and Description |
---|---|
int |
getColumn(int index)
Gets the size of the gap left of the column
index . |
int |
getLine(int column,
int index)
Gets the size of the gap top of the cell
index of column . |
protected abstract void |
handleResized()
Called if the size of a
Span changed and the station must be resized. |
void |
mutate(int column)
Mutates the
Span s to present an insertion into column column . |
void |
mutate(int column,
int line)
Mutates the
Span s to present an insertion into column at line . |
void |
reset(boolean force)
Tests which columns and cells currently exist, and may create or delete
Span
if necessary. |
void |
setController(bibliothek.gui.DockController controller)
Sets the
DockController in whose realm this strategy works, allows to access
the current SpanFactory . |
void |
setDividers(ToolbarGroupDividerStrategy dividers)
Sets the strategy for painting between the
Dockable s. |
public ToolbarGroupSpanStrategy(DockablePlaceholderToolbarGrid<P> grid, ToolbarGroupDockStation station)
grid
- all the columns and theirs cellsstation
- the station that is using this strategypublic void setDividers(ToolbarGroupDividerStrategy dividers)
Dockable
s. The strategy is required
to find the minimum size of all gaps.dividers
- the new strategy, can be null
protected abstract void handleResized()
Span
changed and the station must be resized.public void setController(bibliothek.gui.DockController controller)
DockController
in whose realm this strategy works, allows to access
the current SpanFactory
.controller
- the new controller, can be null
public void reset(boolean force)
Span
if necessary.force
- if true
, then the Span
s get recreated even if the number of
columns and lines did not changepublic int getColumn(int index)
index
. If there are n
columns, index=n
will return the size of the right most gap.index
- the index of a columnpublic int getLine(int column, int index)
index
of column
. If there
are n
cells, then index=n
will return the size of the bottom most gap.column
- the column in which to searchindex
- the index of the cellpublic void mutate(int column)
Span
s to present an insertion into column column
.column
- the column where an item is insertedpublic void mutate(int column, int line)
Span
s to present an insertion into column
at line
.column
- the column where the insertion is happeningline
- the line into which an item is inserted