edu.cmu.hcii.calo.view.DisclosureButton Class Reference

List of all members.

Detailed Description

A toggle button that displays a disclosure triangle.

Todo:
The transition between states should ideally be animated.
Author:
Brian Ellis


Public Member Functions

 DisclosureButton ()
 Constructs a disclosure triangle in the collapsed state.
 DisclosureButton (Action a)
 Constructs a disclosure triangle in the collapsed state with the given action.
Dimension getPreferredSize ()
 Returns the preferred size of this button.
void setSelectedToolTipText (String selectedToolTipText)
 Sets the text to use on the tooltip for this button when it is expanded.
void setUnselectedToolTipText (String unselectedToolTipText)
 Sets the text to use on the tooltip for this button when it is collapsed.

Protected Member Functions

void fireStateChanged ()
 Fires the state changed event for this button.

Private Member Functions

 DisclosureButton (Icon icon)
 Superclass constructor.
 DisclosureButton (Icon icon, boolean selected)
 Superclass constructor.
 DisclosureButton (String title)
 Superclass constructor.
 DisclosureButton (String title, boolean selected)
 Superclass constructor.
 DisclosureButton (String title, Icon icon)
 Superclass constructor.
 DisclosureButton (String title, Icon icon, boolean selected)
 Superclass constructor.
String getSelectedToolTipText ()
 Returns the text that will be displayed in the tooltip when the disclosure button is expanded.
String getUnselectedToolTipText ()
 Returns the text that will be displayed in the tooltip when the disclosure button is collapsed.
void setCollapsedAppearance ()
 Sets the appearance of the disclosure button to what it should be when it's collapsed.
void setExpandedAppearance ()
 Sets the appearance of the disclosure button to what it should be when it's expanded.
void setup ()
 Sets up the visual appearance of this button.

Private Attributes

String selectedToolTipText
 The text to use as the tooltip for this triangle when it's expanded.
String unselectedToolTipText
 The text to use as the tooltip for this triangle when it's collapsed.

Static Private Attributes

static final long serialVersionUID = -8742538298469444232L
 Prevent serialization collisions.
static final double ANIMATION_FRAME_LENGTH = 0.10
 The length of a single frame of the animation between states (the one that currently doesn't happen).
static final Icon COLLAPSED = new ImageIcon("Resources/disclosure-collapsed.png")
 The icon to use when the triangle is representing a collapsed state.
static final Icon PRESSED_COLLAPSED
 The icon to use when the triangle is representing a collapsed state and has been clicked.
static final Icon EXPANDED = new ImageIcon("Resources/disclosure-expanded.png")
 The icon to use when the triangle is representing an expanded state.
static final Icon PRESSED_EXPANDED
 The icon to use when the triangle is representing an expanded state and has been clicked.
static final Icon ANIMATING = new ImageIcon("Resources/disclosure-animating.png")
 The icon to use when the triangle is animating.


Constructor & Destructor Documentation

edu.cmu.hcii.calo.view.DisclosureButton.DisclosureButton (  ) 

Constructs a disclosure triangle in the collapsed state.

edu.cmu.hcii.calo.view.DisclosureButton.DisclosureButton ( Action  a  ) 

Constructs a disclosure triangle in the collapsed state with the given action.

Parameters:
a the action to attach

edu.cmu.hcii.calo.view.DisclosureButton.DisclosureButton ( Icon  icon  )  [private]

Superclass constructor.

Do not use.

Parameters:
icon icon

edu.cmu.hcii.calo.view.DisclosureButton.DisclosureButton ( Icon  icon,
boolean  selected 
) [private]

Superclass constructor.

Do not use.

Parameters:
icon icon
selected selected

edu.cmu.hcii.calo.view.DisclosureButton.DisclosureButton ( String  title  )  [private]

Superclass constructor.

Do not use.

Parameters:
title title

edu.cmu.hcii.calo.view.DisclosureButton.DisclosureButton ( String  title,
boolean  selected 
) [private]

Superclass constructor.

Do not use.

Parameters:
title title
selected selected

edu.cmu.hcii.calo.view.DisclosureButton.DisclosureButton ( String  title,
Icon  icon 
) [private]

Superclass constructor.

Do not use.

Parameters:
title title
icon icon

edu.cmu.hcii.calo.view.DisclosureButton.DisclosureButton ( String  title,
Icon  icon,
boolean  selected 
) [private]

Superclass constructor.

Do not use.

Parameters:
title title
icon icon
selected selected


Member Function Documentation

Dimension edu.cmu.hcii.calo.view.DisclosureButton.getPreferredSize (  ) 

Returns the preferred size of this button.

It is always the size of the icon, unless its preferred size has been explicitly set, in which case that value is returned instead.

void edu.cmu.hcii.calo.view.DisclosureButton.setSelectedToolTipText ( String  selectedToolTipText  ) 

Sets the text to use on the tooltip for this button when it is expanded.

Parameters:
selectedToolTipText the tooltip text

void edu.cmu.hcii.calo.view.DisclosureButton.setUnselectedToolTipText ( String  unselectedToolTipText  ) 

Sets the text to use on the tooltip for this button when it is collapsed.

Parameters:
unselectedToolTipText the tooltip text

void edu.cmu.hcii.calo.view.DisclosureButton.fireStateChanged (  )  [protected]

Fires the state changed event for this button.

Overridden to set the tooltip text to the appropriate string as well.

See also:
javax.swing.AbstractButton.fireStateChanged()

String edu.cmu.hcii.calo.view.DisclosureButton.getSelectedToolTipText (  )  [private]

Returns the text that will be displayed in the tooltip when the disclosure button is expanded.

Returns:
the tooltip text

String edu.cmu.hcii.calo.view.DisclosureButton.getUnselectedToolTipText (  )  [private]

Returns the text that will be displayed in the tooltip when the disclosure button is collapsed.

Returns:
the tooltip text

void edu.cmu.hcii.calo.view.DisclosureButton.setCollapsedAppearance (  )  [private]

Sets the appearance of the disclosure button to what it should be when it's collapsed.

void edu.cmu.hcii.calo.view.DisclosureButton.setExpandedAppearance (  )  [private]

Sets the appearance of the disclosure button to what it should be when it's expanded.

void edu.cmu.hcii.calo.view.DisclosureButton.setup (  )  [private]

Sets up the visual appearance of this button.


Member Data Documentation

final long edu.cmu.hcii.calo.view.DisclosureButton.serialVersionUID = -8742538298469444232L [static, private]

Prevent serialization collisions.

final double edu.cmu.hcii.calo.view.DisclosureButton.ANIMATION_FRAME_LENGTH = 0.10 [static, private]

The length of a single frame of the animation between states (the one that currently doesn't happen).

final Icon edu.cmu.hcii.calo.view.DisclosureButton.COLLAPSED = new ImageIcon("Resources/disclosure-collapsed.png") [static, private]

The icon to use when the triangle is representing a collapsed state.

final Icon edu.cmu.hcii.calo.view.DisclosureButton.PRESSED_COLLAPSED [static, private]

Initial value:

        new ImageIcon("Resources/disclosure-pressed-collapsed.png")
The icon to use when the triangle is representing a collapsed state and has been clicked.

final Icon edu.cmu.hcii.calo.view.DisclosureButton.EXPANDED = new ImageIcon("Resources/disclosure-expanded.png") [static, private]

The icon to use when the triangle is representing an expanded state.

final Icon edu.cmu.hcii.calo.view.DisclosureButton.PRESSED_EXPANDED [static, private]

Initial value:

        new ImageIcon("Resources/disclosure-pressed-expanded.png")
The icon to use when the triangle is representing an expanded state and has been clicked.

final Icon edu.cmu.hcii.calo.view.DisclosureButton.ANIMATING = new ImageIcon("Resources/disclosure-animating.png") [static, private]

The icon to use when the triangle is animating.

Currently unused due to the lack of animation.

String edu.cmu.hcii.calo.view.DisclosureButton.selectedToolTipText [private]

The text to use as the tooltip for this triangle when it's expanded.

String edu.cmu.hcii.calo.view.DisclosureButton.unselectedToolTipText [private]

The text to use as the tooltip for this triangle when it's collapsed.


The documentation for this class was generated from the following file:
Generated on Mon Aug 13 15:06:22 2007 for CALO by  doxygen 1.5.2