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

The following examples show how to use javax.swing.JComponent#removeKeyListener() . 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: WritingTextArea.java    From pumpernickel with MIT License 5 votes vote down vote up
@Override
public void uninstallUI(JComponent c) {
	super.uninstallUI(c);
	c.removeKeyListener(keyListener);
	c.removeMouseListener(mouseListener);
	layout.removePropertyChangeListener(layoutListener);
}
 
Example 2
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 3
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 4
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 5
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 6
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 7
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 8
Source File: RightAngleBoxContainerPanelUI.java    From pumpernickel with MIT License 4 votes vote down vote up
@Override
public void uninstallUI(JComponent c) {
	super.uninstallUI(c);
	c.removeKeyListener(keyListener);
}