Java Code Examples for javax.swing.JComponent#removeFocusListener()

The following examples show how to use javax.swing.JComponent#removeFocusListener() . 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: TransparentToolBar.java    From netbeans with Apache License 2.0 7 votes vote down vote up
public void removeItem(JComponent c) {
    if (toolbar != null) {
        toolbar.remove(c);
    } else {
        if (c instanceof AbstractButton) {
            c.removeMouseListener(listener);
            ((AbstractButton) c).removeChangeListener(listener);
            c.removeFocusListener(listener);
        }
        remove(c);
    }
}
 
Example 2
Source File: TransparentToolBar.java    From visualvm with GNU General Public License v2.0 5 votes vote down vote up
public void removeItem(JComponent c) {
    if (toolbar != null) {
        toolbar.remove(c);
    } else {
        if (c instanceof AbstractButton) {
            c.removeMouseListener(listener);
            ((AbstractButton) c).removeChangeListener(listener);
            c.removeFocusListener(listener);
        }
        remove(c);
    }
}
 
Example 3
Source File: ColorWellUI.java    From pumpernickel with MIT License 5 votes vote down vote up
@Override
public void uninstallUI(JComponent c) {
	c.removeFocusListener(repaintFocusListener);
	c.removeMouseListener(mouseListener);
	c.removeMouseMotionListener(mouseListener);
	c.removeKeyListener(keyListener);

	JColorWell well = (JColorWell) c;
	ColorChangeListener ccl = listenerMap.remove(well);
	if (ccl != null)
		well.getColorSelectionModel().removeChangeListener(ccl);
}
 
Example 4
Source File: PaletteUI.java    From pumpernickel with MIT License 5 votes vote down vote up
@Override
public void uninstallUI(JComponent c) {
	super.uninstallUI(c);
	c.removePropertyChangeListener(JPalette.PROPERTY_COLORS,
			propertyLayoutListener);
	c.removePropertyChangeListener(PaletteUI.PROPERTY_HIGHLIGHT,
			propertyRepaintListener);
	c.removeMouseListener(mouseListener);
	c.removeFocusListener(focusListener);
	c.removeKeyListener(keyListener);
	Fields fields = getFields((JPalette) c, false);
	if (fields != null)
		fields.uninstall();
	c.putClientProperty(PROPERTY_FIELDS, null);
}
 
Example 5
Source File: MultiThumbSliderUI.java    From pumpernickel with MIT License 5 votes vote down vote up
@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);
}
 
Example 6
Source File: LuckPasswordFieldUI.java    From littleluck with Apache License 2.0 5 votes vote down vote up
/**
 * remove focus Listener
 *
 * @param c
 */
protected void uninstallFocusListener(JComponent c)
{
    if(handle != null)
    {
        c.removeMouseListener(handle);

        c.removeFocusListener(handle);

        handle = null;
    }
    
    borderShape = null;
}
 
Example 7
Source File: LuckFormattedTextFieldUI.java    From littleluck with Apache License 2.0 5 votes vote down vote up
/**
 * remove focus Listener
 *
 * @param c
 */
protected void uninstallFocusListener(JComponent c)
{
    if(handle != null)
    {
        c.removeMouseListener(handle);

        c.removeFocusListener(handle);

        handle = null;
    }
    
    borderShape = null;
}
 
Example 8
Source File: LuckTexFieldUI.java    From littleluck with Apache License 2.0 5 votes vote down vote up
/**
 * remove focus Listener
 *
 * @param c
 */
protected void uninstallFocusListener(JComponent c)
{
    if(handle != null)
    {
        c.removeMouseListener(handle);

        c.removeFocusListener(handle);

        handle = null;
    }
}
 
Example 9
Source File: LuckComboBoxUI.java    From littleluck with Apache License 2.0 5 votes vote down vote up
/**
 * remove focus Listener
 *
 * @param c
 */
protected void uninstallFocusListener(JComponent c)
{
    if(handle != null)
    {
        c.removeMouseListener(handle);

        c.removeFocusListener(handle);

        handle = null;
    }
}
 
Example 10
Source File: MultiThumbSliderUI.java    From PyramidShader with GNU General Public License v3.0 5 votes vote down vote up
@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);
}
 
Example 11
Source File: SwingRendererImpl.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * 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;
			}
		}
	}
}
 
Example 12
Source File: SwingRendererImpl.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void setProperty( String sProperty, Object oValue )
{
	// InteractiveRenderer(iv) is only for Swing
	if ( sProperty.equals( IDeviceRenderer.UPDATE_NOTIFIER ) && iv != null )
	{
		_iun = (IUpdateNotifier) oValue;
		iv.setUpdateNotifier( _iun );
		_lhmAllTriggers.clear( );
		Object obj = _iun.peerInstance( );

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

			if ( _eh != null )
			{
				// We can't promise to remove all the old swtEventHandler
				// due to SWT limitation here, so be sure to just attach the
				// update_notifier only to one renderer.

				jc.removeMouseListener( _eh );
				jc.removeMouseMotionListener( _eh );
				jc.removeKeyListener( _eh );
				jc.removeFocusListener( _eh );
			}

			_eh = new SwingEventHandler( iv,
					_lhmAllTriggers,
					_iun,
					getULocale( ) );
			jc.addMouseListener( _eh );
			jc.addMouseMotionListener( _eh );
			jc.addKeyListener( _eh );
			jc.addFocusListener( _eh );
		}
	}
	
	super.setProperty( sProperty, oValue );
}
 
Example 13
Source File: RoundTextFieldUI.java    From pumpernickel with MIT License 4 votes vote down vote up
@Override
public void uninstallUI(JComponent c) {
	super.uninstallUI(c);
	c.removeFocusListener(focusListener);
}