org.proteinshader.gui.listeners.controlpanel
Class ColorPanelListenerFactory

java.lang.Object
  extended by org.proteinshader.gui.listeners.controlpanel.ColorPanelListenerFactory

public class ColorPanelListenerFactory
extends Object

Creates the listener for the ColorPanel.


Constructor Summary
ColorPanelListenerFactory(Mediator mediator, ColorPanel colorPanel)
          Constructs a ColorPanelListenerFactory.
 
Method Summary
 ActionListener createChooserButtonActionListener()
          Creates an action listener for the "Chooser" button.
 ChangeListener createChooserChangeListener()
          Creates a ChangeListener that will get the color selection from the JColorChooser and calls on the ColorPanel to change the color of whatever items are currently selected.
 ActionListener createDefault1ButtonActionListener()
          Creates an action listener for the first default button.
 ActionListener createDefault2ButtonActionListener()
          Creates an action listener for the second default button.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColorPanelListenerFactory

public ColorPanelListenerFactory(Mediator mediator,
                                 ColorPanel colorPanel)
Constructs a ColorPanelListenerFactory.

Parameters:
mediator - the centralized Mediator object that listeners call on to accomplish their task.
colorPanel - the ColorPanel that this class creates listeners for.
Method Detail

createDefault1ButtonActionListener

public ActionListener createDefault1ButtonActionListener()
Creates an action listener for the first default button. When the action listener is called, it will apply the default 1 color to whatever objects are currently selected in the RadioPanel.

Returns:
The action listener.

createDefault2ButtonActionListener

public ActionListener createDefault2ButtonActionListener()
Creates an action listener for the second default button. When the action listener is called, it will apply the default 2 color to whatever objects are currently selected in the RadioPanel.

Returns:
The action listener.

createChooserButtonActionListener

public ActionListener createChooserButtonActionListener()
Creates an action listener for the "Chooser" button. When the action listener is called, it will open a JColorChooser. Any color selections made by the JColorChooser will be used to enter numbers in the ColorPanel text fields for Red, Green, and Blue.

Returns:
The action listener.

createChooserChangeListener

public ChangeListener createChooserChangeListener()
Creates a ChangeListener that will get the color selection from the JColorChooser and calls on the ColorPanel to change the color of whatever items are currently selected.

Returns:
The action listener.


Copyright © 2007-2008