Class LayerUtil
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.layer.LayerUtil
-
public final class LayerUtil extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static int
ADDITIONAL_POSITION_MODIFIER
Modifier that is used by layers if they add additional columns or rows.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
convertColumnPosition(ILayer sourceLayer, int sourceColumnPosition, IUniqueIndexLayer targetLayer)
Convert column position from the source layer to the target layerstatic int
convertRowPosition(ILayer sourceLayer, int sourceRowPosition, IUniqueIndexLayer targetLayer)
Convert row position from the source layer to the target layerprotected static int
findColumnPosition(int xOffset, int columnOffset, ILayer layer, int x, int totalWidth, int columnCount)
protected static int
findRowPosition(int yOffset, int rowOffset, ILayer layer, int y, int totalHeight, int rowCount)
static int
getColumnPositionByX(ILayer layer, int x)
static int
getRowPositionByY(ILayer layer, int y)
-
-
-
Field Detail
-
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:
- Constant Field Values
-
-
Method Detail
-
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 layersourceColumnPosition
- column position in the source layertargetLayer
- 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 layersourceRowPosition
- position in the source layertargetLayer
- layer to convert the from position to- Returns:
- converted row position, or -1 if conversion not possible
-
-