public class AnnotationObject
extends java.lang.Object
The AnnotationObject
When including annotation objects in your applications, you will need to reference the ChartFX.Annotation.dll assembly. This assembly contains all the resources need to create annotation objects.
Once you have included the annotation assembly into your project, you can create an annotation extension object. Once you have created that annotation extension object, you can add it to your application using the Extensions method:
Once the annotation extension object has been added to your charting application, you may begin adding annotation objects to the annotation list, thus adding the annotation objects to your application:
Once you have created an object as above, you can begin assigning attributes of the AnnotationObject
Constructor and Description |
---|
AnnotationObject() |
Modifier and Type | Method and Description |
---|---|
void |
attach(DataUnit dx,
DataUnit dy)
Attaches the annotation object to the chart relative to X and Y Axis values.
|
void |
attach(DataUnit dx,
DataUnit dy,
AxisX axisX,
AxisY axisY)
Attaches the annotation object to the chart relative to X and Y Axis values.
|
void |
attach(DataUnit dxLeft,
DataUnit dyTop,
DataUnit dxRight,
DataUnit dyBottom,
AxisX axisX,
AxisY axisY)
Attaches the annotation object to the chart relative to X and Y Axis values.
|
void |
attach(double dx,
double dy)
Attaches the annotation object to the chart relative to X and Y Axis values.
|
void |
attach(double dxLeft,
double dyTop,
double dxRight,
double dyBottom)
Attaches the annotation object to the chart relative to X and Y Axis values.
|
void |
attach(StringAlignment horizontalAlignment,
double dx,
StringAlignment verticalAlignment,
double dy)
Attaches the annotation object to the chart relative to X and Y Axis values.
|
void |
attach(StringAlignment horizontalAlignment,
double dx,
StringAlignment verticalAlignment,
double dy,
AxisX axisX,
AxisY axisY)
Attaches the annotation object to the chart relative to X and Y Axis values.
|
void |
detach()
Detaches the selected annotation object from the chart.
|
void |
flip(boolean horizontal)
Allows you to flip an object horizontally or vertically.
|
java.util.EnumSet<AnchorStyles> |
getAnchor()
Gets or sets the Anchor style for the AnnotationObject.
|
Line |
getBorder()
Allows you to apply border attributes to a selected annotation object.
|
java.awt.Color |
getColor()
Sets the inside fill color for annotation object.
|
int |
getHeight()
Gets or sets the height in pixels for the selected annotation object.
|
int |
getLeft()
Allows you to specify or read the left position of a selected annotation object.
|
com.softwarefx.server.Link |
getLink()
Gets the Link object for a selected AnnotationObject item.
|
java.awt.Rectangle |
getObjectBounds()
Allows you to specify the bounds for a selected annotation object.
|
HatchStyle |
getPattern()
Allows you to set a pattern for the selected annotation object.
|
java.lang.Object |
getTag()
Allows you to get or set a unique identifier to the objects you have created in the chart area.
|
int |
getTop()
Allows you to specify or read the top position of a selected annotation object.
|
int |
getWidth()
Gets or sets the Width in pixels for the selected annotation object.
|
boolean |
isAllowModify()
Used to allow or prevent the user from changing object attributes from the User Interface.
|
boolean |
isAllowMove()
Used to allow or prevent the user from moving an annotation object in the chart area.
|
boolean |
isPaintBefore()
Configures the selected annotation object to paint before the rest of the chart elements.
|
boolean |
isPlotAreaOnly()
Gets or sets a value specifying if annotation objects will be drawn outside the plot area.
|
boolean |
isVisible()
Used to show or hide a selected annotation object in the chart area.
|
void |
refresh()
Instructs Chart FX to repaint the selected annotation object.
|
void |
resetAllowModify()
Set the property AllowModify to its default value.
|
void |
resetAllowMove()
Set the property AllowMove to its default value.
|
void |
resetAnchor()
Set the property Anchor to its default value.
|
void |
resetBoundsNormalized()
Set the property BoundsNormalized to its default value.
|
void |
resetColor()
Set the property Color to its default value.
|
void |
resetPaintBefore()
Set the property PaintBefore to its default value.
|
void |
resetPattern()
Set the property Pattern to its default value.
|
void |
resetPlotAreaOnly()
Set the property PlotAreaOnly to its default value.
|
void |
resetVisible()
Set the property Visible to its default value.
|
void |
rotate(boolean clockWise)
Allows you to rotate an object 90 degrees clockwise or counterclockwise.
|
void |
setAllowModify(boolean value)
Used to allow or prevent the user from changing object attributes from the User Interface.
|
void |
setAllowMove(boolean value)
Used to allow or prevent the user from moving an annotation object in the chart area.
|
void |
setAnchor(java.util.EnumSet<AnchorStyles> value)
Gets or sets the Anchor style for the AnnotationObject.
|
void |
setBorder(Line value)
Allows you to apply border attributes to a selected annotation object.
|
void |
setColor(java.awt.Color value)
Sets the inside fill color for annotation object.
|
void |
setHeight(int value)
Gets or sets the height in pixels for the selected annotation object.
|
void |
setLeft(int value)
Allows you to specify or read the left position of a selected annotation object.
|
void |
setObjectBounds(java.awt.Rectangle value)
Allows you to specify the bounds for a selected annotation object.
|
void |
setPaintBefore(boolean value)
Configures the selected annotation object to paint before the rest of the chart elements.
|
void |
setPattern(HatchStyle value)
Allows you to set a pattern for the selected annotation object.
|
void |
setPlotAreaOnly(boolean value)
Gets or sets a value specifying if annotation objects will be drawn outside the plot area.
|
void |
setTag(java.lang.Object value)
Allows you to get or set a unique identifier to the objects you have created in the chart area.
|
void |
setTop(int value)
Allows you to specify or read the top position of a selected annotation object.
|
void |
setVisible(boolean value)
Used to show or hide a selected annotation object in the chart area.
|
void |
setWidth(int value)
Gets or sets the Width in pixels for the selected annotation object.
|
public boolean isAllowModify()
Annotations annots; annots = new Annotations(); annots.setEnableUI(true); chart1.getExtensions().add(((IExtension)annots)); AnnotationArrow arrow; arrow = new AnnotationArrow(); annots.getList().add(((AnnotationObject)arrow)); arrow.Attach(1.0, 60.0, 3.0, 40.0); arrow.getChartBorder().setColor(new java.awt.Color(255,0,0,255)); arrow.setAllowModify(false);
resetAllowModify
public void setAllowModify(boolean value)
Annotations annots; annots = new Annotations(); annots.setEnableUI(true); chart1.getExtensions().add(((IExtension)annots)); AnnotationArrow arrow; arrow = new AnnotationArrow(); annots.getList().add(((AnnotationObject)arrow)); arrow.Attach(1.0, 60.0, 3.0, 40.0); arrow.getChartBorder().setColor(new java.awt.Color(255,0,0,255)); arrow.setAllowModify(false);
value
- resetAllowModify
public boolean isAllowMove()
Annotations annots; annots = new Annotations(); annots.setEnableUI(true); chart1.getExtensions().add(((IExtension)annots)); AnnotationArrow arrow; arrow = new AnnotationArrow(); annots.getList().add(((AnnotationObject)arrow)); arrow.Attach(1.0, 60.0, 3.0, 40.0); arrow.getChartBorder().setColor(new java.awt.Color(255,0,0,255)); arrow.setAllowMove(false);
resetAllowMove
public void setAllowMove(boolean value)
Annotations annots; annots = new Annotations(); annots.setEnableUI(true); chart1.getExtensions().add(((IExtension)annots)); AnnotationArrow arrow; arrow = new AnnotationArrow(); annots.getList().add(((AnnotationObject)arrow)); arrow.Attach(1.0, 60.0, 3.0, 40.0); arrow.getChartBorder().setColor(new java.awt.Color(255,0,0,255)); arrow.setAllowMove(false);
value
- resetAllowMove
public java.util.EnumSet<AnchorStyles> getAnchor()
AnnotationText text; text = new AnnotationText("Annotation Text String"); text.setHeight(20); text.setWidth((short)50); text.setTop(20); text.setLeft(100); text.setAnchor(SfxNET.System.Windows.Forms.AnchorStyles.Bottom);
resetAnchor
public void setAnchor(java.util.EnumSet<AnchorStyles> value)
AnnotationText text; text = new AnnotationText("Annotation Text String"); text.setHeight(20); text.setWidth((short)50); text.setTop(20); text.setLeft(100); text.setAnchor(SfxNET.System.Windows.Forms.AnchorStyles.Bottom);
value
- resetAnchor
public Line getBorder()
Allows you to apply border attributes to a selected annotation object.
This method provides access to the supported members of the AnnotationObject
class. Using the supported members you can modify the setColor
, setStyle
, setWidth
, setEndCap
and setStartCap
of selected line annotation objects.
Set the color of lines in an annotation arrow object to red:
public void setBorder(Line value)
Allows you to apply border attributes to a selected annotation object.
This method provides access to the supported members of the AnnotationObject
class. Using the supported members you can modify the setColor
, setStyle
, setWidth
, setEndCap
and setStartCap
of selected line annotation objects.
Set the color of lines in an annotation arrow object to red:
value
- public java.awt.Color getColor()
Sets the inside fill color for annotation object.
When working with Arrow annotation objects, this method controls the color of the arrow head and tail. The setColor
method of the Line
class is used in conjunction with the setBorder
method to modify the line color of the arrow.
For more information regarding the Color type, please refer to the Documentation.
To set the fill to blue for an annotation circle:
resetColor
public void setColor(java.awt.Color value)
Sets the inside fill color for annotation object.
When working with Arrow annotation objects, this method controls the color of the arrow head and tail. The setColor
method of the Line
class is used in conjunction with the setBorder
method to modify the line color of the arrow.
For more information regarding the Color type, please refer to the Documentation.
To set the fill to blue for an annotation circle:
value
- resetColor
public int getHeight()
Gets or sets the height in pixels for the selected annotation object.
Important note: It is very important to set the Height and setWidth
for every annotation object created in a chart. The default height and width are zero(0), so if you do not set the these attributes the annotation object will not appear in the chart area. (The attach
method can be used instead of setting these methods, see next remark.)
When you call the attach
method using the left, top, right and bottom parameters, both the Height and Width for the object is calculated by Chart FX. If you only specify a dx and dy parameter, you will still need to configure the height and width.
With this method you can also control the orientation of certain objects (e.g. Arrows). For example assigning a positive height will cause the arrow to point down (X-axis). Similarly, assigning a negative value for the width will cause the arrow to point up (Toolbar). You must then use the setWidth
method to point the line or arrow correctly.
Set the Height for the annotation circle:
public void setHeight(int value)
Gets or sets the height in pixels for the selected annotation object.
Important note: It is very important to set the Height and setWidth
for every annotation object created in a chart. The default height and width are zero(0), so if you do not set the these attributes the annotation object will not appear in the chart area. (The attach
method can be used instead of setting these methods, see next remark.)
When you call the attach
method using the left, top, right and bottom parameters, both the Height and Width for the object is calculated by Chart FX. If you only specify a dx and dy parameter, you will still need to configure the height and width.
With this method you can also control the orientation of certain objects (e.g. Arrows). For example assigning a positive height will cause the arrow to point down (X-axis). Similarly, assigning a negative value for the width will cause the arrow to point up (Toolbar). You must then use the setWidth
method to point the line or arrow correctly.
Set the Height for the annotation circle:
value
- public int getLeft()
Allows you to specify or read the left position of a selected annotation object.
This method should be used in conjunction with the setTop
method to position the object in the chart area. Both the setTop
and Left methods support pixel unit configuration.
The Chart Origin, coordinates (0,0), is always located at the top-left corner of the chart area.
The attach
method may also be used to attach an annotation object to a chart based on X and Y Axis values.
To set a left position of 50 pixels:
public void setLeft(int value)
Allows you to specify or read the left position of a selected annotation object.
This method should be used in conjunction with the setTop
method to position the object in the chart area. Both the setTop
and Left methods support pixel unit configuration.
The Chart Origin, coordinates (0,0), is always located at the top-left corner of the chart area.
The attach
method may also be used to attach an annotation object to a chart based on X and Y Axis values.
To set a left position of 50 pixels:
value
- public com.softwarefx.server.Link getLink()
public java.awt.Rectangle getObjectBounds()
public void setObjectBounds(java.awt.Rectangle value)
value
- public boolean isPaintBefore()
resetPaintBefore
public void setPaintBefore(boolean value)
value
- resetPaintBefore
public HatchStyle getPattern()
resetPattern
public void setPattern(HatchStyle value)
value
- resetPattern
public boolean isPlotAreaOnly()
Annotations annExt; annExt = new Annotations(); annExt.setChart(chart1); AnnotationArrow annArrow; annArrow = new AnnotationArrow(); annExt.getList().add(((AnnotationObject)annArrow)); annArrow.Attach(3.0, 50.0, 4.0, 70.0); annArrow.setPlotAreaOnly(true);
resetPlotAreaOnly
public void setPlotAreaOnly(boolean value)
Annotations annExt; annExt = new Annotations(); annExt.setChart(chart1); AnnotationArrow annArrow; annArrow = new AnnotationArrow(); annExt.getList().add(((AnnotationObject)annArrow)); annArrow.Attach(3.0, 50.0, 4.0, 70.0); annArrow.setPlotAreaOnly(true);
value
- resetPlotAreaOnly
public java.lang.Object getTag()
public void setTag(java.lang.Object value)
value
- public int getTop()
Allows you to specify or read the top position of a selected annotation object.
This method should be used in conjunction with the setLeft
method to position the object in the chart area. Both the Top and setLeft
methods support pixel unit configuration.
The Chart Origin, coordinates (0,0), is always located at the top-left corner of the chart area.
The attach
method may also be used to attach an annotation object to a chart based on X and Y Axis values.
To set a top position of 40 pixels:
public void setTop(int value)
Allows you to specify or read the top position of a selected annotation object.
This method should be used in conjunction with the setLeft
method to position the object in the chart area. Both the Top and setLeft
methods support pixel unit configuration.
The Chart Origin, coordinates (0,0), is always located at the top-left corner of the chart area.
The attach
method may also be used to attach an annotation object to a chart based on X and Y Axis values.
To set a top position of 40 pixels:
value
- public boolean isVisible()
Annotations annots; annots = new Annotations(); annots.setEnableUI(true); AnnotationArrow arrow; arrow = new AnnotationArrow(); annots.getList().add(((AnnotationObject)arrow)); chart1.getExtensions().add(((IExtension)annots)); arrow.Attach(1.0, 60.0, 3.0, 40.0); arrow.getChartBorder().setColor(new java.awt.Color(255,0,0,255)); arrow.setAllowModify(false); arrow.setVisible(false);
resetVisible
public void setVisible(boolean value)
Annotations annots; annots = new Annotations(); annots.setEnableUI(true); AnnotationArrow arrow; arrow = new AnnotationArrow(); annots.getList().add(((AnnotationObject)arrow)); chart1.getExtensions().add(((IExtension)annots)); arrow.Attach(1.0, 60.0, 3.0, 40.0); arrow.getChartBorder().setColor(new java.awt.Color(255,0,0,255)); arrow.setAllowModify(false); arrow.setVisible(false);
value
- resetVisible
public int getWidth()
Gets or sets the Width in pixels for the selected annotation object.
Important note: It is very important to set the setHeight
and Width for every annotation object created in a chart. The default height and width are zero(0), so if you do not set the these attributes the annotation object will not appear in the chart area. (The attach
method can be used instead of setting these methods, see next remark.)
When you call the attach
method using the left, top, right and bottom parameters, both the Height and Width for the object is calculated by Chart FX. If you only specify a dx and dy parameter, you will still need to configure the height and width.
With this method you can also control the orientation of certain objects (e.g. Arrows). For example assigning a positive height will cause the arrow to point down (X-axis). Similarly, assigning a negative value for the width will cause the arrow to point up (Toolbar). You must then use the setWidth
method to point the line or arrow correctly.
Set the Width for the annotation circle:
public void setWidth(int value)
Gets or sets the Width in pixels for the selected annotation object.
Important note: It is very important to set the setHeight
and Width for every annotation object created in a chart. The default height and width are zero(0), so if you do not set the these attributes the annotation object will not appear in the chart area. (The attach
method can be used instead of setting these methods, see next remark.)
When you call the attach
method using the left, top, right and bottom parameters, both the Height and Width for the object is calculated by Chart FX. If you only specify a dx and dy parameter, you will still need to configure the height and width.
With this method you can also control the orientation of certain objects (e.g. Arrows). For example assigning a positive height will cause the arrow to point down (X-axis). Similarly, assigning a negative value for the width will cause the arrow to point up (Toolbar). You must then use the setWidth
method to point the line or arrow correctly.
Set the Width for the annotation circle:
value
- public void attach(DataUnit dx, DataUnit dy)
Attaches the annotation object to the chart relative to X and Y Axis values.
This method supports two configurations. By specifying 2 parameters (dx, dy), the annotation object will attached to the chart at the center of the object. By specifying 4 parameters (dxLeft, dyTop, dxRight, dyBottom), the annotation object will be attached to the chart by the corners of the annotation objects. The second configuration allows for the resizing of the annotation object with the chart area.
You can also specify the pixel location of the annotation object using the setHeight
and setWidth
methods.
The attach
method may NOT be used when positioning the AnnotationPolygon object. The AnnotationPolygon is the only annotation object that does not support the attach
method. Please use the setVertices
method.
To attach an Annotation Arrow to the chart using left, top, right and bottom parameters:
Annotations annots; annots = new Annotations(); chart1.getExtensions().add(((IExtension)annots)); AnnotationArrow arrow; arrow = new AnnotationArrow(); annots.getList().add(((AnnotationObject)arrow)); arrow.Attach(1.0, 60.0, 3.0, 40.0); arrow.getChartBorder().setColor(new java.awt.Color(255,0,0,255));
dx
- dy
- public void attach(double dx, double dy)
Attaches the annotation object to the chart relative to X and Y Axis values.
This method supports two configurations. By specifying 2 parameters (dx, dy), the annotation object will attached to the chart at the center of the object. By specifying 4 parameters (dxLeft, dyTop, dxRight, dyBottom), the annotation object will be attached to the chart by the corners of the annotation objects. The second configuration allows for the resizing of the annotation object with the chart area.
You can also specify the pixel location of the annotation object using the setHeight
and setWidth
methods.
The attach
method may NOT be used when positioning the AnnotationPolygon object. The AnnotationPolygon is the only annotation object that does not support the attach
method. Please use the setVertices
method.
To attach an Annotation Arrow to the chart using left, top, right and bottom parameters:
Annotations annots; annots = new Annotations(); chart1.getExtensions().add(((IExtension)annots)); AnnotationArrow arrow; arrow = new AnnotationArrow(); annots.getList().add(((AnnotationObject)arrow)); arrow.Attach(1.0, 60.0, 3.0, 40.0); arrow.getChartBorder().setColor(new java.awt.Color(255,0,0,255));
dx
- X Axis coordinate value.dy
- Y Axis coordinate value.public void attach(StringAlignment horizontalAlignment, double dx, StringAlignment verticalAlignment, double dy)
Attaches the annotation object to the chart relative to X and Y Axis values.
This method supports two configurations. By specifying 2 parameters (dx, dy), the annotation object will attached to the chart at the center of the object. By specifying 4 parameters (dxLeft, dyTop, dxRight, dyBottom), the annotation object will be attached to the chart by the corners of the annotation objects. The second configuration allows for the resizing of the annotation object with the chart area.
You can also specify the pixel location of the annotation object using the setHeight
and setWidth
methods.
The attach
method may NOT be used when positioning the AnnotationPolygon object. The AnnotationPolygon is the only annotation object that does not support the attach
method. Please use the setVertices
method.
To attach an Annotation Arrow to the chart using left, top, right and bottom parameters:
Annotations annots; annots = new Annotations(); chart1.getExtensions().add(((IExtension)annots)); AnnotationArrow arrow; arrow = new AnnotationArrow(); annots.getList().add(((AnnotationObject)arrow)); arrow.Attach(1.0, 60.0, 3.0, 40.0); arrow.getChartBorder().setColor(new java.awt.Color(255,0,0,255));
horizontalAlignment
- Horizontal string alignment.dx
- X Axis coordinate value.verticalAlignment
- Vertical string alignment.dy
- Y Axis coordinate value.public void attach(DataUnit dx, DataUnit dy, AxisX axisX, AxisY axisY)
Attaches the annotation object to the chart relative to X and Y Axis values.
This method supports two configurations. By specifying 2 parameters (dx, dy), the annotation object will attached to the chart at the center of the object. By specifying 4 parameters (dxLeft, dyTop, dxRight, dyBottom), the annotation object will be attached to the chart by the corners of the annotation objects. The second configuration allows for the resizing of the annotation object with the chart area.
You can also specify the pixel location of the annotation object using the setHeight
and setWidth
methods.
The attach
method may NOT be used when positioning the AnnotationPolygon object. The AnnotationPolygon is the only annotation object that does not support the attach
method. Please use the setVertices
method.
To attach an Annotation Arrow to the chart using left, top, right and bottom parameters:
Annotations annots; annots = new Annotations(); chart1.getExtensions().add(((IExtension)annots)); AnnotationArrow arrow; arrow = new AnnotationArrow(); annots.getList().add(((AnnotationObject)arrow)); arrow.Attach(1.0, 60.0, 3.0, 40.0); arrow.getChartBorder().setColor(new java.awt.Color(255,0,0,255));
dx
- dy
- axisX
- axisY
- public void attach(double dxLeft, double dyTop, double dxRight, double dyBottom)
Attaches the annotation object to the chart relative to X and Y Axis values.
This method supports two configurations. By specifying 2 parameters (dx, dy), the annotation object will attached to the chart at the center of the object. By specifying 4 parameters (dxLeft, dyTop, dxRight, dyBottom), the annotation object will be attached to the chart by the corners of the annotation objects. The second configuration allows for the resizing of the annotation object with the chart area.
You can also specify the pixel location of the annotation object using the setHeight
and setWidth
methods.
The attach
method may NOT be used when positioning the AnnotationPolygon object. The AnnotationPolygon is the only annotation object that does not support the attach
method. Please use the setVertices
method.
To attach an Annotation Arrow to the chart using left, top, right and bottom parameters:
Annotations annots; annots = new Annotations(); chart1.getExtensions().add(((IExtension)annots)); AnnotationArrow arrow; arrow = new AnnotationArrow(); annots.getList().add(((AnnotationObject)arrow)); arrow.Attach(1.0, 60.0, 3.0, 40.0); arrow.getChartBorder().setColor(new java.awt.Color(255,0,0,255));
dxLeft
- Left X Axis coordinate value.dyTop
- Top Y Axis coordinate value.dxRight
- Right X Axis coordinate value.dyBottom
- Bottom Y Axis coordinate value.public void attach(StringAlignment horizontalAlignment, double dx, StringAlignment verticalAlignment, double dy, AxisX axisX, AxisY axisY)
Attaches the annotation object to the chart relative to X and Y Axis values.
This method supports two configurations. By specifying 2 parameters (dx, dy), the annotation object will attached to the chart at the center of the object. By specifying 4 parameters (dxLeft, dyTop, dxRight, dyBottom), the annotation object will be attached to the chart by the corners of the annotation objects. The second configuration allows for the resizing of the annotation object with the chart area.
You can also specify the pixel location of the annotation object using the setHeight
and setWidth
methods.
The attach
method may NOT be used when positioning the AnnotationPolygon object. The AnnotationPolygon is the only annotation object that does not support the attach
method. Please use the setVertices
method.
To attach an Annotation Arrow to the chart using left, top, right and bottom parameters:
Annotations annots; annots = new Annotations(); chart1.getExtensions().add(((IExtension)annots)); AnnotationArrow arrow; arrow = new AnnotationArrow(); annots.getList().add(((AnnotationObject)arrow)); arrow.Attach(1.0, 60.0, 3.0, 40.0); arrow.getChartBorder().setColor(new java.awt.Color(255,0,0,255));
horizontalAlignment
- Horizontal string alignment.dx
- X Axis coordinate value.verticalAlignment
- Vertical string alignment.dy
- Y Axis coordinate value.axisX
- X Axis where the Annotation object will be attached.axisY
- Y Axis where the Annotation object will be attached.public void attach(DataUnit dxLeft, DataUnit dyTop, DataUnit dxRight, DataUnit dyBottom, AxisX axisX, AxisY axisY)
Attaches the annotation object to the chart relative to X and Y Axis values.
This method supports two configurations. By specifying 2 parameters (dx, dy), the annotation object will attached to the chart at the center of the object. By specifying 4 parameters (dxLeft, dyTop, dxRight, dyBottom), the annotation object will be attached to the chart by the corners of the annotation objects. The second configuration allows for the resizing of the annotation object with the chart area.
You can also specify the pixel location of the annotation object using the setHeight
and setWidth
methods.
The attach
method may NOT be used when positioning the AnnotationPolygon object. The AnnotationPolygon is the only annotation object that does not support the attach
method. Please use the setVertices
method.
To attach an Annotation Arrow to the chart using left, top, right and bottom parameters:
Annotations annots; annots = new Annotations(); chart1.getExtensions().add(((IExtension)annots)); AnnotationArrow arrow; arrow = new AnnotationArrow(); annots.getList().add(((AnnotationObject)arrow)); arrow.Attach(1.0, 60.0, 3.0, 40.0); arrow.getChartBorder().setColor(new java.awt.Color(255,0,0,255));
dxLeft
- dyTop
- dxRight
- dyBottom
- axisX
- axisY
- public void detach()
Detaches the selected annotation object from the chart.
By default, all annotation objects are detached from the chart. When you call the attach
method for a particular object, that object is attached to the chart. Once you refresh the chart, the object will appear in the configured attached location. Call this method after an object has been attached to detach the object.
To detach an annotation text object from a chart:
Annotations annots; annots = new Annotations(); chart1.getExtensions().add(((IExtension)annots)); AnnotationText text; text = new AnnotationText(); annots.getList().add(((AnnotationObject)text)); text.Attach(2.0, 20.0, 4.0, 40.0); text.Detach();
public void flip(boolean horizontal)
Flip orientation:
Annotation objects can also be rotated with the rotate
method.
To flip a circle horizontally:
AnnotationCircle circle; circle = new AnnotationCircle(); circle.setHeight(30); circle.setWidth((short)30); circle.setTop(40); circle.setLeft(40); circle.Flip(true);
horizontal
- Specifies horizontal or vertical flip.public void refresh()
This method should be called after any visual attribute has been modified for the selected annotation object. If this method is not invoked, the change will not be visible.
To refresh a circle object after changing the color:
public void resetAllowModify()
isAllowModify
public void resetAllowMove()
isAllowMove
public void resetAnchor()
setAnchor
public void resetBoundsNormalized()
public void resetColor()
setColor
public void resetPaintBefore()
isPaintBefore
public void resetPattern()
setPattern
public void resetPlotAreaOnly()
isPlotAreaOnly
public void resetVisible()
isVisible
public void rotate(boolean clockWise)
The boolean parameter specifies the directional rotation of the selected annotation object. Setting the parameter to True will cause the object to rotate clockwise. Setting the parameter to False will cause the object to rotate counter clockwise.
Objects may only be rotated 90 degrees.
You may use the flip
method to flip objects horizontally and vertically.
To rotate an arrow 90 degrees counter clockwise:
clockWise
- Boolean specifying rotation direction.2014 Software FX, Inc. All Rights Reserved. Chart FX is a registered trademark of Software FX, Inc
All other names are trademarks or registered trademarks of their respective owners.