|
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
public abstract class AnnotationObject
Provides access to the AnnotationObject object.
The AnnotationObject Class is a collection of general annotation object properties and methods. All supported annotation objects share access to these members and the are used for general attribute assignment. When you create a specific annotation object, you will have access to properties specific to that type.
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 property:
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 Class to the annotation object:
Constructor Summary | |
---|---|
AnnotationObject()
|
Method Summary | |
---|---|
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 |
detach()
Detaches the selected annotation object from the chart. |
void |
dispose()
Releases all resources used by the current instance of a selected object. |
void |
flip(boolean horizontal)
Allows you to flip an object horizontally or vertically. |
EnumSet<AnchorStyles> |
getAnchor()
Gets the Anchor. |
Line |
getBorder()
Gets the Border. |
Color |
getColor()
Gets the Color. |
int |
getHeight()
Gets the Height. |
int |
getLeft()
Gets the Left. |
Link |
getLink()
Gets the Link object for a selected AnnotationObject item. |
Rectangle |
getObjectBounds()
Gets the ObjectBounds. |
HatchStyle |
getPattern()
Gets the Pattern. |
Object |
getTag()
Gets the Tag. |
int |
getTop()
Gets the Top. |
int |
getWidth()
Gets the Width. |
boolean |
isAllowModify()
Gets the AllowModify. |
boolean |
isAllowMove()
Gets the AllowMove. |
boolean |
isPaintBefore()
Gets the PaintBefore. |
boolean |
isPlotAreaOnly()
Gets the PlotAreaOnly. |
boolean |
isVisible()
Gets the Visible. |
void |
refresh()
Instructs Chart FX to repaint the selected annotation object. |
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(EnumSet<AnchorStyles> value)
Sets the Anchor style for the AnnotationObject. |
void |
setBorder(Line value)
Allows you to apply border attributes to a selected annotation object. |
void |
setColor(Color value)
Sets the inside fill color for annotation object. |
void |
setHeight(int value)
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(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)
Sets a value specifying if annotation objects will be drawn outside the plot area. |
void |
setTag(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)
Sets the Width in pixels for the selected annotation object. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AnnotationObject()
Method Detail |
---|
public void attach(double dx, double dy)
Attaches the annotation object to the chart relative to X and Y Axis values.
This property 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(int)
and setWidth(int)
properties.
The attach(double, double)
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 AnnotationPolygon.setVertices(java.awt.Point[])
property.
dx
- X Axis coordinate value.dy
- Y Axis coordinate value.setHeight(int)
,
setWidth(int)
,
AnnotationPolygon.setVertices(java.awt.Point[])
,
AnnotationPolygon
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 property 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(int)
and setWidth(int)
properties.
The attach(double, double)
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 AnnotationPolygon.setVertices(java.awt.Point[])
property.
horizontalAlignment
- Horizontal string alignment.dx
- X Axis coordinate value.verticalAlignment
- Vertical string alignment.dy
- Y Axis coordinate value.setHeight(int)
,
setWidth(int)
,
AnnotationPolygon.setVertices(java.awt.Point[])
,
AnnotationPolygon
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 property 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(int)
and setWidth(int)
properties.
The attach(double, double)
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 AnnotationPolygon.setVertices(java.awt.Point[])
property.
dxLeft
- Left X Axis coordinate value.dyTop
- Top Y Axis coordinate value.dxRight
- Right X Axis coordinate value.dyBottom
- Bottom Y Axis coordinate value.setHeight(int)
,
setWidth(int)
,
AnnotationPolygon.setVertices(java.awt.Point[])
,
AnnotationPolygon
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(double, double)
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.
attach(double, double)
public void dispose()
Releases all resources used by the current instance of a selected object.
Calling Dispose allows the resources used by the Timer to be reallocated for other purposes. For more information about Dispose, see Cleaning Up Unmanaged Resources in the Java API Documentation.
AnnotationObject
public void flip(boolean horizontal)
Allows you to flip an object horizontally or vertically.
Flip orientation:
True
- Flips annotation object horizontally.
False
- Flips annotation object vertically.
Annotation objects can also be rotated with the rotate(boolean)
method.
horizontal
- Specifies horizontal or vertical flip.rotate(boolean)
public EnumSet<AnchorStyles> getAnchor()
Gets the Anchor. For more detail see setAnchor(java.util.EnumSet
.
public Line getBorder()
Gets the Border. For more detail see setBorder(com.softwarefx.chartfx.server.Line)
.
public Color getColor()
Gets the Color. For more detail see setColor(java.awt.Color)
.
public int getHeight()
Gets the Height. For more detail see setHeight(int)
.
public int getLeft()
Gets the Left. For more detail see setLeft(int)
.
public Link getLink()
Gets the Link object for a selected AnnotationObject item.
Developers may obtain the Link object for an annotation item using this property. Using the supported Link
Class
members, developers may configure a Link.setUrl(java.lang.String)
and Link.setTarget(java.lang.String)
for the object.
Link.setUrl(java.lang.String)
,
Link.setTarget(java.lang.String)
,
Link
public Rectangle getObjectBounds()
Gets the ObjectBounds. For more detail see setObjectBounds(java.awt.Rectangle)
.
public HatchStyle getPattern()
Gets the Pattern. For more detail see setPattern(com.softwarefx.HatchStyle)
.
public Object getTag()
Gets the Tag. For more detail see setTag(java.lang.Object)
.
public int getTop()
Gets the Top. For more detail see setTop(int)
.
public int getWidth()
Gets the Width. For more detail see setWidth(int)
.
public boolean isAllowModify()
Gets the AllowModify. For more detail see setAllowModify(boolean)
.
public boolean isAllowMove()
Gets the AllowMove. For more detail see setAllowMove(boolean)
.
public boolean isPaintBefore()
Gets the PaintBefore. For more detail see setPaintBefore(boolean)
.
public boolean isPlotAreaOnly()
Gets the PlotAreaOnly. For more detail see setPlotAreaOnly(boolean)
.
public boolean isVisible()
Gets the Visible. For more detail see setVisible(boolean)
.
public void refresh()
Instructs Chart FX to repaint the selected annotation object.
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.
public void rotate(boolean clockWise)
Allows you to rotate an object 90 degrees clockwise or counterclockwise.
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(boolean)
method to flip objects horizontally and vertically.
clockWise
- Boolean specifying rotation direction.flip(boolean)
public void setAllowModify(boolean value)
Used to allow or prevent the user from changing object attributes from the User Interface.
Whenever you add an annotation object in the chart area with the annotation list Annotations.setEnableUI(boolean)
, the user may double-click the object and change its properties. Set this property to False if you do not want the end user to have access to the object's attributes.
In order for end users to interact with annotation objects created programmatically, you must set the Annotations.setEnableUI(boolean)
property for the annotation list object to True.
This property controls only visual attributes of the object. If you do not want the user to be able to move the object, please refer to the setAllowMove(boolean)
property.
setAllowMove(boolean)
,
Annotations.setEnableUI(boolean)
,
Annotations
public void setAllowMove(boolean value)
Used to allow or prevent the user from moving an annotation object in the chart area.
When an annotation object is added to a chart and the Annotation List has been Annotations.setEnableUI(boolean)
, by default the user may click the object and change its position in the chart. If you are highlighting specific markers in the chart with an annotation object, you may want to prevent the user from moving the object to another position. Setting this property to False will prevent the end user from moving the object from its original position.
In order for end users to interact with annotation objects created programmatically, you must set the Annotations.setEnableUI(boolean)
property for the annotation list object to True.
This property controls only the object's position. If you want to prevent the user from changing additional object attributes, please refer to the setAllowModify(boolean)
property.
setAllowModify(boolean)
,
Annotations.setEnableUI(boolean)
,
Annotations
public void setAnchor(EnumSet<AnchorStyles> value)
Sets the Anchor style for the AnnotationObject.
This property is used to set the AnchorStyle for selected annotation object.
Be sure to configure a setHeight(int)
and setWidth(int)
for the annotation objects in the chart, otherwise, they will not be visible.
setHeight(int)
,
setWidth(int)
public void setBorder(Line value)
Allows you to apply border attributes to a selected annotation object.
This property provides access to the supported members of the Line
Class
. Using the supported members you can modify the Line.setColor(java.awt.Color)
, Line.setStyle(com.softwarefx.DashStyle)
, Line.setWidth(int)
, Line.setEndCap(com.softwarefx.LineCap)
and Line.setStartCap(com.softwarefx.LineCap)
of selected line annotation objects.
Line.setColor(java.awt.Color)
,
Line.setStyle(com.softwarefx.DashStyle)
,
Line.setWidth(int)
,
Line.setEndCap(com.softwarefx.LineCap)
,
Line.setStartCap(com.softwarefx.LineCap)
,
Line
public void setColor(Color value)
Sets the inside fill color for annotation object.
When working with Arrow annotation objects, this property controls the color of the arrow head and tail. The Line.setColor(java.awt.Color)
property of the Line
Class
is used in conjunction with the setBorder(com.softwarefx.chartfx.server.Line)
property to modify the line color of the arrow.
For more information regarding the Color type, please refer to the Java API Documentation.
Line.setColor(java.awt.Color)
,
Line
public void setHeight(int value)
Sets the height in pixels for the selected annotation object.
Important note: It is very important to set the Height and setWidth(int)
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(double, double)
method can be used instead of setting these properties, see next remark.)
When you call the attach(double, double)
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 property 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 Width property to point the line or arrow correctly.
setWidth(int)
,
attach(double, double)
public void setLeft(int value)
Allows you to specify or read the left position of a selected annotation object.
This property should be used in conjunction with the setTop(int)
property to position the object in the chart area. Both the setTop(int)
and Left properties support pixel unit configuration.
The Chart Origin, coordinates (0,0), is always located at the top-left corner of the chart area.
The attach(double, double)
method may also be used to attach an annotation object to a chart based on X and Y Axis values.
setTop(int)
,
attach(double, double)
public void setObjectBounds(Rectangle value)
Allows you to specify the bounds for a selected annotation object.
This property accepts a rectangle type object which you may create with your custom dimensions.
attach(double, double)
public void setPaintBefore(boolean value)
Configures the selected annotation object to paint before the rest of the chart elements.
Setting this property to True will instruct Chart FX to paint the selected annotation object before other chart elements.
refresh()
,
AnnotationObject
public void setPattern(HatchStyle value)
Allows you to set a pattern for the selected annotation object.
This property exposes the supported pattern styles included in the HatchStyle type.
For more information regarding the HatchStyle type, please refer to the Java API Documentation.
setColor(java.awt.Color)
,
setHeight(int)
,
setWidth(int)
,
attach(double, double)
,
Annotations
public void setPlotAreaOnly(boolean value)
Sets a value specifying if annotation objects will be drawn outside the plot area.
When set to true, annotation objects will be clipped (cut off) if they extend outside the plot area.
setTop(int)
,
setLeft(int)
,
attach(double, double)
public void setTag(Object value)
Allows you to get or set a unique identifier to the objects you have created in the chart area.
This property is particularly useful when you go through the list of objects and you want each object to have a unique identifier.
The Tag value must be an integer.
public void setTop(int value)
Allows you to specify or read the top position of a selected annotation object.
This property should be used in conjunction with the setLeft(int)
property to position the object in the chart area. Both the Top and setLeft(int)
properties support pixel unit configuration.
The Chart Origin, coordinates (0,0), is always located at the top-left corner of the chart area.
The attach(double, double)
method may also be used to attach an annotation object to a chart based on X and Y Axis values.
setLeft(int)
,
attach(double, double)
public void setVisible(boolean value)
Used to show or hide a selected annotation object in the chart area.
The AnnotationObject Class members are accessible by all supported annotation objects, therefore this property may be used to hide any annotation object in the chart.
When using this property, the Chart
Class
refresh()
method should be called to ensure the the selected object is hidden or shown in the chart area.
refresh()
,
Chart
public void setWidth(int value)
Sets the Width in pixels for the selected annotation object.
Important note: It is very important to set the setHeight(int)
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(double, double)
method can be used instead of setting these properties, see next remark.)
When you call the attach(double, double)
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 property 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 Width property to point the line or arrow correctly.
setHeight(int)
,
attach(double, double)
|
http://www.softwarefx.com | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |