Package 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:
ImageObserver,MenuContainer,Serializable,Accessible
public class JThermometer extends JPanel implements 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
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Component
Component.BaselineResizeBehavior -
Field Summary
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors Constructor Description JThermometer()Default constructor. -
Method Summary
Modifier and Type Method Description voidaddSubitle(Title subtitle)Adds a subtitle to the chart.voidaddSubtitle(String subtitle)Adds a subtitle to the chart.voidaddSubtitle(String subtitle, Font font)Adds a subtitle to the chart.voidchangeTickFontSize(int delta)Increases or decreases the tick font size.intgetShowAxisLocation()Returns the location for the axis.FontgetTickLabelFont()Returns the tick label font.NumbergetValue()Returns the value of the thermometer.voidsetBackground(Color bg)Sets the background color.voidsetFollowDataInSubranges(boolean flag)Sets the flag that controls whether or not the display range follows the data value.voidsetForeground(Color fg)Sets the foreground color.voidsetOutlinePaint(Paint p)Sets the outline paint.voidsetRange(double lower, double upper)Sets the lower and upper bounds for the thermometer.voidsetShowAxisLocation(int location)Sets the location for the axis.voidsetShowValueLines(boolean b)Sets the flag that controls whether or not value lines are displayed.voidsetSubrangeInfo(int range, double displayLow, double displayHigh)Sets the range.voidsetSubrangeInfo(int range, double rangeLow, double rangeHigh, double displayLow, double displayHigh)Sets the range.voidsetTickFontStyle(int style)Sets the tick font style.voidsetTickLabelFont(Font font)Sets the tick label font.voidsetUnits(int i)Sets the unit type.voidsetValue(double value)Sets the value of the thermometer.voidsetValue(Number value)Sets the value of the thermometer.voidsetValueFont(Font f)Sets the value font.voidsetValueFormat(DecimalFormat df)Sets the value format for the thermometer.voidsetValueLocation(int loc)Sets the location at which the temperature value is displayed.voidsetValuePaint(Paint paint)Sets the value paint.Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUIMethods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validateMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Constructor Details
-
JThermometer
public JThermometer()Default constructor.
-
-
Method Details
-
addSubitle
Adds a subtitle to the chart.- Parameters:
subtitle- the subtitle.
-
addSubtitle
Adds a subtitle to the chart.- Parameters:
subtitle- the subtitle.
-
addSubtitle
Adds a subtitle to the chart.- Parameters:
subtitle- the subtitle.font- the subtitle font.
-
setValueFormat
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.
-
setValuePaint
Sets the value paint.- Parameters:
paint- the paint.
-
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
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
Sets the outline paint.- Parameters:
p- the paint.
-
setForeground
Sets the foreground color.- Overrides:
setForegroundin classJComponent- Parameters:
fg- the foreground color.
-
setBackground
Sets the background color.- Overrides:
setBackgroundin classJComponent- Parameters:
bg- the background color.
-
setValueFont
Sets the value font.- Parameters:
f- the font.
-
getTickLabelFont
Returns the tick label font.- Returns:
- The tick label font.
-
setTickLabelFont
Sets the tick label font.- Parameters:
font- the font.
-
changeTickFontSize
public void changeTickFontSize(int delta)Increases or decreases the tick font size.- Parameters:
delta- the change in size.
-
setTickFontStyle
public void setTickFontStyle(int style)Sets the tick font style.- Parameters:
style- the style.
-
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.
-
setShowAxisLocation
public void setShowAxisLocation(int location)Sets the location for the axis.- Parameters:
location- the location.
-
getShowAxisLocation
public int getShowAxisLocation()Returns the location for the axis.- Returns:
- the location.
-