|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Canvas multigraph.DoubleBufferedCanvas multigraph.Plotter multigraph.StretchPlotter multigraph.TimeSeriesPlotter
A Plotter
that provides for drawing graphs of time series
data. TimeSeriesPlotter
takes care of things common
to any interactive graph of time series data in which time is on
the horizontal axis. In particular, it provides the following
additional functionality over and above Plotter
:
PlotFrame
(StretchPlotter.horizAxisFrame
),
in which the line y=0 corresponds to horizontal line displaced
from the bottom of Plotter.marginFrame
by a given
vertical distance (StretchPlotter.bottomOffset
); this line serves
as the horizontal axis of the plot
Date
attributes d0
and d1
defining points in time corresponing to the left and right
edges of the (visible region of the) plot
PlotFrame
(StretchPlotter.currentHorizFrame
), in which the vertical
coordinate is the same as for StretchPlotter.horizAxisFrame
and whose
horizontal coordinate represents time, with d0
on the
left and d1
on the right. d0
and d1
are set in from the edges of the plot by given amounts (StretchPlotter.leftOffset
and StretchPlotter.rightOffset
). The time coordinates
are in milliseconds, as returned by
java.util.Date.getTime()
.
paint(java.awt.Graphics)
method that draws the horizontal axis
and labels it with tick marks and time labels
Nested Class Summary |
Nested classes inherited from class multigraph.StretchPlotter |
StretchPlotter.DragAxis, StretchPlotter.DragType |
Nested classes inherited from class java.awt.Canvas |
java.awt.Canvas.AccessibleAWTCanvas |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
protected java.util.Calendar |
cal
|
protected java.util.Date |
d0
|
protected java.util.Date |
d1
|
protected javax.swing.Timer |
keyTimer
|
protected int |
keyTimerDefaultDelayMillis
|
protected long |
keyTimerT0
|
protected static int |
minLabelPixelDistance
|
static long |
oneDayInMillis
|
static long |
oneHourInMillis
|
static long |
oneMonthInMillis
|
static long |
oneYearInMillis
|
Fields inherited from class multigraph.StretchPlotter |
bottomOffset, buttonOffset, buttons, currentHorizFrame, dragAxis, dragType, graphStatusRectangle, horizAxisFrame, labelLine1Height, labelLine2Height, labelLine3Height, leftOffset, paintTimeInMillis, rightOffset, statusMessage, statusTimer, tickHeight, topOffset |
Fields inherited from class multigraph.Plotter |
bottomMargin, devicePixelFrame, lastMouseX, lastMouseY, leftMargin, marginFrame, mouseBaseX, mouseBaseY, pixelFrame, rightMargin, topMargin |
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 | |
TimeSeriesPlotter(int pixelWidth,
int pixelHeight,
ImageGetter imageGetter,
java.lang.String first,
java.lang.String last,
java.util.TimeZone timeZone,
boolean isConfigEnabled)
|
Method Summary | |
protected void |
computeHorizFrame()
|
boolean |
dataLoadNeeded(java.util.Date d0,
java.util.Date d1)
|
static java.util.Date |
downRound(java.util.Date d,
long dt)
|
void |
drawHorizAxisLabel(java.awt.Graphics g,
java.util.Date x,
java.lang.String label)
|
void |
drawHorizAxisTick(java.awt.Graphics g,
java.util.Date x)
|
PlotFrame |
getTimeFrame()
|
protected void |
horizZoom(double dTime,
int baseX)
|
void |
keyTyped(int modifiers,
char key)
Process a keyTyped event; the Plotter's
handler calls this whenever a keyTyped event occurs. |
protected void |
leftStep()
|
boolean |
loadData(java.util.Date d0,
java.util.Date d1)
|
void |
mouseDragged(int modifiers,
int x,
int y)
Process a mouseDragged event; the Plotter's
handler calls this whenever a mouseDragged event occurs. |
void |
mouseReleased(int modifiers,
int x,
int y)
Process a mouseReleased event; the Plotter's
handler calls this whenever a mouseReleased event occurs. |
void |
paint(java.awt.Graphics g)
Erase the background to white (unless renderClear
has been called since the last call to paint ),
and draw a light grey rectangle
around the Plotter.marginFrame . |
protected void |
rightStep()
|
void |
setFirst(java.util.Date d0)
|
void |
setLast(java.util.Date d1)
|
void |
setTimeFrame(int calendarTimePeriod)
|
void |
setTimes(java.util.Date d0,
java.util.Date d1)
|
void |
setTimeZone(java.util.TimeZone timeZone)
|
static java.util.Date |
upRound(java.util.Date d,
long dt)
|
Methods inherited from class multigraph.StretchPlotter |
buttonsMouseMoved, buttonsMousePressed, buttonsMouseReleased, computeFrames, getButtons, getCurrentHorizFrame, getHorizAxisFrame, getPixelFrame, mouseMoved, mousePressed, setCurrentHorizFrame, setLabelFont, setPixelOffsets, setStatusMessage, setStatusMessage, vertDrag |
Methods inherited from class multigraph.Plotter |
drawLine, drawRect, drawRect, drawRect, drawString, fillArc, fillCircle, fillPolygon, fillQuad, fillRect, fillRect, fillRect, fillRectDefinite, fillRectLLDefinite, keyReleased, renderClear, setMargins |
Methods inherited from class multigraph.DoubleBufferedCanvas |
getMaximumSize, getMinimumSize, getPreferredSize, update |
Methods inherited from class java.awt.Canvas |
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.util.Date d0
protected java.util.Date d1
protected java.util.Calendar cal
public static final long oneHourInMillis
public static final long oneDayInMillis
public static final long oneMonthInMillis
public static final long oneYearInMillis
protected static int minLabelPixelDistance
protected javax.swing.Timer keyTimer
protected int keyTimerDefaultDelayMillis
protected long keyTimerT0
Constructor Detail |
public TimeSeriesPlotter(int pixelWidth, int pixelHeight, ImageGetter imageGetter, java.lang.String first, java.lang.String last, java.util.TimeZone timeZone, boolean isConfigEnabled)
Method Detail |
public PlotFrame getTimeFrame()
public static java.util.Date downRound(java.util.Date d, long dt)
public static java.util.Date upRound(java.util.Date d, long dt)
public void drawHorizAxisTick(java.awt.Graphics g, java.util.Date x)
public void drawHorizAxisLabel(java.awt.Graphics g, java.util.Date x, java.lang.String label)
public boolean loadData(java.util.Date d0, java.util.Date d1)
public boolean dataLoadNeeded(java.util.Date d0, java.util.Date d1)
public void setTimeZone(java.util.TimeZone timeZone)
public void setFirst(java.util.Date d0)
public void setLast(java.util.Date d1)
public void setTimes(java.util.Date d0, java.util.Date d1)
protected void computeHorizFrame()
computeHorizFrame
in class StretchPlotter
protected void horizZoom(double dTime, int baseX)
horizZoom
in class StretchPlotter
public void setTimeFrame(int calendarTimePeriod)
protected void leftStep()
leftStep
in class StretchPlotter
protected void rightStep()
rightStep
in class StretchPlotter
public void paint(java.awt.Graphics g)
Plotter
renderClear
has been called since the last call to paint
),
and draw a light grey rectangle
around the Plotter.marginFrame
. Subclasses can override this
method to provide their own rendering.
paint
in class StretchPlotter
public void mouseDragged(int modifiers, int x, int y)
Plotter
Plotter's
handler calls this whenever a mouseDragged event occurs.
mouseDragged
in class Plotter
modifiers
- The event modifier mask returned
by java.awt.event.InputEvent.getModifiers()x
- The x coordinate (in Plotter.devicePixelFrame
space)
of the event.y
- The y coordinate (in Plotter.devicePixelFrame
space)
of the event.public void mouseReleased(int modifiers, int x, int y)
Plotter
Plotter's
handler calls this whenever a mouseReleased event occurs.
mouseReleased
in class Plotter
modifiers
- The event modifier mask returned
by java.awt.event.InputEvent.getModifiers()x
- The x coordinate (in Plotter.devicePixelFrame
space)
of the event.y
- The y coordinate (in Plotter.devicePixelFrame
space)
of the event.public void keyTyped(int modifiers, char key)
Plotter
Plotter's
handler calls this whenever a keyTyped event occurs.
keyTyped
in class Plotter
modifiers
- The event modifier mask returned
by java.awt.event.InputEvent.getModifiers()key
- The key that was typed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |