|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.pentec.gui.widgets.ATemperaturePanel
public class ATemperaturePanel
Generic temperature panel with a unit combo box and graph button. This is often extended implementing Runnable to update itself as a temperature monitor.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
javax.swing.JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
private java.lang.String |
$Name
Name of the temperature panel (used as a label for the button) |
static java.lang.String[] |
a$Units
Supported temperature units |
static int |
DEGC
Degrees Celsius index |
static int |
DEGF
Degrees Fahrenheit index |
static int |
DEGR
Degrees Rankin index |
private double |
dTemperatureDegC
Current temperature in degrees Celsius |
static double |
ERROR
Value marking an error in reading/setting the temperature |
private int |
iDisplayPrecision
Number of digits past the decimal point to display |
private int |
iNumDataPoints
Number of history data points to maintain |
private int |
iUnits
Currently displayed units |
private javax.swing.JButton |
jbGraph
Button to graph temperature history (labeled with $Name |
private javax.swing.JComboBox |
jcbUnits
Units selection combo box |
private javax.swing.JTextField |
jtfTemperature
Text field the current temperature in the currently selected units is displayed in |
static int |
KELVIN
Kelvin index |
private long |
lFirstSampleTime
First sample time |
protected java.util.ArrayList |
tempList
List of temperatures for each data point |
protected java.util.ArrayList |
timeList
List of elapsed times for each data point |
| 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, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
ATemperaturePanel(java.lang.String $Name,
int iNumDataPoints,
int iDisplayPrecision)
|
|
ATemperaturePanel(java.lang.String $Name,
int iNumDataPoints,
int iDisplayPrecision,
java.awt.Dimension graphButtonSize)
|
|
ATemperaturePanel(java.lang.String $Name,
int iNumDataPoints,
int iDisplayPrecision,
int iDefaultUnit)
|
|
ATemperaturePanel(java.lang.String $Name,
int iNumDataPoints,
int iDisplayPrecision,
int iDefaultUnit,
java.awt.Dimension graphButtonSize)
|
|
| Method Summary | |
|---|---|
static double |
convertTemperatureFromCelsius(double dTemperature,
int iUnit)
Convert temperature from degrees Celsius to iUnit. |
static double |
convertTemperatureToCelsius(double dTemperature,
int iUnit)
Convert temperature to degrees Celsius from iUnit. |
static javax.swing.JComboBox |
createTemperatureComboBox()
|
static int |
decodeUnits(java.lang.String $Unit)
Decode the String form of units into an integer index |
DataFrame |
generateGraph()
Generate an APlot of the last iNumDataPoints recorded temperatures. |
java.lang.String |
getName()
|
private void |
setTemperature(double dTemperature)
Set and display the current temperature |
java.lang.String |
toString()
|
void |
updateTemperature(double dTemperature)
Set and record the current temperature |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, 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, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, 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, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private java.lang.String $Name
public static final java.lang.String[] a$Units
public static final int DEGC
public static final int DEGF
public static final int DEGR
private double dTemperatureDegC
public static final double ERROR
private int iDisplayPrecision
private int iNumDataPoints
private int iUnits
private javax.swing.JButton jbGraph
$Name
private javax.swing.JComboBox jcbUnits
private javax.swing.JTextField jtfTemperature
public static final int KELVIN
private long lFirstSampleTime
protected java.util.ArrayList tempList
protected java.util.ArrayList timeList
| Constructor Detail |
|---|
public ATemperaturePanel(java.lang.String $Name,
int iNumDataPoints,
int iDisplayPrecision)
public ATemperaturePanel(java.lang.String $Name,
int iNumDataPoints,
int iDisplayPrecision,
java.awt.Dimension graphButtonSize)
public ATemperaturePanel(java.lang.String $Name,
int iNumDataPoints,
int iDisplayPrecision,
int iDefaultUnit)
public ATemperaturePanel(java.lang.String $Name,
int iNumDataPoints,
int iDisplayPrecision,
int iDefaultUnit,
java.awt.Dimension graphButtonSize)
| Method Detail |
|---|
public static double convertTemperatureFromCelsius(double dTemperature,
int iUnit)
dTemperature - temperature in degrees CelsiusiUnit - unit to convert to
public static double convertTemperatureToCelsius(double dTemperature,
int iUnit)
dTemperature - temperature in iUnitiUnit - unit to convert from
public static javax.swing.JComboBox createTemperatureComboBox()
public static int decodeUnits(java.lang.String $Unit)
$Unit - String form of a supported unit
$Unit, -1 on failure to decode (unsupported unit)public DataFrame generateGraph()
iNumDataPoints recorded temperatures.
public java.lang.String getName()
getName in class java.awt.Componentprivate void setTemperature(double dTemperature)
dTemperature - current temperature in degrees Celsiuspublic java.lang.String toString()
toString in class java.awt.Componentpublic void updateTemperature(double dTemperature)
dTemperature - current temperature in degrees Celsius
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||