gov.noaa.pmel.sgt
Class VectorCartesianRenderer

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

public class VectorCartesianRenderer
extends CartesianRenderer

Produces a vector plot. If a second data set is specified it must have the same shape as the first.

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

Field Summary
 
Fields inherited from class gov.noaa.pmel.sgt.CartesianRenderer
cg_
 
Constructor Summary
VectorCartesianRenderer(CartesianGraph cg)
          Default constructor.
VectorCartesianRenderer(CartesianGraph cg, Collection col, VectorAttribute attr)
          Construct a VectorCartesianRenderer.
VectorCartesianRenderer(CartesianGraph cg, SGTVector vector)
          Construct a VectorCartesianRenderer.
VectorCartesianRenderer(CartesianGraph cg, SGTVector vector, VectorAttribute attr)
          Construct a VectorCartesianRenderer.
 
Method Summary
 void draw(java.awt.Graphics g)
          Render the SGTData.
protected  void drawMark(java.awt.Graphics g, int[] xp, int[] yp, int npoints, VectorAttribute 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 SGTVector objects.
 SGTData getDataAt(java.awt.Point pt)
          Find data object.
 SGTVector getVector()
          Get the SGTVector object.
 VectorAttribute getVectorAttribute()
          Get the VectorAttribute.
 boolean hasCollection()
          Test if a Collection of SGTVector was using to construct this renderer.
 void propertyChange(java.beans.PropertyChangeEvent evt)
           
 void setVectorAttribute(VectorAttribute l)
          Set the VectorAttribute.
 
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

VectorCartesianRenderer

public VectorCartesianRenderer(CartesianGraph cg)
Default constructor.

See Also:
CartesianGraph, Graph

VectorCartesianRenderer

public VectorCartesianRenderer(CartesianGraph cg,
                               SGTVector vector)
Construct a VectorCartesianRenderer. The default VectorAttribute will be used.

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

VectorCartesianRenderer

public VectorCartesianRenderer(CartesianGraph cg,
                               SGTVector vector,
                               VectorAttribute attr)
Construct a VectorCartesianRenderer.

Parameters:
cg - the parent CartesianGraph
vector - a SGTVector
attr - the VectorAttribute
See Also:
CartesianGraph, Graph

VectorCartesianRenderer

public VectorCartesianRenderer(CartesianGraph cg,
                               Collection col,
                               VectorAttribute attr)
Construct a VectorCartesianRenderer.

Parameters:
cg - the parent CartesianGraph
col - a Collection of SGTVector objects
attr - the VectorAttribute
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,
                        VectorAttribute attr)
Draw a mark at the requested location. This routine is used by VectorCartesianGraph and VectorKey.

Parameters:
g - Graphics object
xp - horizontal coordinate
yp - vertical coordinate
attr - vector attribute
See Also:
VectorKey

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()

setVectorAttribute

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

Parameters:
l - VectorAttribute

getVectorAttribute

public VectorAttribute getVectorAttribute()
Get the VectorAttribute.

Returns:
VectorAttribute

hasCollection

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

Returns:
true if Collection was used

getCollection

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

Returns:
Collection

getVector

public SGTVector getVector()
Get the SGTVector object.

Returns:
SGTVector

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