org.proteinshader.gui.listeners.controlpanel
Class VisibilityPanelListenerFactory

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

public class VisibilityPanelListenerFactory
extends Object

Creates the listener for the VisibilityPanel.


Constructor Summary
VisibilityPanelListenerFactory(Mediator mediator, VisibilityPanel visibilityPanel)
          Constructs a VisibilityPanelListenerFactory.
 
Method Summary
 ChangeListener createAlphaSliderChangeListener()
          Creates a change listener for the alpha slider.
 ActionListener createInvisibleButtonActionListener()
          Creates an action listener for the "Invisible" button.
 ActionListener createOpaqueButtonActionListener()
          Creates an action listener for the "Opaque" button.
 ActionListener createTranslucentButtonActionListener()
          Creates an action listener for the "Translucent" button.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VisibilityPanelListenerFactory

public VisibilityPanelListenerFactory(Mediator mediator,
                                      VisibilityPanel visibilityPanel)
Constructs a VisibilityPanelListenerFactory.

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

createOpaqueButtonActionListener

public ActionListener createOpaqueButtonActionListener()
Creates an action listener for the "Opaque" button. When the action listener is called, it will apply VisibilityEnum.OPAQUE and an alpha value of 1.0 to whatever item or items are selected in the radio panel.

Returns:
The action listener.

createInvisibleButtonActionListener

public ActionListener createInvisibleButtonActionListener()
Creates an action listener for the "Invisible" button. When the action listener is called, it will apply VisibilityEnum.INVISIBLE and an alpha value of 0.0 to whatever item or items are selected in the radio panel.

Returns:
The action listener.

createTranslucentButtonActionListener

public ActionListener createTranslucentButtonActionListener()
Creates an action listener for the "Translucent" button. When the action listener is called, it will apply VisibilityEnum.TRANSLUCENT and an alpha value of VisibilityPanel.SLIDER_INIT to whatever item or items are selected in the radio panel.

Returns:
The action listener.

createAlphaSliderChangeListener

public ChangeListener createAlphaSliderChangeListener()
Creates a change listener for the alpha slider. When the change listener is called, it will update the "% translucent" text field, calculate the corresponding alpha value, and then apply that alpha value to the item or items currently selected in the RadioPanel.

Returns:
The change listener.


Copyright © 2007-2008