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
FieldsModifier and TypeFieldDescriptionprotected SizeConfigprotected IDataProviderstatic final intstatic final intstatic final Stringstatic final Stringprotected SizeConfigFields inherited from class org.eclipse.nebula.widgets.nattable.layer.AbstractLayer
commandHandlers, eventHandlers, eventHelperLock, layerPainterFields inherited from interface org.eclipse.nebula.widgets.nattable.persistence.IPersistable
DOT, VALUE_SEPARATOR -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedDataLayer(int defaultColumnWidth, int defaultRowHeight) DataLayer(IDataProvider dataProvider) DataLayer(IDataProvider dataProvider, int defaultColumnWidth, int defaultRowHeight) -
Method Summary
Modifier and TypeMethodDescriptionbooleandoCommand(ILayerCommand command) Opportunity to respond to a command as it flows down the stack.intdownScaleColumnWidth(int value) Calculates the column width value dependent on a possible configured scaling from DPI to pixel value.intdownScaleRowHeight(int value) Calculates the row height value dependent on a possible configured scaling from DPI to pixel value.intintgetColumnIndexByPosition(int columnPosition) This is the root coordinate system, so the column index is always equal to the column position.intgetColumnPositionByIndex(int columnIndex) This is the root coordinate system, so the column position is always equal to the column index.intgetColumnPositionByX(int x) Returns the column position that contains the given x coordinate.intgetColumnWidthByPosition(int columnPosition) Returns the width in pixels of the given column.intgetConfiguredColumnWidthByPosition(int columnPosition) Returns the width of the given column position without any transformation.doublegetConfiguredColumnWidthPercentageByPosition(int columnPosition) Returns the configured width in percent of the given column position.intgetConfiguredMinColumnWidthByPosition(int columnPosition) Returns the configured minimum width of the given column position without any transformation.intgetConfiguredMinRowHeightByPosition(int rowPosition) Returns the configured minimum height of the given row position without any transformation.intgetConfiguredRowHeightByPosition(int rowPosition) Returns the height of the given row position without any transformation.doublegetConfiguredRowHeightPercentageByPosition(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.intintintintintReturns the total height in pixels of this layer.intgetMinColumnWidth(int position) Returns the minimum column width for the given position.intgetMinRowHeight(int position) Returns the minimum row height for the given position.intintintintintintgetRowHeightByPosition(int rowPosition) Returns the height in pixels of the given row.intgetRowIndexByPosition(int rowPosition) This is the root coordinate system, so the row index is always equal to the row position.intgetRowPositionByIndex(int rowIndex) This is the root coordinate system, so the row position is always equal to the row index.intgetRowPositionByY(int y) Returns the row position that contains the given y coordinate.intgetStartXOfColumnPosition(int columnPosition) Returns the x offset in pixels of the given column.intgetStartYOfRowPosition(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.intgetWidth()Returns the total width in pixels of this layer.booleanbooleanisColumnPercentageSizing(int position) booleanisColumnPositionResizable(int columnPosition) Check if the column at the given position is resizable.booleanbooleanbooleanReturn whether dynamic percentage sized column positions should be fixed on any resize or not.booleanReturn whether dynamic percentage sized row positions should be fixed on any resize or not.booleanbooleanisMinColumnWidthConfigured(int position) booleanbooleanisMinRowHeightConfigured(int position) booleanbooleanisRowPercentageSizing(int position) booleanisRowPositionResizable(int rowPosition) Check if the row at the given position is resizable.voidloadState(String prefix, Properties properties) Restore the state out of the given Properties identified by the specified prefix.intlocalToUnderlyingColumnPosition(int localColumnPosition) Convert a column position to the coordinates of the underlying layer.intlocalToUnderlyingRowPosition(int localRowPosition) Convert a row position to the coordinates of the underlying layer.protected voidLayers should use this method to register their command handlers and call it from their constructor.voidresetColumnWidth(int position, boolean fireEvent) This method will reset a custom set column width to the default size.voidresetColumnWidthConfiguration(boolean fireEvent) This method will reset all column width customizations, e.g.voidresetMinColumnWidth(int position, boolean fireEvent) This method will reset a custom set minimum column width to the default minimum size.voidresetMinRowHeight(int position, boolean fireEvent) This method will reset a custom set minimum row height to the default minimum size.voidresetRowHeight(int position, boolean fireEvent) This method will reset a custom set row height to the default size.voidresetRowHeightConfiguration(boolean fireEvent) This method will reset all row height customizations, e.g.voidsaveState(String prefix, Properties properties) Saves the state to the given Properties using the specified prefix.voidsetColumnPercentageSizing(boolean percentageSizing) Configures how the column sizing of thisDataLayeris handled, either pixel sizing or percentage sizing.voidsetColumnPercentageSizing(int position, boolean percentageSizing) Configures how the column sizing of thisDataLayeris handled for the given column.voidsetColumnPositionResizable(int columnPosition, boolean resizable) voidsetColumnsResizableByDefault(boolean resizableByDefault) voidsetColumnWidthByPosition(int columnPosition, int width) voidsetColumnWidthByPosition(int columnPosition, int width, boolean fireEvent) voidsetColumnWidthPercentageByPosition(int columnPosition, double width) Set the width of the column at the given position to the given percentage value.voidsetColumnWidthPercentageByPosition(int columnPosition, int width) voidsetDataProvider(IDataProvider dataProvider) Set theIDataProviderto use.voidsetDataValue(int columnIndex, int rowIndex, Object newValue) Sets the value at the given column and row index.voidsetDataValueByPosition(int columnPosition, int rowPosition, Object newValue) voidsetDefaultColumnWidth(int width) voidsetDefaultColumnWidthByPosition(int columnPosition, int width) voidsetDefaultMinColumnWidth(int defaultMinWidth) Set the default minimum column width.voidsetDefaultMinRowHeight(int defaultMinHeight) Set the default minimum row height.voidsetDefaultRowHeight(int height) voidsetDefaultRowHeightByPosition(int rowPosition, int height) voidsetDistributeRemainingColumnSpace(boolean distributeRemaining) Configure the percentage sizing behavior when manually specifying percentages and not having 100% configured.voidsetDistributeRemainingRowSpace(boolean distributeRemaining) Configure the percentage sizing behavior when manually specifying percentages and not having 100% configured.voidsetFixColumnPercentageValuesOnResize(boolean enabled) Configure whether dynamic percentage sized column positions should be fixed on any resize or not.voidsetFixRowPercentageValuesOnResize(boolean enabled) Configure whether dynamic percentage sized row positions should be fixed on any resize or not.voidsetMinColumnWidth(int position, int minWidth) Set the minimum column width for the given position.voidsetMinRowHeight(int position, int minHeight) Set the minimum row height for the given position.voidsetRowHeightByPosition(int rowPosition, int height) voidsetRowHeightByPosition(int rowPosition, int height, boolean fireEvent) voidsetRowHeightPercentageByPosition(int rowPosition, double height) Set the height of the row at the given position to the given percentage value.voidsetRowHeightPercentageByPosition(int rowPosition, int height) voidsetRowPercentageSizing(boolean percentageSizing) Configures how the row sizing of thisDataLayeris handled, either pixel sizing or percentage sizing.voidsetRowPercentageSizing(int position, boolean percentageSizing) Configures how the row sizing of thisDataLayeris handled for the given row.voidsetRowPositionResizable(int rowPosition, boolean resizable) voidsetRowsResizableByDefault(boolean resizableByDefault) intunderlyingToLocalColumnPosition(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.intunderlyingToLocalRowPosition(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.intupScaleColumnWidth(int value) Calculates the column width value dependent on a possible configured scaling from pixel to DPI value.intupScaleRowHeight(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, unregisterPersistableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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, unregisterPersistableMethods 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:IPersistableSaves 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:
saveStatein interfaceIPersistable- Overrides:
saveStatein 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:IPersistableRestore 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:
loadStatein interfaceIPersistable- Overrides:
loadStatein 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:AbstractLayerLayers 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:
registerCommandHandlersin classAbstractLayer
-
getDataProvider
- Returns:
- The
IDataProviderthat is used by thisDataLayer.
-
setDataProvider
Set theIDataProviderto use.- Parameters:
dataProvider- TheIDataProviderthat 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:
getColumnCountin interfaceILayer- Returns:
- The number of columns in this layer.
-
getPreferredColumnCount
public int getPreferredColumnCount()- Specified by:
getPreferredColumnCountin 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:
getColumnIndexByPositionin 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:
getColumnPositionByIndexin interfaceIUniqueIndexLayer
-
localToUnderlyingColumnPosition
public int localToUnderlyingColumnPosition(int localColumnPosition) Description copied from interface:ILayerConvert a column position to the coordinates of the underlying layer. This is possible since each layer is aware of its underlying layer.- Specified by:
localToUnderlyingColumnPositionin 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:ILayerTransforms the column position relative to the given underlying layer to this layer coordinates.- Specified by:
underlyingToLocalColumnPositionin 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:ILayerTransforms the column position ranges relative to the given underlying layer to this layer coordinates.- Specified by:
underlyingToLocalColumnPositionsin 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:ILayerReturns the total width in pixels of this layer. -
getPreferredWidth
public int getPreferredWidth()- Specified by:
getPreferredWidthin 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:ILayerReturns the width in pixels of the given column. The width of invisible and non-existing columns is 0.- Specified by:
getColumnWidthByPositionin 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:ILayerCheck if the column at the given position is resizable.- Specified by:
isColumnPositionResizablein interfaceILayer- Parameters:
columnPosition- The column position to check.- Returns:
trueif the column is resizable,falseif not.
-
setColumnPositionResizable
public void setColumnPositionResizable(int columnPosition, boolean resizable) -
setColumnsResizableByDefault
public void setColumnsResizableByDefault(boolean resizableByDefault) -
getUnderlyingLayersByColumnPosition
Description copied from interface:ILayerReturns 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:
getUnderlyingLayersByColumnPositionin 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
nullif this layer has no underlying layers.
-
getRowCount
public int getRowCount()- Specified by:
getRowCountin interfaceILayer- Returns:
- The number of rows in this layer.
-
getPreferredRowCount
public int getPreferredRowCount()- Specified by:
getPreferredRowCountin 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:
getRowIndexByPositionin 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:
getRowPositionByIndexin interfaceIUniqueIndexLayer
-
localToUnderlyingRowPosition
public int localToUnderlyingRowPosition(int localRowPosition) Description copied from interface:ILayerConvert a row position to the coordinates of the underlying layer. This is possible since each layer is aware of its underlying layer.- Specified by:
localToUnderlyingRowPositionin 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:ILayerTransforms the row position relative to the given underlying layer to this layer coordinates.- Specified by:
underlyingToLocalRowPositionin 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:ILayerTransforms the row position ranges relative to the given underlying layer to this layer coordinates.- Specified by:
underlyingToLocalRowPositionsin 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:ILayerReturns the total height in pixels of this layer. -
getPreferredHeight
public int getPreferredHeight()- Specified by:
getPreferredHeightin 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:ILayerReturns the height in pixels of the given row. The height of invisible and non-existing rows is 0.- Specified by:
getRowHeightByPositionin 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:ILayerCheck if the row at the given position is resizable.- Specified by:
isRowPositionResizablein interfaceILayer- Parameters:
rowPosition- The row position to check.- Returns:
trueif the row is resizable,falseif not.
-
setRowPositionResizable
public void setRowPositionResizable(int rowPosition, boolean resizable) -
setRowsResizableByDefault
public void setRowsResizableByDefault(boolean resizableByDefault) -
getUnderlyingLayersByRowPosition
Description copied from interface:ILayerReturns 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:
getUnderlyingLayersByRowPositionin 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
nullif this layer has no underlying layers.
-
getDataValueByPosition
Description copied from interface:ILayerReturns the data value for the cell at the given coordinates.- Specified by:
getDataValueByPositionin 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:ILayerReturns the column position that contains the given x coordinate.- Specified by:
getColumnPositionByXin 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:ILayerReturns the row position that contains the given y coordinate.- Specified by:
getRowPositionByYin 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:ILayerReturns the x offset in pixels of the given column.- Specified by:
getStartXOfColumnPositionin 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:ILayerReturns the y offset in pixels of the given row.- Specified by:
getStartYOfRowPositionin interfaceILayer- Parameters:
rowPosition- the row position in this layer- Returns:
- the y offset of the row, or -1
-
getUnderlyingLayerByPosition
Description copied from interface:ILayerReturns the layer that is directly below this layer for the given cell coordinate.- Specified by:
getUnderlyingLayerByPositionin 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
nullif this layer has no underlying layers.
-
doCommand
Description copied from interface:ILayerOpportunity 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:
doCommandin interfaceILayer- Overrides:
doCommandin classAbstractLayer- Parameters:
command- The command to execute.- Returns:
trueif the command has been handled and was therefore consumed,falseotherwise.
-
isColumnPercentageSizing
public boolean isColumnPercentageSizing()- Returns:
trueif the column sizing is done by percentage calculation,falseif the column sizing is done by pixel (default)
-
setColumnPercentageSizing
public void setColumnPercentageSizing(boolean percentageSizing) Configures how the column sizing of thisDataLayeris 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 totruewill 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-trueif the column sizing should be done by percentage calculation,falseif 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:
trueif the column sizing for the given position is done by percentage calculation,falseif the column sizing is done by pixel (default)
-
setColumnPercentageSizing
public void setColumnPercentageSizing(int position, boolean percentageSizing) Configures how the column sizing of thisDataLayeris handled for the given column. Default is pixel sizing.- Parameters:
position- The position for which the sizing configuration should be set.percentageSizing-trueif the column sizing should be done by percentage calculation,falseif the column sizing should be done by pixel (default)
-
isRowPercentageSizing
public boolean isRowPercentageSizing()- Returns:
trueif the row sizing is done by percentage calculation,falseif the row sizing is done by pixel (default)
-
setRowPercentageSizing
public void setRowPercentageSizing(boolean percentageSizing) Configures how the row sizing of thisDataLayeris 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 totruewill 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-trueif the row sizing should be done by percentage calculation,falseif 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:
trueif the row sizing for the given position is done by percentage calculation,falseif the row sizing is done by pixel (default)
-
setRowPercentageSizing
public void setRowPercentageSizing(int position, boolean percentageSizing) Configures how the row sizing of thisDataLayeris handled for the given row. Default is pixel sizing.- Parameters:
position- The row position for which the sizing configuration should be set.percentageSizing-trueif the row sizing should be done by percentage calculation,falseif 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 tofalsein 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 tofalsein 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 tofalsein 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 tofalsein 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 tofalsein 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 tofalsein 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:
trueif remaining space on fixed percentage sizing is distributed to other percentage sized columns,falseif 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 totruethe 25% will be increased so the whole available space is filled.- Parameters:
distributeRemaining-trueif remaining space on fixed percentage sizing should be distributed to other percentage sized columns,falseif not.- Since:
- 1.6
-
isDistributeRemainingRowSpace
public boolean isDistributeRemainingRowSpace()- Returns:
trueif remaining space on fixed percentage sizing is distributed to other percentage sized rows,falseif 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 totruethe 25% will be increased so the whole available space is filled.- Parameters:
distributeRemaining-trueif remaining space on fixed percentage sizing should be distributed to other percentage sized rows,falseif 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:
trueif the default min column width or at least one position has a min column width configured,falseif 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:
trueif the given column has a minimum width configured or a default minimum column width is configured,falseif 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:
trueif the default min row height or at least one position has a min row height configured,falseif 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:
trueif the given row has a minimum height configured or a default minimum row height is configured,falseif 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
IDpiConverteris configured, the value itself if noIDpiConverteris 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
IDpiConverteris configured, the value itself if noIDpiConverteris 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
IDpiConverteris configured, the value itself if noIDpiConverteris 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
IDpiConverteris configured, the value itself if noIDpiConverteris 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 tofalseonly 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 totruewill 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:
trueif calculating the fix percentage value for dynamic percentage sized column positions and position with a configured minimum on resize,falseif 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 tofalseonly 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 totruewill 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-trueto calculate the fix percentage value for dynamic percentage sized column positions and positions with a configured minimum on resize,falseif 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 tofalseonly 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 totruewill 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:
trueif calculating the fix percentage value for dynamic percentage sized row positions and position with a configured minimum on resize,falseif 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 tofalseonly 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 totruewill 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-trueto calculate the fix percentage value for dynamic percentage sized row positions and positions with a configured minimum on resize,falseif the dynamic percentage sized row positions should stay dynamic on resize.- Since:
- 1.6
-