/** * Installs the necessary listeners on the parent window, if there is one. * This takes the parent so that cleanup can be done from * <tt>removeNotify</tt>, at which point the parent hasn't been reset yet. * * @param parent The parent of the <tt>JRootPane</tt>. */ private void installWindowListeners(Component parent) { window = parent instanceof Window ? (Window) parent : SwingUtilities.getWindowAncestor(parent); if (window != null) { if (mouseInputListener == null) { mouseInputListener = createWindowMouseInputListener(); } window.addMouseListener(mouseInputListener); window.addMouseMotionListener(mouseInputListener); } }
/** * Installs the necessary Listeners on the parent <code>Window</code>, if * there is one. * <p> * This takes the parent so that cleanup can be done from <code>removeNotify</code>, * at which point the parent hasn't been reset yet. * * @param parent The parent of the JRootPane */ private void installWindowListeners(JRootPane root, Component parent) { if (parent instanceof java.awt.Window) { window = (java.awt.Window)parent; } else { window = SwingUtilities.getWindowAncestor(parent); } if (window != null) { if (mouseInputListener == null) { mouseInputListener = createWindowMouseInputListener(root); } window.addMouseListener(mouseInputListener); window.addMouseMotionListener(mouseInputListener); } }
/** * Installs the necessary Listeners on the parent <code>Window</code>, if * there is one. * <p> * This takes the parent so that cleanup can be done from * <code>removeNotify</code>, at which point the parent hasn't been reset * yet. * * @param parent The parent of the JRootPane */ private void installWindowListeners(JRootPane root, Component parent) { if (parent instanceof Window) { window = (Window) parent; } else { window = SwingUtilities.getWindowAncestor(parent); } if (window != null) { if (mouseInputListener == null) { mouseInputListener = createWindowMouseInputListener(root); } window.addMouseListener(mouseInputListener); window.addMouseMotionListener(mouseInputListener); } }
mouseInputListener = createWindowMouseInputListener(root); window.addMouseListener(mouseInputListener); window.addMouseMotionListener(mouseInputListener);
/** * Installs the necessary Listeners on the parent <code>Window</code>, if * there is one. * * <p>This takes the parent so that cleanup can be done from <code> * removeNotify</code>, at which point the parent hasn't been reset yet.</p> * * @param root the JRootPane. * @param parent The parent of the JRootPane */ private void installWindowListeners(JRootPane root, Component parent) { if (parent instanceof Window) { window = (Window) parent; } else { window = SwingUtilities.getWindowAncestor(parent); } if (window != null) { if (mouseInputListener == null) { mouseInputListener = createWindowMouseInputListener(root); } window.addMouseListener(mouseInputListener); window.addMouseMotionListener(mouseInputListener); if (windowListener == null) { windowListener = createFocusListener(); window.addWindowListener(windowListener); } } }
public void ancestorAdded(AncestorEvent event) { if ( showing ) { return; } Window ttip = SwingUtilities.getWindowAncestor(getParent()); if ( ttip == null || !ttip.isVisible() ) { return; } //ttip.addMouseListener(this); ttip.getLocation(point); ttip.setVisible(false); getParent().remove(JCustomTooltip.this); JComponent c = getComponent(); c.setToolTipText(null); c.removeMouseMotionListener(ToolTipManager.sharedInstance()); popup = PopupFactory.getSharedInstance().getPopup( c, JCustomTooltip.this, point.x, point.y); Window w = SwingUtilities.getWindowAncestor(JCustomTooltip.this); w.addMouseListener(this); w.setFocusableWindowState(true); popup.show(); showing = true; }
root.addMouseListener(listener); root.addMouseMotionListener(listener);
root.addMouseListener(listener); root.addMouseMotionListener(listener);
window.addMouseListener(this); } else { window = null;
.createWindowMouseInputListener(root); this.window.addMouseListener(this.substanceMouseInputListener); this.window .addMouseMotionListener(this.substanceMouseInputListener);
.createWindowMouseInputListener(root); this.window.addMouseListener(this.substanceMouseInputListener); this.window .addMouseMotionListener(this.substanceMouseInputListener);
cellTipWindow.addMouseListener(this); } else { cellTipWindow = null;
window.addMouseListener(ma); Robot robot = new Robot(); robot.click(window, x, y, mask); window.addMouseListener(ma); Robot robot = new Robot(); robot.click(window, x, y, mask);
cellTipWindow.addMouseListener(this); cellTipWindow.addMouseWheelListener(this); } else {
protected void initWindowListeners() { descriptor.setIdOnTitleBar(); // Remove listeners window.getWindow().removeMouseMotionListener(resizeMouseInputHandler); window.getWindow().removeMouseListener(resizeMouseInputHandler); titleBarTabs.removeEventDispatcherlListener(moveMouseInputHandler); titleBar.removeMouseMotionListener(moveMouseInputHandler); titleBar.removeMouseListener(moveMouseInputHandler); // Add listeners window.getWindow().addMouseMotionListener(resizeMouseInputHandler); window.getWindow().addMouseListener(resizeMouseInputHandler); titleBarTabs.addEventDispatcherlListener(moveMouseInputHandler); titleBar.addMouseMotionListener(moveMouseInputHandler); titleBar.addMouseListener(moveMouseInputHandler); settedListener = true; }
moveMouseInputHandler = new FloatingMoveMouseInputHandler(window.getWindow()); window.getWindow().addMouseMotionListener(resizeMouseInputHandler); window.getWindow().addMouseListener(resizeMouseInputHandler); window.getWindow().addComponentListener(windowComponentAdapter); moveMouseInputHandler = new FloatingMoveMouseInputHandler(window.getWindow()); window.getWindow().addMouseMotionListener(resizeMouseInputHandler); window.getWindow().addMouseListener(resizeMouseInputHandler); window.getWindow().addComponentListener(new WindowComponentAdapter());