Class ColumnHeaderLayer

All Implemented Interfaces:
ILayer, ILayerListener, IPersistable
Direct Known Subclasses:
ColumnHeaderLayerFixture

public class ColumnHeaderLayer extends DimensionallyDependentLayer
Responsible for rendering, event handling etc on the column headers.
  • Field Details

  • Constructor Details

    • ColumnHeaderLayer

      public ColumnHeaderLayer(IUniqueIndexLayer baseLayer, ILayer horizontalLayerDependency, SelectionLayer selectionLayer)
      Creates a column header layer using the default configuration and painter
      Parameters:
      baseLayer - The base layer for this layer, typically a DataLayer.
      horizontalLayerDependency - The layer to link the horizontal dimension to, typically the body layer.
      selectionLayer - The SelectionLayer needed to respond to selection events.
    • ColumnHeaderLayer

      public ColumnHeaderLayer(IUniqueIndexLayer baseLayer, ILayer horizontalLayerDependency, SelectionLayer... selectionLayer)
      Creates a column header layer using the default configuration and painter
      Parameters:
      baseLayer - The base layer for this layer, typically a DataLayer.
      horizontalLayerDependency - The layer to link the horizontal dimension to, typically the body layer.
      selectionLayer - 0 to multiple SelectionLayer needed to respond to selection events.
      Since:
      1.4
    • ColumnHeaderLayer

      public ColumnHeaderLayer(IUniqueIndexLayer baseLayer, ILayer horizontalLayerDependency, SelectionLayer selectionLayer, boolean useDefaultConfiguration)
      Creates a row header layer using the default painter.
      Parameters:
      baseLayer - The base layer for this layer, typically a DataLayer.
      horizontalLayerDependency - The layer to link the horizontal dimension to, typically the body layer.
      selectionLayer - The SelectionLayer needed to respond to selection events.
      useDefaultConfiguration - Flag to configure whether to use the default configuration or not.
    • ColumnHeaderLayer

      public ColumnHeaderLayer(IUniqueIndexLayer baseLayer, ILayer horizontalLayerDependency, SelectionLayer[] selectionLayer, boolean useDefaultConfiguration)
      Creates a row header layer using the default painter.
      Parameters:
      baseLayer - The base layer for this layer, typically a DataLayer.
      horizontalLayerDependency - The layer to link the horizontal dimension to, typically the body layer.
      selectionLayer - 0 to multiple SelectionLayer needed to respond to selection events.
      useDefaultConfiguration - Flag to configure whether to use the default configuration or not.
      Since:
      1.4
    • ColumnHeaderLayer

      public ColumnHeaderLayer(IUniqueIndexLayer baseLayer, ILayer horizontalLayerDependency, SelectionLayer selectionLayer, boolean useDefaultConfiguration, ILayerPainter layerPainter)
      Parameters:
      baseLayer - The base layer for this layer, typically a DataLayer.
      horizontalLayerDependency - The layer to link the horizontal dimension to, typically the body layer.
      selectionLayer - The SelectionLayer needed to respond to selection events.
      useDefaultConfiguration - Flag to configure whether to use the default configuration or not.
      layerPainter - The painter for this layer or null to use the painter of the base layer.
    • ColumnHeaderLayer

      public ColumnHeaderLayer(IUniqueIndexLayer baseLayer, ILayer horizontalLayerDependency, SelectionLayer[] selectionLayer, boolean useDefaultConfiguration, ILayerPainter layerPainter)
      Parameters:
      baseLayer - The base layer for this layer, typically a DataLayer.
      horizontalLayerDependency - The layer to link the horizontal dimension to, typically the body layer.
      selectionLayer - 0 to multiple SelectionLayer needed to respond to selection events.
      useDefaultConfiguration - Flag to configure whether to use the default configuration or not.
      layerPainter - The painter for this layer or null to use the painter of the base layer.
      Since:
      1.4
  • Method Details

    • getDisplayModeByPosition

      public DisplayMode getDisplayModeByPosition(int columnPosition, int rowPosition)
      Description copied from interface: ILayer
      Returns the active DisplayMode for the cell at the given coordinates. Needed to retrieve the corresponding configurations out of the IConfigRegistry. The default value is DisplayMode.NORMAL. The SelectionLayer for example overrides this to return DisplayMode.SELECT for cells that are currently selected.
      Specified by:
      getDisplayModeByPosition in interface ILayer
      Overrides:
      getDisplayModeByPosition in class DimensionallyDependentLayer
      Parameters:
      columnPosition - The column position of the cell.
      rowPosition - The row position of the cell.
      Returns:
      DisplayMode for the cell at the given coordinates.
    • getConfigLabelsByPosition

      public LabelStack getConfigLabelsByPosition(int columnPosition, int rowPosition)
      Description copied from interface: ILayer
      Returns the config labels for the cell at the given coordinates. Needed to retrieve the corresponding configurations out of the IConfigRegistry.
      Specified by:
      getConfigLabelsByPosition in interface ILayer
      Overrides:
      getConfigLabelsByPosition in class DimensionallyDependentLayer
      Parameters:
      columnPosition - The column position of the cell.
      rowPosition - The row position of the cell.
      Returns:
      The LabelStack with the config labels for the cell at the given coordinates.
    • 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
      Overrides:
      getDataValueByPosition in class DimensionallyDependentLayer
      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.
    • 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
    • handleLayerEvent

      public void handleLayerEvent(ILayerEvent event)
      Description copied from class: AbstractLayer
      Handle layer event notification. Convert it to your context and propagate UP. If you override this method you MUST NOT FORGET to raise the event up the layer stack by calling super.fireLayerEvent(event) - unless you plan to eat the event yourself.
      Specified by:
      handleLayerEvent in interface ILayerListener
      Overrides:
      handleLayerEvent in class AbstractLayer
      Parameters:
      event - the event
    • getOriginalColumnLabel

      public String getOriginalColumnLabel(int columnPosition)
      Parameters:
      columnPosition - the column position for which the original label is requested
      Returns:
      column header as defined by the data source
    • getRenamedColumnLabel

      public String getRenamedColumnLabel(int columnPosition)
      Parameters:
      columnPosition - the column position for which the renamed label is requested
      Returns:
      renamed column header if the column has been renamed, NULL otherwise
    • getRenamedColumnLabelByIndex

      public String getRenamedColumnLabelByIndex(int columnIndex)
      Parameters:
      columnIndex - the column index for which the renamed label is requested
      Returns:
      renamed column header if the column has been renamed, NULL otherwise
    • isColumnRenamed

      public boolean isColumnRenamed(int columnIndex)
      Parameters:
      columnIndex - the column index that should be checked
      Returns:
      true if the column at the given index has been given a custom name by the user.
    • renameColumnPosition

      public boolean renameColumnPosition(int columnPosition, String customColumnName)
    • renameColumnIndex

      public boolean renameColumnIndex(int columnIndex, String customColumnName)