public class CoordinateUtilities extends Object
| Constructor and Description |
|---|
CoordinateUtilities() |
| Modifier and Type | Method and Description |
|---|---|
static com.ait.lienzo.client.core.types.Point2D |
convertDOMToGridCoordinate(GridWidget view,
com.ait.lienzo.client.core.types.Point2D point)
Convert a DOM-relative coordinate to one within a GridWidget, taking
the current transformation (translation and scale) into consideration.
|
static int |
getRelativeXOfEvent(com.google.gwt.event.dom.client.DomEvent event) |
static int |
getRelativeYOfEvent(com.google.gwt.event.dom.client.DomEvent event) |
static Integer |
getUiColumnIndex(GridWidget gridWidget,
double relativeX)
Gets the column index corresponding to the provided Canvas x-coordinate relative to the grid.
|
static Integer |
getUiHeaderRowIndex(GridWidget gridWidget,
com.ait.lienzo.client.core.types.Point2D rp)
Gets the header row index corresponding to the provided Canvas y-coordinate relative to
the grid.
|
static Integer |
getUiRowIndex(GridWidget gridWidget,
double relativeY)
Gets the row index corresponding to the provided Canvas y-coordinate relative to the grid.
|
public static com.ait.lienzo.client.core.types.Point2D convertDOMToGridCoordinate(GridWidget view, com.ait.lienzo.client.core.types.Point2D point)
view - The GridWidget to which we need to find the relative coordinate.point - The Canvas/DOM MouseEvent coordinate.public static Integer getUiRowIndex(GridWidget gridWidget, double relativeY)
INodeXYEvent using convertDOMToGridCoordinate(GridWidget, Point2D)gridWidget - GridWidget to check.relativeY - y-coordinate relative to the GridWidget.public static Integer getUiColumnIndex(GridWidget gridWidget, double relativeX)
INodeXYEvent using convertDOMToGridCoordinate(GridWidget, Point2D)gridWidget - GridWidget to check.relativeX - x-coordinate relative to the GridWidget.public static Integer getUiHeaderRowIndex(GridWidget gridWidget, com.ait.lienzo.client.core.types.Point2D rp)
INodeXYEvent using
convertDOMToGridCoordinate(GridWidget, Point2D)gridWidget - GridWidget to check.rp - Canvas coordinate relative to the GridWidget.public static int getRelativeXOfEvent(com.google.gwt.event.dom.client.DomEvent event)
public static int getRelativeYOfEvent(com.google.gwt.event.dom.client.DomEvent event)
Copyright © 2012–2020 JBoss by Red Hat. All rights reserved.