Java Code Examples for java.awt.Component#removeMouseMotionListener()

The following examples show how to use java.awt.Component#removeMouseMotionListener() . 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
Source File: MagnificationPanel.java    From pumpernickel with MIT License 5 votes vote down vote up
private void removeMouseListeners(Component c) {
	c.removeMouseMotionListener(mouseListener);
	c.removeMouseListener(mouseListener);
	if (c instanceof Container) {
		Container c2 = (Container) c;
		c2.removeContainerListener(containerListener);
		for (Component child : c2.getComponents()) {
			addMouseListeners(child);
		}
	}
}
 
Example 2
Source File: DescendantMouseListener.java    From pumpernickel with MIT License 5 votes vote down vote up
/**
 * Remove all our internal listeners from a component and its descendants.
 */
private void removeListeners(DefaultMutableTreeNode componentNode) {
	Component c = (Component) componentNode.getUserObject();
	c.removeHierarchyListener(hierarchyListener);
	c.removeMouseListener(mouseListener);
	c.removeMouseMotionListener(mouseListener);
	for (int a = 0; a < componentNode.getChildCount(); a++) {
		removeListeners((DefaultMutableTreeNode) componentNode
				.getChildAt(a));
	}
	if (c instanceof Container)
		((Container) c).removeContainerListener(containerListener);
}
 
Example 3
Source File: WindowMover.java    From Cognizant-Intelligent-Test-Scripter with Apache License 2.0 4 votes vote down vote up
private void removeListeners(Component com) {
    com.removeMouseListener(ma);
    com.removeMouseMotionListener(mma);

}
 
Example 4
Source File: DragReorderHandler.java    From Pixelitor with GNU General Public License v3.0 4 votes vote down vote up
public void detachFromComponent(Component c) {
    c.removeMouseListener(this);
    c.removeMouseMotionListener(this);
}
 
Example 5
Source File: GlobalMouseAdapter.java    From jclic with GNU General Public License v2.0 4 votes vote down vote up
public void detach(Component cmp) {
  if (cmp != null) {
    cmp.removeMouseListener(this);
    cmp.removeMouseMotionListener(this);
  }
}