public class Figure
extends java.lang.Object
Constructor and Description |
---|
Figure() |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(double x,
double y,
DrawContext ctx)
This method is called by the study framework to determine if the figure contains the x and y coordinates.
|
void |
draw(java.awt.Graphics2D gc,
DrawContext ctx)
This method draws the figure on the graph (using the given Graphics2D).
|
java.awt.geom.Rectangle2D |
getBounds()
Gets the bounds of this figure as a java.awt.Rectangle
|
boolean |
isVisible(DrawContext ctx)
This method is called by the study framework and is used to
improve the performance of the study by only working figures
that are currently visible.
|
void |
layout(DrawContext ctx)
This method is called to translate any real values in the figure to the graph (represented by the DrawContext).
|
protected void |
setBounds(java.awt.geom.Rectangle2D bounds)
Sets the bounds for this figure.
|
public boolean isVisible(DrawContext ctx)
public boolean contains(double x, double y, DrawContext ctx)
public void layout(DrawContext ctx)
ctx
- draw contextpublic void draw(java.awt.Graphics2D gc, DrawContext ctx)
gc
- graphics contextctx
- draw contextpublic java.awt.geom.Rectangle2D getBounds()
protected void setBounds(java.awt.geom.Rectangle2D bounds)
bounds
- bounds of this figure