multigraph
Class StretchPlotter

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Canvas
          extended bymultigraph.DoubleBufferedCanvas
              extended bymultigraph.Plotter
                  extended bymultigraph.StretchPlotter
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
Direct Known Subclasses:
GraphPlotter, TimeSeriesPlotter

public abstract class StretchPlotter
extends Plotter

Author:
gunn TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates
See Also:
Serialized Form

Nested Class Summary
static class StretchPlotter.DragAxis
           
static class 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  int bottomOffset
           
protected  int buttonOffset
           
protected  java.util.Vector buttons
           
protected  PlotFrame currentHorizFrame
           
protected  StretchPlotter.DragAxis dragAxis
           
protected  StretchPlotter.DragType dragType
           
protected  java.awt.Rectangle graphStatusRectangle
           
protected  PlotFrame horizAxisFrame
           
protected  int labelLine1Height
           
protected  int labelLine2Height
           
protected  int labelLine3Height
           
protected  int leftOffset
           
protected  long paintTimeInMillis
           
protected  int rightOffset
           
protected  java.lang.String statusMessage
           
protected  javax.swing.Timer statusTimer
           
protected  int tickHeight
           
protected  int 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
StretchPlotter(int pixelWidth, int pixelHeight, ImageGetter ig)
           
 
Method Summary
 void buttonsMouseMoved(int x, int y, java.awt.Graphics g)
           
 boolean buttonsMousePressed(int x, int y, java.awt.Graphics g)
           
 boolean buttonsMouseReleased(int x, int y, java.awt.Graphics g)
           
protected  void computeFrames()
           
protected abstract  void computeHorizFrame()
           
 java.util.Vector getButtons()
           
 PlotFrame getCurrentHorizFrame()
           
 PlotFrame getHorizAxisFrame()
           
 PlotFrame getPixelFrame()
          Returns the Plotter.pixelFrame for this Plotter object.
protected abstract  void horizZoom(double time, int lastMouseX)
           
protected abstract  void leftStep()
           
 void mouseMoved(int modifiers, int x, int y)
          Process a mouseMoved event; the Plotter's handler calls this whenever a mouseMoved event occurs.
 void mousePressed(int modifiers, int x, int y)
          Process a mousePressed event; the Plotter's handler calls this whenever a mousePressed 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 abstract  void rightStep()
           
 void setCurrentHorizFrame(PlotFrame currentHorizFrame)
           
protected  void setLabelFont(java.awt.Graphics g)
           
 void setPixelOffsets(int bottomOffset, int leftOffset, int rightOffset)
          Set the pixel offsets for this TimeSeriesPlotter; if any of the passed-in values are negative then the corresponding offset is left unchanged.
 void setStatusMessage(java.lang.String message)
           
 void setStatusMessage(java.lang.String message, int duration)
           
protected  void vertDrag(StretchPlotter.DragType type, StretchPlotter.DragAxis axis, int x, int y, int dx, int dy)
           
 
Methods inherited from class multigraph.Plotter
drawLine, drawRect, drawRect, drawRect, drawString, fillArc, fillCircle, fillPolygon, fillQuad, fillRect, fillRect, fillRect, fillRectDefinite, fillRectLLDefinite, keyReleased, keyTyped, mouseDragged, mouseReleased, 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

labelLine1Height

protected int labelLine1Height

labelLine2Height

protected int labelLine2Height

labelLine3Height

protected int labelLine3Height

horizAxisFrame

protected PlotFrame horizAxisFrame

bottomOffset

protected int bottomOffset

topOffset

protected int topOffset

leftOffset

protected int leftOffset

rightOffset

protected int rightOffset

buttonOffset

protected int buttonOffset

tickHeight

protected int tickHeight

buttons

protected java.util.Vector buttons

statusMessage

protected java.lang.String statusMessage

statusTimer

protected javax.swing.Timer statusTimer

graphStatusRectangle

protected java.awt.Rectangle graphStatusRectangle

paintTimeInMillis

protected long paintTimeInMillis

dragType

protected StretchPlotter.DragType dragType

dragAxis

protected StretchPlotter.DragAxis dragAxis

currentHorizFrame

protected PlotFrame currentHorizFrame
Constructor Detail

StretchPlotter

public StretchPlotter(int pixelWidth,
                      int pixelHeight,
                      ImageGetter ig)
Parameters:
pixelWidth -
pixelHeight -
Method Detail

getHorizAxisFrame

public PlotFrame getHorizAxisFrame()

getPixelFrame

public PlotFrame getPixelFrame()
Description copied from class: Plotter
Returns the Plotter.pixelFrame for this Plotter object.

Overrides:
getPixelFrame in class Plotter

computeFrames

protected void computeFrames()

computeHorizFrame

protected abstract void computeHorizFrame()

horizZoom

protected abstract void horizZoom(double time,
                                  int lastMouseX)

leftStep

protected abstract void leftStep()

rightStep

protected abstract void rightStep()

setPixelOffsets

public void setPixelOffsets(int bottomOffset,
                            int leftOffset,
                            int rightOffset)
Set the pixel offsets for this TimeSeriesPlotter; if any of the passed-in values are negative then the corresponding offset is left unchanged.


paint

public void paint(java.awt.Graphics g)
Description copied from class: Plotter
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. Subclasses can override this method to provide their own rendering.

Overrides:
paint in class Plotter

setStatusMessage

public void setStatusMessage(java.lang.String message)

setStatusMessage

public void setStatusMessage(java.lang.String message,
                             int duration)

setLabelFont

protected void setLabelFont(java.awt.Graphics g)

buttonsMouseMoved

public void buttonsMouseMoved(int x,
                              int y,
                              java.awt.Graphics g)

mouseMoved

public void mouseMoved(int modifiers,
                       int x,
                       int y)
Description copied from class: Plotter
Process a mouseMoved event; the Plotter's handler calls this whenever a mouseMoved event occurs.

Overrides:
mouseMoved in class Plotter
Parameters:
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.

buttonsMousePressed

public boolean buttonsMousePressed(int x,
                                   int y,
                                   java.awt.Graphics g)

mousePressed

public void mousePressed(int modifiers,
                         int x,
                         int y)
Description copied from class: Plotter
Process a mousePressed event; the Plotter's handler calls this whenever a mousePressed event occurs.

Overrides:
mousePressed in class Plotter
Parameters:
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.

vertDrag

protected void vertDrag(StretchPlotter.DragType type,
                        StretchPlotter.DragAxis axis,
                        int x,
                        int y,
                        int dx,
                        int dy)

buttonsMouseReleased

public boolean buttonsMouseReleased(int x,
                                    int y,
                                    java.awt.Graphics g)

getCurrentHorizFrame

public PlotFrame getCurrentHorizFrame()
Returns:
Returns the currentHorizFrame.

setCurrentHorizFrame

public void setCurrentHorizFrame(PlotFrame currentHorizFrame)
Parameters:
currentHorizFrame - The currentHorizFrame to set.

getButtons

public java.util.Vector getButtons()
Returns:
Returns the buttons.