APIdia Launch Partner
Top Description Inners Fields Constructors Methods
javax.swing.plaf.basic

public Class BasicColorChooserUI

extends ColorChooserUI
Class Inheritance
Known Direct Subclasses
javax.swing.plaf.synth.SynthColorChooserUI
Imports
javax.swing.*, javax.swing.colorchooser.*, javax.swing.event.*, javax.swing.border.*, javax.swing.plaf.*, java.awt.*, java.awt.event.*, java.beans.PropertyChangeEvent, .PropertyChangeListener, sun.swing.DefaultLookup

Provides the basic look and feel for a JColorChooser.
Authors
Tom Santos, Steve Wilson

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
private class
public class
BasicColorChooserUI.PropertyHandler

This class should be treated as a "protected" inner class.

Field Summary

Modifier and TypeField and Description
protected JColorChooser
chooser

JColorChooser this BasicColorChooserUI is installed on.

protected AbstractColorChooserPanel[]
defaultChoosers

The array of default color choosers.

private static TransferHandler
private BasicColorChooserUI.Handler
pack-priv boolean
protected ChangeListener
previewListener

The instance of ChangeListener.

pack-priv JComponent
pack-priv JPanel
protected PropertyChangeListener
propertyChangeListener

The instance of PropertyChangeListener.

pack-priv JPanel
pack-priv JTabbedPane

Constructor Summary

AccessConstructor and Description
public
BasicColorChooserUI()

Constructs a BasicColorChooserUI.

Method Summary

Modifier and TypeMethod and Description
protected AbstractColorChooserPanel[]

Returns:

an array of default color choosers
createDefaultChoosers
()

Returns an array of default color choosers.

protected PropertyChangeListener

Returns:

an instance of PropertyChangeListener
createPropertyChangeListener
()

Returns an instance of PropertyChangeListener.

public static ComponentUI

Returns:

a new instance of BasicColorChooserUI
createUI
(JComponent
a component
c
)

Hides javax.swing.plaf.ComponentUI.createUI.

Returns a new instance of BasicColorChooserUI.

private BasicColorChooserUI.Handler
protected void
installDefaults()

Installs default properties.

protected void
installListeners()

Registers listeners.

protected void
installPreviewPanel()

Installs preview panel.

public void
installUI(JComponent c)

Overrides javax.swing.plaf.ComponentUI.installUI.

Configures the specified component appropriately for the look and feel.

private void
protected void
uninstallDefaultChoosers()

Uninstalls default color choosers.

protected void
uninstallDefaults()

Uninstalls default properties.

protected void
uninstallListeners()

Unregisters listeners.

protected void
uninstallPreviewPanel()

Removes installed preview panel from the UI delegate.

public void
uninstallUI(JComponent c)

Overrides javax.swing.plaf.ComponentUI.uninstallUI.

Reverses configuration which was done on the specified component during installUI.

Field Detail

chooserback to summary
protected JColorChooser chooser

JColorChooser this BasicColorChooserUI is installed on.

Since
1.5
defaultChoosersback to summary
protected AbstractColorChooserPanel[] defaultChoosers

The array of default color choosers.

defaultTransferHandlerback to summary
private static TransferHandler defaultTransferHandler
handlerback to summary
private BasicColorChooserUI.Handler handler
isMultiPanelback to summary
pack-priv boolean isMultiPanel
previewListenerback to summary
protected ChangeListener previewListener

The instance of ChangeListener.

previewPanelback to summary
pack-priv JComponent previewPanel
previewPanelHolderback to summary
pack-priv JPanel previewPanelHolder
propertyChangeListenerback to summary
protected PropertyChangeListener propertyChangeListener

The instance of PropertyChangeListener.

singlePanelback to summary
pack-priv JPanel singlePanel
tabbedPaneback to summary
pack-priv JTabbedPane tabbedPane

Constructor Detail

BasicColorChooserUIback to summary
public BasicColorChooserUI()

Constructs a BasicColorChooserUI.

Method Detail

createDefaultChoosersback to summary
protected AbstractColorChooserPanel[] createDefaultChoosers()

Returns an array of default color choosers.

Returns:AbstractColorChooserPanel[]

an array of default color choosers

createPropertyChangeListenerback to summary
protected PropertyChangeListener createPropertyChangeListener()

Returns an instance of PropertyChangeListener.

Returns:PropertyChangeListener

an instance of PropertyChangeListener

createUIback to summary
public static ComponentUI createUI(JComponent c)

Hides javax.swing.plaf.ComponentUI.createUI.

Returns a new instance of BasicColorChooserUI.

Parameters
c:JComponent

a component

Returns:ComponentUI

a new instance of BasicColorChooserUI

getHandlerback to summary
private BasicColorChooserUI.Handler getHandler()
installDefaultsback to summary
protected void installDefaults()

Installs default properties.

installListenersback to summary
protected void installListeners()

Registers listeners.

installPreviewPanelback to summary
protected void installPreviewPanel()

Installs preview panel.

installUIback to summary
public void installUI(JComponent c)

Overrides javax.swing.plaf.ComponentUI.installUI.

Doc from javax.swing.plaf.ComponentUI.installUI.

Configures the specified component appropriately for the look and feel. This method is invoked when the ComponentUI instance is being installed as the UI delegate on the specified component. This method should completely configure the component for the look and feel, including the following:

  1. Install default property values for color, fonts, borders, icons, opacity, etc. on the component. Whenever possible, property values initialized by the client program should not be overridden.
  2. Install a LayoutManager on the component if necessary.
  3. Create/add any required sub-components to the component.
  4. Create/install event listeners on the component.
  5. Create/install a PropertyChangeListener on the component in order to detect and respond to component property changes appropriately.
  6. Install keyboard UI (mnemonics, traversal, etc.) on the component.
  7. Initialize any appropriate instance data.
selectionChangedback to summary
private void selectionChanged(ColorSelectionModel model)
uninstallDefaultChoosersback to summary
protected void uninstallDefaultChoosers()

Uninstalls default color choosers.

uninstallDefaultsback to summary
protected void uninstallDefaults()

Uninstalls default properties.

uninstallListenersback to summary
protected void uninstallListeners()

Unregisters listeners.

uninstallPreviewPanelback to summary
protected void uninstallPreviewPanel()

Removes installed preview panel from the UI delegate.

Since
1.7
uninstallUIback to summary
public void uninstallUI(JComponent c)

Overrides javax.swing.plaf.ComponentUI.uninstallUI.

Doc from javax.swing.plaf.ComponentUI.uninstallUI.

Reverses configuration which was done on the specified component during installUI. This method is invoked when this UIComponent instance is being removed as the UI delegate for the specified component. This method should undo the configuration performed in installUI, being careful to leave the JComponent instance in a clean state (no extraneous listeners, look-and-feel-specific property objects, etc.). This should include the following:

  1. Remove any UI-set borders from the component.
  2. Remove any UI-set layout managers on the component.
  3. Remove any UI-added sub-components from the component.
  4. Remove any UI-added event/property listeners from the component.
  5. Remove any UI-installed keyboard UI from the component.
  6. Nullify any allocated instance data objects to allow for GC.
javax.swing.plaf.basic back to summary

pack-priv Class BasicColorChooserUI.ColorTransferHandler

extends TransferHandler
implements UIResource
Class Inheritance
All Implemented Interfaces
javax.swing.plaf.UIResource
Annotations
@SuppressWarnings:serial

Field Summary

Inherited from javax.swing.TransferHandler:
COPYCOPY_OR_MOVELINKMOVENONE

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Inherited from javax.swing.TransferHandler:
canImportcanImportcreateTransferableexportAsDragexportDoneexportToClipboardgetCopyActiongetCutActiongetDragImagegetDragImageOffsetgetPasteActiongetSourceActionsgetVisualRepresentationimportDataimportDatasetDragImagesetDragImageOffset

Constructor Detail

ColorTransferHandlerback to summary
pack-priv ColorTransferHandler()
javax.swing.plaf.basic back to summary

private Class BasicColorChooserUI.Handler

extends Object
implements ChangeListener, MouseListener, PropertyChangeListener
Class Inheritance
All Implemented Interfaces
java.beans.PropertyChangeListener, java.util.EventListener, java.awt.event.MouseListener, javax.swing.event.ChangeListener

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
mouseClicked(MouseEvent evt)

Implements java.awt.event.MouseListener.mouseClicked.

Invoked when the mouse button has been clicked (pressed and released) on a component.

public void
mouseEntered(MouseEvent evt)

Implements java.awt.event.MouseListener.mouseEntered.

Invoked when the mouse enters a component.

public void
mouseExited(MouseEvent evt)

Implements java.awt.event.MouseListener.mouseExited.

Invoked when the mouse exits a component.

public void
mousePressed(MouseEvent evt)

Implements java.awt.event.MouseListener.mousePressed.

Invoked when a mouse button has been pressed on a component.

public void
mouseReleased(MouseEvent evt)

Implements java.awt.event.MouseListener.mouseReleased.

Invoked when a mouse button has been released on a component.

public void
propertyChange(PropertyChangeEvent evt)

Implements java.beans.PropertyChangeListener.propertyChange.

This method gets called when a bound property is changed.

public void
stateChanged(ChangeEvent evt)

Implements javax.swing.event.ChangeListener.stateChanged.

Invoked when the target of the listener has changed its state.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Handlerback to summary
private Handler()

Method Detail

mouseClickedback to summary
public void mouseClicked(MouseEvent evt)

Implements java.awt.event.MouseListener.mouseClicked.

Doc from java.awt.event.MouseListener.mouseClicked.

Invoked when the mouse button has been clicked (pressed and released) on a component.

mouseEnteredback to summary
public void mouseEntered(MouseEvent evt)

Implements java.awt.event.MouseListener.mouseEntered.

Doc from java.awt.event.MouseListener.mouseEntered.

Invoked when the mouse enters a component.

mouseExitedback to summary
public void mouseExited(MouseEvent evt)

Implements java.awt.event.MouseListener.mouseExited.

Doc from java.awt.event.MouseListener.mouseExited.

Invoked when the mouse exits a component.

mousePressedback to summary
public void mousePressed(MouseEvent evt)

Implements java.awt.event.MouseListener.mousePressed.

Doc from java.awt.event.MouseListener.mousePressed.

Invoked when a mouse button has been pressed on a component.

mouseReleasedback to summary
public void mouseReleased(MouseEvent evt)

Implements java.awt.event.MouseListener.mouseReleased.

Doc from java.awt.event.MouseListener.mouseReleased.

Invoked when a mouse button has been released on a component.

propertyChangeback to summary
public void propertyChange(PropertyChangeEvent evt)

Implements java.beans.PropertyChangeListener.propertyChange.

Doc from java.beans.PropertyChangeListener.propertyChange.

This method gets called when a bound property is changed.

stateChangedback to summary
public void stateChanged(ChangeEvent evt)

Implements javax.swing.event.ChangeListener.stateChanged.

Doc from javax.swing.event.ChangeListener.stateChanged.

Invoked when the target of the listener has changed its state.

javax.swing.plaf.basic back to summary

public Class BasicColorChooserUI.PropertyHandler

extends Object
implements PropertyChangeListener
Class Inheritance
All Implemented Interfaces
java.beans.PropertyChangeListener, java.util.EventListener

This class should be treated as a "protected" inner class. Instantiate it only within subclasses of BasicColorChooserUI.

Constructor Summary

AccessConstructor and Description
public
PropertyHandler()

Constructs a PropertyHandler.

Method Summary

Modifier and TypeMethod and Description
public void
propertyChange(PropertyChangeEvent e)

Implements java.beans.PropertyChangeListener.propertyChange.

This method gets called when a bound property is changed.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

PropertyHandlerback to summary
public PropertyHandler()

Constructs a PropertyHandler.

Method Detail

propertyChangeback to summary
public void propertyChange(PropertyChangeEvent e)

Implements java.beans.PropertyChangeListener.propertyChange.

Doc from java.beans.PropertyChangeListener.propertyChange.

This method gets called when a bound property is changed.