public class RowGroupHeaderLayer<T> extends AbstractLayerTransform
NatTable.saveState(String, Properties)
is invoked.
Internally uses the IRowGroupModel
to track the row groups.
See RowGroupGridExample
underlyingLayer
DOT, VALUE_SEPARATOR
Constructor and Description |
---|
RowGroupHeaderLayer(ILayer rowHeaderLayer,
SelectionLayer selectionLayer,
IRowGroupModel<T> rowGroupModel) |
RowGroupHeaderLayer(ILayer rowHeaderLayer,
SelectionLayer selectionLayer,
IRowGroupModel<T> rowGroupModel,
boolean useDefaultConfiguration) |
Modifier and Type | Method and Description |
---|---|
void |
clearAllGroups() |
void |
collapseRowGroupByIndex(int rowIndex) |
ILayerCell |
getCellByPosition(int columnPosition,
int rowPosition)
If a cell belongs to a column group:
column position - set to the start position of the group
span - set to the width/size of the row group
NOTE: gc.setClip() is used in the CompositeLayerPainter to ensure that partially visible
Column group header cells are rendered properly.
|
int |
getColumnCount() |
int |
getColumnIndexByPosition(int columnPosition)
Gets the underlying non-transformed column index for the given column position.
|
int |
getColumnPositionByX(int x)
Returns the column position that contains the given x coordinate.
|
int |
getColumnWidthByPosition(int columnPosition)
Returns the width in pixels of the given column.
|
LabelStack |
getConfigLabelsByPosition(int columnPosition,
int rowPosition) |
Object |
getDataValueByPosition(int columnPosition,
int rowPosition) |
String |
getDisplayModeByPosition(int columnPosition,
int rowPosition) |
ILayerPainter |
getLayerPainter() |
IRowGroupModel<T> |
getModel() |
int |
getPreferredColumnCount() |
int |
getPreferredWidth() |
LabelStack |
getRegionLabelsByXY(int x,
int y)
Layer can apply its own labels to any cell it wishes.
|
protected int |
getRowSpan(int rowPosition)
Calculates the span of a cell in a Row Group.
|
int |
getStartXOfColumnPosition(int columnPosition)
Returns the x offset in pixels of the given column.
|
int |
getWidth()
Returns the total width in pixels of this layer.
|
boolean |
isColumnPositionResizable(int columnPosition) |
void |
loadState(String prefix,
Properties properties)
Underlying layers must load state first.
|
protected void |
registerCommandHandlers()
Layers should use this method to register their command handlers
and call it from their constructor.
|
void |
saveState(String prefix,
Properties properties)
Saves the state to the given Properties using the specified prefix.
|
void |
setColumnWidth(int columnWidth) |
configure, dispose, doCommand, getCellPainter, getHeight, getPreferredHeight, getPreferredRowCount, getRowCount, getRowHeightByPosition, getRowIndexByPosition, getRowPositionByY, getStartYOfRowPosition, getUnderlyingLayer, getUnderlyingLayerByPosition, getUnderlyingLayersByColumnPosition, getUnderlyingLayersByRowPosition, isRowPositionResizable, localToUnderlyingColumnPosition, localToUnderlyingRowPosition, setClientAreaProvider, setUnderlyingLayer, underlyingToLocalColumnPosition, underlyingToLocalColumnPositions, underlyingToLocalRowPosition, underlyingToLocalRowPositions
addConfiguration, addLayerListener, clearConfiguration, fireLayerEvent, getBoundsByPosition, getClientAreaProvider, getConfigLabelAccumulator, getRegionName, handleLayerEvent, hasLayerListener, registerCommandHandler, registerEventHandler, registerPersistable, removeLayerListener, setConfigLabelAccumulator, setLayerPainter, setRegionName, toString, unregisterCommandHandler, unregisterPersistable
public RowGroupHeaderLayer(ILayer rowHeaderLayer, SelectionLayer selectionLayer, IRowGroupModel<T> rowGroupModel)
public RowGroupHeaderLayer(ILayer rowHeaderLayer, SelectionLayer selectionLayer, IRowGroupModel<T> rowGroupModel, boolean useDefaultConfiguration)
public IRowGroupModel<T> getModel()
public void saveState(String prefix, Properties properties)
IPersistable
saveState
in interface IPersistable
saveState
in class AbstractLayerTransform
prefix
- The prefix to use for the state keys. Is also used as the state
configuration name.properties
- The Properties instance to save the state to.public void loadState(String prefix, Properties properties)
AbstractLayerTransform
IStructuralChangeEvent
from underlying
layers will reset caches after state has been loadedloadState
in interface IPersistable
loadState
in class AbstractLayerTransform
prefix
- The prefix to use for the state keys. Is also used as the state
configuration name.properties
- The Properties instance to load the state from.protected void registerCommandHandlers()
AbstractLayer
registerCommandHandlers
in class AbstractLayer
public ILayerPainter getLayerPainter()
getLayerPainter
in interface ILayer
getLayerPainter
in class AbstractLayerTransform
ILayerPainter
. Defaults to GridLineCellLayerPainter
public int getColumnCount()
getColumnCount
in interface ILayer
getColumnCount
in class AbstractLayerTransform
public int getPreferredColumnCount()
getPreferredColumnCount
in interface ILayer
getPreferredColumnCount
in class AbstractLayerTransform
public int getColumnIndexByPosition(int columnPosition)
ILayer
getColumnIndexByPosition
in interface ILayer
getColumnIndexByPosition
in class AbstractLayerTransform
columnPosition
- a column position relative to this coordinate modelpublic int getWidth()
ILayer
getWidth
in interface ILayer
getWidth
in class AbstractLayerTransform
public int getPreferredWidth()
getPreferredWidth
in interface ILayer
getPreferredWidth
in class AbstractLayerTransform
public int getColumnWidthByPosition(int columnPosition)
ILayer
getColumnWidthByPosition
in interface ILayer
getColumnWidthByPosition
in class AbstractLayerTransform
columnPosition
- the column position in this layerpublic void setColumnWidth(int columnWidth)
public boolean isColumnPositionResizable(int columnPosition)
isColumnPositionResizable
in interface ILayer
isColumnPositionResizable
in class AbstractLayerTransform
public int getColumnPositionByX(int x)
ILayer
getColumnPositionByX
in interface ILayer
getColumnPositionByX
in class AbstractLayerTransform
x
- a horizontal pixel location relative to the pixel boundary of this layerpublic int getStartXOfColumnPosition(int columnPosition)
ILayer
getStartXOfColumnPosition
in interface ILayer
getStartXOfColumnPosition
in class AbstractLayerTransform
columnPosition
- the column position in this layerpublic ILayerCell getCellByPosition(int columnPosition, int rowPosition)
getCellByPosition
in interface ILayer
getCellByPosition
in class AbstractLayerTransform
protected int getRowSpan(int rowPosition)
rowPosition
- position of any row belonging to the grouppublic String getDisplayModeByPosition(int columnPosition, int rowPosition)
getDisplayModeByPosition
in interface ILayer
getDisplayModeByPosition
in class AbstractLayerTransform
columnPosition
- the column position of the cellrowPosition
- the row position of the cellDisplayMode
for the cell at the given position.
The DisplayMode
affects the settings out of the ConfigRegistry
.
Display mode is NORMAL by default.
Example: SelectionLayer
overrides this to return the SELECT
label for cells which are selected.
public LabelStack getConfigLabelsByPosition(int columnPosition, int rowPosition)
getConfigLabelsByPosition
in interface ILayer
getConfigLabelsByPosition
in class AbstractLayerTransform
public Object getDataValueByPosition(int columnPosition, int rowPosition)
getDataValueByPosition
in interface ILayer
getDataValueByPosition
in class AbstractLayerTransform
public LabelStack getRegionLabelsByXY(int x, int y)
ILayer
getRegionLabelsByXY
in interface ILayer
getRegionLabelsByXY
in class AbstractLayerTransform
x
- the x pixel coordinatey
- the y pixel coordinatepublic void collapseRowGroupByIndex(int rowIndex)
public void clearAllGroups()
Copyright © 2013. All Rights Reserved.