java.lang.Object
org.eclipse.nebula.widgets.nattable.layer.LayerUtil

public final class LayerUtil extends Object
  • Field Details

    • ADDITIONAL_POSITION_MODIFIER

      public static final int ADDITIONAL_POSITION_MODIFIER
      Modifier that is used by layers if they add additional columns or rows. By using this modifier layers can mark an added position to tell the conversion that it can handle the negative index to position conversion. For example, the HierarchicalTreeLayer adds structural columns to separate levels, these columns do not have an index as they are added. As some layers need the local column position, a conversion is performed first getting the column index and then get back the local position by index. Each added column is multiplied with this modifier and an identifier so the returned index is greater than -1, to tell the index-position transformation that calculation back to position is possible, and via the identifier the concrete position in the HierarchicalTreeLayer can be retrieved.
      Since:
      1.6
      See Also:
  • Method Details

    • getColumnPositionByX

      public static final int getColumnPositionByX(ILayer layer, int x)
    • findColumnPosition

      protected static final int findColumnPosition(int xOffset, int columnOffset, ILayer layer, int x, int totalWidth, int columnCount)
    • getRowPositionByY

      public static final int getRowPositionByY(ILayer layer, int y)
    • findRowPosition

      protected static final int findRowPosition(int yOffset, int rowOffset, ILayer layer, int y, int totalHeight, int rowCount)
    • convertColumnPosition

      public static final int convertColumnPosition(ILayer sourceLayer, int sourceColumnPosition, IUniqueIndexLayer targetLayer)
      Convert column position from the source layer to the target layer
      Parameters:
      sourceLayer - source layer
      sourceColumnPosition - column position in the source layer
      targetLayer - layer to convert the from position to
      Returns:
      converted column position, or -1 if conversion not possible
    • convertRowPosition

      public static final int convertRowPosition(ILayer sourceLayer, int sourceRowPosition, IUniqueIndexLayer targetLayer)
      Convert row position from the source layer to the target layer
      Parameters:
      sourceLayer - source layer
      sourceRowPosition - position in the source layer
      targetLayer - layer to convert the from position to
      Returns:
      converted row position, or -1 if conversion not possible