org.eclipse.nebula.widgets.nattable.ui.util
Class CellEdgeDetectUtil

java.lang.Object
  extended by org.eclipse.nebula.widgets.nattable.ui.util.CellEdgeDetectUtil

public class CellEdgeDetectUtil
extends Object


Constructor Summary
CellEdgeDetectUtil()
           
 
Method Summary
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.
static CellEdgeEnum getHorizontalCellEdge(ILayer layer, org.eclipse.swt.graphics.Point clickPt)
           
static CellEdgeEnum getHorizontalCellEdge(ILayer layer, org.eclipse.swt.graphics.Point clickPt, int handleWidth)
           
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.
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.
static int getRowPositionToResize(ILayer layer, org.eclipse.swt.graphics.Point clickPt)
          Calculate the row position to resize depending on the cursor's position on the top/bottom edges of the cell.
static CellEdgeEnum getVerticalCellEdge(ILayer layer, org.eclipse.swt.graphics.Point clickPt)
           
static CellEdgeEnum getVerticalCellEdge(ILayer layer, org.eclipse.swt.graphics.Point clickPt, int handleHeight)
           
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CellEdgeDetectUtil

public CellEdgeDetectUtil()
Method Detail

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.


getRowPositionToResize

public static int getRowPositionToResize(ILayer layer,
                                         org.eclipse.swt.graphics.Point clickPt)
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.


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 click
clickPt - 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 click
clickPt -
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 click
clickPt - 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)


Copyright © 2015. All rights reserved.