public class LineChart
extends javax.swing.JComponent
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Constructor and Description |
|---|
LineChart(int lineSampleInterval,
long sampleInterval,
java.lang.String format,
java.lang.String detailFormat,
int averageWindow,
boolean antialias) |
| Modifier and Type | Method and Description |
|---|---|
void |
mouseClicked(java.awt.event.MouseEvent event)
Called when the mouse is clicked ont the component.
|
void |
mouseDragged(java.awt.event.MouseEvent event)
Called when the mouse is dragged over the component.
|
void |
mouseEntered(java.awt.event.MouseEvent event)
Called when the mouse is enters the component.
|
void |
mouseExited(java.awt.event.MouseEvent event)
Called when the mouse is exits the component.
|
void |
mouseMoved(java.awt.event.MouseEvent event)
Called when the mouse is moved over the component.
|
void |
mousePressed(java.awt.event.MouseEvent event)
Called when the mouse is pressed ont the component.
|
void |
mouseReleased(java.awt.event.MouseEvent event)
Called when the mouse is released ont the component.
|
void |
paintComponent(java.awt.Graphics g)
Paints the component.
|
void |
setAntialias(boolean antialias)
Sets the antialias flag to control whether or not antialiasing will be
used when rendering the component.
|
void |
setValues(int[] values,
long time)
Sets the data samples to be displayed by the line chart.
|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, 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, getUIClassID, 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, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUIadd, 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, validateaction, 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, getPeer, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic LineChart(int lineSampleInterval,
long sampleInterval,
java.lang.String format,
java.lang.String detailFormat,
int averageWindow,
boolean antialias)
lineSampleInterval - The interval in data points at which to place vertical lines and
labels along the x (time) axis.sampleInterval - The number of milliseconds represented by each data sample.format - Format of the text which is displayed along the x (time) axis of
the chart. The text will display the time of the line chart at a
particular interval. The text should take the format
"{0}/{1}/{2} {3}:{4}:{5}.{6}" where {0} is replaced by the year,
{1} by the month, {2} by the day, {3} by the hour, {4} by the
minute, {5} by the second, and {6} by the hundereths of a
second.detailFormat - Format of the text which is displayed over the component as the
user moves the mouse over the line chart. The text will display
the exact value of the line chart at a particular point. The
text should take the format "{0}/{1}/{2} {3}:{4}:{5}.{6}" where
{0} is replaced by the year, {1} by the month, {2} by the day,
{3} by the hour, {4} by the minute, {5} by the second, and {6}
by the hundereths of a second.averageWindow - Number of data points to do a moving average over when the mouse
is pressed on the component.antialias - True if Antialiasing should be used when rendering the chart.public void setAntialias(boolean antialias)
antialias - True to use antialiasing.public void setValues(int[] values,
long time)
values - Array of data samples.time - The time of the start of the last sample point.public void paintComponent(java.awt.Graphics g)
paintComponent in class javax.swing.JComponentg - Graphics to paint the chart onto.public void mouseClicked(java.awt.event.MouseEvent event)
mouseClicked in interface java.awt.event.MouseListenerevent - Event which describes the action.public void mousePressed(java.awt.event.MouseEvent event)
mousePressed in interface java.awt.event.MouseListenerevent - Event which describes the action.public void mouseReleased(java.awt.event.MouseEvent event)
mouseReleased in interface java.awt.event.MouseListenerevent - Event which describes the action.public void mouseEntered(java.awt.event.MouseEvent event)
mouseEntered in interface java.awt.event.MouseListenerevent - Event which describes the action.public void mouseExited(java.awt.event.MouseEvent event)
mouseExited in interface java.awt.event.MouseListenerevent - Event which describes the action.public void mouseDragged(java.awt.event.MouseEvent event)
mouseDragged in interface java.awt.event.MouseMotionListenerevent - Event which describes the motion.public void mouseMoved(java.awt.event.MouseEvent event)
mouseMoved in interface java.awt.event.MouseMotionListenerevent - Event which describes the motion.