|
Chart FX 7 for Java Server | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.softwarefx.chartfx.server.annotation.AnnotationObject
com.softwarefx.chartfx.server.annotation.AnnotationPolygon
public class AnnotationPolygon
Provides access to the AnnotationPolygon object.
The AnnotationPolygon Class allows you to create polygon annotation objects in your charts. The supported members allow you to configure the vertices for the object as well as many other attributes.
Below is an example of an annotation polygon object:
chart1.importChart(FileFormat.XML, application.getRealPath("/") + "/data/samples.cfx");
com.softwarefx.chartfx.server.annotation.Annotations annot = new com.softwarefx.chartfx.server.annotation.Annotations();
chart1.getExtensions().add(annot);
com.softwarefx.chartfx.server.annotation.AnnotationPolygon poly = new com.softwarefx.chartfx.server.annotation.AnnotationPolygon();
annot.getList().add(poly);
java.awt.Point[] p = new java.awt.Point[4];
p[0] = new java.awt.Point(250,50);
p[1] = new java.awt.Point(320,150);
p[2] = new java.awt.Point(300,200);
p[3] = new java.awt.Point(200,80);
Note: The AnnotationObject.attach(double, double)
Attach method may NOT be used when positioning the AnnotationPolygon object within the chart area. The AnnotationPolygon is the only annotation object that does not support the Attach method.
Constructor Summary | |
---|---|
AnnotationPolygon()
|
|
AnnotationPolygon(Point[] points)
|
Method Summary | |
---|---|
int |
getNumVertex()
Allows you to read the number of vertices associated with an annotation polygon object. |
Point[] |
getVertices()
Gets the Vertices. |
boolean |
isClosed()
Gets the Closed. |
void |
recalcBounds()
Instruct Chart FX to recalculate the bounds for an annotation polygon object. |
void |
setClosed(boolean value)
Instructs Chart FX to draw a line from the beginning vertex to the ending vertex. |
void |
setVertices(Point[] value)
Used to set the vertices for an annotation polygon object. |
Methods inherited from class com.softwarefx.chartfx.server.annotation.AnnotationObject |
---|
attach, attach, attach, detach, dispose, flip, getAnchor, getBorder, getColor, getHeight, getLeft, getLink, getObjectBounds, getPattern, getTag, getTop, getWidth, isAllowModify, isAllowMove, isPaintBefore, isPlotAreaOnly, isVisible, refresh, rotate, setAllowModify, setAllowMove, setAnchor, setBorder, setColor, setHeight, setLeft, setObjectBounds, setPaintBefore, setPattern, setPlotAreaOnly, setTag, setTop, setVisible, setWidth |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AnnotationPolygon()
public AnnotationPolygon(Point[] points)
Method Detail |
---|
public int getNumVertex()
Allows you to read the number of vertices associated with an annotation polygon object.
You can set multiple vertices for polygon using the setVertices(java.awt.Point[])
property.
setVertices(java.awt.Point[])
,
AnnotationObject
public Point[] getVertices()
Gets the Vertices. For more detail see setVertices(java.awt.Point[])
.
public boolean isClosed()
Gets the Closed. For more detail see setClosed(boolean)
.
public void recalcBounds()
Instruct Chart FX to recalculate the bounds for an annotation polygon object.
This method should be invoked every time the vertex of a polygon object is modified. Recalculating the bounds will instruct Chart FX to redraw the polygon object with the new attributes.
setVertices(java.awt.Point[])
,
AnnotationObject
public void setClosed(boolean value)
Instructs Chart FX to draw a line from the beginning vertex to the ending vertex.
By default this property is set to True. This means that when you set the vertices for a polygon, Chart FX will draw a line from the beginning vertex and ending vertex to make an enclosed shape.
Setting this property to False will cause the configured polygon to have an open side if the vertices have not be set to meet manually.
If your polygon object has an open side, the object will not accept its configured AnnotationObject.setColor(java.awt.Color)
.
AnnotationObject.setColor(java.awt.Color)
,
AnnotationObject
public void setVertices(Point[] value)
Used to set the vertices for an annotation polygon object.
When configuring the vertices for an annotation polygon, you will need to create an array of X/Y values interlaced, i.e. the first entry in the array will contain the first X value, the second entry will have the first Y value, the third entry will contain the second X value, and so on. The AnnotationObject.attach(double, double)
method may NOT be used when positioning the AnnotationPolygon object. The AnnotationPolygon is the only annotation object that does not support the Attach method.
When configuring the vertices for an annotation polygon, you will need to create an array of points. Each of the points (X,Y) will represent a vertex for the polygon you are creating. The AnnotationObject.attach(double, double)
method may NOT be used when positioning the AnnotationPolygon object. The AnnotationPolygon is the only annotation object that does not support the Attach method.
A polygon is usually a closed shape with three or more straight sides. For example, a triangle is a polygon with three sides, a rectangle is a polygon with four sides, and a pentagon is a polygon with five sides.
The setClosed(boolean)
property allows you to specify that a selected polygon object will be an open or closed geometric shape. If a selected polygon object is not closed, you will not be able to color in inside area using the AnnotationObject.setColor(java.awt.Color)
property.
You may read the number of vertices of a selected polygon object using the getNumVertex()
property.
setClosed(boolean)
,
AnnotationObject.setColor(java.awt.Color)
,
getNumVertex()
,
recalcBounds()
,
AnnotationObject
|
http://www.softwarefx.com | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |