com.isti.util.gui
Class IstiColorSelector

java.lang.Object
  extended by javax.swing.colorchooser.DefaultColorSelectionModel
      extended by com.isti.util.gui.IstiColorSelector
All Implemented Interfaces:
java.io.Serializable, javax.swing.colorchooser.ColorSelectionModel

public class IstiColorSelector
extends javax.swing.colorchooser.DefaultColorSelectionModel

Defines the color selector.

See Also:
Serialized Form

Field Summary
protected  javax.swing.JButton button
           
protected  java.util.Vector listenerList
           
 
Fields inherited from class javax.swing.colorchooser.DefaultColorSelectionModel
changeEvent
 
Constructor Summary
IstiColorSelector(java.awt.Color c, java.lang.String title)
          Creates a color selector.
 
Method Summary
 void addActionListener(java.awt.event.ActionListener l)
          Adds an ActionListener to the button.
protected  void fireActionPerformed(java.awt.event.ActionEvent event)
          Notifies all listeners that have registered interest for notification on this event type.
 java.awt.Component getSelectionComponent()
          Gets the selection component.
 void removeActionListener(java.awt.event.ActionListener l)
          Removes an ActionListener from the button.
 void setSelectedColor(java.awt.Color color)
          Sets the model's selected color to color.
 
Methods inherited from class javax.swing.colorchooser.DefaultColorSelectionModel
addChangeListener, fireStateChanged, getChangeListeners, getSelectedColor, removeChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

button

protected final javax.swing.JButton button

listenerList

protected java.util.Vector listenerList
Constructor Detail

IstiColorSelector

public IstiColorSelector(java.awt.Color c,
                         java.lang.String title)
Creates a color selector.

Parameters:
c - the initial color selection.
title - title for the selector.
Method Detail

getSelectionComponent

public java.awt.Component getSelectionComponent()
Gets the selection component.

Returns:
component for color selection.

setSelectedColor

public void setSelectedColor(java.awt.Color color)
Sets the model's selected color to color.

Specified by:
setSelectedColor in interface javax.swing.colorchooser.ColorSelectionModel
Overrides:
setSelectedColor in class javax.swing.colorchooser.DefaultColorSelectionModel
Parameters:
color - selected color. Notifies any listeners if the model changes
See Also:
DefaultColorSelectionModel.getSelectedColor(), DefaultColorSelectionModel.addChangeListener(javax.swing.event.ChangeListener)

addActionListener

public void addActionListener(java.awt.event.ActionListener l)
Adds an ActionListener to the button.

Parameters:
l - the ActionListener to be added

removeActionListener

public void removeActionListener(java.awt.event.ActionListener l)
Removes an ActionListener from the button. If the listener is the currently set Action for the button, then the Action is set to null.

Parameters:
l - the listener to be removed

fireActionPerformed

protected void fireActionPerformed(java.awt.event.ActionEvent event)
Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.

Parameters:
event - the ChangeEvent object
See Also:
EventListenerList