public class ColumnGroupHeaderLayer extends AbstractLayerTransform
NatTable.saveState(String, Properties) is invoked.
Internally uses the ColumnGroupModel to track the column groups. See
ColumnGroupGridExampleunderlyingLayercommandHandlers, eventHandlers, eventHelperLock, layerPainterDOT, VALUE_SEPARATOR| Constructor and Description |
|---|
ColumnGroupHeaderLayer(ILayer columnHeaderLayer,
SelectionLayer selectionLayer,
ColumnGroupModel columnGroupModel) |
ColumnGroupHeaderLayer(ILayer columnHeaderLayer,
SelectionLayer selectionLayer,
ColumnGroupModel columnGroupModel,
boolean useDefaultConfiguration) |
| Modifier and Type | Method and Description |
|---|---|
void |
addColumnsIndexesToGroup(String colGroupName,
int... colIndexes) |
void |
clearAllGroups() |
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 column group
NOTE: gc.setClip() is used in the CompositeLayerPainter to ensure that
partially visible Column group header cells are rendered properly.
|
int |
getColumnSpan(int columnPosition)
Calculates the span of a cell in a Column Group.
|
LabelStack |
getConfigLabelsByPosition(int columnPosition,
int rowPosition) |
Object |
getDataValueByPosition(int columnPosition,
int rowPosition) |
String |
getDisplayModeByPosition(int columnPosition,
int rowPosition) |
int |
getHeight()
Returns the total height in pixels of this layer.
|
int |
getPreferredHeight() |
int |
getPreferredRowCount() |
Collection<String> |
getProvidedLabels() |
LabelStack |
getRegionLabelsByXY(int x,
int y)
Layer can apply its own labels to any cell it wishes.
|
int |
getRowCount() |
int |
getRowHeightByPosition(int rowPosition)
Returns the height in pixels of the given row.
|
int |
getRowIndexByPosition(int rowPosition)
Gets the underlying non-transformed row index for the given row position.
|
int |
getRowPositionByY(int y)
Returns the row position that contains the given y coordinate.
|
int |
getStartPositionOfGroup(int columnPosition)
Figures out the start position of the group.
|
int |
getStartYOfRowPosition(int rowPosition)
Returns the y offset in pixels of the given row.
|
boolean |
isCalculateHeight() |
boolean |
isColumnInGroup(int bodyColumnIndex) |
boolean |
isRowPositionResizable(int rowPosition) |
void |
loadState(String prefix,
Properties properties)
Underlying layers must load state first.
|
int |
localToUnderlyingRowPosition(int localRowPosition) |
void |
saveState(String prefix,
Properties properties)
Saves the state to the given Properties using the specified prefix.
|
void |
setCalculateHeight(boolean calculateHeight) |
void |
setGroupAsCollapsed(int columnIndex) |
void |
setGroupUnbreakable(int columnIndex) |
void |
setRowHeight(int rowHeight) |
void |
setStaticColumnIndexesByGroup(String colGroupName,
int... staticColumnIndexes) |
configure, dispose, doCommand, getCellPainter, getColumnCount, getColumnIndexByPosition, getColumnPositionByX, getColumnWidthByPosition, getLayerPainter, getPreferredColumnCount, getPreferredWidth, getStartXOfColumnPosition, getUnderlyingLayer, getUnderlyingLayerByPosition, getUnderlyingLayersByColumnPosition, getUnderlyingLayersByRowPosition, getWidth, isColumnPositionResizable, isDynamicSizeLayer, localToUnderlyingColumnPosition, setClientAreaProvider, setUnderlyingLayer, underlyingToLocalColumnPosition, underlyingToLocalColumnPositions, underlyingToLocalRowPosition, underlyingToLocalRowPositionsaddConfiguration, addLayerListener, clearConfiguration, fireLayerEvent, getBoundsByPosition, getClientAreaProvider, getConfigLabelAccumulator, getRegionName, handleLayerEvent, hasLayerListener, registerCommandHandler, registerCommandHandlers, registerEventHandler, registerPersistable, removeLayerListener, setConfigLabelAccumulator, setLayerPainter, setRegionName, toString, unregisterCommandHandler, unregisterEventHandler, unregisterPersistablepublic ColumnGroupHeaderLayer(ILayer columnHeaderLayer, SelectionLayer selectionLayer, ColumnGroupModel columnGroupModel)
public ColumnGroupHeaderLayer(ILayer columnHeaderLayer, SelectionLayer selectionLayer, ColumnGroupModel columnGroupModel, boolean useDefaultConfiguration)
public void saveState(String prefix, Properties properties)
IPersistablesaveState in interface IPersistablesaveState in class AbstractLayerTransformprefix - 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)
AbstractLayerTransformIStructuralChangeEvent from underlying layers will reset caches
after state has been loadedloadState in interface IPersistableloadState in class AbstractLayerTransformprefix - 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.public int getRowCount()
getRowCount in interface ILayergetRowCount in class AbstractLayerTransformpublic int getPreferredRowCount()
getPreferredRowCount in interface ILayergetPreferredRowCount in class AbstractLayerTransformpublic int getRowIndexByPosition(int rowPosition)
ILayergetRowIndexByPosition in interface ILayergetRowIndexByPosition in class AbstractLayerTransformrowPosition - a row position relative to this coordinate modelpublic int localToUnderlyingRowPosition(int localRowPosition)
localToUnderlyingRowPosition in interface ILayerlocalToUnderlyingRowPosition in class AbstractLayerTransformpublic int getHeight()
ILayergetHeight in interface ILayergetHeight in class AbstractLayerTransformpublic int getPreferredHeight()
getPreferredHeight in interface ILayergetPreferredHeight in class AbstractLayerTransformpublic int getRowHeightByPosition(int rowPosition)
ILayergetRowHeightByPosition in interface ILayergetRowHeightByPosition in class AbstractLayerTransformrowPosition - the row position in this layerpublic void setRowHeight(int rowHeight)
public boolean isRowPositionResizable(int rowPosition)
isRowPositionResizable in interface ILayerisRowPositionResizable in class AbstractLayerTransformpublic int getRowPositionByY(int y)
ILayergetRowPositionByY in interface ILayergetRowPositionByY in class AbstractLayerTransformy - a vertical pixel location relative to the pixel boundary of
this layerpublic int getStartYOfRowPosition(int rowPosition)
ILayergetStartYOfRowPosition in interface ILayergetStartYOfRowPosition in class AbstractLayerTransformrowPosition - the row position in this layerpublic ILayerCell getCellByPosition(int columnPosition, int rowPosition)
getCellByPosition in interface ILayergetCellByPosition in class AbstractLayerTransformpublic int getColumnSpan(int columnPosition)
columnPosition - position of any column belonging to the grouppublic int getStartPositionOfGroup(int columnPosition)
columnPosition - of any column belonging to the grouppublic String getDisplayModeByPosition(int columnPosition, int rowPosition)
getDisplayModeByPosition in interface ILayergetDisplayModeByPosition in class AbstractLayerTransformcolumnPosition - 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 ILayergetConfigLabelsByPosition in class AbstractLayerTransformpublic Object getDataValueByPosition(int columnPosition, int rowPosition)
getDataValueByPosition in interface ILayergetDataValueByPosition in class AbstractLayerTransformpublic LabelStack getRegionLabelsByXY(int x, int y)
ILayergetRegionLabelsByXY in interface ILayergetRegionLabelsByXY in class AbstractLayerTransformx - the x pixel coordinatey - the y pixel coordinatepublic void addColumnsIndexesToGroup(String colGroupName, int... colIndexes)
public void clearAllGroups()
public void setStaticColumnIndexesByGroup(String colGroupName, int... staticColumnIndexes)
public boolean isColumnInGroup(int bodyColumnIndex)
public void setGroupUnbreakable(int columnIndex)
public void setGroupAsCollapsed(int columnIndex)
public boolean isCalculateHeight()
public void setCalculateHeight(boolean calculateHeight)
public Collection<String> getProvidedLabels()
getProvidedLabels in class AbstractLayerCopyright © 2019. All rights reserved.