org.argouml.ui
Class ZoomSliderButton

java.lang.Object
  |
  +--ModalButton
        |
        +--org.argouml.swingext.PopupButton
              |
              +--org.argouml.ui.ZoomSliderButton

public class ZoomSliderButton
extends PopupButton

A button that can be used to change the zoom magnification of the current diagram. When the user presses the button, a popup is displayed which contains a vertical slider representing the range of zoom magnifications. Dragging the slider changes the zoom magnification for the current diagram.

See Also:
Serialized Form

Field Summary
private  javax.swing.JTextField _currentValue
          The text field which shows the current zoom magnification value.
private  javax.swing.JSlider _slider
          The slider component.
private static java.lang.String BUNDLE
          The localization bundle.
private static java.awt.Font LABEL_FONT
          Font used for the slider tick labels and for the current magnification value label.
private static int MAXIMUM_ZOOM
          The maximum zoom magnification slider value.
private static int MINIMUM_ZOOM
          The minimum zoom magnification slider value.
private static java.lang.String RESOURCE_NAME
          Used for loading the zoom icon from the Zoom Reset action.
private static int SLIDER_HEIGHT
          The preferred height of the slider component.
 
Fields inherited from class org.argouml.swingext.PopupButton
 
Constructor Summary
ZoomSliderButton()
          Constructs a new ZoomSliderButton.
 
Method Summary
private  void createPopupComponent()
          Creates the slider popup component.
private  void handleSliderValueChange()
          Called when the slider value changes.
private  void handleTextEntry()
          Called when the text field value changes.
protected  void showPopup()
          Update the slider value every time the popup is shown.
private  void updateCurrentValueLabel()
          Sets the current value label's text to the current slider value.
 
Methods inherited from class org.argouml.swingext.PopupButton
getPopupComponent, setIcon, setPopupComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE_NAME

private static final java.lang.String RESOURCE_NAME
Used for loading the zoom icon from the Zoom Reset action.

See Also:
Constant Field Values

BUNDLE

private static final java.lang.String BUNDLE
The localization bundle.

See Also:
Constant Field Values

LABEL_FONT

private static final java.awt.Font LABEL_FONT
Font used for the slider tick labels and for the current magnification value label.


MINIMUM_ZOOM

private static final int MINIMUM_ZOOM
The minimum zoom magnification slider value.

See Also:
Constant Field Values

MAXIMUM_ZOOM

private static final int MAXIMUM_ZOOM
The maximum zoom magnification slider value.

See Also:
Constant Field Values

SLIDER_HEIGHT

private static final int SLIDER_HEIGHT
The preferred height of the slider component.

See Also:
Constant Field Values

_slider

private javax.swing.JSlider _slider
The slider component.


_currentValue

private javax.swing.JTextField _currentValue
The text field which shows the current zoom magnification value.

Constructor Detail

ZoomSliderButton

public ZoomSliderButton()
Constructs a new ZoomSliderButton.

Method Detail

createPopupComponent

private void createPopupComponent()
Creates the slider popup component.


showPopup

protected void showPopup()
Update the slider value every time the popup is shown.

Overrides:
showPopup in class PopupButton

handleSliderValueChange

private void handleSliderValueChange()
Called when the slider value changes.


handleTextEntry

private void handleTextEntry()
Called when the text field value changes.


updateCurrentValueLabel

private void updateCurrentValueLabel()
Sets the current value label's text to the current slider value.



ArgoUML © 1996-2004 (20040306)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook