|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.noaa.pmel.sgt.Graph
public abstract class Graph
Abstract base class for all graphics drawn on a Layer
. The
Graph
class defines the interfaces for the user to physical
coordinate, user to device, and physical to user coordinate systems.
The following demonstrates how a CartesianGraph
may be
used.
// Create a CartesianGraph and transforms. CartesianGraph graph; LinearTransform xt, yt; Range2D xPhysRange, xUserRange; Range2D yPhysRange, yUserRange; Point2D.Double origin; graph = new CartesianGraph("Point Graph"); layer.setGraph(graph); xt = new LinearTransform(xPhysRange, xUserRange); yt = new LinearTransform(yPhysRange, yUserRange); graph.setXTransform(xt); graph.setYTransform(yt); origin = new Point2D.Double(xUserRange.start, yUserRange.start); // Create the bottom axis, set its range in user units // and its origin. Add the axis to the graph. PlainAxis xbot; xbot = new PlainAxis("Botton Axis"); xbot.setRangeU(xUserRange); xbot.setLocationU(origin); graph.addXAxis(xbot); // Create the left axis, set its range in user units // and its origin. Add the axis to the graph. PlainAxis yleft; yleft = new PlainAxis("Left Axis"); yleft.setRangeU(yUserRange); yleft.setLocationU(origin); graph.addYAxis(yleft); // Create a PointAttribute for the display of the // Collection of points. The points will be marked // with a red triangle and labelled at the NE corner // in blue. PointAttribute pattr; pattr = new PointAttribute(10, Color.red); // Associate the attribute and the point Collection // with the graph. graph.setData(col, pattr);
Layer
,
LinearTransform
,
PlainAxis
,
SGLabel
,
CartesianGraph
Field Summary | |
---|---|
protected Layer |
layer_
|
Constructor Summary | |
---|---|
Graph()
Default constructor. |
|
Graph(java.lang.String id)
Constructor for Graph class. |
Method Summary | |
---|---|
static Range2D |
computeRange(double min,
double max,
int num)
Compute a "nice" range from the minimum, maximum, and number of intervals. |
static Range2D |
computeRange(Range2D range,
int num)
Compute a "nice" range from a range and number of intervals. |
static SoTRange |
computeRange(SoTRange range,
int num)
Compute a "nice" range from a range and number of intervals. |
abstract Graph |
copy()
Copy the Graph object and all attached classes. |
abstract SGTData |
getDataAt(java.awt.Point pt)
Find data at a Point |
java.lang.String |
getId()
Get the Graph identifier |
Layer |
getLayer()
Get the associated Layer . |
AbstractPane |
getPane()
Return parent pane. |
void |
modified(java.lang.String mess)
Used internally by sgt. |
java.lang.String |
toString()
Get a String representation of the
Graph . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.beans.PropertyChangeListener |
---|
propertyChange |
Field Detail |
---|
protected Layer layer_
Constructor Detail |
---|
public Graph()
public Graph(java.lang.String id)
Graph
class.
id
- identifierMethod Detail |
---|
public abstract Graph copy()
Graph
object and all attached classes.
public java.lang.String getId()
Graph
identifier
public Layer getLayer()
Layer
.
Layer
objectpublic AbstractPane getPane()
public void modified(java.lang.String mess)
public static Range2D computeRange(Range2D range, int num)
range
- min and max valuesnum
- number of intervals
public static SoTRange computeRange(SoTRange range, int num)
range
- min and max valuesnum
- number of intervals
public static Range2D computeRange(double min, double max, int num)
min
- minimum valuemax
- maximum valuenum
- number of intervals
public java.lang.String toString()
String
representation of the
Graph
.
toString
in class java.lang.Object
String
representationpublic abstract SGTData getDataAt(java.awt.Point pt)
Point
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |