public abstract class ToolbarGroupSpanStrategy<P extends PlaceholderListItem<Dockable>> extends Object
Spans 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
Spans to present an insertion into column column. |
void |
mutate(int column,
int line)
|
void |
reset(boolean force)
Tests which columns and cells currently exist, and may create or delete
Span
if necessary. |
void |
setController(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
Dockables. |
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)
Dockables. The strategy is required
to find the minimum size of all gaps.dividers - the new strategy, can be nullprotected abstract void handleResized()
Span changed and the station must be resized.public void setController(DockController controller)
DockController in whose realm this strategy works, allows to access
the current SpanFactory.controller - the new controller, can be nullpublic void reset(boolean force)
Span
if necessary.force - if true, then the Spans 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)
Spans to present an insertion into column column.column - the column where an item is insertedpublic void mutate(int column,
int line)
column - the column where the insertion is happeningline - the line into which an item is insertedCopyright © 2018. All rights reserved.