kiwi.ui
Class Thermometer

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--kiwi.ui.KPanel
                                |
                                +--kiwi.ui.Thermometer

public class Thermometer
extends KPanel

This class represents a combination progress meter / busy slider.

Version:
1.1 (11/98)
Author:
Mark Lindner, PING Software Group
See Also:
Serialized Form

Inner classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
Thermometer()
          Construct a new Thermometer with a default foreground color (a dark blue).
Thermometer(Color color)
          Construct a new Thermometer with the given foreground color.
 
Method Summary
 Dimension getMinimumSize()
          Get the minimum size of the component.
 Dimension getPreferredSize()
          Get the preferred size of the component.
 void paint(Graphics gc)
          Paint the component.
 void setPercent(int percent)
          Set a percentage on the meter.
 void setSize(int w, int h)
          Set the size of the component.
 void start()
          Start the busy slider.
 void stop()
          Stop the busy slider.
 
Methods inherited from class kiwi.ui.KPanel
getComponentByName, paintComponent, setOpaque, setTexture
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, paramString, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getNextFocusableComponent, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintImmediately, paintImmediately, processComponentKeyEvent, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Thermometer

public Thermometer()
Construct a new Thermometer with a default foreground color (a dark blue).

Thermometer

public Thermometer(Color color)
Construct a new Thermometer with the given foreground color.
Parameters:
color - The foreground color.
Method Detail

setPercent

public void setPercent(int percent)
Set a percentage on the meter. The percentage value, which must be between 0 and 100 inclusive, specifies how much of the meter should be filled in with the foreground color.
Parameters:
percent - The new percentage value. If the value is out of range, it is clipped.

setSize

public void setSize(int w,
                    int h)
Set the size of the component.
Overrides:
setSize in class Component

getPreferredSize

public Dimension getPreferredSize()
Get the preferred size of the component. The preferred size is always 100 pixels for width and the current height.
Overrides:
getPreferredSize in class JComponent

getMinimumSize

public Dimension getMinimumSize()
Get the minimum size of the component. Returns the preferred size of the component.
Overrides:
getMinimumSize in class JComponent

paint

public void paint(Graphics gc)
Paint the component.
Overrides:
paint in class JComponent

start

public void start()
Start the busy slider. The busy slider is a rectangular segment, 20% of the width of the meter that slides back and forth along the length of the meter. A dedicated thread is created to update this slider.

stop

public void stop()
Stop the busy slider. Stops the slider and clears the meter. The dedicated update thread is interrupted and released.