本文整理了Java中com.google.gwt.event.dom.client.MouseEvent.getY()
方法的一些代码示例,展示了MouseEvent.getY()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MouseEvent.getY()
方法的具体详情如下:
包路径:com.google.gwt.event.dom.client.MouseEvent
类名称:MouseEvent
方法名:getY
[英]Gets the mouse y-position relative to the event's current target element.
[中]获取鼠标相对于事件当前目标元素的y位置。
代码示例来源:origin: com.ahome-it/lienzo-core
public void down(final MouseEvent<? extends EventHandler> event)
{
if ((getSelectionShape() != null) && !m_selectionShapeProvider.isMultipleSelection(event))
{
// if the mousedown is any where other than the rectangle, and shift was not held, clear it.
// this way, if necessary, a new selection can begin
final Node<?> node = m_layer.getViewport().findShapeAtPoint(event.getX(), event.getY());
if (node != getSelectionShape())
{
clearIfSelection();
}
}
}
代码示例来源:origin: ahome-it/lienzo-core
public void down(final MouseEvent<? extends EventHandler> event)
{
if ((getSelectionShape() != null) && !m_selectionShapeProvider.isMultipleSelection(event))
{
// if the mousedown is any where other than the rectangle, and shift was not held, clear it.
// this way, if necessary, a new selection can begin
final Node<?> node = m_layer.getViewport().findShapeAtPoint(event.getX(), event.getY());
if (node != getSelectionShape())
{
clearIfSelection();
}
}
}
代码示例来源:origin: ahome-it/lienzo-core
public void down(final MouseEvent<? extends EventHandler> event)
{
if ((getSelectionShape() != null) && !m_selectionShapeProvider.isMultipleSelection(event))
{
// if the mousedown is any where other than the rectangle, and shift was not held, clear it.
// this way, if necessary, a new selection can begin
final Node<?> node = m_layer.getViewport().findShapeAtPoint(event.getX(), event.getY());
if (node != getSelectionShape())
{
clearIfSelection();
}
}
}
代码示例来源:origin: ahome-it/lienzo-core
void drawSelectionShape(final MouseEvent<? extends EventHandler> event)
{
final double relativeStartX = getSelectionManager().relativeStartX();
final double relativeStartY = getSelectionManager().relativeStartY();
final Point2D untransformedPoint = getSelectionManager().getUntransformedPoint(new Point2D(event.getX(), event.getY()));
final double relativeEventX = untransformedPoint.getX();
final double relativeEventY = untransformedPoint.getY();
final Layer overLayer = m_layer.getViewport().getOverLayer();
double width = relativeEventX - relativeStartX;
double height = relativeEventY - relativeStartY;
// if either width or height is zero, you won't see the line being drawn, so ensure at least 1px separation
if ( width == 0 )
{
width += 1;
}
if ( height == 0 )
{
height += 1;
}
getSelectionManager().drawSelectionShape(relativeStartX, relativeStartY, width, height, overLayer);
overLayer.draw();
}
代码示例来源:origin: com.ahome-it/lienzo-core
void drawSelectionShape(final MouseEvent<? extends EventHandler> event)
{
final double relativeStartX = getSelectionManager().relativeStartX();
final double relativeStartY = getSelectionManager().relativeStartY();
final Point2D untransformedPoint = getSelectionManager().getUntransformedPoint(new Point2D(event.getX(), event.getY()));
final double relativeEventX = untransformedPoint.getX();
final double relativeEventY = untransformedPoint.getY();
final Layer overLayer = m_layer.getViewport().getOverLayer();
double width = relativeEventX - relativeStartX;
double height = relativeEventY - relativeStartY;
// if either width or height is zero, you won't see the line being drawn, so ensure at least 1px separation
if ( width == 0 )
{
width += 1;
}
if ( height == 0 )
{
height += 1;
}
getSelectionManager().drawSelectionShape(relativeStartX, relativeStartY, width, height, overLayer);
overLayer.draw();
}
代码示例来源:origin: org.geomajas.plugin/geomajas-plugin-javascript-api
public Coordinate getLocation(HumanInputEvent<?> event, String renderSpace) {
Element el = DOM.getElementById(map.getHtmlElementId()).getFirstChildElement();
Coordinate location = null;
if (event instanceof MouseEvent) {
MouseEvent<?> mEvent = (MouseEvent<?>) event;
event.setRelativeElement(el);
location = new Coordinate(mEvent.getX(), mEvent.getY());
} else if (event instanceof TouchEvent) {
TouchEvent<?> tEvent = (TouchEvent<?>) event;
if (tEvent.getTouches().length() > 0) {
location = new Coordinate(tEvent.getTouches().get(0).getRelativeX(el), tEvent.getTouches().get(0)
.getRelativeY(el));
}
}
if (location == null) {
location = new Coordinate(event.getNativeEvent().getClientX(), event.getNativeEvent().getClientY());
}
if ("world".equalsIgnoreCase(renderSpace)) {
return map.getViewPort().transform(location, "screen", renderSpace);
}
return location;
}
代码示例来源:origin: ahome-it/lienzo-core
void drawSelectionShape(final MouseEvent<? extends EventHandler> event)
{
final double relativeStartX = getSelectionManager().relativeStartX();
final double relativeStartY = getSelectionManager().relativeStartY();
final Point2D untransformedPoint = getSelectionManager().getUntransformedPoint(new Point2D(event.getX(), event.getY()));
final double relativeEventX = untransformedPoint.getX();
final double relativeEventY = untransformedPoint.getY();
final Layer overLayer = m_layer.getViewport().getOverLayer();
double width = relativeEventX - relativeStartX;
double height = relativeEventY - relativeStartY;
// if either width or height is zero, you won't see the line being drawn, so ensure at least 1px separation
if ( width == 0 )
{
width += 1;
}
if ( height == 0 )
{
height += 1;
}
getSelectionManager().drawSelectionShape(relativeStartX, relativeStartY, width, height, overLayer);
overLayer.draw();
}
内容来源于网络,如有侵权,请联系作者删除!