Class DataLayer
- All Implemented Interfaces:
ILayer
,ILayerListener
,IUniqueIndexLayer
,IPersistable
- Direct Known Subclasses:
BaseDataLayerFixture
,BaseDataLayerFixture
,DefaultColumnHeaderDataLayer
,DefaultRowHeaderDataLayer
,FilterRowDataLayer
,GroupByDataLayer
,SpanningDataLayer
IDataProvider
, and serves as the data source for all other
layers. Also, tracks the size of the columns and the rows using
SizeConfig
objects. Since this layer sits directly on top of the data
source, at this layer index == position.-
Field Summary
Modifier and TypeFieldDescriptionprotected SizeConfig
protected IDataProvider
static final int
static final int
static final String
static final String
protected SizeConfig
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
ModifierConstructorDescriptionprotected
protected
DataLayer
(int defaultColumnWidth, int defaultRowHeight) DataLayer
(IDataProvider dataProvider) DataLayer
(IDataProvider dataProvider, int defaultColumnWidth, int defaultRowHeight) -
Method Summary
Modifier and TypeMethodDescriptionboolean
doCommand
(ILayerCommand command) Opportunity to respond to a command as it flows down the stack.int
downScaleColumnWidth
(int value) Calculates the column width value dependent on a possible configured scaling from DPI to pixel value.int
downScaleRowHeight
(int value) Calculates the row height value dependent on a possible configured scaling from DPI to pixel value.int
int
getColumnIndexByPosition
(int columnPosition) This is the root coordinate system, so the column index is always equal to the column position.int
getColumnPositionByIndex
(int columnIndex) This is the root coordinate system, so the column position is always equal to the column index.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.int
getConfiguredColumnWidthByPosition
(int columnPosition) Returns the width of the given column position without any transformation.double
getConfiguredColumnWidthPercentageByPosition
(int columnPosition) Returns the configured width in percent of the given column position.int
getConfiguredMinColumnWidthByPosition
(int columnPosition) Returns the configured minimum width of the given column position without any transformation.int
getConfiguredMinRowHeightByPosition
(int rowPosition) Returns the configured minimum height of the given row position without any transformation.int
getConfiguredRowHeightByPosition
(int rowPosition) Returns the height of the given row position without any transformation.double
getConfiguredRowHeightPercentageByPosition
(int rowPosition) Returns the configured height in percent of the given row position.getDataValue
(int columnIndex, int rowIndex) Gets the value at the given column and row index.getDataValueByPosition
(int columnPosition, int rowPosition) Returns the data value for the cell at the given coordinates.int
int
int
int
int
Returns the total height in pixels of this layer.int
getMinColumnWidth
(int position) Returns the minimum column width for the given position.int
getMinRowHeight
(int position) Returns the minimum row height for the given position.int
int
int
int
int
int
getRowHeightByPosition
(int rowPosition) Returns the height in pixels of the given row.int
getRowIndexByPosition
(int rowPosition) This is the root coordinate system, so the row index is always equal to the row position.int
getRowPositionByIndex
(int rowIndex) This is the root coordinate system, so the row position is always equal to the row index.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.getUnderlyingLayerByPosition
(int columnPosition, int rowPosition) Returns the layer that is directly below this layer for the given cell coordinate.getUnderlyingLayersByColumnPosition
(int columnPosition) Returns the layers that are directly below this layer for the given column position.getUnderlyingLayersByRowPosition
(int rowPosition) Returns the layers that are directly below this layer for the given row position.int
getWidth()
Returns the total width in pixels of this layer.boolean
boolean
isColumnPercentageSizing
(int position) boolean
isColumnPositionResizable
(int columnPosition) Check if the column at the given position is resizable.boolean
boolean
boolean
Return whether dynamic percentage sized column positions should be fixed on any resize or not.boolean
Return whether dynamic percentage sized row positions should be fixed on any resize or not.boolean
boolean
isMinColumnWidthConfigured
(int position) boolean
boolean
isMinRowHeightConfigured
(int position) boolean
boolean
isRowPercentageSizing
(int position) boolean
isRowPositionResizable
(int rowPosition) Check if the row at the given position is resizable.void
loadState
(String prefix, Properties properties) Restore the state out of the given Properties identified by the specified prefix.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.protected void
Layers should use this method to register their command handlers and call it from their constructor.void
resetColumnWidth
(int position, boolean fireEvent) This method will reset a custom set column width to the default size.void
resetColumnWidthConfiguration
(boolean fireEvent) This method will reset all column width customizations, e.g.void
resetMinColumnWidth
(int position, boolean fireEvent) This method will reset a custom set minimum column width to the default minimum size.void
resetMinRowHeight
(int position, boolean fireEvent) This method will reset a custom set minimum row height to the default minimum size.void
resetRowHeight
(int position, boolean fireEvent) This method will reset a custom set row height to the default size.void
resetRowHeightConfiguration
(boolean fireEvent) This method will reset all row height customizations, e.g.void
saveState
(String prefix, Properties properties) Saves the state to the given Properties using the specified prefix.void
setColumnPercentageSizing
(boolean percentageSizing) Configures how the column sizing of thisDataLayer
is handled, either pixel sizing or percentage sizing.void
setColumnPercentageSizing
(int position, boolean percentageSizing) Configures how the column sizing of thisDataLayer
is handled for the given column.void
setColumnPositionResizable
(int columnPosition, boolean resizable) void
setColumnsResizableByDefault
(boolean resizableByDefault) void
setColumnWidthByPosition
(int columnPosition, int width) void
setColumnWidthByPosition
(int columnPosition, int width, boolean fireEvent) void
setColumnWidthPercentageByPosition
(int columnPosition, double width) Set the width of the column at the given position to the given percentage value.void
setColumnWidthPercentageByPosition
(int columnPosition, int width) void
setDataProvider
(IDataProvider dataProvider) Set theIDataProvider
to use.void
setDataValue
(int columnIndex, int rowIndex, Object newValue) Sets the value at the given column and row index.void
setDataValueByPosition
(int columnPosition, int rowPosition, Object newValue) void
setDefaultColumnWidth
(int width) void
setDefaultColumnWidthByPosition
(int columnPosition, int width) void
setDefaultMinColumnWidth
(int defaultMinWidth) Set the default minimum column width.void
setDefaultMinRowHeight
(int defaultMinHeight) Set the default minimum row height.void
setDefaultRowHeight
(int height) void
setDefaultRowHeightByPosition
(int rowPosition, int height) void
setDistributeRemainingColumnSpace
(boolean distributeRemaining) Configure the percentage sizing behavior when manually specifying percentages and not having 100% configured.void
setDistributeRemainingRowSpace
(boolean distributeRemaining) Configure the percentage sizing behavior when manually specifying percentages and not having 100% configured.void
setFixColumnPercentageValuesOnResize
(boolean enabled) Configure whether dynamic percentage sized column positions should be fixed on any resize or not.void
setFixRowPercentageValuesOnResize
(boolean enabled) Configure whether dynamic percentage sized row positions should be fixed on any resize or not.void
setMinColumnWidth
(int position, int minWidth) Set the minimum column width for the given position.void
setMinRowHeight
(int position, int minHeight) Set the minimum row height for the given position.void
setRowHeightByPosition
(int rowPosition, int height) void
setRowHeightByPosition
(int rowPosition, int height, boolean fireEvent) void
setRowHeightPercentageByPosition
(int rowPosition, double height) Set the height of the row at the given position to the given percentage value.void
setRowHeightPercentageByPosition
(int rowPosition, int height) void
setRowPercentageSizing
(boolean percentageSizing) Configures how the row sizing of thisDataLayer
is handled, either pixel sizing or percentage sizing.void
setRowPercentageSizing
(int position, boolean percentageSizing) Configures how the row sizing of thisDataLayer
is handled for the given row.void
setRowPositionResizable
(int rowPosition, boolean resizable) void
setRowsResizableByDefault
(boolean resizableByDefault) int
underlyingToLocalColumnPosition
(ILayer sourceUnderlyingLayer, int underlyingColumnPosition) Transforms the column position relative to the given underlying layer to this layer coordinates.underlyingToLocalColumnPositions
(ILayer sourceUnderlyingLayer, Collection<Range> underlyingColumnPositionRanges) Transforms the column position ranges 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.underlyingToLocalRowPositions
(ILayer sourceUnderlyingLayer, Collection<Range> underlyingRowPositionRanges) Transforms the row position ranges relative to the given underlying layer to this layer coordinates.int
upScaleColumnWidth
(int value) Calculates the column width value dependent on a possible configured scaling from pixel to DPI value.int
upScaleRowHeight
(int value) Calculates the row height value dependent on a possible configured scaling from pixel to DPI value.Methods inherited from class org.eclipse.nebula.widgets.nattable.layer.AbstractLayer
addConfiguration, addLayerListener, clearConfiguration, configure, dispose, fireLayerEvent, getBoundsByPosition, getCellByPosition, getCellPainter, getClientAreaProvider, getConfigLabelAccumulator, getConfigLabelsByPosition, getDisplayModeByPosition, getLayerPainter, getProvidedLabels, getRegionLabelsByXY, getRegionName, handleLayerEvent, hasLayerListener, isDynamicSizeLayer, registerCommandHandler, registerEventHandler, registerPersistable, removeLayerListener, setClientAreaProvider, 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, configure, dispose, fireLayerEvent, getBoundsByPosition, getCellByPosition, getCellPainter, getClientAreaProvider, getConfigLabelsByPosition, getDisplayModeByPosition, getLayerPainter, getProvidedLabels, getRegionLabelsByXY, hasLayerListener, isDynamicSizeLayer, registerCommandHandler, registerPersistable, removeLayerListener, setClientAreaProvider, unregisterCommandHandler, unregisterPersistable
Methods inherited from interface org.eclipse.nebula.widgets.nattable.layer.ILayerListener
handleLayerEvent
-
Field Details
-
PERSISTENCE_KEY_ROW_HEIGHT
- See Also:
-
PERSISTENCE_KEY_COLUMN_WIDTH
- See Also:
-
DEFAULT_COLUMN_WIDTH
public static final int DEFAULT_COLUMN_WIDTH- See Also:
-
DEFAULT_ROW_HEIGHT
public static final int DEFAULT_ROW_HEIGHT- See Also:
-
dataProvider
-
columnWidthConfig
-
rowHeightConfig
-
-
Constructor Details
-
DataLayer
-
DataLayer
-
DataLayer
protected DataLayer() -
DataLayer
protected DataLayer(int defaultColumnWidth, int defaultRowHeight)
-
-
Method Details
-
saveState
Description copied from interface:IPersistable
Saves the state to the given Properties using the specified prefix. Note: The prefix must be prepended to the property key to support multiple states within one Properties instance.- Specified by:
saveState
in interfaceIPersistable
- Overrides:
saveState
in classAbstractLayer
- Parameters:
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.
-
loadState
Description copied from interface:IPersistable
Restore the state out of the given Properties identified by the specified prefix. Note: The prefix must be prepended to the property key to support multiple states within one Properties instance.- Specified by:
loadState
in interfaceIPersistable
- Overrides:
loadState
in classAbstractLayer
- Parameters:
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.
-
registerCommandHandlers
protected void registerCommandHandlers()Description copied from class:AbstractLayer
Layers should use this method to register their command handlers and call it from their constructor. This allows easy overriding if required of command handlers- Overrides:
registerCommandHandlers
in classAbstractLayer
-
getDataProvider
- Returns:
- The
IDataProvider
that is used by thisDataLayer
.
-
setDataProvider
Set theIDataProvider
to use.- Parameters:
dataProvider
- TheIDataProvider
that should be used by thisDataLayer
.- Since:
- 1.4
-
getDataValue
Gets the value at the given column and row index.- Parameters:
columnIndex
- The column index of the cell whose value is requested.rowIndex
- The row index of the cell whose value is requested.- Returns:
- the data value associated with the specified cell
-
setDataValue
Sets the value at the given column and row index. Optional operation. Should throw UnsupportedOperationException if this operation is not supported.- Parameters:
columnIndex
- The column index of the cell whose value is requested.rowIndex
- The row index of the cell whose value is requested.newValue
- The new value that should be set.
-
getColumnCount
public int getColumnCount()- Specified by:
getColumnCount
in interfaceILayer
- Returns:
- The number of columns in this layer.
-
getPreferredColumnCount
public int getPreferredColumnCount()- Specified by:
getPreferredColumnCount
in interfaceILayer
-
getColumnIndexByPosition
public int getColumnIndexByPosition(int columnPosition) This is the root coordinate system, so the column index is always equal to the column position.- Specified by:
getColumnIndexByPosition
in interfaceILayer
- Parameters:
columnPosition
- The column position relative to this layer.- Returns:
- An underlying non-transformed column index, or -1 if the given column position does not exist within this coordinate system.
-
getColumnPositionByIndex
public int getColumnPositionByIndex(int columnIndex) This is the root coordinate system, so the column position is always equal to the column index.- Specified by:
getColumnPositionByIndex
in interfaceIUniqueIndexLayer
-
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
- 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
- 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.
-
underlyingToLocalColumnPositions
public Collection<Range> underlyingToLocalColumnPositions(ILayer sourceUnderlyingLayer, Collection<Range> underlyingColumnPositionRanges) Description copied from interface:ILayer
Transforms the column position ranges relative to the given underlying layer to this layer coordinates.- Specified by:
underlyingToLocalColumnPositions
in interfaceILayer
- Parameters:
sourceUnderlyingLayer
- The underlying layer to which the given column positions match.underlyingColumnPositionRanges
- The column position ranges relative to the given underlying layer that should be converted to local column positions.- Returns:
- The given column position ranges transformed to this layer.
-
getWidth
public int getWidth()Description copied from interface:ILayer
Returns the total width in pixels of this layer. -
getPreferredWidth
public int getPreferredWidth()- Specified by:
getPreferredWidth
in interfaceILayer
-
getDefaultColumnWidth
public int getDefaultColumnWidth()- Returns:
- The default column width that is used if no specialized width is configured for a column.
-
getColumnWidthByPosition
public int getColumnWidthByPosition(int columnPosition) Description copied from interface:ILayer
Returns the width in pixels of the given column. The width of invisible and non-existing columns is 0.- Specified by:
getColumnWidthByPosition
in interfaceILayer
- Parameters:
columnPosition
- The column position in this layer.- Returns:
- The width of the column.
-
setColumnWidthByPosition
public void setColumnWidthByPosition(int columnPosition, int width) -
setColumnWidthByPosition
public void setColumnWidthByPosition(int columnPosition, int width, boolean fireEvent) -
setColumnWidthPercentageByPosition
public void setColumnWidthPercentageByPosition(int columnPosition, int width) -
setColumnWidthPercentageByPosition
public void setColumnWidthPercentageByPosition(int columnPosition, double width) Set the width of the column at the given position to the given percentage value.- Parameters:
columnPosition
- The position of the column to change.width
- The percentage value to set.- Since:
- 1.6
-
setDefaultColumnWidth
public void setDefaultColumnWidth(int width) -
setDefaultColumnWidthByPosition
public void setDefaultColumnWidthByPosition(int columnPosition, int width) -
isColumnPositionResizable
public boolean isColumnPositionResizable(int columnPosition) Description copied from interface:ILayer
Check if the column at the given position is resizable.- Specified by:
isColumnPositionResizable
in interfaceILayer
- Parameters:
columnPosition
- The column position to check.- Returns:
true
if the column is resizable,false
if not.
-
setColumnPositionResizable
public void setColumnPositionResizable(int columnPosition, boolean resizable) -
setColumnsResizableByDefault
public void setColumnsResizableByDefault(boolean resizableByDefault) -
getUnderlyingLayersByColumnPosition
Description copied from interface:ILayer
Returns the layers that are directly below this layer for the given column position. For simple layers this collection will typically only have one entry. Layer compositions might return multiple values, e.g. in a default grid there will be 2 layers in the collection as there are two layers involved in a column.- Specified by:
getUnderlyingLayersByColumnPosition
in interfaceILayer
- Parameters:
columnPosition
- The column position for which the underlying layers are requested.- Returns:
- The layers that are directly below this layer for the given
column position or
null
if this layer has no underlying layers.
-
getRowCount
public int getRowCount()- Specified by:
getRowCount
in interfaceILayer
- Returns:
- The number of rows in this layer.
-
getPreferredRowCount
public int getPreferredRowCount()- Specified by:
getPreferredRowCount
in interfaceILayer
-
getRowIndexByPosition
public int getRowIndexByPosition(int rowPosition) This is the root coordinate system, so the row index is always equal to the row position.- Specified by:
getRowIndexByPosition
in interfaceILayer
- Parameters:
rowPosition
- The row position relative to this layer.- Returns:
- An underlying non-transformed row index, or -1 if the given row position does not exist within this coordinate system.
-
getRowPositionByIndex
public int getRowPositionByIndex(int rowIndex) This is the root coordinate system, so the row position is always equal to the row index.- Specified by:
getRowPositionByIndex
in interfaceIUniqueIndexLayer
-
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
- Parameters:
localRowPosition
- row position in local (the layer's own) coordinates- Returns:
- row position in the underlying layer's coordinates
-
underlyingToLocalRowPosition
Description copied from interface:ILayer
Transforms the row position relative to the given underlying layer to this layer coordinates.- Specified by:
underlyingToLocalRowPosition
in interfaceILayer
- 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.
-
underlyingToLocalRowPositions
public Collection<Range> underlyingToLocalRowPositions(ILayer sourceUnderlyingLayer, Collection<Range> underlyingRowPositionRanges) Description copied from interface:ILayer
Transforms the row position ranges relative to the given underlying layer to this layer coordinates.- Specified by:
underlyingToLocalRowPositions
in interfaceILayer
- Parameters:
sourceUnderlyingLayer
- The underlying layer to which the given row positions match.underlyingRowPositionRanges
- The row position ranges relative to the given underlying layer that should be converted to local row positions.- Returns:
- The given row position ranges transformed to this layer.
-
getHeight
public int getHeight()Description copied from interface:ILayer
Returns the total height in pixels of this layer. -
getPreferredHeight
public int getPreferredHeight()- Specified by:
getPreferredHeight
in interfaceILayer
-
getDefaultRowHeight
public int getDefaultRowHeight()- Returns:
- The default row height that is used if no specialized height is configured for a row.
-
getRowHeightByPosition
public int getRowHeightByPosition(int rowPosition) Description copied from interface:ILayer
Returns the height in pixels of the given row. The height of invisible and non-existing rows is 0.- Specified by:
getRowHeightByPosition
in interfaceILayer
- Parameters:
rowPosition
- The row position in this layer.- Returns:
- The height of the row.
-
setRowHeightByPosition
public void setRowHeightByPosition(int rowPosition, int height) -
setRowHeightByPosition
public void setRowHeightByPosition(int rowPosition, int height, boolean fireEvent) -
setRowHeightPercentageByPosition
public void setRowHeightPercentageByPosition(int rowPosition, int height) -
setRowHeightPercentageByPosition
public void setRowHeightPercentageByPosition(int rowPosition, double height) Set the height of the row at the given position to the given percentage value.- Parameters:
rowPosition
- The position of the row to change.height
- The percentage value to set.- Since:
- 1.6
-
setDefaultRowHeight
public void setDefaultRowHeight(int height) -
setDefaultRowHeightByPosition
public void setDefaultRowHeightByPosition(int rowPosition, int height) -
isRowPositionResizable
public boolean isRowPositionResizable(int rowPosition) Description copied from interface:ILayer
Check if the row at the given position is resizable.- Specified by:
isRowPositionResizable
in interfaceILayer
- Parameters:
rowPosition
- The row position to check.- Returns:
true
if the row is resizable,false
if not.
-
setRowPositionResizable
public void setRowPositionResizable(int rowPosition, boolean resizable) -
setRowsResizableByDefault
public void setRowsResizableByDefault(boolean resizableByDefault) -
getUnderlyingLayersByRowPosition
Description copied from interface:ILayer
Returns the layers that are directly below this layer for the given row position. For simple layers this collection will typically only have one entry. Layer compositions might return multiple values, e.g. in a default grid there will be 2 layers in the collection as there are two layers involved in a row.- Specified by:
getUnderlyingLayersByRowPosition
in interfaceILayer
- Parameters:
rowPosition
- The row position for which the underlying layers are requested.- Returns:
- The layers that are directly below this layer for the given row
position or
null
if this layer has no underlying layers.
-
getDataValueByPosition
Description copied from interface:ILayer
Returns the data value for the cell at the given coordinates.- Specified by:
getDataValueByPosition
in interfaceILayer
- Parameters:
columnPosition
- The column position of the cell.rowPosition
- The row position of the cell.- Returns:
- The data value for the cell at the given coordinates.
-
setDataValueByPosition
-
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
- 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.
-
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
- 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
-
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
- Parameters:
columnPosition
- The column position in this layer.- Returns:
- The x offset of the column, or -1.
-
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
- Parameters:
rowPosition
- the row position in this layer- Returns:
- the y offset of the row, or -1
-
getUnderlyingLayerByPosition
Description copied from interface:ILayer
Returns the layer that is directly below this layer for the given cell coordinate.- Specified by:
getUnderlyingLayerByPosition
in interfaceILayer
- Parameters:
columnPosition
- The column position for which the underlying layer is requested.rowPosition
- The row position for which the underlying layer is requested.- Returns:
- The layer that is directly below this layer for the given cell
coordinates or
null
if this layer has no underlying layers.
-
doCommand
Description copied from interface:ILayer
Opportunity to respond to a command as it flows down the stack. If the layer is not interested in the command it should allow the command to keep traveling down the stack.Note: Before the layer can process a command it must convert the command to its local coordinates using
ILayerCommand.convertToTargetLayer(ILayer)
- Specified by:
doCommand
in interfaceILayer
- Overrides:
doCommand
in classAbstractLayer
- Parameters:
command
- The command to execute.- Returns:
true
if the command has been handled and was therefore consumed,false
otherwise.
-
isColumnPercentageSizing
public boolean isColumnPercentageSizing()- Returns:
true
if the column sizing is done by percentage calculation,false
if the column sizing is done by pixel (default)
-
setColumnPercentageSizing
public void setColumnPercentageSizing(boolean percentageSizing) Configures how the column sizing of thisDataLayer
is handled, either pixel sizing or percentage sizing. Default is pixel sizing.Note: The configuration of this flag impacts the size calculation in mixed mode. If this flag is set to
false
, positions that are configured for fixed percentages will use the full available space for percentage calculation. Setting it totrue
will cause using the remaining space for percentage calculation. This means if also fixed pixel sized positions are configured, they will be subtracted from the full available space.- Parameters:
percentageSizing
-true
if the column sizing should be done by percentage calculation,false
if the column sizing should be done by pixel (default)
-
isColumnPercentageSizing
public boolean isColumnPercentageSizing(int position) - Parameters:
position
- The position which is asked for the percentage sizing configuration.- Returns:
true
if the column sizing for the given position is done by percentage calculation,false
if the column sizing is done by pixel (default)
-
setColumnPercentageSizing
public void setColumnPercentageSizing(int position, boolean percentageSizing) Configures how the column sizing of thisDataLayer
is handled for the given column. Default is pixel sizing.- Parameters:
position
- The position for which the sizing configuration should be set.percentageSizing
-true
if the column sizing should be done by percentage calculation,false
if the column sizing should be done by pixel (default)
-
isRowPercentageSizing
public boolean isRowPercentageSizing()- Returns:
true
if the row sizing is done by percentage calculation,false
if the row sizing is done by pixel (default)
-
setRowPercentageSizing
public void setRowPercentageSizing(boolean percentageSizing) Configures how the row sizing of thisDataLayer
is handled, either pixel sizing or percentage sizing. Default is pixel sizing.Note: The configuration of this flag impacts the size calculation in mixed mode. If this flag is set to
false
, positions that are configured for fixed percentages will use the full available space for percentage calculation. Setting it totrue
will cause using the remaining space for percentage calculation. This means if also fixed pixel sized positions are configured, they will be subtracted from the full available space.- Parameters:
percentageSizing
-true
if the row sizing should be done by percentage calculation,false
if the row sizing should be done by pixel (default)
-
isRowPercentageSizing
public boolean isRowPercentageSizing(int position) - Parameters:
position
- The position which is asked for the percentage sizing configuration.- Returns:
true
if the row sizing for the given position is done by percentage calculation,false
if the row sizing is done by pixel (default)
-
setRowPercentageSizing
public void setRowPercentageSizing(int position, boolean percentageSizing) Configures how the row sizing of thisDataLayer
is handled for the given row. Default is pixel sizing.- Parameters:
position
- The row position for which the sizing configuration should be set.percentageSizing
-true
if the row sizing should be done by percentage calculation,false
if the row sizing should be done by pixel (default)
-
resetColumnWidthConfiguration
public void resetColumnWidthConfiguration(boolean fireEvent) This method will reset all column width customizations, e.g. set column widths and whether columns can be resizable.- Parameters:
fireEvent
- flag to indicate whether a refresh event should be triggered or not. Should be set tofalse
in case additional actions should be executed before the refresh should be done.- Since:
- 1.6
-
resetRowHeightConfiguration
public void resetRowHeightConfiguration(boolean fireEvent) This method will reset all row height customizations, e.g. set row heights and whether rows can be resizable.- Parameters:
fireEvent
- flag to indicate whether a refresh event should be triggered or not. Should be set tofalse
in case additional actions should be executed before the refresh should be done.- Since:
- 1.6
-
resetColumnWidth
public void resetColumnWidth(int position, boolean fireEvent) This method will reset a custom set column width to the default size.- Parameters:
position
- The column position that should be reset.fireEvent
- flag to indicate whether a refresh event should be triggered or not. Should be set tofalse
in case additional actions should be executed before the refresh should be done.- Since:
- 1.6
-
resetRowHeight
public void resetRowHeight(int position, boolean fireEvent) This method will reset a custom set row height to the default size.- Parameters:
position
- The row position that should be reset.fireEvent
- flag to indicate whether a refresh event should be triggered or not. Should be set tofalse
in case additional actions should be executed before the refresh should be done.- Since:
- 1.6
-
resetMinColumnWidth
public void resetMinColumnWidth(int position, boolean fireEvent) This method will reset a custom set minimum column width to the default minimum size.- Parameters:
position
- The column position that should be reset.fireEvent
- flag to indicate whether a refresh event should be triggered or not. Should be set tofalse
in case additional actions should be executed before the refresh should be done.- Since:
- 1.6
-
resetMinRowHeight
public void resetMinRowHeight(int position, boolean fireEvent) This method will reset a custom set minimum row height to the default minimum size.- Parameters:
position
- The row position that should be reset.fireEvent
- flag to indicate whether a refresh event should be triggered or not. Should be set tofalse
in case additional actions should be executed before the refresh should be done.- Since:
- 1.6
-
getConfiguredColumnWidthByPosition
public int getConfiguredColumnWidthByPosition(int columnPosition) Returns the width of the given column position without any transformation. That means it returns the value that was set and not an upscaled value.- Parameters:
columnPosition
- The column position for which the configured width should be returned.- Returns:
- The width that is configured for the given column position without transformation or -1 if no explicit value is configured and the default size is used.
- Since:
- 1.6
- See Also:
-
getConfiguredColumnWidthPercentageByPosition
public double getConfiguredColumnWidthPercentageByPosition(int columnPosition) Returns the configured width in percent of the given column position.- Parameters:
columnPosition
- The column position for which the configured width percentage should be returned.- Returns:
- The percentage that is configured for the given column position or -1 if no specific percentage value is configured.
- Since:
- 1.6
- See Also:
-
getConfiguredRowHeightByPosition
public int getConfiguredRowHeightByPosition(int rowPosition) Returns the height of the given row position without any transformation. That means it returns the value that was set and not an upscaled value.- Parameters:
rowPosition
- The row position for which the configured height should be returned.- Returns:
- The height that is configured for the given row position without transformation or -1 if no explicit value is configured and the default size is used.
- Since:
- 1.6
- See Also:
-
getConfiguredRowHeightPercentageByPosition
public double getConfiguredRowHeightPercentageByPosition(int rowPosition) Returns the configured height in percent of the given row position.- Parameters:
rowPosition
- The row position for which the configured height percentage should be returned.- Returns:
- The height that is configured for the given row position or -1 if no specific percentage value is configured.
- Since:
- 1.6
- See Also:
-
getConfiguredMinColumnWidthByPosition
public int getConfiguredMinColumnWidthByPosition(int columnPosition) Returns the configured minimum width of the given column position without any transformation. If no explicit minimum width is set for the column position it returns -1 instead of the default minimum width.- Parameters:
columnPosition
- The column position for which the configured minimum width should be returned.- Returns:
- The minimum width that is configured for the given column position without transformation or -1 if no explicit minimum width is set for that column position.
- Since:
- 1.6
- See Also:
-
getConfiguredMinRowHeightByPosition
public int getConfiguredMinRowHeightByPosition(int rowPosition) Returns the configured minimum height of the given row position without any transformation. If no explicit minimum height is set for the row position it returns -1 instead of the default minimum height.- Parameters:
rowPosition
- The row position for which the configured minimum height should be returned.- Returns:
- The minimum height that is configured for the given row position without transformation or -1 if no explicit minimum height is set for that row position.
- Since:
- 1.6
- See Also:
-
isDistributeRemainingColumnSpace
public boolean isDistributeRemainingColumnSpace()- Returns:
true
if remaining space on fixed percentage sizing is distributed to other percentage sized columns,false
if not. Default isfalse
.- Since:
- 1.6
-
setDistributeRemainingColumnSpace
public void setDistributeRemainingColumnSpace(boolean distributeRemaining) Configure the percentage sizing behavior when manually specifying percentages and not having 100% configured. By default the remaining space is not distributed to the configured positions. That means for example that 25% of 100 pixels will be 25, regardless of the other positions. When setting this flag totrue
the 25% will be increased so the whole available space is filled.- Parameters:
distributeRemaining
-true
if remaining space on fixed percentage sizing should be distributed to other percentage sized columns,false
if not.- Since:
- 1.6
-
isDistributeRemainingRowSpace
public boolean isDistributeRemainingRowSpace()- Returns:
true
if remaining space on fixed percentage sizing is distributed to other percentage sized rows,false
if not. Default isfalse
.- Since:
- 1.6
-
setDistributeRemainingRowSpace
public void setDistributeRemainingRowSpace(boolean distributeRemaining) Configure the percentage sizing behavior when manually specifying percentages and not having 100% configured. By default the remaining space is not distributed to the configured positions. That means for example that 25% of 100 pixels will be 25, regardless of the other positions. When setting this flag totrue
the 25% will be increased so the whole available space is filled.- Parameters:
distributeRemaining
-true
if remaining space on fixed percentage sizing should be distributed to other percentage sized rows,false
if not.- Since:
- 1.6
-
getDefaultMinColumnWidth
public int getDefaultMinColumnWidth()- Returns:
- The default minimum column width. Default value is 0.
- Since:
- 1.6
-
setDefaultMinColumnWidth
public void setDefaultMinColumnWidth(int defaultMinWidth) Set the default minimum column width. Will affect percentage sizing to avoid column widths smaller than the given minimum value.- Parameters:
defaultMinWidth
- The default minimum column width to use, can not be less than 0.- Throws:
IllegalArgumentException
- if defaultMinWidth is less than 0.- Since:
- 1.6
-
getMinColumnWidth
public int getMinColumnWidth(int position) Returns the minimum column width for the given position. If no specific value is configured for the given position, the default minimum size is returned.- Parameters:
position
- The position for which the minimum column width is requested.- Returns:
- The minimum column width for the given position.
- Since:
- 1.6
- See Also:
-
setMinColumnWidth
public void setMinColumnWidth(int position, int minWidth) Set the minimum column width for the given position. Will affect percentage sizing to avoid column widths smaller than the given minimum value.- Parameters:
position
- The column position for which the minimum width should be set.minWidth
- The minimum width for the given position.- Throws:
IllegalArgumentException
- if size is less than 0.- Since:
- 1.6
-
isMinColumnWidthConfigured
public boolean isMinColumnWidthConfigured()- Returns:
true
if the default min column width or at least one position has a min column width configured,false
if no min column width configuration is set.- Since:
- 1.6
-
isMinColumnWidthConfigured
public boolean isMinColumnWidthConfigured(int position) - Parameters:
position
- The position for which it should be checked if a minimum column width is configured.- Returns:
true
if the given column has a minimum width configured or a default minimum column width is configured,false
if not- Since:
- 1.6
-
getDefaultMinRowHeight
public int getDefaultMinRowHeight()- Returns:
- The default minimum row height. Default value is 0.
- Since:
- 1.6
-
setDefaultMinRowHeight
public void setDefaultMinRowHeight(int defaultMinHeight) Set the default minimum row height. Will affect percentage sizing to avoid row heights smaller than the given minimum value.- Parameters:
defaultMinHeight
- The default minimum row height to use, can not be less than 0.- Throws:
IllegalArgumentException
- if defaultMinWidth is less than 0.- Since:
- 1.6
-
getMinRowHeight
public int getMinRowHeight(int position) Returns the minimum row height for the given position. If no specific value is configured for the given position, the default minimum size is returned.- Parameters:
position
- The position for which the minimum row height is requested.- Returns:
- The minimum row height for the given position.
- Since:
- 1.6
- See Also:
-
setMinRowHeight
public void setMinRowHeight(int position, int minHeight) Set the minimum row height for the given position. Will affect percentage sizing to avoid row heights smaller than the given minimum value.- Parameters:
position
- The position for which the minimum height should be set.minHeight
- The minimum height for the given position.- Throws:
IllegalArgumentException
- if size is less than 0.- Since:
- 1.6
-
isMinRowHeightConfigured
public boolean isMinRowHeightConfigured()- Returns:
true
if the default min row height or at least one position has a min row height configured,false
if no min row height configuration is set.- Since:
- 1.6
-
isMinRowHeightConfigured
public boolean isMinRowHeightConfigured(int position) - Parameters:
position
- The position for which it should be checked if a minimum row height is configured.- Returns:
true
if the given row has a minimum height configured or a default minimum row height is configured,false
if not- Since:
- 1.6
-
upScaleColumnWidth
public int upScaleColumnWidth(int value) Calculates the column width value dependent on a possible configured scaling from pixel to DPI value.- Parameters:
value
- The value that should be up scaled.- Returns:
- The scaled value if a
IDpiConverter
is configured, the value itself if noIDpiConverter
is set. - Since:
- 1.6
- See Also:
-
downScaleColumnWidth
public int downScaleColumnWidth(int value) Calculates the column width value dependent on a possible configured scaling from DPI to pixel value.- Parameters:
value
- The value that should be down scaled.- Returns:
- The scaled value if a
IDpiConverter
is configured, the value itself if noIDpiConverter
is set. - Since:
- 1.6
-
upScaleRowHeight
public int upScaleRowHeight(int value) Calculates the row height value dependent on a possible configured scaling from pixel to DPI value.- Parameters:
value
- The value that should be up scaled.- Returns:
- The scaled value if a
IDpiConverter
is configured, the value itself if noIDpiConverter
is set. - Since:
- 1.6
- See Also:
-
downScaleRowHeight
public int downScaleRowHeight(int value) Calculates the row height value dependent on a possible configured scaling from DPI to pixel value.- Parameters:
value
- The value that should be down scaled.- Returns:
- The scaled value if a
IDpiConverter
is configured, the value itself if noIDpiConverter
is set. - Since:
- 1.6
-
isFixColumnPercentageValuesOnResize
public boolean isFixColumnPercentageValuesOnResize()Return whether dynamic percentage sized column positions should be fixed on any resize or not. This means, if column positions are configured for percentage sizing without a specific percentage value, the size is calculated based on the space that is still available. If this flag is set tofalse
only the column position that is resized will get a fixed value. The other column positions will still be dynamic and therefore will also resize as the available space is changed. Setting this flag totrue
will cause that all column positions with dynamic percentage configuration will get a fixed percentage value to have a deterministic resize behavior for the user that triggers the resize. Also percentage sized columns with a minimum width, where the minimum is bigger than the calculated percentage value will be recalculated to set the percentage value that matches the current state. Default istrue
.- Returns:
true
if calculating the fix percentage value for dynamic percentage sized column positions and position with a configured minimum on resize,false
if the dynamic percentage sized column positions stay dynamic on resize.- Since:
- 1.6
-
setFixColumnPercentageValuesOnResize
public void setFixColumnPercentageValuesOnResize(boolean enabled) Configure whether dynamic percentage sized column positions should be fixed on any resize or not. This means, if column positions are configured for percentage sizing without a specific percentage value, the size is calculated based on the space that is still available. If this flag is set tofalse
only the column position that is resized will get a fixed value. The other column positions will still be dynamic and therefore will also resize as the available space is changed. Setting this flag totrue
will cause that all column positions with dynamic percentage configuration will get a fixed percentage value to have a deterministic resize behavior for the user that triggers the resize. Also percentage sized columns with a minimum width, where the minimum is bigger than the calculated percentage value will be recalculated to set the percentage value that matches the current state. Default istrue
.- Parameters:
enabled
-true
to calculate the fix percentage value for dynamic percentage sized column positions and positions with a configured minimum on resize,false
if the dynamic percentage sized column positions should stay dynamic on resize.- Since:
- 1.6
-
isFixRowPercentageValuesOnResize
public boolean isFixRowPercentageValuesOnResize()Return whether dynamic percentage sized row positions should be fixed on any resize or not. This means, if row positions are configured for percentage sizing without a specific percentage value, the size is calculated based on the space that is still available. If this flag is set tofalse
only the row position that is resized will get a fixed value. The other row positions will still be dynamic and therefore will also resize as the available space is changed. Setting this flag totrue
will cause that all row positions with dynamic percentage configuration will get a fixed percentage value to have a deterministic resize behavior for the user that triggers the resize. Also percentage sized rows with a minimum height, where the minimum is bigger than the calculated percentage value will be recalculated to set the percentage value that matches the current state. Default istrue
.- Returns:
true
if calculating the fix percentage value for dynamic percentage sized row positions and position with a configured minimum on resize,false
if the dynamic percentage sized row positions stay dynamic on resize.- Since:
- 1.6
-
setFixRowPercentageValuesOnResize
public void setFixRowPercentageValuesOnResize(boolean enabled) Configure whether dynamic percentage sized row positions should be fixed on any resize or not. This means, if row positions are configured for percentage sizing without a specific percentage value, the size is calculated based on the space that is still available. If this flag is set tofalse
only the row position that is resized will get a fixed value. The other row positions will still be dynamic and therefore will also resize as the available space is changed. Setting this flag totrue
will cause that all row positions with dynamic percentage configuration will get a fixed percentage value to have a deterministic resize behavior for the user that triggers the resize. Also percentage sized rows with a minimum height, where the minimum is bigger than the calculated percentage value will be recalculated to set the percentage value that matches the current state. Default istrue
.- Parameters:
enabled
-true
to calculate the fix percentage value for dynamic percentage sized row positions and positions with a configured minimum on resize,false
if the dynamic percentage sized row positions should stay dynamic on resize.- Since:
- 1.6
-