当前位置: 首页>>代码示例>>Java>>正文


Java MouseEvent.BUTTON3_DOWN_MASK属性代码示例

本文整理汇总了Java中java.awt.event.MouseEvent.BUTTON3_DOWN_MASK属性的典型用法代码示例。如果您正苦于以下问题:Java MouseEvent.BUTTON3_DOWN_MASK属性的具体用法?Java MouseEvent.BUTTON3_DOWN_MASK怎么用?Java MouseEvent.BUTTON3_DOWN_MASK使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在java.awt.event.MouseEvent的用法示例。


在下文中一共展示了MouseEvent.BUTTON3_DOWN_MASK属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setMovementMouseButton

/**
 * Sets the mouse button that is used for moving the map. Possible values are:
 * <ul>
 * <li>{@link MouseEvent#BUTTON1} (left mouse button)</li>
 * <li>{@link MouseEvent#BUTTON2} (middle mouse button)</li>
 * <li>{@link MouseEvent#BUTTON3} (right mouse button)</li>
 * </ul>
 *
 * @param movementMouseButton the mouse button that is used for moving the map
 */
public void setMovementMouseButton(int movementMouseButton) {
    this.movementMouseButton = movementMouseButton;
    switch (movementMouseButton) {
        case MouseEvent.BUTTON1:
            movementMouseButtonMask = MouseEvent.BUTTON1_DOWN_MASK;
            break;
        case MouseEvent.BUTTON2:
            movementMouseButtonMask = MouseEvent.BUTTON2_DOWN_MASK;
            break;
        case MouseEvent.BUTTON3:
            movementMouseButtonMask = MouseEvent.BUTTON3_DOWN_MASK;
            break;
        default:
            throw new RuntimeException("Unsupported button");
    }
}
 
开发者ID:berniejenny,项目名称:MapAnalyst,代码行数:26,代码来源:DefaultMapController.java

示例2: mouseDragged

/**
 * Pass mouse events into the event queue.
 *
 * @param mouse mouse event received
 */
public void mouseDragged(final MouseEvent mouse) {
    int modifiers = mouse.getModifiersEx();
    boolean eventMouse1 = false;
    boolean eventMouse2 = false;
    boolean eventMouse3 = false;
    if ((modifiers & MouseEvent.BUTTON1_DOWN_MASK) != 0) {
        eventMouse1 = true;
    }
    if ((modifiers & MouseEvent.BUTTON2_DOWN_MASK) != 0) {
        eventMouse2 = true;
    }
    if ((modifiers & MouseEvent.BUTTON3_DOWN_MASK) != 0) {
        eventMouse3 = true;
    }
    mouse1 = eventMouse1;
    mouse2 = eventMouse2;
    mouse3 = eventMouse3;
    int x = screen.textColumn(mouse.getX());
    int y = screen.textRow(mouse.getY());

    TMouseEvent mouseEvent = new TMouseEvent(TMouseEvent.Type.MOUSE_MOTION,
        x, y, x, y, mouse1, mouse2, mouse3, false, false);

    synchronized (eventQueue) {
        eventQueue.add(mouseEvent);
    }
    synchronized (listener) {
        listener.notifyAll();
    }
}
 
开发者ID:klamonte,项目名称:jermit,代码行数:35,代码来源:SwingTerminal.java

示例3: mousePressed

/**
 * Pass mouse events into the event queue.
 *
 * @param mouse mouse event received
 */
public void mousePressed(final MouseEvent mouse) {
    int modifiers = mouse.getModifiersEx();
    boolean eventMouse1 = false;
    boolean eventMouse2 = false;
    boolean eventMouse3 = false;
    if ((modifiers & MouseEvent.BUTTON1_DOWN_MASK) != 0) {
        eventMouse1 = true;
    }
    if ((modifiers & MouseEvent.BUTTON2_DOWN_MASK) != 0) {
        eventMouse2 = true;
    }
    if ((modifiers & MouseEvent.BUTTON3_DOWN_MASK) != 0) {
        eventMouse3 = true;
    }
    mouse1 = eventMouse1;
    mouse2 = eventMouse2;
    mouse3 = eventMouse3;
    int x = screen.textColumn(mouse.getX());
    int y = screen.textRow(mouse.getY());

    TMouseEvent mouseEvent = new TMouseEvent(TMouseEvent.Type.MOUSE_DOWN,
        x, y, x, y, mouse1, mouse2, mouse3, false, false);

    synchronized (eventQueue) {
        eventQueue.add(mouseEvent);
    }
    synchronized (listener) {
        listener.notifyAll();
    }
}
 
开发者ID:klamonte,项目名称:jermit,代码行数:35,代码来源:SwingTerminal.java

示例4: mouseReleased

/**
 * Pass mouse events into the event queue.
 *
 * @param mouse mouse event received
 */
public void mouseReleased(final MouseEvent mouse) {
    int modifiers = mouse.getModifiersEx();
    boolean eventMouse1 = false;
    boolean eventMouse2 = false;
    boolean eventMouse3 = false;
    if ((modifiers & MouseEvent.BUTTON1_DOWN_MASK) != 0) {
        eventMouse1 = true;
    }
    if ((modifiers & MouseEvent.BUTTON2_DOWN_MASK) != 0) {
        eventMouse2 = true;
    }
    if ((modifiers & MouseEvent.BUTTON3_DOWN_MASK) != 0) {
        eventMouse3 = true;
    }
    if (mouse1) {
        mouse1 = false;
        eventMouse1 = true;
    }
    if (mouse2) {
        mouse2 = false;
        eventMouse2 = true;
    }
    if (mouse3) {
        mouse3 = false;
        eventMouse3 = true;
    }
    int x = screen.textColumn(mouse.getX());
    int y = screen.textRow(mouse.getY());

    TMouseEvent mouseEvent = new TMouseEvent(TMouseEvent.Type.MOUSE_UP,
        x, y, x, y, eventMouse1, eventMouse2, eventMouse3, false, false);

    synchronized (eventQueue) {
        eventQueue.add(mouseEvent);
    }
    synchronized (listener) {
        listener.notifyAll();
    }
}
 
开发者ID:klamonte,项目名称:jermit,代码行数:44,代码来源:SwingTerminal.java

示例5: mouseWheelMoved

/**
 * Pass mouse events into the event queue.
 *
 * @param mouse mouse event received
 */
public void mouseWheelMoved(final MouseWheelEvent mouse) {
    int modifiers = mouse.getModifiersEx();
    boolean eventMouse1 = false;
    boolean eventMouse2 = false;
    boolean eventMouse3 = false;
    boolean mouseWheelUp = false;
    boolean mouseWheelDown = false;
    if ((modifiers & MouseEvent.BUTTON1_DOWN_MASK) != 0) {
        eventMouse1 = true;
    }
    if ((modifiers & MouseEvent.BUTTON2_DOWN_MASK) != 0) {
        eventMouse2 = true;
    }
    if ((modifiers & MouseEvent.BUTTON3_DOWN_MASK) != 0) {
        eventMouse3 = true;
    }
    mouse1 = eventMouse1;
    mouse2 = eventMouse2;
    mouse3 = eventMouse3;
    int x = screen.textColumn(mouse.getX());
    int y = screen.textRow(mouse.getY());
    if (mouse.getWheelRotation() > 0) {
        mouseWheelDown = true;
    }
    if (mouse.getWheelRotation() < 0) {
        mouseWheelUp = true;
    }

    TMouseEvent mouseEvent = new TMouseEvent(TMouseEvent.Type.MOUSE_DOWN,
        x, y, x, y, mouse1, mouse2, mouse3, mouseWheelUp, mouseWheelDown);

    synchronized (eventQueue) {
        eventQueue.add(mouseEvent);
    }
    synchronized (listener) {
        listener.notifyAll();
    }
}
 
开发者ID:klamonte,项目名称:jermit,代码行数:43,代码来源:SwingTerminal.java

示例6: mouseReleased

/**
 * Sets the selection rectangle
 *
 * @param e
 */
@Override
public void mouseReleased(MouseEvent e) {
    if (startPoint == null) {
        return;
    }
    if ((e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == MouseEvent.BUTTON1_DOWN_MASK) {
        setSelectionRectangleFromMouseEvent(e);
    } else if ((e.getModifiersEx() & MouseEvent.BUTTON3_DOWN_MASK) == MouseEvent.BUTTON3_DOWN_MASK) {
        stats.temporalNoise.setTemporalNoiseLineFromMouseEvent(e);
    }
    selecting = false;
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:17,代码来源:ApsNoiseStatistics.java

示例7: mouseDragged

/**
 * Sets the selection rectangle
 *
 * @param e
 */
@Override
public void mouseDragged(MouseEvent e) {
    if (startPoint == null) {
        return;
    }
    if ((e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == MouseEvent.BUTTON1_DOWN_MASK) {
        setSelectionRectangleFromMouseEvent(e);
    } else if ((e.getModifiersEx() & MouseEvent.BUTTON3_DOWN_MASK) == MouseEvent.BUTTON3_DOWN_MASK) {
        stats.temporalNoise.setTemporalNoiseLineFromMouseEvent(e);
    }
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:16,代码来源:ApsNoiseStatistics.java


注:本文中的java.awt.event.MouseEvent.BUTTON3_DOWN_MASK属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。