/** Restore the original state of the Component */ @Override public void mouseReleased(MouseEvent e) { if (!potentialDrag) { return; } source.removeMouseMotionListener(this); potentialDrag = false; if (changeCursor) { source.setCursor(originalCursor); } if (destination instanceof JComponent) { ((JComponent) destination).setAutoscrolls(autoscrolls); } // Layout the components on the parent container if (autoLayout) { if (destination instanceof JComponent) { ((JComponent) destination).revalidate(); } else { destination.validate(); } } }
/** Disposes all resources that are used by this handler. */ public void destroy() { if (container != null) { setCursor(null); current = null; container.removeMouseListener(this); container.removeMouseMotionListener(this); container = null; } }
/** Remove All and their listeners */ public void removeAll() { m_nodes.clear(); m_lines.clear(); Component[] components = getComponents(); for (int i = 0; i < components.length; i++) { Component component = components[i]; component.removeMouseListener(this); component.removeMouseMotionListener(this); } super.removeAll(); } // removeAll
public void attachTo(@Nullable Component owner, @Nullable Component mouseTarget) { if (myMouseTarget != null) { myClickListener.uninstall(myMouseTarget); myMouseTarget.removeMouseMotionListener(myMouseMotionListener); } myOwner = owner; myMouseTarget = mouseTarget; if (myMouseTarget != null) { myClickListener.installOn(myMouseTarget); myMouseTarget.addMouseMotionListener(myMouseMotionListener); } }
void uninstallListeners(Component component) { for (ComponentListener listener : componentListeners) component.removeComponentListener(listener); for (KeyListener listener : keyListeners) component.removeKeyListener(listener); for (MouseListener listener : mouseListeners) component.removeMouseListener(listener); for (MouseMotionListener listener : mouseMotionListeners) component.removeMouseMotionListener(listener); if (component instanceof Container) { Container container = (Container) component; container.removeContainerListener(containerListener); for (int iComp = container.getComponentCount(); iComp-- != 0; ) { uninstallListeners(container.getComponent(iComp)); } } }
/** Disposes all resources that are used by this handler. */ public void destroy() { if (container != null) { setCursor(null); current = null; container.removeMouseListener(this); container.removeMouseMotionListener(this); container = null; try { java.awt.Toolkit.getDefaultToolkit().removeAWTEventListener(this); } catch (Throwable e) { e.printStackTrace(); } setController(null); station.removeDockHierarchyListener(this); } }
/** * Remove listeners from the specified component * * @param component the component the listeners are removed from */ public void deregisterComponent(Component... components) { for (Component component : components) { component.removeMouseListener(this); component.removeMouseMotionListener(this); } }
/** * Unregister itself from the given event source. If a selection rectangle is shown, hide it * first. * * @param eventSource The emitter of the mouse events. */ public void unregister(Component eventSource) { eventSource.removeMouseListener(this); eventSource.removeMouseMotionListener(this); selectionEndedListener.removePropertyChangeListener(this); }
/** * Stops monitoring mouse movement events on given component. * * @param component component to cancel monitoring. */ public synchronized void deregister(Component component) { component.removeMouseMotionListener(this); }
@Override public void removeMouseInputListener(MouseInputListener listener) { component.removeMouseListener(listener); component.removeMouseMotionListener(listener); }
/** * @see JPanel#removeMouseMotionListener(MouseMotionListener) * @param mml mouse motion listener */ public void removeMouseMotionListener(MouseMotionListener mml) { canvas.removeMouseMotionListener(mml); }