|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel edu.uah.math.devices.Graph edu.uah.math.devices.Timeline
public class Timeline
This class defines a simple timeline for displaying random points in time. The timeline is shown as an axis, with the points in time as dots in specified colors. This object is useful for the Poisson and negative binomial experiments.
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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class edu.uah.math.devices.Graph |
---|
ABOVE, BELOW, HORIZONTAL, LEFT, RIGHT, showModelDistribution, VERTICAL |
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 | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class edu.uah.math.devices.Graph |
---|
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, setShowModelDistribution |
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, 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, 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, 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, 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 |
---|
public Timeline(Domain d, java.lang.String n)
d
- the domainn
- the namepublic Timeline(Domain d)
public Timeline()
Method Detail |
---|
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.Component
n
- the name of the variablepublic java.lang.String getName()
getName
in class java.awt.Component
public void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
g
- 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 index
public double getCummilativeTimesAtIndex(int ind)
i
- the index
public java.util.Vector getTimes()
public int getDataSize()
public java.awt.Color getColor(int i)
i
- the index
public 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.MouseMotionListener
e
- the mouse eventpublic void mouseDragged(java.awt.event.MouseEvent event)
mouseDragged
in interface java.awt.event.MouseMotionListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |