javax.swing.JComponent#removeMouseListener ( )源码实例Demo

下面列出了javax.swing.JComponent#removeMouseListener ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: netbeans   文件: ToolTipManagerEx.java
/**
    * Registers a component for tooltip management.
    * <p>
    * This will register key bindings to show and hide the tooltip text
    * only if <code>component</code> has focus bindings. This is done
    * so that components that are not normally focus traversable, such
    * as <code>JLabel</code>, are not made focus traversable as a result
    * of invoking this method.
    *
    * @param component  a <code>JComponent</code> object to add
    * @see JComponent#isFocusTraversable
    */
   protected void registerComponent(JComponent component) {
       component.removeMouseListener(this);
       component.addMouseListener(this);
       component.removeMouseMotionListener(moveBeforeEnterListener);
component.addMouseMotionListener(moveBeforeEnterListener);

if (shouldRegisterBindings(component)) {
    // register our accessibility keybindings for this component
    // this will apply globally across L&F
    // Post Tip: Ctrl+F1
    // Unpost Tip: Esc and Ctrl+F1
    InputMap inputMap = component.getInputMap(JComponent.WHEN_FOCUSED);
    ActionMap actionMap = component.getActionMap();

    if (inputMap != null && actionMap != null) {
               //XXX remove
    }
}
   }
 
源代码2 项目: audiveris   文件: Rubber.java
/**
 * Actually register the rubber as the mouse listener for the provided component.
 *
 * @param component the related component
 */
public final void connectComponent (JComponent component)
{
    // Clean up if needed
    disconnectComponent(this.component);

    // Remember the related component (to get visible rect, etc ...)
    this.component = component;

    if (component != null) {
        // To be notified of mouse clicks
        component.removeMouseListener(this); // No multiple notifications
        component.addMouseListener(this);

        // To be notified of mouse mouvements
        component.removeMouseMotionListener(this); // No multiple notifs
        component.addMouseMotionListener(this);

        // To be notified of mouse  wheel mouvements
        component.removeMouseWheelListener(this); // No multiple notifs
        component.addMouseWheelListener(this);
    }
}
 
源代码3 项目: libreveris   文件: Rubber.java
/**
 * Actually register the rubber as the mouse listener for the provided
 * component.
 *
 * @param component the related component
 */
public void connectComponent (JComponent component)
{
    // Clean up if needed
    disconnectComponent(this.component);

    // Remember the related component (to get visible rect, etc ...)
    this.component = component;

    // To be notified of mouse clicks
    component.removeMouseListener(this); // No multiple notifications
    component.addMouseListener(this);

    // To be notified of mouse mouvements
    component.removeMouseMotionListener(this); // No multiple notifs
    component.addMouseMotionListener(this);

    // To be notified of mouse  wheel mouvements
    component.removeMouseWheelListener(this); // No multiple notifs
    component.addMouseWheelListener(this);
}
 
源代码4 项目: ghidra   文件: CodeBrowserPlugin.java
@Override
public void addOverviewProvider(OverviewProvider overviewProvider) {
	JComponent component = overviewProvider.getComponent();

	// just in case we get repeated calls
	component.removeMouseListener(focusingMouseListener);
	component.addMouseListener(focusingMouseListener);
	connectedProvider.getListingPanel().addOverviewProvider(overviewProvider);
}
 
源代码5 项目: ghidra   文件: CodeBrowserPlugin.java
@Override
public void addMarginProvider(MarginProvider marginProvider) {
	JComponent component = marginProvider.getComponent();

	// just in case we get repeated calls
	component.removeMouseListener(focusingMouseListener);
	component.addMouseListener(focusingMouseListener);
	connectedProvider.getListingPanel().addMarginProvider(marginProvider);
}
 
源代码6 项目: PyramidShader   文件: MultiThumbSliderUI.java
@Override
public void uninstallUI(JComponent slider) {
	slider.removeMouseListener(this);
	slider.removeMouseMotionListener(this);
	slider.removeFocusListener(focusListener);
	slider.removeKeyListener(keyListener);
	slider.removeComponentListener(compListener);
	slider.removePropertyChangeListener(propertyListener);
	slider.removePropertyChangeListener(THUMB_SHAPE_PROPERTY, thumbShapeListener);
	super.uninstallUI(slider);
}
 
源代码7 项目: netbeans   文件: ToolTipManagerEx.java
/**
    * Removes a component from tooltip control.
    *
    * @param component  a <code>JComponent</code> object to remove
    */
   protected void unregisterComponent(JComponent component) {
       component.removeMouseListener(this);
component.removeMouseMotionListener(moveBeforeEnterListener);

if (shouldRegisterBindings(component)) {
    InputMap inputMap = component.getInputMap(JComponent.WHEN_FOCUSED);
    ActionMap actionMap = component.getActionMap();

    if (inputMap != null && actionMap != null) {
               //XXX remove
    }
}
   }
 
源代码8 项目: rtg-tools   文件: RocLinePanel.java
private static void insertRightMouseButtonFilter(final JComponent component) {
  final RightMouseButtonFilter filter = new RightMouseButtonFilter(component.getMouseListeners());
  for (final MouseListener l : filter.mListeners) {
    component.removeMouseListener(l);
  }
  component.addMouseListener(filter);
}
 
源代码9 项目: audiveris   文件: Rubber.java
/**
 * Disconnect the provided component
 *
 * @param component the component to disconnect
 */
private void disconnectComponent (JComponent component)
{
    if (component != null) {
        component.removeMouseListener(this);
        component.removeMouseMotionListener(this);
        component.removeMouseWheelListener(this);
    }
}
 
源代码10 项目: littleluck   文件: LuckComboBoxUI.java
/**
 * remove focus Listener
 *
 * @param c
 */
protected void uninstallFocusListener(JComponent c)
{
    if(handle != null)
    {
        c.removeMouseListener(handle);

        c.removeFocusListener(handle);

        handle = null;
    }
}
 
源代码11 项目: pumpernickel   文件: WritingTextArea.java
@Override
public void uninstallUI(JComponent c) {
	super.uninstallUI(c);
	c.removeKeyListener(keyListener);
	c.removeMouseListener(mouseListener);
	layout.removePropertyChangeListener(layoutListener);
}
 
源代码12 项目: birt   文件: SwingRendererImpl.java
/**
 * Free all allocated system resources.
 */
@Override
public void dispose( )
{
	super.dispose( );
	
	_lhmAllTriggers.clear( );

	if ( _iun != null )
	{
		Object obj = _iun.peerInstance( );

		if ( obj instanceof JComponent )
		{
			JComponent jc = (JComponent) obj;

			if ( _eh != null )
			{
				jc.removeMouseListener( _eh );
				jc.removeMouseMotionListener( _eh );
				jc.removeKeyListener( _eh );
				jc.removeFocusListener( _eh );

				_eh = null;
			}
		}
	}
}
 
源代码13 项目: pumpernickel   文件: MultiThumbSliderUI.java
@Override
public void uninstallUI(JComponent slider) {
	slider.removeMouseListener(this);
	slider.removeMouseMotionListener(this);
	slider.removeFocusListener(focusListener);
	slider.removeKeyListener(keyListener);
	slider.removeComponentListener(compListener);
	slider.removePropertyChangeListener(propertyListener);
	slider.removePropertyChangeListener(THUMB_SHAPE_PROPERTY,
			thumbShapeListener);
	super.uninstallUI(slider);
}
 
源代码14 项目: libreveris   文件: Rubber.java
/**
 * Disconnect the provided component
 *
 * @param component the component to disconnect
 */
public void disconnectComponent (JComponent component)
{
    if (component != null) {
        component.removeMouseListener(this);
        component.removeMouseMotionListener(this);
        component.removeMouseWheelListener(this);
    }
}
 
源代码15 项目: pumpernickel   文件: BreadCrumbUI.java
@Override
public void uninstallUI(JComponent c) {
	super.uninstallUI(c);

	c.removeMouseListener(mouseListener);
	c.removePropertyChangeListener(JBreadCrumb.PATH_KEY, refreshUIListener);
	c.removePropertyChangeListener(JBreadCrumb.FORMATTER_KEY,
			refreshUIListener);
	c.removePropertyChangeListener(PROPERTY_SEPARATOR_ICON,
			refreshUIListener);
}
 
源代码16 项目: littleluck   文件: LuckPasswordFieldUI.java
/**
 * remove focus Listener
 *
 * @param c
 */
protected void uninstallFocusListener(JComponent c)
{
    if(handle != null)
    {
        c.removeMouseListener(handle);

        c.removeFocusListener(handle);

        handle = null;
    }
    
    borderShape = null;
}
 
源代码17 项目: littleluck   文件: LuckFormattedTextFieldUI.java
/**
 * remove focus Listener
 *
 * @param c
 */
protected void uninstallFocusListener(JComponent c)
{
    if(handle != null)
    {
        c.removeMouseListener(handle);

        c.removeFocusListener(handle);

        handle = null;
    }
    
    borderShape = null;
}
 
源代码18 项目: mzmine3   文件: ComponentToolTipManager.java
/**
 * Removes a component from tooltip control.
 * 
 * @param component a <code>JComponent</code> object to remove
 */
public void unregisterComponent(JComponent component) {
  component.removeMouseListener(this);
  component.removeMouseMotionListener(moveBeforeEnterListener);

}
 
源代码19 项目: ghidra   文件: CodeBrowserPlugin.java
@Override
public void removeMarginProvider(MarginProvider marginProvider) {
	JComponent component = marginProvider.getComponent();
	component.removeMouseListener(focusingMouseListener);
	connectedProvider.getListingPanel().removeMarginProvider(marginProvider);
}
 
源代码20 项目: mzmine2   文件: ComponentToolTipManager.java
/**
 * Removes a component from tooltip control.
 * 
 * @param component a <code>JComponent</code> object to remove
 */
public void unregisterComponent(JComponent component) {
  component.removeMouseListener(this);
  component.removeMouseMotionListener(moveBeforeEnterListener);

}