vipratech.beans.standardbeans
Class XYGraph

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--vipratech.beans.standardbeans.XYGraph

public class XYGraph
extends java.awt.Canvas
implements InterfaceProperties, java.lang.Cloneable

The XYGraph class allows Y values to be plotted against X. The Y values can be scaled against the left axis (Y1) or the right axis (Y2) allowing for multiple plots with different scaling. There are numerous other variables that can be configured at design time for scaling and display of the plot. The XYGraph instantiates vipratech.beans.standardbeans.Trace objects to draw the plot lines on the graph.

The YXGraph receives data using property change events. There is a channel1(PropertyChangeEvent event) method and a channel2(PropertyChange event) method for writing either a single point or a Vector of up to 5 points against a Y axis scale. Poinrs are described vipratech.beans.standardbeans.resources.PointFloat.java.

Version:
1.07, 24 June 2002
Author:
Warwick Bailey   warwick-bailey@bigfoot.com
See Also:
SimpleDataSource, Trace, PointFloat, Serialized Form

Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
XYGraph()
          Constructor.
 
Method Summary
 void channel1(java.beans.PropertyChangeEvent event)
          Method to receive property change events to the y1 axis.
 void channel2(java.beans.PropertyChangeEvent event)
          Method to receive property change events to the y2 axis.
 java.lang.Object clone()
          Method to clone the Object for Printing
 void destroy()
          Disposes of offscreen graphics.
 void finalize()
           
 java.lang.String getAxisLabelX()
          Returns x-axis label.
 java.lang.String getAxisLabelY1()
          Returns left hand y-axis label.
 java.lang.String getAxisLabelY2()
          Returns right hand y-axis label.
 int getAxisWidthY1()
          Returns the size of the space on the left hand side of the graph.
 int getAxisWidthY2()
          Returns the size of the space on the right hand side of the graph.
 java.lang.String getComment1()
          Returns the first comment line.
 java.lang.String getComment2()
          Returns the second comment line.
 int getDecimalPlacesX()
          Returns number of decimal places for x-axis values.
 int getDecimalPlacesY1()
          Returns number of decimal places for left hand y-axis values.
 int getDecimalPlacesY2()
          Returns number of decimal places for right hand y-axis values.
 boolean getGridVisible()
          Returns the visibility of the grid.
 java.awt.Color getLabelColorY1()
          Returns the left hand y1-axis label color.
 java.awt.Color getLabelColorY2()
          Returns the right hand y2-axis label color.
 java.util.Locale getLocale()
          Returns the locale for this component.
 float getMaxX()
          Returns maximum value on the horizontal axis.
 float getMaxY1()
          Returns maximum value on the left hand vertical axis.
 float getMaxY2()
          Returns maximum value on the right hand vertical axis.
 java.awt.Dimension getMinimumSize()
          Minimum paper size is 200 x 150 pixels.
 float getMinX()
          Returns minimum value on the horizontal axis.
 float getMinY1()
          Returns minimum value on the left hand vertical axis.
 float getMinY2()
          Returns minimum value on the right hand vertical axis.
 boolean getOffscreenGraphics()
          Returns true if the offscreen graphics are loaded.
 boolean getRightToLeft()
          Returns the right to left toggle.
 int getTicksX()
          Returns number of tick marks and grid lines along the horizontal axis.
 int getTicksY()
          Returns number of tick marks and grid lines along the vertical axis.
 java.lang.String getTitle()
          Returns the graph title.
 boolean getY1AxisVisible()
          Returns the visibility of the left hand y axis.
 boolean getY2AxisVisible()
          Returns the visibility of the right hand y axis.
 void paint(java.awt.Graphics g)
          Draws the image to the screen.
 void propertyChange(java.beans.PropertyChangeEvent event)
          Method to receive property change events for changing language labels.
 void reset()
          Resets to a blank graph paper.
 void setAxisLabelX(java.lang.String axisLabelX)
          Sets x-axis label.
 void setAxisLabelY1(java.lang.String axisLabelY1)
          Sets left hand y-axis label.
 void setAxisLabelY2(java.lang.String axisLabelY2)
          Sets right hand y-axis label.
 void setAxisWidthY1(int axisWidthY1)
          Sets the size of the space on the left hand side of the graph.
 void setAxisWidthY2(int axisWidthY2)
          Sets the size of the space on the right hand side of the graph.
 void setComment1(java.lang.String comment1)
          Sets the first comment line.
 void setComment2(java.lang.String comment2)
          Sets the second comment line.
 void setDecimalPlacesX(int decimalPlacesX)
          Sets number of decimal places for x-axis values.
 void setDecimalPlacesY1(int decimalPlacesY1)
          Sets number of decimal places for left hand y-axis values.
 void setDecimalPlacesY2(int decimalPlacesY2)
          Sets number of decimal places for right hand y-axis values.
 void setGridVisible(boolean gridVisible)
          Sets the grid to be visible.
 void setLabelColorY1(java.awt.Color labelColorY1)
          Sets the left hand y1-axis label color.
 void setLabelColorY2(java.awt.Color labelColorY2)
          Sets the right hand y2-axis label color.
 void setLocale(java.util.Locale locale)
          Sets the locale for this component.
 void setMaxX(float maxX)
          Sets maximum value on the horizontal axis.
 void setMaxY1(float maxY1)
          Sets maximum value on the left hand vertical axis.
 void setMaxY2(float maxY2)
          Sets maximum value on the right hand vertical axis.
 void setMinX(float minX)
          Sets minimum value on the horizontal axis.
 void setMinY1(float minY1)
          Sets minimum value on the left hand vertical axis.
 void setMinY2(float minY2)
          Sets minimum value on the right hand vertical axis.
 void setRightToLeft(boolean rightToLeft)
          Toggles the graph to display data right to left.
 void setTicksX(int ticksX)
          Sets number of tick marks and grid lines along the horizontal axis.
 void setTicksY(int ticksY)
          Sets number of tick marks and grid lines along the vertical axis.
 void setTitle(java.lang.String title)
          Sets the graph title.
 void setY1AxisVisible(boolean y1AxisVisible)
          Sets the left hand y axis visible.
 void setY2AxisVisible(boolean y2AxisVisible)
          Sets the right hand y axis visible.
 void update(java.awt.Graphics g)
          Overides update method to minimise screen flicker.
 
Methods inherited from class java.awt.Canvas
addNotify
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, 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, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XYGraph

public XYGraph()
Constructor.
Method Detail

finalize

public final void finalize()

paint

public final void paint(java.awt.Graphics g)
Draws the image to the screen.
Overrides:
paint in class java.awt.Canvas

update

public final void update(java.awt.Graphics g)
Overides update method to minimise screen flicker.
Overrides:
update in class java.awt.Component

reset

public final void reset()
Resets to a blank graph paper.

channel1

public final void channel1(java.beans.PropertyChangeEvent event)
Method to receive property change events to the y1 axis. The object sent by the property change event may be a point of a vector of up to 5 data points.

channel2

public final void channel2(java.beans.PropertyChangeEvent event)
Method to receive property change events to the y2 axis. The object sent by the property change event may be a point of a vector of up to 5 data points.

propertyChange

public final void propertyChange(java.beans.PropertyChangeEvent event)
Method to receive property change events for changing language labels.

destroy

public final void destroy()
Disposes of offscreen graphics.

getMinimumSize

public final java.awt.Dimension getMinimumSize()
Minimum paper size is 200 x 150 pixels.
Overrides:
getMinimumSize in class java.awt.Component

setGridVisible

public final void setGridVisible(boolean gridVisible)
Sets the grid to be visible.

getGridVisible

public final boolean getGridVisible()
Returns the visibility of the grid.

setMaxX

public final void setMaxX(float maxX)
Sets maximum value on the horizontal axis.

getMaxX

public final float getMaxX()
Returns maximum value on the horizontal axis.

setMinX

public final void setMinX(float minX)
Sets minimum value on the horizontal axis.

getMinX

public final float getMinX()
Returns minimum value on the horizontal axis.

setMaxY1

public final void setMaxY1(float maxY1)
Sets maximum value on the left hand vertical axis.

getMaxY1

public final float getMaxY1()
Returns maximum value on the left hand vertical axis.

setMinY1

public final void setMinY1(float minY1)
Sets minimum value on the left hand vertical axis.

getMinY1

public final float getMinY1()
Returns minimum value on the left hand vertical axis.

setMaxY2

public final void setMaxY2(float maxY2)
Sets maximum value on the right hand vertical axis.

getMaxY2

public final float getMaxY2()
Returns maximum value on the right hand vertical axis.

setMinY2

public final void setMinY2(float minY2)
Sets minimum value on the right hand vertical axis.

getMinY2

public final float getMinY2()
Returns minimum value on the right hand vertical axis.

setTicksX

public final void setTicksX(int ticksX)
Sets number of tick marks and grid lines along the horizontal axis.

getTicksX

public final int getTicksX()
Returns number of tick marks and grid lines along the horizontal axis.

setTicksY

public final void setTicksY(int ticksY)
Sets number of tick marks and grid lines along the vertical axis.

getTicksY

public final int getTicksY()
Returns number of tick marks and grid lines along the vertical axis.

setDecimalPlacesX

public final void setDecimalPlacesX(int decimalPlacesX)
Sets number of decimal places for x-axis values.

getDecimalPlacesX

public final int getDecimalPlacesX()
Returns number of decimal places for x-axis values.

setDecimalPlacesY1

public final void setDecimalPlacesY1(int decimalPlacesY1)
Sets number of decimal places for left hand y-axis values.

getDecimalPlacesY1

public final int getDecimalPlacesY1()
Returns number of decimal places for left hand y-axis values.

setDecimalPlacesY2

public final void setDecimalPlacesY2(int decimalPlacesY2)
Sets number of decimal places for right hand y-axis values.

getDecimalPlacesY2

public final int getDecimalPlacesY2()
Returns number of decimal places for right hand y-axis values.

setAxisLabelX

public final void setAxisLabelX(java.lang.String axisLabelX)
Sets x-axis label.

getAxisLabelX

public final java.lang.String getAxisLabelX()
Returns x-axis label.

setAxisLabelY1

public final void setAxisLabelY1(java.lang.String axisLabelY1)
Sets left hand y-axis label.

getAxisLabelY1

public final java.lang.String getAxisLabelY1()
Returns left hand y-axis label.

setAxisLabelY2

public final void setAxisLabelY2(java.lang.String axisLabelY2)
Sets right hand y-axis label.

getAxisLabelY2

public final java.lang.String getAxisLabelY2()
Returns right hand y-axis label.

setTitle

public final void setTitle(java.lang.String title)
Sets the graph title.

getTitle

public final java.lang.String getTitle()
Returns the graph title.

setY1AxisVisible

public final void setY1AxisVisible(boolean y1AxisVisible)
Sets the left hand y axis visible.

getY1AxisVisible

public final boolean getY1AxisVisible()
Returns the visibility of the left hand y axis.

setY2AxisVisible

public final void setY2AxisVisible(boolean y2AxisVisible)
Sets the right hand y axis visible.

getY2AxisVisible

public final boolean getY2AxisVisible()
Returns the visibility of the right hand y axis.

setAxisWidthY1

public final void setAxisWidthY1(int axisWidthY1)
Sets the size of the space on the left hand side of the graph.

getAxisWidthY1

public final int getAxisWidthY1()
Returns the size of the space on the left hand side of the graph.

setAxisWidthY2

public final void setAxisWidthY2(int axisWidthY2)
Sets the size of the space on the right hand side of the graph.

getAxisWidthY2

public final int getAxisWidthY2()
Returns the size of the space on the right hand side of the graph.

setComment1

public final void setComment1(java.lang.String comment1)
Sets the first comment line.

getComment1

public final java.lang.String getComment1()
Returns the first comment line.

setComment2

public final void setComment2(java.lang.String comment2)
Sets the second comment line.

getComment2

public final java.lang.String getComment2()
Returns the second comment line.

setLocale

public final void setLocale(java.util.Locale locale)
Sets the locale for this component.
Overrides:
setLocale in class java.awt.Component

getLocale

public final java.util.Locale getLocale()
Returns the locale for this component.
Overrides:
getLocale in class java.awt.Component

setLabelColorY1

public final void setLabelColorY1(java.awt.Color labelColorY1)
Sets the left hand y1-axis label color.

getLabelColorY1

public final java.awt.Color getLabelColorY1()
Returns the left hand y1-axis label color.

setLabelColorY2

public final void setLabelColorY2(java.awt.Color labelColorY2)
Sets the right hand y2-axis label color.

getLabelColorY2

public final java.awt.Color getLabelColorY2()
Returns the right hand y2-axis label color.

getOffscreenGraphics

public final boolean getOffscreenGraphics()
Returns true if the offscreen graphics are loaded.

setRightToLeft

public final void setRightToLeft(boolean rightToLeft)
Toggles the graph to display data right to left.

getRightToLeft

public final boolean getRightToLeft()
Returns the right to left toggle.

clone

public java.lang.Object clone()
Method to clone the Object for Printing

dathe@chemie.uni-leipzig.de"

http://leipzig.vernetztes-studium.de