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


Java MouseEvent.MOUSE_EXITED属性代码示例

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


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

示例1: notifyMouseEvent

@Override
public void notifyMouseEvent(int id, long when, int button, int x, int y,
                             int absX, int absY, int modifiers,
                             int clickCount, boolean popupTrigger,
                             byte[] bdata) {
    LWWindowPeer peer = ownerPeer.get();
    if (id == MouseEvent.MOUSE_EXITED) {
        if (peer != null) {
            peer.updateSecurityWarningVisibility();
        }
    } else if(id == MouseEvent.MOUSE_ENTERED) {
        if (peer != null) {
            peer.updateSecurityWarningVisibility();
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:16,代码来源:CWarningWindow.java

示例2: notifyMouseEvent

@Override
public void notifyMouseEvent(int id, long when, int button, int x, int y,
                             int screenX, int screenY, int modifiers,
                             int clickCount, boolean popupTrigger,
                             byte[] bdata) {
    LWWindowPeer peer = ownerPeer.get();
    if (id == MouseEvent.MOUSE_EXITED) {
        if (peer != null) {
            peer.updateSecurityWarningVisibility();
        }
    } else if(id == MouseEvent.MOUSE_ENTERED) {
        if (peer != null) {
            peer.updateSecurityWarningVisibility();
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:CWarningWindow.java

示例3: isRightMouseButton

static boolean isRightMouseButton(MouseEvent me) {
    int numButtons = ((Integer)getDefaultToolkit().getDesktopProperty("awt.mouse.numButtons")).intValue();
    switch (me.getID()) {
      case MouseEvent.MOUSE_PRESSED:
      case MouseEvent.MOUSE_RELEASED:
          return ((numButtons == 2 && me.getButton() == MouseEvent.BUTTON2) ||
                   (numButtons > 2 && me.getButton() == MouseEvent.BUTTON3));
      case MouseEvent.MOUSE_ENTERED:
      case MouseEvent.MOUSE_EXITED:
      case MouseEvent.MOUSE_CLICKED:
      case MouseEvent.MOUSE_DRAGGED:
          return ((numButtons == 2 && (me.getModifiersEx() & InputEvent.BUTTON2_DOWN_MASK) != 0) ||
                  (numButtons > 2 && (me.getModifiersEx() & InputEvent.BUTTON3_DOWN_MASK) != 0));
    }
    return false;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:XToolkit.java

示例4: eventToString

private static String eventToString(MouseEvent e) {
    StringBuilder result = new StringBuilder();

    switch (e.getID()) {
        case MouseEvent.MOUSE_PRESSED:
            result.append("MOUSE_PRESSED");
            break;
        case MouseEvent.MOUSE_RELEASED:
            result.append("MOUSE_RELEASED");
            break;
        case MouseEvent.MOUSE_CLICKED:
            result.append("MOUSE_CLICKED");
            break;
        case MouseEvent.MOUSE_ENTERED:
            result.append("MOUSE_ENTERED");
            break;
        case MouseEvent.MOUSE_EXITED:
            result.append("MOUSE_EXITED");
            break;
        case MouseEvent.MOUSE_MOVED:
            result.append("MOUSE_MOVED");
            break;
        case MouseEvent.MOUSE_DRAGGED:
            result.append("MOUSE_DRAGGED");
            break;
        case MouseEvent.MOUSE_WHEEL:
            result.append("MOUSE_WHEEL");
            break;
        default:
            result.append("unknown type");
    }

    result.append(", modifiers = " + MouseEvent.getMouseModifiersText(e.getModifiers()));
    result.append(", modifiersEx = " + MouseEvent.getMouseModifiersText(e.getModifiersEx()));
    result.append(", button = " + e.getButton());

    return result.toString();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:38,代码来源:bug7146377.java

示例5: exitedGeneratesSameEvents

public void exitedGeneratesSameEvents() throws Throwable {
    events = MouseEvent.MOUSE_EXITED;
    SwingUtilities.invokeAndWait(new Runnable() {
        @Override public void run() {
            actionsArea.setText("");
        }
    });
    driver = new JavaDriver();
    WebElement b = driver.findElement(By.name("click-me"));
    WebElement t = driver.findElement(By.name("actions"));

    Point location = EventQueueWait.call_noexc(button, "getLocationOnScreen");
    Dimension size = EventQueueWait.call_noexc(button, "getSize");
    Robot r = new Robot();
    r.setAutoDelay(10);
    r.setAutoWaitForIdle(true);
    r.keyPress(KeyEvent.VK_ALT);
    r.mouseMove(location.x + size.width / 2, location.y + size.height / 2);
    r.mousePress(InputEvent.BUTTON1_MASK);
    r.mouseRelease(InputEvent.BUTTON1_MASK);
    Point location2 = EventQueueWait.call_noexc(actionsArea, "getLocationOnScreen");
    Dimension size2 = EventQueueWait.call_noexc(button, "getSize");
    r.mouseMove(location2.x + size2.width / 2, location2.y + size2.height / 2);
    r.mousePress(InputEvent.BUTTON1_MASK);
    r.mouseRelease(InputEvent.BUTTON1_MASK);
    r.keyRelease(KeyEvent.VK_ALT);
    new EventQueueWait() {
        @Override public boolean till() {
            return actionsArea.getText().length() > 0;
        }
    }.wait("Waiting for actionsArea failed?");

    String expected = t.getText();
    tclear();
    new Actions(driver).moveToElement(t).keyDown(Keys.ALT).moveToElement(b).moveToElement(t).keyUp(Keys.ALT).perform();
    AssertJUnit.assertEquals(expected, t.getText());
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:37,代码来源:NativeEventsTest.java

示例6: processEvent

public void processEvent(AWTEvent event) {
    setIndexOfType(super.getIndexOfType());
    if (event instanceof MouseEvent) {
        MouseEvent me = (MouseEvent) event;

        switch (me.getID()) {
        case MouseEvent.MOUSE_ENTERED:
            mouseEntered(me);
            break;
        case MouseEvent.MOUSE_PRESSED:
            mousePressed(me);
            break;
        case MouseEvent.MOUSE_RELEASED:
            mouseReleased(me);
            break;
        case MouseEvent.MOUSE_CLICKED:
            mouseClicked(me);
            break;
        case MouseEvent.MOUSE_EXITED:
            mouseExited(me);
            break;
        }
    } else if (event instanceof KeyEvent) {
        KeyEvent ke = (KeyEvent) event;
        switch (ke.getID()) {
        case KeyEvent.KEY_PRESSED:
            keyPressed(ke);
            break;
        case KeyEvent.KEY_RELEASED:
            keyReleased(ke);
            break;
        case KeyEvent.KEY_TYPED:
            keyTyped(ke);
            break;
        }
    }
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:37,代码来源:RComponent.java

示例7: eventDispatched

public void eventDispatched(AWTEvent event) {
    if (event instanceof MouseEvent) {
        MouseEvent me = (MouseEvent) event;
        Component mecmp = me.getComponent();

        if (!SwingUtilities.isDescendingFrom(mecmp, (Component) rootPaneContainer)) {
            return;
        }
        if ((me.getID() == MouseEvent.MOUSE_EXITED) && (mecmp == rootPaneContainer)) {
            highcmp = null;
            point = null;
        } else {
            MouseEvent converted = SwingUtilities.convertMouseEvent(mecmp, me, this);
            point = converted.getPoint();
            Component parent = mecmp;
            Rectangle rect = new Rectangle();
            rect.width = mecmp.getWidth();
            rect.height = mecmp.getHeight();
            Rectangle parentBounds = new Rectangle();
            while ((parent != null) && (parent != this.getRootPane()) && (parent != rootPaneContainer)) {
                parent.getBounds(parentBounds);
                rect.x += parentBounds.x;
                rect.y += parentBounds.y;
                parent = parent.getParent();
            }
            highcmp = rect;
        }
        repaint();
    }
}
 
开发者ID:igr,项目名称:swingspy,代码行数:30,代码来源:SwingSpyGlassPane.java

示例8: handleMouseEvent

/**
 * Handles mouse events.
 */
void handleMouseEvent(int eventType, int modifierFlags, int buttonNumber,
                      int clickCount, int x, int y, int absoluteX,
                      int absoluteY) {
    final SunToolkit tk = (SunToolkit)Toolkit.getDefaultToolkit();
    if ((buttonNumber > 2 && !tk.areExtraMouseButtonsEnabled())
            || buttonNumber > tk.getNumberOfButtons() - 1) {
        return;
    }

    int jeventType = isNpapiCallback ? NSEvent.npToJavaEventType(eventType) :
                                       NSEvent.nsToJavaEventType(eventType);

    int jbuttonNumber = MouseEvent.NOBUTTON;
    int jclickCount = 0;

    if (jeventType != MouseEvent.MOUSE_MOVED &&
        jeventType != MouseEvent.MOUSE_ENTERED &&
        jeventType != MouseEvent.MOUSE_EXITED)
    {
        jbuttonNumber = NSEvent.nsToJavaButton(buttonNumber);
        jclickCount = clickCount;
    }

    int jmodifiers = NSEvent.nsToJavaMouseModifiers(buttonNumber,
                                                    modifierFlags);
    boolean jpopupTrigger = NSEvent.isPopupTrigger(jmodifiers);

    eventNotifier.notifyMouseEvent(jeventType, System.currentTimeMillis(), jbuttonNumber,
            x, y, absoluteX, absoluteY, jmodifiers, jclickCount,
            jpopupTrigger, null);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:34,代码来源:CPlatformResponder.java

示例9: isLeftMouseButton

static boolean isLeftMouseButton(MouseEvent me) {
    switch (me.getID()) {
      case MouseEvent.MOUSE_PRESSED:
      case MouseEvent.MOUSE_RELEASED:
          return (me.getButton() == MouseEvent.BUTTON1);
      case MouseEvent.MOUSE_ENTERED:
      case MouseEvent.MOUSE_EXITED:
      case MouseEvent.MOUSE_CLICKED:
      case MouseEvent.MOUSE_DRAGGED:
          return ((me.getModifiersEx() & InputEvent.BUTTON1_DOWN_MASK) != 0);
    }
    return false;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:XToolkit.java

示例10: eventDispatched

@Override
public void eventDispatched(AWTEvent event) {
    if (event instanceof MouseEvent) {
        MouseEvent e = (MouseEvent) event;
        if (e.getID() == MouseEvent.MOUSE_ENTERED) {
            mouseComponent = e.getComponent();
        } else if (e.getID() == MouseEvent.MOUSE_EXITED) {
            mouseComponent = null;
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:EventDispatcher.java

示例11: isIgnoreEvent

private boolean isIgnoreEvent(MouseEvent e) {
    int eventID = e.getID();
    return eventID == MouseEvent.MOUSE_ENTERED ||
           eventID == MouseEvent.MOUSE_EXITED;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:ProfilerTableHover.java

示例12: isFocusChangeEvent

private boolean isFocusChangeEvent(int id) {
    return id != MouseEvent.MOUSE_ENTERED && id != MouseEvent.MOUSE_EXITED && id != MouseEvent.MOUSE_MOVED;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:3,代码来源:JavaRecorderHook.java

示例13: sendResponse

public boolean sendResponse(long ctxt, int eventID, int action) {
    XClientMessageEvent xclient = new XClientMessageEvent(ctxt);

    if (xclient.get_message_type() !=
        XDnDConstants.XA_XdndPosition.getAtom()) {

        return false;
    }

    if (eventID == MouseEvent.MOUSE_EXITED) {
        action = DnDConstants.ACTION_NONE;
    }

    XClientMessageEvent msg = new XClientMessageEvent();
    try {
        msg.set_type((int)XConstants.ClientMessage);
        msg.set_window(xclient.get_data(0));
        msg.set_format(32);
        msg.set_message_type(XDnDConstants.XA_XdndStatus.getAtom());
        /* target window */
        msg.set_data(0, xclient.get_window());
        /* flags */
        long flags = 0;
        if (action != DnDConstants.ACTION_NONE) {
            flags |= XDnDConstants.XDND_ACCEPT_DROP_FLAG;
        }
        msg.set_data(1, flags);
        /* specify an empty rectangle */
        msg.set_data(2, 0); /* x, y */
        msg.set_data(3, 0); /* w, h */
        /* action accepted by the target */
        msg.set_data(4, XDnDConstants.getXDnDActionForJavaAction(action));

        XToolkit.awtLock();
        try {
            XlibWrapper.XSendEvent(XToolkit.getDisplay(),
                                   xclient.get_data(0),
                                   false, XConstants.NoEventMask,
                                   msg.pData);
        } finally {
            XToolkit.awtUnlock();
        }
    } finally {
        msg.dispose();
    }

    return true;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:48,代码来源:XDnDDropTargetProtocol.java

示例14: handleJavaMouseEvent

void handleJavaMouseEvent(MouseEvent e) {
    super.handleJavaMouseEvent(e);
    int id = e.getID();
    switch (id) {
      case MouseEvent.MOUSE_PRESSED:
          if (XToolkit.isLeftMouseButton(e) ) {
              Button b = (Button) e.getSource();

              if(b.contains(e.getX(), e.getY())) {
                  if (!isEnabled()) {
                      // Disabled buttons ignore all input...
                      return;
                  }
                  pressed = true;
                  armed = true;
                  repaint();
              }
          }

          break;

      case MouseEvent.MOUSE_RELEASED:
          if (XToolkit.isLeftMouseButton(e)) {
              if (armed)
              {
                  action(e.getWhen(),e.getModifiers());
              }
              pressed = false;
              armed = false;
              repaint();
          }

          break;

      case  MouseEvent.MOUSE_ENTERED:
          if (pressed)
              armed = true;
          break;
      case MouseEvent.MOUSE_EXITED:
          armed = false;
          break;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:43,代码来源:XButtonPeer.java

示例15: sendResponse

public boolean sendResponse(long ctxt, int eventID, int action) {
    XClientMessageEvent xclient = new XClientMessageEvent(ctxt);

    if (xclient.get_message_type() !=
        XDnDConstants.XA_XdndPosition.getAtom()) {

        return false;
    }

    if (eventID == MouseEvent.MOUSE_EXITED) {
        action = DnDConstants.ACTION_NONE;
    }

    XClientMessageEvent msg = new XClientMessageEvent();
    try {
        msg.set_type(XConstants.ClientMessage);
        msg.set_window(xclient.get_data(0));
        msg.set_format(32);
        msg.set_message_type(XDnDConstants.XA_XdndStatus.getAtom());
        /* target window */
        msg.set_data(0, xclient.get_window());
        /* flags */
        long flags = 0;
        if (action != DnDConstants.ACTION_NONE) {
            flags |= XDnDConstants.XDND_ACCEPT_DROP_FLAG;
        }
        msg.set_data(1, flags);
        /* specify an empty rectangle */
        msg.set_data(2, 0); /* x, y */
        msg.set_data(3, 0); /* w, h */
        /* action accepted by the target */
        msg.set_data(4, XDnDConstants.getXDnDActionForJavaAction(action));

        XToolkit.awtLock();
        try {
            XlibWrapper.XSendEvent(XToolkit.getDisplay(),
                                   xclient.get_data(0),
                                   false, XConstants.NoEventMask,
                                   msg.pData);
        } finally {
            XToolkit.awtUnlock();
        }
    } finally {
        msg.dispose();
    }

    return true;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:48,代码来源:XDnDDropTargetProtocol.java


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