Class CellEdgeDetectUtil
java.lang.Object
org.eclipse.nebula.widgets.nattable.ui.util.CellEdgeDetectUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic intgetColumnPosition(ILayer layer, org.eclipse.swt.graphics.Point clickPoint) Calculate the column position depending on the cursor's position on the left/right edges of the cell.static intgetColumnPositionToResize(ILayer layer, org.eclipse.swt.graphics.Point clickPoint) Calculate the column position to resize depending on the cursor's position on the left/right edges of the cell.static CellEdgeEnumgetHorizontalCellEdge(ILayer layer, org.eclipse.swt.graphics.Point clickPt) static CellEdgeEnumgetHorizontalCellEdge(ILayer layer, org.eclipse.swt.graphics.Point clickPt, int handleWidth) static CellEdgeEnumgetHorizontalCellEdge(org.eclipse.swt.graphics.Rectangle cellBounds, org.eclipse.swt.graphics.Point clickPt) Gets the edge (left/right) of the cell which is closer to the click point.static CellEdgeEnumgetHorizontalCellEdge(org.eclipse.swt.graphics.Rectangle cellBounds, org.eclipse.swt.graphics.Point clickPt, int distanceFromEdge) Figure out if the click point is closer to the left/right edge of the cell.static intgetRowPosition(ILayer layer, org.eclipse.swt.graphics.Point clickPoint) Calculate the row position to resize depending on the cursor's position on the top/bottom edges of the cell.static intgetRowPositionToResize(ILayer layer, org.eclipse.swt.graphics.Point clickPoint) Calculate the row position to resize depending on the cursor's position on the top/bottom edges of the cell.static CellEdgeEnumgetVerticalCellEdge(ILayer layer, org.eclipse.swt.graphics.Point clickPt) static CellEdgeEnumgetVerticalCellEdge(ILayer layer, org.eclipse.swt.graphics.Point clickPt, int handleHeight) static CellEdgeEnumgetVerticalCellEdge(org.eclipse.swt.graphics.Rectangle cellBounds, org.eclipse.swt.graphics.Point clickPt) Gets the edge (top/bottom) of the cell which is closer to the click point.
-
Method Details
-
getColumnPosition
Calculate the column position depending on the cursor's position on the left/right edges of the cell.- Parameters:
layer- The layer that should be used to calculate the column position. Typically the NatTable itself.clickPoint- The coordinate on which an action happened.- Returns:
- the column position according to the cell edge.
- Since:
- 1.6
-
getColumnPositionToResize
public static int getColumnPositionToResize(ILayer layer, org.eclipse.swt.graphics.Point clickPoint) Calculate the column position to resize depending on the cursor's position on the left/right edges of the cell. Does not take into account columns which are not allowed to be resized.- Parameters:
layer- The layer that should be used to calculate the column position. Typically the NatTable itself.clickPoint- The coordinate on which an action happened.- Returns:
- the column position according to the cell edge or -1 for an invalid column, e.g. the left edge of the first column, as a resize is not possible here.
-
getRowPosition
Calculate the row position to resize depending on the cursor's position on the top/bottom edges of the cell.- Parameters:
layer- The layer that should be used to calculate the row position. Typically the NatTable itself.clickPoint- The coordinate on which an action happened.- Returns:
- the row position according to the cell edge.
- Since:
- 1.6
-
getRowPositionToResize
Calculate the row position to resize depending on the cursor's position on the top/bottom edges of the cell. Does not take into account rows which are not allowed to be resized.- Parameters:
layer- The layer that should be used to calculate the row position. Typically the NatTable itself.clickPoint- The coordinate on which an action happened.- Returns:
- the row position according to the cell edge or -1 for an invalid row, e.g. the top edge of the first row, as a resize is not possible here.
-
getHorizontalCellEdge
public static CellEdgeEnum getHorizontalCellEdge(org.eclipse.swt.graphics.Rectangle cellBounds, org.eclipse.swt.graphics.Point clickPt) Gets the edge (left/right) of the cell which is closer to the click point.- Parameters:
cellBounds- bounds of the cell containing the clickclickPt- usually the coordinates of a mouse click
-
getHorizontalCellEdge
public static CellEdgeEnum getHorizontalCellEdge(ILayer layer, org.eclipse.swt.graphics.Point clickPt) -
getHorizontalCellEdge
public static CellEdgeEnum getHorizontalCellEdge(ILayer layer, org.eclipse.swt.graphics.Point clickPt, int handleWidth) -
getHorizontalCellEdge
public static CellEdgeEnum getHorizontalCellEdge(org.eclipse.swt.graphics.Rectangle cellBounds, org.eclipse.swt.graphics.Point clickPt, int distanceFromEdge) Figure out if the click point is closer to the left/right edge of the cell.- Parameters:
cellBounds- of the table cell containing the clickclickPt-distanceFromEdge- distance from the edge to qualify as close to the cell edge
-
getVerticalCellEdge
public static CellEdgeEnum getVerticalCellEdge(org.eclipse.swt.graphics.Rectangle cellBounds, org.eclipse.swt.graphics.Point clickPt) Gets the edge (top/bottom) of the cell which is closer to the click point.- Parameters:
cellBounds- bounds of the cell containing the clickclickPt- usually the coordinates of a mouse click
-
getVerticalCellEdge
public static CellEdgeEnum getVerticalCellEdge(ILayer layer, org.eclipse.swt.graphics.Point clickPt) -
getVerticalCellEdge
public static CellEdgeEnum getVerticalCellEdge(ILayer layer, org.eclipse.swt.graphics.Point clickPt, int handleHeight)
-