org.strbio.util.graph
Class PointPlot

java.lang.Object
  extended by org.strbio.util.graph.PointPlot
All Implemented Interfaces:
Graphable2D
Direct Known Subclasses:
PointColorPlot

public class PointPlot
extends java.lang.Object
implements Graphable2D

A component that displays a point plot (a 2D graph of a bunch of points).

  Version 1.1, 5/11/99 - added legend.
  Version 1.0, 4/16/99 - original version.
  

Version:
1.0, 5/11/99
Author:
JMC

Field Summary
protected  Legend legend
          legend, if there
protected  DVectorSet points
          This is a vector of points to plot.
protected  PointType ptype
          type of point to draw.
 
Constructor Summary
PointPlot(DVectorSet x)
          initialize with a set of points.
 
Method Summary
 void createLegend()
          creates a new legend
 Legend getLegend()
          get legend
 DVectorSet getPoints()
          Returns a pointer to the points being drawn.
 double maxX()
          maximum x value that will be graphed.
 double maxY()
          maximum y value that will be graphed.
 double minX()
          minimum x value that will be graphed.
 double minY()
          minimum y value that will be graphed.
 void paintGraph(java.awt.Graphics g, java.awt.Rectangle r, Graph2D gr)
          draw the graph, in a given rectangle.
protected  void paintVectorAt(int x, int y, DVector v, java.awt.Graphics g)
          Draw one of the points somewhere.
 void setLegend(PointLegend x)
          sets legend.
 void setPoints(DVectorSet x)
          Sets the points being drawn.
 void setPointType(PointType pt)
          Set point type to draw.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

legend

protected Legend legend
legend, if there


points

protected DVectorSet points
This is a vector of points to plot. Each point is a DVector, and must contain at least 2 coordinates.


ptype

protected PointType ptype
type of point to draw.

Constructor Detail

PointPlot

public PointPlot(DVectorSet x)
initialize with a set of points.

Method Detail

getPoints

public DVectorSet getPoints()
Returns a pointer to the points being drawn.


setPoints

public void setPoints(DVectorSet x)
Sets the points being drawn. Does not copy data.


minX

public double minX()
Description copied from interface: Graphable2D
minimum x value that will be graphed.

Specified by:
minX in interface Graphable2D

minY

public double minY()
Description copied from interface: Graphable2D
minimum y value that will be graphed.

Specified by:
minY in interface Graphable2D

maxX

public double maxX()
Description copied from interface: Graphable2D
maximum x value that will be graphed.

Specified by:
maxX in interface Graphable2D

maxY

public double maxY()
Description copied from interface: Graphable2D
maximum y value that will be graphed.

Specified by:
maxY in interface Graphable2D

setPointType

public void setPointType(PointType pt)
Set point type to draw.


paintVectorAt

protected void paintVectorAt(int x,
                             int y,
                             DVector v,
                             java.awt.Graphics g)
Draw one of the points somewhere. Note that this doesn't need the DVector, but derived classes might.


getLegend

public Legend getLegend()
get legend

Specified by:
getLegend in interface Graphable2D

setLegend

public void setLegend(PointLegend x)
sets legend.


createLegend

public void createLegend()
creates a new legend


paintGraph

public void paintGraph(java.awt.Graphics g,
                       java.awt.Rectangle r,
                       Graph2D gr)
Description copied from interface: Graphable2D
draw the graph, in a given rectangle. Should not clear the background, since more than 1 could be drawn.

Specified by:
paintGraph in interface Graphable2D