Class FreezeLayer
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.layer.AbstractLayer
-
- org.eclipse.nebula.widgets.nattable.layer.AbstractIndexLayerTransform
-
- org.eclipse.nebula.widgets.nattable.freeze.FreezeLayer
-
- All Implemented Interfaces:
ILayer
,ILayerListener
,IUniqueIndexLayer
,IPersistable
public class FreezeLayer extends AbstractIndexLayerTransform
-
-
Field Summary
Fields Modifier and Type Field Description static String
PERSISTENCE_BOTTOM_RIGHT_POSITION
static String
PERSISTENCE_TOP_LEFT_POSITION
-
Fields inherited from class org.eclipse.nebula.widgets.nattable.layer.AbstractLayer
commandHandlers, eventHandlers, eventHelperLock, layerPainter
-
Fields inherited from interface org.eclipse.nebula.widgets.nattable.persistence.IPersistable
DOT, VALUE_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description FreezeLayer(IUniqueIndexLayer underlyingLayer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PositionCoordinate
getBottomRightPosition()
int
getColumnCount()
int
getColumnPositionByX(int x)
Returns the column position that contains the given x coordinate.int
getHeight()
Returns the total height in pixels of this layer.int
getPreferredColumnCount()
int
getPreferredHeight()
int
getPreferredRowCount()
int
getPreferredWidth()
int
getRowCount()
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.PositionCoordinate
getTopLeftPosition()
int
getWidth()
Returns the total width in pixels of this layer.boolean
isFrozen()
int
localToUnderlyingColumnPosition(int localColumnPosition)
Convert a column position to the coordinates of the underlying layer.int
localToUnderlyingRowPosition(int localRowPosition)
Convert a row position to the coordinates of the underlying layer.void
setBottomRightPosition(int rightColumnPosition, int bottomRowPosition)
void
setTopLeftPosition(int leftColumnPosition, int topRowPosition)
int
underlyingToLocalColumnPosition(ILayer sourceUnderlyingLayer, int underlyingColumnPosition)
Transforms the column position relative to the given underlying layer to this layer coordinates.int
underlyingToLocalRowPosition(ILayer sourceUnderlyingLayer, int underlyingRowPosition)
Transforms the row position relative to the given underlying layer to this layer coordinates.-
Methods inherited from class org.eclipse.nebula.widgets.nattable.layer.AbstractIndexLayerTransform
configure, dispose, doCommand, getCellByPosition, getCellPainter, getColumnIndexByPosition, getColumnPositionByIndex, getColumnWidthByPosition, getConfigLabelsByPosition, getDataValueByPosition, getDisplayModeByPosition, getLayerPainter, getRegionLabelsByXY, getRowHeightByPosition, getRowIndexByPosition, getRowPositionByIndex, getUnderlyingLayer, getUnderlyingLayerByPosition, getUnderlyingLayersByColumnPosition, getUnderlyingLayersByRowPosition, isColumnPositionResizable, isDynamicSizeLayer, isRowPositionResizable, loadState, saveState, setClientAreaProvider, setUnderlyingLayer, underlyingToLocalColumnPositions, underlyingToLocalRowPositions
-
Methods inherited from class org.eclipse.nebula.widgets.nattable.layer.AbstractLayer
addConfiguration, addLayerListener, clearConfiguration, fireLayerEvent, getBoundsByPosition, getClientAreaProvider, getConfigLabelAccumulator, getProvidedLabels, getRegionName, handleLayerEvent, hasLayerListener, registerCommandHandler, registerCommandHandlers, registerEventHandler, registerPersistable, removeLayerListener, setConfigLabelAccumulator, setLayerPainter, setRegionName, toString, unregisterCommandHandler, unregisterEventHandler, unregisterPersistable
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.nebula.widgets.nattable.layer.ILayer
addLayerListener, fireLayerEvent, getBoundsByPosition, getClientAreaProvider, getProvidedLabels, hasLayerListener, registerCommandHandler, registerPersistable, removeLayerListener, unregisterCommandHandler, unregisterPersistable
-
Methods inherited from interface org.eclipse.nebula.widgets.nattable.layer.ILayerListener
handleLayerEvent
-
-
-
-
Field Detail
-
PERSISTENCE_TOP_LEFT_POSITION
public static final String PERSISTENCE_TOP_LEFT_POSITION
- See Also:
- Constant Field Values
-
PERSISTENCE_BOTTOM_RIGHT_POSITION
public static final String PERSISTENCE_BOTTOM_RIGHT_POSITION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FreezeLayer
public FreezeLayer(IUniqueIndexLayer underlyingLayer)
-
-
Method Detail
-
isFrozen
public boolean isFrozen()
-
getTopLeftPosition
public PositionCoordinate getTopLeftPosition()
-
setTopLeftPosition
public void setTopLeftPosition(int leftColumnPosition, int topRowPosition)
-
getBottomRightPosition
public PositionCoordinate getBottomRightPosition()
-
setBottomRightPosition
public void setBottomRightPosition(int rightColumnPosition, int bottomRowPosition)
-
getColumnCount
public int getColumnCount()
- Specified by:
getColumnCount
in interfaceILayer
- Overrides:
getColumnCount
in classAbstractIndexLayerTransform
- Returns:
- The number of columns in this layer.
-
getPreferredColumnCount
public int getPreferredColumnCount()
- Specified by:
getPreferredColumnCount
in interfaceILayer
- Overrides:
getPreferredColumnCount
in classAbstractIndexLayerTransform
-
localToUnderlyingColumnPosition
public int localToUnderlyingColumnPosition(int localColumnPosition)
Description copied from interface:ILayer
Convert a column position to the coordinates of the underlying layer. This is possible since each layer is aware of its underlying layer.- Specified by:
localToUnderlyingColumnPosition
in interfaceILayer
- Overrides:
localToUnderlyingColumnPosition
in classAbstractIndexLayerTransform
- Parameters:
localColumnPosition
- column position in local (the layer's own) coordinates- Returns:
- column position in the underlying layer's coordinates
-
underlyingToLocalColumnPosition
public int underlyingToLocalColumnPosition(ILayer sourceUnderlyingLayer, int underlyingColumnPosition)
Description copied from interface:ILayer
Transforms the column position relative to the given underlying layer to this layer coordinates.- Specified by:
underlyingToLocalColumnPosition
in interfaceILayer
- Overrides:
underlyingToLocalColumnPosition
in classAbstractIndexLayerTransform
- Parameters:
sourceUnderlyingLayer
- The underlying layer to which the given column position matches.underlyingColumnPosition
- The column position in the given underlying layer that should be converted to a local column position.- Returns:
- The given column position transformed to be local to this layer.
-
getWidth
public int getWidth()
Description copied from interface:ILayer
Returns the total width in pixels of this layer.- Specified by:
getWidth
in interfaceILayer
- Overrides:
getWidth
in classAbstractIndexLayerTransform
- Returns:
- The total width in pixels of this layer.
-
getPreferredWidth
public int getPreferredWidth()
- Specified by:
getPreferredWidth
in interfaceILayer
- Overrides:
getPreferredWidth
in classAbstractIndexLayerTransform
-
getColumnPositionByX
public int getColumnPositionByX(int x)
Description copied from interface:ILayer
Returns the column position that contains the given x coordinate.- Specified by:
getColumnPositionByX
in interfaceILayer
- Overrides:
getColumnPositionByX
in classAbstractIndexLayerTransform
- Parameters:
x
- A horizontal pixel location relative to the pixel boundary of this layer.- Returns:
- A column position relative to the associated coordinate system, or -1 if there is no column that contains x.
-
getStartXOfColumnPosition
public int getStartXOfColumnPosition(int columnPosition)
Description copied from interface:ILayer
Returns the x offset in pixels of the given column.- Specified by:
getStartXOfColumnPosition
in interfaceILayer
- Overrides:
getStartXOfColumnPosition
in classAbstractIndexLayerTransform
- Parameters:
columnPosition
- The column position in this layer.- Returns:
- The x offset of the column, or -1.
-
getRowCount
public int getRowCount()
- Specified by:
getRowCount
in interfaceILayer
- Overrides:
getRowCount
in classAbstractIndexLayerTransform
- Returns:
- The number of rows in this layer.
-
getPreferredRowCount
public int getPreferredRowCount()
- Specified by:
getPreferredRowCount
in interfaceILayer
- Overrides:
getPreferredRowCount
in classAbstractIndexLayerTransform
-
localToUnderlyingRowPosition
public int localToUnderlyingRowPosition(int localRowPosition)
Description copied from interface:ILayer
Convert a row position to the coordinates of the underlying layer. This is possible since each layer is aware of its underlying layer.- Specified by:
localToUnderlyingRowPosition
in interfaceILayer
- Overrides:
localToUnderlyingRowPosition
in classAbstractIndexLayerTransform
- Parameters:
localRowPosition
- row position in local (the layer's own) coordinates- Returns:
- row position in the underlying layer's coordinates
-
underlyingToLocalRowPosition
public int underlyingToLocalRowPosition(ILayer sourceUnderlyingLayer, int underlyingRowPosition)
Description copied from interface:ILayer
Transforms the row position relative to the given underlying layer to this layer coordinates.- Specified by:
underlyingToLocalRowPosition
in interfaceILayer
- Overrides:
underlyingToLocalRowPosition
in classAbstractIndexLayerTransform
- Parameters:
sourceUnderlyingLayer
- The underlying layer to which the given row position matches.underlyingRowPosition
- The row position in the given underlying layer that should be converted to a local row position.- Returns:
- The given row position transformed to be local to this layer.
-
getHeight
public int getHeight()
Description copied from interface:ILayer
Returns the total height in pixels of this layer.- Specified by:
getHeight
in interfaceILayer
- Overrides:
getHeight
in classAbstractIndexLayerTransform
- Returns:
- The total height in pixels of this layer.
-
getPreferredHeight
public int getPreferredHeight()
- Specified by:
getPreferredHeight
in interfaceILayer
- Overrides:
getPreferredHeight
in classAbstractIndexLayerTransform
-
getRowPositionByY
public int getRowPositionByY(int y)
Description copied from interface:ILayer
Returns the row position that contains the given y coordinate.- Specified by:
getRowPositionByY
in interfaceILayer
- Overrides:
getRowPositionByY
in classAbstractIndexLayerTransform
- Parameters:
y
- a vertical pixel location relative to the pixel boundary of this layer- Returns:
- a row position relative to the associated coordinate system, or -1 if there is no row that contains y
-
getStartYOfRowPosition
public int getStartYOfRowPosition(int rowPosition)
Description copied from interface:ILayer
Returns the y offset in pixels of the given row.- Specified by:
getStartYOfRowPosition
in interfaceILayer
- Overrides:
getStartYOfRowPosition
in classAbstractIndexLayerTransform
- Parameters:
rowPosition
- the row position in this layer- Returns:
- the y offset of the row, or -1
-
-