public class Timeline extends Graph implements java.awt.event.MouseMotionListener, java.io.Serializable
javax.swing.JPanel.AccessibleJPaneljavax.swing.JComponent.AccessibleJComponentABOVE, BELOW, HORIZONTAL, LEFT, RIGHT, showModelDistribution, VERTICALaccessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Constructor and Description |
|---|
Timeline()
This default constructor creates a new timeline corresponding to the default
domain (0, 1) (with step size 0.1), and with the default name "x".
|
Timeline(Domain d)
This special constructor creates a new timeline corresponding to a specified
domain and the default name "x".
|
Timeline(Domain d,
java.lang.String n)
This general constructor creates a new timeline corresponding to a specified
domain and a specified name for the underlying variable.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addTime()
This method adds a new time point of the default color red that is
uniformly distributed on the domain.
|
void |
addTime(java.awt.Color c)
This method adds a new time point of a specified color that is uniformly
distributed on the domain.
|
void |
addTime(double t)
This method adds a new time with the default color red.
|
void |
addTime(double t,
java.awt.Color c)
This method adds a new time with a specified color.
|
java.awt.Color |
getAxisColor()
This method returns the axis color.
|
java.awt.Color |
getColor(int i)
This method returns the color at a specified index.
|
java.util.Vector |
getColors()
This method returns the entire vector of colors
|
double |
getCummilativeTimesAtIndex(int ind)
This method returns the Cummulative times UP-TO a specified index.
|
double |
getCurrentTime()
This method gets the current time.
|
java.awt.Color |
getCurrentTimeColor()
This method returns the color used to denote the current time.
|
int |
getDataSize()
This method returns the number of data points.
|
Domain |
getDomain()
This method returns the domain.
|
java.lang.String |
getName()
This method retunrs the name.
|
double |
getTime(int i)
This method returns the time at a specified index.
|
java.util.Vector |
getTimes()
This method returns the entire vector of times.
|
void |
mouseDragged(java.awt.event.MouseEvent event) |
void |
mouseMoved(java.awt.event.MouseEvent e)
This method handles the mouse move event.
|
void |
paintComponent(java.awt.Graphics g)
This method paints the timeline as an axis, with the data points as
dots in a specified color.
|
void |
reset()
This method resets the data, by clearing the vector of times and colors,
and then repaints the timeline.
|
void |
resetData()
This method resets the data by clearing the vector of times and color.
|
void |
setAxisColor(java.awt.Color c)
This method specifies the axis color.
|
void |
setCurrentTime(double t)
This method sets the current time.
|
void |
setCurrentTimeColor(java.awt.Color c)
This method sets the color used for the current time tick mark.
|
void |
setDomain(Domain d)
This method sets the domain.
|
void |
setName(java.lang.String n)
This method sets the name.
|
drawAxis, drawAxis, drawAxis, drawBox, drawBox, drawBoxPlot, drawBoxPlot, drawCircle, drawLabel, drawLine, drawPoint, drawTick, drawTick, fillBox, fillBox, fillBoxPlot, fillBoxPlot, fillCircle, format, getBottomMargin, getLeftMargin, getPointSize, getRightMargin, getTopMargin, getXGraph, getXMax, getXMin, getXPixels, getXScale, getYGraph, getYMax, getYMin, getYPixels, getYScale, setMargins, setPointSize, setScale, setShowModelDistributiongetAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, 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, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, 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, updateadd, 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, transferFocusDownCycle, validate, validateTreeaction, 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, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic Timeline(Domain d, java.lang.String n)
d - the domainn - the namepublic Timeline(Domain d)
public Timeline()
public void setDomain(Domain d)
d - the domain of the variablepublic Domain getDomain()
public void setName(java.lang.String n)
setName in class java.awt.Componentn - the name of the variablepublic java.lang.String getName()
getName in class java.awt.Componentpublic void paintComponent(java.awt.Graphics g)
paintComponent in class javax.swing.JComponentg - the graphics contextpublic void setAxisColor(java.awt.Color c)
c - the axis colorpublic java.awt.Color getAxisColor()
public void addTime(double t,
java.awt.Color c)
t - the value (time) of the data pointc - the color to be used to represent the pointpublic void addTime(double t)
t - the value (time) of the data pointpublic void addTime(java.awt.Color c)
c - the color of the pointpublic void addTime()
public double getTime(int i)
i - the indexpublic double getCummilativeTimesAtIndex(int ind)
i - the indexpublic java.util.Vector getTimes()
public int getDataSize()
public java.awt.Color getColor(int i)
i - the indexpublic java.util.Vector getColors()
public void resetData()
public void reset()
public void setCurrentTime(double t)
t - the current timepublic double getCurrentTime()
public void setCurrentTimeColor(java.awt.Color c)
c - the color for the current timepublic java.awt.Color getCurrentTimeColor()
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenere - the mouse eventpublic void mouseDragged(java.awt.event.MouseEvent event)
mouseDragged in interface java.awt.event.MouseMotionListener