public abstract class GJAnnotation extends java.lang.Object implements GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font>
add method (in which case the position of the annotation will be set
in the coordinate space of that container's View) or by calling the
add method of a parentGraph layer in the View of a container (in
which case the position of the annotation will be set in that layer's
coordinate space).| Modifier and Type | Class and Description |
|---|---|
static class |
GJAnnotation.ArrowAnnotation
Internal class for arrow annotations
|
static class |
GJAnnotation.LineAnnotation
Internal class for line annotations
|
static class |
GJAnnotation.ShapeAnnotation
Internal class for shape annotations
|
static class |
GJAnnotation.TextAnnotation
Internal class for text annotations
|
| Constructor and Description |
|---|
GJAnnotation()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static GJAnnotation.ArrowAnnotation |
createArrow(double x1,
double y1,
double x2,
double y2,
double szx,
double szy)
Static method to create a line between {x1,y1} and {x2,y2}.
|
static GJAnnotation.ArrowAnnotation |
createArrow(double x1,
double y1,
double x2,
double y2,
double x3,
double y3,
double szx,
double szy) |
static GJAnnotation.ShapeAnnotation |
createBox(double x,
double y,
double w,
double h)
Static method to create a rectangle where {X,Y} is the top left corner
and w and h are the width and height.
|
static GJAnnotation.ShapeAnnotation |
createEllipse(double x,
double y,
double w,
double h)
Static method to create an ellipse where {X,Y} is the top left corner and
w and h are the width and height of the bounding rectangle.
|
static GJAnnotation.LineAnnotation |
createLine(double x1,
double y1,
double x2,
double y2)
Static method to create a line between {x1,y1} and {x2,y2}.
|
static GJAnnotation.LineAnnotation |
createLine(double x1,
double y1,
double x2,
double y2,
double x3,
double y3)
Static method to create a line between {x1,y1} and {x2,y2}.
|
static GJAnnotation.ShapeAnnotation |
createShape(java.awt.Shape s)
Creates an annotation using the specified object which should implement
the {code Shape} interface.
|
static GJAnnotation.TextAnnotation |
createText(double x,
double y,
java.lang.String s) |
GJMarker |
getExtra()
Returns the parentGraph reference for setting the coordinate system for
this annotation.
|
java.awt.Paint |
getFill() |
java.awt.Font |
getFont() |
java.awt.Paint |
getLineColor() |
java.awt.Stroke |
getLineStroke() |
int |
getLineTextPosition() |
GJMarker |
getMarker() |
java.lang.String |
getName() |
GJGraphInterface |
getParentGraph()
Returns the parentGraph reference for setting the coordinate system for
this annotation.
|
java.awt.geom.Path2D |
getPath()
Returns a clone of the Path2D object.
|
java.lang.String |
getText() |
java.awt.Paint |
getTextBackground() |
java.awt.Paint |
getTextColor() |
double |
getXData() |
double |
getYData() |
void |
paintAnnotation(java.awt.Graphics2D g2,
java.awt.geom.AffineTransform af)
paintAnnotation method.
|
void |
remove()
Removes the annotation
|
void |
remove(java.lang.String name)
Removes annotation(s) named by the string
|
void |
setExtra(GJMarker p)
Sets the Path2D object.
|
void |
setFill(java.awt.Paint Fill) |
void |
setFont(java.awt.Font Font) |
void |
setLineColor(java.awt.Paint LineColor) |
void |
setLineStroke(java.awt.Stroke LineStroke) |
void |
setLineTextPosition(int pos) |
void |
setMarker(GJMarker Marker) |
void |
setName(java.lang.String Name) |
void |
setParentGraph(GJGraphInterface gr)
setParentGraph method.
|
void |
setPath(java.awt.geom.Path2D p)
Sets the Path2D object.
|
void |
setText(java.lang.String Text) |
void |
setTextBackground(java.awt.Paint textBackground) |
void |
setTextColor(java.awt.Paint TextColor)
Sets the textColor
|
void |
setXData(double X) |
void |
setYData(double Y) |
public java.awt.geom.Path2D getPath()
getPath in interface GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font>public void setPath(java.awt.geom.Path2D p)
setPath in interface GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font>p - public GJGraphInterface getParentGraph()
getParentGraph in interface GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font>public void setExtra(GJMarker p)
setExtra in interface GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font>p - public GJMarker getExtra()
getExtra in interface GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font>public void setParentGraph(GJGraphInterface gr)
add method of a parentGraph - which is recommended - so need
not be called directly by the user.setParentGraph in interface GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font>gr - public java.awt.Stroke getLineStroke()
getLineStroke in interface GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font>public void setLineStroke(java.awt.Stroke LineStroke)
setLineStroke in interface GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font>LineStroke - the LineStroke to setpublic java.awt.Paint getLineColor()
getLineColor in interface GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font>public void setLineColor(java.awt.Paint LineColor)
setLineColor in interface GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font>LineColor - the LineColor to setpublic java.awt.Font getFont()
getFont in interface GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font>public void setFont(java.awt.Font Font)
setFont in interface GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font>Font - the Font to setpublic java.awt.Paint getFill()
getFill in interface GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font>public void setFill(java.awt.Paint Fill)
setFill in interface GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font>Fill - the Fill to setpublic GJMarker getMarker()
getMarker in interface GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font>public void setMarker(GJMarker Marker)
setMarker in interface GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font>Marker - the Marker to setpublic java.lang.String getName()
getName in interface GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font>public void setName(java.lang.String Name)
setName in interface GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font>Name - the Name to setpublic java.lang.String getText()
getText in interface GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font>public void setText(java.lang.String Text)
setText in interface GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font>Text - the Text to setpublic double getXData()
getXData in interface GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font>public void setXData(double X)
setXData in interface GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font>X - the X to setpublic double getYData()
getYData in interface GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font>public void setYData(double Y)
setYData in interface GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font>Y - the Y to setpublic java.awt.Paint getTextColor()
getTextColor in interface GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font>public void setTextColor(java.awt.Paint TextColor)
setTextColor in interface GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font>TextColor - the TextColor to setpublic int getLineTextPosition()
public void setLineTextPosition(int pos)
pos - the lineTextPosition to setpublic void remove()
GJAnnotationInterfaceremove in interface GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font>public void remove(java.lang.String name)
GJAnnotationInterfaceremove in interface GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font>name - the name of the annotation(s) to removepublic void paintAnnotation(java.awt.Graphics2D g2,
java.awt.geom.AffineTransform af)
add method, this is done automatically.paintAnnotation in interface GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font>g2 - the graphics object to render toaf - an AffineTransform instance with scale and translate set to
position this annotation correctly in the container using the
parentGraph's coordinate system.public static GJAnnotation.LineAnnotation createLine(double x1, double y1, double x2, double y2)
x1 - y1 - x2 - y2 - public static GJAnnotation.ArrowAnnotation createArrow(double x1, double y1, double x2, double y2, double szx, double szy)
x1 - y1 - x2 - y2 - szx - szy - public static GJAnnotation.ArrowAnnotation createArrow(double x1, double y1, double x2, double y2, double x3, double y3, double szx, double szy)
x1 - y1 - x2 - y2 - x3 - y3 - szx - szy - public static GJAnnotation.LineAnnotation createLine(double x1, double y1, double x2, double y2, double x3, double y3)
x1 - y1 - x2 - y2 - x3 - y3 - public static GJAnnotation.ShapeAnnotation createBox(double x, double y, double w, double h)
x - y - w - h - public static GJAnnotation.ShapeAnnotation createEllipse(double x, double y, double w, double h)
x - y - w - h - public static GJAnnotation.ShapeAnnotation createShape(java.awt.Shape s)
s - a Shape.public static GJAnnotation.TextAnnotation createText(double x, double y, java.lang.String s)
public java.awt.Paint getTextBackground()
public void setTextBackground(java.awt.Paint textBackground)
textBackground - the textBackground to set