public class AbstractIndexLayerTransform extends AbstractLayer implements IUniqueIndexLayer
layerPainter
DOT, VALUE_SEPARATOR
Constructor and Description |
---|
AbstractIndexLayerTransform() |
AbstractIndexLayerTransform(IUniqueIndexLayer underlyingLayer) |
Modifier and Type | Method and Description |
---|---|
void |
configure(ConfigRegistry configRegistry,
UiBindingRegistry uiBindingRegistry)
Every layer gets this call back, starting at the top of the stack.
|
void |
dispose() |
boolean |
doCommand(ILayerCommand command)
Opportunity to respond to a command as it flows down the stack.
|
ILayerCell |
getCellByPosition(int columnPosition,
int rowPosition) |
ICellPainter |
getCellPainter(int columnPosition,
int rowPosition,
ILayerCell cell,
IConfigRegistry configRegistry) |
int |
getColumnCount() |
int |
getColumnIndexByPosition(int columnPosition)
Gets the underlying non-transformed column index for the given column position.
|
int |
getColumnPositionByIndex(int columnIndex) |
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) |
int |
getHeight()
Returns the total height in pixels of this layer.
|
ILayerPainter |
getLayerPainter() |
int |
getPreferredColumnCount() |
int |
getPreferredHeight() |
int |
getPreferredRowCount() |
int |
getPreferredWidth() |
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 |
getRowPositionByIndex(int rowIndex) |
int |
getRowPositionByY(int y)
Returns the row position that contains the given y coordinate.
|
int |
getStartXOfColumnPosition(int columnPosition)
Returns the x offset in pixels of the given column.
|
int |
getStartYOfRowPosition(int rowPosition)
Returns the y offset in pixels of the given row.
|
protected IUniqueIndexLayer |
getUnderlyingLayer() |
ILayer |
getUnderlyingLayerByPosition(int columnPosition,
int rowPosition) |
Collection<ILayer> |
getUnderlyingLayersByColumnPosition(int columnPosition) |
Collection<ILayer> |
getUnderlyingLayersByRowPosition(int rowPosition) |
int |
getWidth()
Returns the total width in pixels of this layer.
|
boolean |
isColumnPositionResizable(int columnPosition) |
boolean |
isRowPositionResizable(int rowPosition) |
void |
loadState(String prefix,
Properties properties)
Underlying layers must load state first.
|
int |
localToUnderlyingColumnPosition(int localColumnPosition)
Convert a column position to the coordinates of the underlying layer.
|
int |
localToUnderlyingRowPosition(int localRowPosition) |
void |
saveState(String prefix,
Properties properties)
Saves the state to the given Properties using the specified prefix.
|
void |
setClientAreaProvider(IClientAreaProvider clientAreaProvider) |
protected void |
setUnderlyingLayer(IUniqueIndexLayer underlyingLayer) |
int |
underlyingToLocalColumnPosition(ILayer sourceUnderlyingLayer,
int underlyingColumnPosition) |
Collection<Range> |
underlyingToLocalColumnPositions(ILayer sourceUnderlyingLayer,
Collection<Range> underlyingColumnPositionRanges) |
int |
underlyingToLocalRowPosition(ILayer sourceUnderlyingLayer,
int underlyingRowPosition) |
Collection<Range> |
underlyingToLocalRowPositions(ILayer sourceUnderlyingLayer,
Collection<Range> underlyingRowPositionRanges) |
addConfiguration, addLayerListener, clearConfiguration, fireLayerEvent, getBoundsByPosition, getClientAreaProvider, getConfigLabelAccumulator, getRegionName, handleLayerEvent, hasLayerListener, registerCommandHandler, registerCommandHandlers, registerEventHandler, registerPersistable, removeLayerListener, setConfigLabelAccumulator, setLayerPainter, setRegionName, toString, unregisterCommandHandler, unregisterPersistable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addLayerListener, fireLayerEvent, getBoundsByPosition, getClientAreaProvider, hasLayerListener, registerCommandHandler, registerPersistable, removeLayerListener, unregisterCommandHandler, unregisterPersistable
handleLayerEvent
public AbstractIndexLayerTransform()
public AbstractIndexLayerTransform(IUniqueIndexLayer underlyingLayer)
protected void setUnderlyingLayer(IUniqueIndexLayer underlyingLayer)
protected final IUniqueIndexLayer getUnderlyingLayer()
public void dispose()
dispose
in interface ILayer
dispose
in class AbstractLayer
public void saveState(String prefix, Properties properties)
IPersistable
saveState
in interface IPersistable
saveState
in class AbstractLayer
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)
IStructuralChangeEvent
from underlying
layers will reset caches after state has been loadedloadState
in interface IPersistable
loadState
in class AbstractLayer
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.public void configure(ConfigRegistry configRegistry, UiBindingRegistry uiBindingRegistry)
ILayer
NatTable.configure()
method. This is an opportunity to add
any key/mouse bindings and other general configuration.public ILayerPainter getLayerPainter()
getLayerPainter
in interface ILayer
getLayerPainter
in class AbstractLayer
ILayerPainter
. Defaults to GridLineCellLayerPainter
public boolean doCommand(ILayerCommand command)
ILayer
ILayerCommand.convertToTargetLayer(ILayer)
doCommand
in interface ILayer
doCommand
in class AbstractLayer
command
- the command to performpublic void setClientAreaProvider(IClientAreaProvider clientAreaProvider)
setClientAreaProvider
in interface ILayer
setClientAreaProvider
in class AbstractLayer
public int getColumnCount()
getColumnCount
in interface ILayer
public int getPreferredColumnCount()
getPreferredColumnCount
in interface ILayer
public int getColumnIndexByPosition(int columnPosition)
ILayer
getColumnIndexByPosition
in interface ILayer
columnPosition
- a column position relative to this coordinate modelpublic int localToUnderlyingColumnPosition(int localColumnPosition)
ILayer
localToUnderlyingColumnPosition
in interface ILayer
localColumnPosition
- column position in local (the layer's own) coordinatespublic int underlyingToLocalColumnPosition(ILayer sourceUnderlyingLayer, int underlyingColumnPosition)
underlyingToLocalColumnPosition
in interface ILayer
public Collection<Range> underlyingToLocalColumnPositions(ILayer sourceUnderlyingLayer, Collection<Range> underlyingColumnPositionRanges)
underlyingToLocalColumnPositions
in interface ILayer
public int getColumnPositionByIndex(int columnIndex)
getColumnPositionByIndex
in interface IUniqueIndexLayer
public int getWidth()
ILayer
public int getPreferredWidth()
getPreferredWidth
in interface ILayer
public int getColumnWidthByPosition(int columnPosition)
ILayer
getColumnWidthByPosition
in interface ILayer
columnPosition
- the column position in this layerpublic boolean isColumnPositionResizable(int columnPosition)
isColumnPositionResizable
in interface ILayer
public int getColumnPositionByX(int x)
ILayer
getColumnPositionByX
in interface ILayer
x
- a horizontal pixel location relative to the pixel boundary of this layerpublic int getStartXOfColumnPosition(int columnPosition)
ILayer
getStartXOfColumnPosition
in interface ILayer
columnPosition
- the column position in this layerpublic Collection<ILayer> getUnderlyingLayersByColumnPosition(int columnPosition)
getUnderlyingLayersByColumnPosition
in interface ILayer
public int getRowCount()
getRowCount
in interface ILayer
public int getPreferredRowCount()
getPreferredRowCount
in interface ILayer
public int getRowIndexByPosition(int rowPosition)
ILayer
getRowIndexByPosition
in interface ILayer
rowPosition
- a row position relative to this coordinate modelpublic int localToUnderlyingRowPosition(int localRowPosition)
localToUnderlyingRowPosition
in interface ILayer
public int underlyingToLocalRowPosition(ILayer sourceUnderlyingLayer, int underlyingRowPosition)
underlyingToLocalRowPosition
in interface ILayer
public Collection<Range> underlyingToLocalRowPositions(ILayer sourceUnderlyingLayer, Collection<Range> underlyingRowPositionRanges)
underlyingToLocalRowPositions
in interface ILayer
public int getRowPositionByIndex(int rowIndex)
getRowPositionByIndex
in interface IUniqueIndexLayer
public int getHeight()
ILayer
public int getPreferredHeight()
getPreferredHeight
in interface ILayer
public int getRowHeightByPosition(int rowPosition)
ILayer
getRowHeightByPosition
in interface ILayer
rowPosition
- the row position in this layerpublic boolean isRowPositionResizable(int rowPosition)
isRowPositionResizable
in interface ILayer
public int getRowPositionByY(int y)
ILayer
getRowPositionByY
in interface ILayer
y
- a vertical pixel location relative to the pixel boundary of this layerpublic int getStartYOfRowPosition(int rowPosition)
ILayer
getStartYOfRowPosition
in interface ILayer
rowPosition
- the row position in this layerpublic Collection<ILayer> getUnderlyingLayersByRowPosition(int rowPosition)
getUnderlyingLayersByRowPosition
in interface ILayer
public ILayerCell getCellByPosition(int columnPosition, int rowPosition)
getCellByPosition
in interface ILayer
getCellByPosition
in class AbstractLayer
public String getDisplayModeByPosition(int columnPosition, int rowPosition)
getDisplayModeByPosition
in interface ILayer
getDisplayModeByPosition
in class AbstractLayer
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 AbstractLayer
public Object getDataValueByPosition(int columnPosition, int rowPosition)
getDataValueByPosition
in interface ILayer
public ICellPainter getCellPainter(int columnPosition, int rowPosition, ILayerCell cell, IConfigRegistry configRegistry)
getCellPainter
in interface ILayer
getCellPainter
in class AbstractLayer
public LabelStack getRegionLabelsByXY(int x, int y)
ILayer
getRegionLabelsByXY
in interface ILayer
getRegionLabelsByXY
in class AbstractLayer
x
- the x pixel coordinatey
- the y pixel coordinatepublic ILayer getUnderlyingLayerByPosition(int columnPosition, int rowPosition)
getUnderlyingLayerByPosition
in interface ILayer
Copyright © 2013. All Rights Reserved.