Java Code Examples for com.google.gwt.event.dom.client.MouseEvent

The following examples show how to use com.google.gwt.event.dom.client.MouseEvent. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
public FakeMouseEvent(MouseEvent evt) {
  x = evt.getX();
  y = evt.getY();
  shift = evt.isShiftKeyDown();
  ctrl = evt.isControlKeyDown();
  alt = evt.isAltKeyDown();
}
 
Example 2
Source Project: calendar-component   Source File: DateCell.java    License: Apache License 2.0 4 votes vote down vote up
private void handleEventRange(final MouseEvent event) {

        if (event.getNativeButton() != NativeEvent.BUTTON_LEFT) {
            return;
        }

        if (eventRangeStart >= 0) {

            int newY = event.getY();
            int fromY, toY;

            if (newY < eventRangeStart) {
                fromY = newY;
                toY = eventRangeStart;
            } else {
                fromY = eventRangeStart;
                toY = newY;
            }

            eventRangeStop = newY;

            Element main = getElement();
            NodeList<Node> nodes = main.getChildNodes();
            for (int i = 0; i < nodes.getLength(); i++) {

                Element c = (Element) nodes.getItem(i);

                if (Arrays.stream(slotElements).anyMatch(e -> e == c)) {

                    int elemStart = c.getOffsetTop();
                    int elemStop = elemStart + getSlotHeight();
                    if (elemStart >= fromY && elemStart <= toY) {
                        c.addClassName("v-daterange");
                    } else if (elemStop >= fromY && elemStop <= toY) {
                        c.addClassName("v-daterange");
                    } else if (elemStop >= fromY && elemStart <= toY) {
                        c.addClassName("v-daterange");
                    } else {
                        c.removeClassName("v-daterange");
                    }
                }
            }
        }

        event.preventDefault();
    }
 
Example 3
Source Project: cuba   Source File: CubaSourceCodeEditorConnector.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void contextHelpIconClick(MouseEvent event) {
    contextHelpIconClick(event.getNativeEvent());
}