gov.noaa.pmel.sgt
Class LineCartesianRenderer

java.lang.Object
  extended by gov.noaa.pmel.sgt.CartesianRenderer
      extended by gov.noaa.pmel.sgt.LineCartesianRenderer
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.util.EventListener

public class LineCartesianRenderer
extends CartesianRenderer

Produces a line plot with optional coloring from a second data set. If a second data set is specified it must have the same shape as the first.

Since:
1.0
Version:
$Revision$, $Date$
Author:
Donald Denbo

Field Summary
 
Fields inherited from class gov.noaa.pmel.sgt.CartesianRenderer
cg_
 
Constructor Summary
LineCartesianRenderer(CartesianGraph cg)
          Default constructor.
LineCartesianRenderer(CartesianGraph cg, Collection col, LineAttribute attr)
          Construct a LineCartesianRenderer.
LineCartesianRenderer(CartesianGraph cg, SGTLine line)
          Construct a LineCartesianRenderer.
LineCartesianRenderer(CartesianGraph cg, SGTLine line, LineAttribute attr)
          Construct a LineCartesianRenderer.
 
Method Summary
 void draw(java.awt.Graphics g)
          Render the SGTData.
protected  void drawMark(java.awt.Graphics g, int[] xp, int[] yp, int npoints, LineAttribute attr)
          Draw a mark at the requested location.
 Attribute getAttribute()
          Get the Attribute associated with the data.
 CartesianGraph getCartesianGraph()
          Get the associated CartesianGraph object.
 Collection getCollection()
          Get the Collection of SGTLine objects.
 SGTData getDataAt(java.awt.Point pt)
          Find data object.
 SGTLine getLine()
          Get the SGTLine object.
 LineAttribute getLineAttribute()
          Get the LineAttribute.
 boolean hasCollection()
          Test if a Collection of SGTLine was using to construct this renderer.
 void propertyChange(java.beans.PropertyChangeEvent evt)
           
 void setLineAttribute(LineAttribute l)
          Set the LineAttribute.
 
Methods inherited from class gov.noaa.pmel.sgt.CartesianRenderer
getDataAt, getPane, getRenderer, modified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineCartesianRenderer

public LineCartesianRenderer(CartesianGraph cg)
Default constructor.

See Also:
CartesianGraph, Graph

LineCartesianRenderer

public LineCartesianRenderer(CartesianGraph cg,
                             SGTLine line)
Construct a LineCartesianRenderer. The default LineAttribute will be used.

Parameters:
cg - the parent CartesianGraph
data - an SGTLine object
See Also:
CartesianGraph, Graph

LineCartesianRenderer

public LineCartesianRenderer(CartesianGraph cg,
                             SGTLine line,
                             LineAttribute attr)
Construct a LineCartesianRenderer.

Parameters:
cg - the parent CartesianGraph
data - an SGTLine
line - the LineAttribute
See Also:
CartesianGraph, Graph

LineCartesianRenderer

public LineCartesianRenderer(CartesianGraph cg,
                             Collection col,
                             LineAttribute attr)
Construct a LineCartesianRenderer.

Parameters:
cg - the parent CartesianGraph
col - a Collection of SGTLine objects
line - the LineAttribute
See Also:
CartesianGraph, Graph
Method Detail

getAttribute

public Attribute getAttribute()
Get the Attribute associated with the data.

Specified by:
getAttribute in class CartesianRenderer
Returns:
the Attribute

drawMark

protected void drawMark(java.awt.Graphics g,
                        int[] xp,
                        int[] yp,
                        int npoints,
                        LineAttribute attr)
Draw a mark at the requested location. This routine is used by LineCartesianGraph and LineKey.

Parameters:
g - Graphics object
xp - horizontal coordinate
yp - vertical coordinate
attr - line attribute
See Also:
LineKey

draw

public void draw(java.awt.Graphics g)
Render the SGTData. This method should not be directly called.

Specified by:
draw in class CartesianRenderer
Parameters:
g - graphics context
See Also:
Pane.draw()

setLineAttribute

public void setLineAttribute(LineAttribute l)
Set the LineAttribute. The line appearance is controlled by this object.

Parameters:
l - LineAttribute

getLineAttribute

public LineAttribute getLineAttribute()
Get the LineAttribute.

Returns:
LineAttribute

hasCollection

public boolean hasCollection()
Test if a Collection of SGTLine was using to construct this renderer.

Returns:
true if Collection was used

getCollection

public Collection getCollection()
Get the Collection of SGTLine objects.

Returns:
Collection

getLine

public SGTLine getLine()
Get the SGTLine object.

Returns:
SGTLine

getCartesianGraph

public CartesianGraph getCartesianGraph()
Get the associated CartesianGraph object.

Specified by:
getCartesianGraph in class CartesianRenderer
Returns:
CartesianGraph

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)

getDataAt

public SGTData getDataAt(java.awt.Point pt)
Description copied from class: CartesianRenderer
Find data object.

Specified by:
getDataAt in class CartesianRenderer
Since:
3.0