java.lang.Object
org.eclipse.nebula.widgets.nattable.layer.AbstractLayer
org.eclipse.nebula.widgets.nattable.layer.DataLayer
All Implemented Interfaces:
ILayer, ILayerListener, IUniqueIndexLayer, IPersistable
Direct Known Subclasses:
BaseDataLayerFixture, BaseDataLayerFixture, DefaultColumnHeaderDataLayer, DefaultRowHeaderDataLayer, FilterRowDataLayer, GroupByDataLayer, SpanningDataLayer

public class DataLayer extends AbstractLayer implements IUniqueIndexLayer
Wraps the 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 Details

  • Constructor Details

    • DataLayer

      public DataLayer(IDataProvider dataProvider)
    • DataLayer

      public DataLayer(IDataProvider dataProvider, int defaultColumnWidth, int defaultRowHeight)
    • DataLayer

      protected DataLayer()
    • DataLayer

      protected DataLayer(int defaultColumnWidth, int defaultRowHeight)
  • Method Details

    • saveState

      public void saveState(String prefix, Properties properties)
      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 interface IPersistable
      Overrides:
      saveState in class AbstractLayer
      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

      public void loadState(String prefix, Properties properties)
      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 interface IPersistable
      Overrides:
      loadState in class AbstractLayer
      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 class AbstractLayer
    • getDataProvider

      public IDataProvider getDataProvider()
      Returns:
      The IDataProvider that is used by this DataLayer.
    • setDataProvider

      public void setDataProvider(IDataProvider dataProvider)
      Set the IDataProvider to use.
      Parameters:
      dataProvider - The IDataProvider that should be used by this DataLayer.
      Since:
      1.4
    • getDataValue

      public Object getDataValue(int columnIndex, int rowIndex)
      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

      public void setDataValue(int columnIndex, int rowIndex, Object newValue)
      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 interface ILayer
      Returns:
      The number of columns in this layer.
    • getPreferredColumnCount

      public int getPreferredColumnCount()
      Specified by:
      getPreferredColumnCount in interface ILayer
    • 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 interface ILayer
      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 interface IUniqueIndexLayer
    • 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 interface ILayer
      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 interface ILayer
      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 interface ILayer
      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.
      Specified by:
      getWidth in interface ILayer
      Returns:
      The total width in pixels of this layer.
    • getPreferredWidth

      public int getPreferredWidth()
      Specified by:
      getPreferredWidth in interface ILayer
    • 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 interface ILayer
      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 interface ILayer
      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

      public Collection<ILayer> getUnderlyingLayersByColumnPosition(int columnPosition)
      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 interface ILayer
      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 interface ILayer
      Returns:
      The number of rows in this layer.
    • getPreferredRowCount

      public int getPreferredRowCount()
      Specified by:
      getPreferredRowCount in interface ILayer
    • 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 interface ILayer
      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 interface IUniqueIndexLayer
    • 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 interface ILayer
      Parameters:
      localRowPosition - row position in local (the layer's own) coordinates
      Returns:
      row position in the underlying layer's coordinates
    • underlyingToLocalRowPosition

      public int underlyingToLocalRowPosition(ILayer sourceUnderlyingLayer, int underlyingRowPosition)
      Description copied from interface: ILayer
      Transforms the row position relative to the given underlying layer to this layer coordinates.
      Specified by:
      underlyingToLocalRowPosition in interface ILayer
      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 interface ILayer
      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.
      Specified by:
      getHeight in interface ILayer
      Returns:
      The total height in pixels of this layer.
    • getPreferredHeight

      public int getPreferredHeight()
      Specified by:
      getPreferredHeight in interface ILayer
    • 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 interface ILayer
      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 interface ILayer
      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

      public Collection<ILayer> getUnderlyingLayersByRowPosition(int rowPosition)
      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 interface ILayer
      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

      public Object getDataValueByPosition(int columnPosition, int rowPosition)
      Description copied from interface: ILayer
      Returns the data value for the cell at the given coordinates.
      Specified by:
      getDataValueByPosition in interface ILayer
      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

      public void setDataValueByPosition(int columnPosition, int rowPosition, Object newValue)
    • 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 interface ILayer
      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 interface ILayer
      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 interface ILayer
      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 interface ILayer
      Parameters:
      rowPosition - the row position in this layer
      Returns:
      the y offset of the row, or -1
    • getUnderlyingLayerByPosition

      public ILayer getUnderlyingLayerByPosition(int columnPosition, int rowPosition)
      Description copied from interface: ILayer
      Returns the layer that is directly below this layer for the given cell coordinate.
      Specified by:
      getUnderlyingLayerByPosition in interface ILayer
      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

      public boolean doCommand(ILayerCommand command)
      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 interface ILayer
      Overrides:
      doCommand in class AbstractLayer
      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 this DataLayer 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 to true 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 this DataLayer 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 this DataLayer 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 to true 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 this DataLayer 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 to false 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 to false 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 to false 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 to false 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 to false 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 to false 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 is false.
      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 to true 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 is false.
      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 to true 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 no IDpiConverter 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 no IDpiConverter 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 no IDpiConverter 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 no IDpiConverter 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 to false 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 to true 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 is true.
      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 to false 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 to true 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 is true.
      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 to false 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 to true 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 is true.
      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 to false 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 to true 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 is true.
      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