org.jfree.chart.plot
Class JThermometer

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--org.jfree.chart.plot.JThermometer
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class JThermometer
extends javax.swing.JPanel
implements java.io.Serializable

An initial quick and dirty. The concept behind this class would be to generate a gui bean that could be used within JBuilder, Netbeans etc... Copyright (c) 2002 Australian Antarctic Division

Author:
Bryan Scott
See Also:
Serialized Form

Field Summary
 
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
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JThermometer()
          Default constructor.
 
Method Summary
 void addSubitle(AbstractTitle subtitle)
          Adds a subtitle to the chart.
 void addSubtitle(java.lang.String subtitle)
          Adds a subtitle to the chart.
 void addSubtitle(java.lang.String subtitle, java.awt.Font font)
          Adds a subtitle to the chart.
 java.lang.Number getValue()
          Returns the value of the thermometer.
 void setBackground(java.awt.Color bg)
          Sets the background color.
 void setFollowDataInSubranges(boolean flag)
          Sets the flag that controls whether or not the display range follows the data value.
 void setForeground(java.awt.Color fg)
          Sets the foreground color.
 void setOutlinePaint(java.awt.Paint p)
          Sets the outline paint.
 void setRange(double lower, double upper)
          Sets the lower and upper bounds for the thermometer.
 void setShowValueLines(boolean b)
          Sets the flag that controls whether or not value lines are displayed.
 void setSubrangeInfo(int range, double displayLow, double displayHigh)
          Sets the range.
 void setSubrangeInfo(int range, double rangeLow, double rangeHigh, double displayLow, double displayHigh)
          Sets the range.
 void setUnits(int i)
          Sets the unit type.
 void setValue(double value)
          Sets the value of the thermometer.
 void setValue(java.lang.Number value)
          Sets the value of the thermometer.
 void setValueFont(java.awt.Font f)
          Sets the value font.
 void setValueFormat(java.text.DecimalFormat df)
          Sets the value format for the thermometer.
 void setValueLocation(int loc)
          Sets the location at which the temperature value is displayed.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JThermometer

public JThermometer()
Default constructor.

Method Detail

addSubitle

public void addSubitle(AbstractTitle subtitle)
Adds a subtitle to the chart.

Parameters:
subtitle - the subtitle.

addSubtitle

public void addSubtitle(java.lang.String subtitle)
Adds a subtitle to the chart.

Parameters:
subtitle - the subtitle.

addSubtitle

public void addSubtitle(java.lang.String subtitle,
                        java.awt.Font font)
Adds a subtitle to the chart.

Parameters:
subtitle - the subtitle.
font - the subtitle font.

setValueFormat

public void setValueFormat(java.text.DecimalFormat df)
Sets the value format for the thermometer.

Parameters:
df - the formatter.

setRange

public void setRange(double lower,
                     double upper)
Sets the lower and upper bounds for the thermometer.

Parameters:
lower - the lower bound.
upper - the upper bound.

setSubrangeInfo

public void setSubrangeInfo(int range,
                            double displayLow,
                            double displayHigh)
Sets the range.

Parameters:
range - the range type.
displayLow - the low value.
displayHigh - the high value.

setSubrangeInfo

public void setSubrangeInfo(int range,
                            double rangeLow,
                            double rangeHigh,
                            double displayLow,
                            double displayHigh)
Sets the range.

Parameters:
range - the range type.
rangeLow - the low value for the range.
rangeHigh - the high value for the range.
displayLow - the low value for display.
displayHigh - the high value for display.

setValueLocation

public void setValueLocation(int loc)
Sets the location at which the temperature value is displayed.

Parameters:
loc - the location.

getValue

public java.lang.Number getValue()
Returns the value of the thermometer.

Returns:
the value.

setValue

public void setValue(double value)
Sets the value of the thermometer.

Parameters:
value - the value.

setValue

public void setValue(java.lang.Number value)
Sets the value of the thermometer.

Parameters:
value - the value.

setUnits

public void setUnits(int i)
Sets the unit type.

Parameters:
i - the unit type.

setOutlinePaint

public void setOutlinePaint(java.awt.Paint p)
Sets the outline paint.

Parameters:
p - the paint.

setForeground

public void setForeground(java.awt.Color fg)
Sets the foreground color.

Overrides:
setForeground in class javax.swing.JComponent
Parameters:
fg - the foreground color.

setBackground

public void setBackground(java.awt.Color bg)
Sets the background color.

Overrides:
setBackground in class javax.swing.JComponent
Parameters:
bg - the background color.

setValueFont

public void setValueFont(java.awt.Font f)
Sets the value font.

Parameters:
f - the font.

setFollowDataInSubranges

public void setFollowDataInSubranges(boolean flag)
Sets the flag that controls whether or not the display range follows the data value.

Parameters:
flag - the new value of the flag.

setShowValueLines

public void setShowValueLines(boolean b)
Sets the flag that controls whether or not value lines are displayed.

Parameters:
b - the new flag value.