|
Chart FX for Java 6.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSoftwareFX.ChartFX.Annotation.AnnotationObject
SoftwareFX.ChartFX.Annotation.AnnotationGroup
Provides access to the AnnotationGroup object.
The AnnotationGroup class allows you to group individual annotation objects together. Because the group object exposes all the common properties, you can change visual attributes of objects in a group with just one property call. For example, if you create a group of 10 circles, you can change the background color of all circles by invoking the AnnotationObject.setColor(java.awt.Color)
property. The AnnotationListBase class exposes members that allow you to AnnotationListBase.add(java.lang.Object)
, AnnotationListBase.remove(int)
and Count objects in a group.
To create a group, first create an annotation extension object. Once you have created and added the extension object to your application you may begin creating the individual objects to be included in the group and the group object itself. Once you have created all the objects, you must add the individual objects to the group and the group to the annotation list.
Below is an example of creating a group of 3 circles:
SoftwareFX.ChartFX.Annotation.AnnotationX annot = new SoftwareFX.ChartFX.Annotation.AnnotationX();
chart1.getExtensions().add(annot);
SoftwareFX.ChartFX.Annotation.AnnotationCircle circle1 = new SoftwareFX.ChartFX.Annotation.AnnotationCircle();
circle1.setHeight(30);
circle1.setWidth(30);
circle1.getBorder().setColor(java.awt.Color.BLACK);
circle1.attach(1, 50);
SoftwareFX.ChartFX.Annotation.AnnotationCircle circle2 = new SoftwareFX.ChartFX.Annotation.AnnotationCircle();
circle2.setHeight(30);
circle2.setWidth(30);
circle2.getBorder().setColor(java.awt.Color.BLACK);
circle2.attach(2, 50);
SoftwareFX.ChartFX.Annotation.AnnotationCircle circle3 = new SoftwareFX.ChartFX.Annotation.AnnotationCircle();
circle3.setHeight(30);
circle3.setWidth(30);
circle3.getBorder().setColor(java.awt.Color.BLACK);
circle3.attach(3, 50);
SoftwareFX.ChartFX.Annotation.AnnotationGroup group = new SoftwareFX.ChartFX.Annotation.AnnotationGroup();
annot.getList().add(group);
group.getList().add(circle1);
group.getList().add(circle2);
group.getList().add(circle3);
group.setPattern(HatchStyle.DARKUPWARDDIAGONAL);
group.setColor(java.awt.Color.YELLOW);
group.recalcBounds();
Constructor Summary | |
AnnotationGroup()
|
|
AnnotationGroup(AnnotationObject annotationObjects)
|
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(int horizontalAlignment,
double dx,
int 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 |
flip(boolean horizontal)
Allows you to flip an object horizontally or vertically. |
int |
getAnchor()
Gets or sets the Anchor style for the AnnotationObject. |
Line |
getBorder()
Allows you to apply border attributes to a selected annotation group. |
java.awt.Color |
getColor()
Sets the inside fill color for the objects included in an annotation group. |
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. |
Link |
getLink()
Gets the Link object for a selected AnnotationObject item. |
AnnotationListBase |
getList()
Allows you to access the CollectionBase members used modify the annotation group. |
AnnotationObject |
getList(int n)
Deprecated. You should use instead. |
java.awt.Rectangle |
getObjectBounds()
Allows you to specify the bounds for a selected annotation object. |
int |
getPattern()
Used to set a pattern style for a group of annotation objects. |
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. |
java.lang.String |
getURL()
Deprecated. You should use AnnotationGroup.getLink().getUrl instead. |
java.lang.String |
getURLTarget()
Deprecated. You should use AnnotationGroup.getLink().getTarget instead. |
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 |
isDrawingArea()
Allows the AnnotationObject margins to go outside of the chart's drawing area. |
boolean |
isPaintBefore()
Configures the selected annotation object to paint before the rest of the chart elements. |
boolean |
isVisible()
Used to show or hide a selected annotation object in the chart area. |
void |
recalcBounds()
Used to recalculate the bounding rectangle for a group of objects. |
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(int value)
Gets or sets the Anchor style for the AnnotationObject. |
void |
setBorder(Line value)
Allows you to apply border attributes to a selected annotation group. |
void |
setColor(java.awt.Color value)
Sets the inside fill color for the objects included in an annotation group. |
void |
setDrawingArea(boolean value)
Allows the AnnotationObject margins to go outside of the chart's drawing area. |
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(int value)
Used to set a pattern style for a group of annotation objects. |
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 |
setURL(java.lang.String value)
Deprecated. You should use AnnotationGroup.getLink().setUrl instead. |
void |
setURLTarget(java.lang.String value)
Deprecated. You should use AnnotationGroup.getLink().setTarget instead. |
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. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AnnotationGroup()
public AnnotationGroup(AnnotationObject annotationObjects)
Method Detail |
public void attach(int horizontalAlignment, double dx, int 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 AnnotationObject.setHeight(int)
and AnnotationObject.setWidth(int)
properties.
The AnnotationObject.attach(int, double, int, 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.
attach
in class AnnotationObject
dx
- X Axis coordinate value.dy
- Y Axis coordinate value.horizontalAlignment
- Horizontal string alignment.verticalAlignment
- Vertical string alignment.AnnotationObject.setHeight(int)
,
AnnotationObject.setWidth(int)
,
AnnotationPolygon.setVertices(java.awt.Point[])
,
AnnotationPolygon
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 AnnotationObject.setHeight(int)
and AnnotationObject.setWidth(int)
properties.
The AnnotationObject.attach(int, double, int, 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.
attach
in class AnnotationObject
dx
- X Axis coordinate value.dy
- Y Axis coordinate value.AnnotationObject.setHeight(int)
,
AnnotationObject.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 AnnotationObject.setHeight(int)
and AnnotationObject.setWidth(int)
properties.
The AnnotationObject.attach(int, double, int, 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.
attach
in class AnnotationObject
dxLeft
- Left X Axis coordinate value.dyTop
- Top Y Axis coordinate value.dxRight
- Right X Axis coordinate value.dyBottom
- Bottom Y Axis coordinate value.AnnotationObject.setHeight(int)
,
AnnotationObject.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 AnnotationObject.attach(int, double, int, 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.
detach
in class AnnotationObject
AnnotationObject.attach(int, double, int, double)
public void flip(boolean horizontal)
Allows you to flip an object horizontally or vertically.
True: Flips annotation object horizontally, False: Flips annotation object vertically.
Annotation objects can also be rotated with the AnnotationObject.rotate(boolean)
method.
flip
in class AnnotationObject
horizontal
- Specifies horizontal or vertical flip.AnnotationObject.rotate(boolean)
public int getAnchor()
Gets or sets the Anchor style for the AnnotationObject.
AnchorStyles :
Specifies how an object anchors to the edges of its container.Value | Description |
BOTTOM | The object is anchored to the bottom edge of its container. |
LEFT | The object is anchored to the left edge of its container. |
NONE | The object is not anchored to any edges of its container. |
RIGHT | The object is anchored to the right edge of its container. |
TOP | The object is anchored to the top edge of its container. |
This property is used to set the AnchorStyle for selected annotation object.
Be sure to configure a AnnotationObject.setHeight(int)
and AnnotationObject.setWidth(int)
for the annotation objects in the chart, otherwise, they will not be visible.
getAnchor
in class AnnotationObject
AnnotationObject.setHeight(int)
,
AnnotationObject.setWidth(int)
public Line getBorder()
Allows you to apply border attributes to a selected annotation group.
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(int)
, Line.setWidth(int)
, Line.setEndCap(int)
and Line.setStartCap(int)
of selected line annotation group.
getBorder
in class AnnotationObject
Line.setColor(java.awt.Color)
,
Line.setStyle(int)
,
Line.setWidth(int)
,
Line.setEndCap(int)
,
Line.setStartCap(int)
,
Line
public java.awt.Color getColor()
Sets the inside fill color for the objects included in an annotation group.
When setting this property for an annotation group, all objects included in the group will be set the configured color of this property. The border of the annotation objects can be modified using the setBorder(SoftwareFX.ChartFX.Annotation.Line)
property.Line.setColor(java.awt.Color)
Line
For more information regarding the Color type, please refer to the Java API Documentation.
getColor
in class AnnotationObject
Line.setColor(java.awt.Color)
,
setBorder(SoftwareFX.ChartFX.Annotation.Line)
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 AnnotationObject.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 AnnotationObject.attach(int, double, int, double)
method can be used instead of setting these properties, see next remark.)
When you call the AnnotationObject.attach(int, double, int, 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.
getHeight
in class AnnotationObject
AnnotationObject.setWidth(int)
,
AnnotationObject.attach(int, double, int, double)
public int getLeft()
Allows you to specify or read the left position of a selected annotation object.
This property should be used in conjunction with the AnnotationObject.setTop(int)
property to position the object in the chart area. Both the AnnotationObject.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 AnnotationObject.attach(int, double, int, double)
method may also be used to attach an annotation object to a chart based on X and Y Axis values.
getLeft
in class AnnotationObject
AnnotationObject.setTop(int)
,
AnnotationObject.attach(int, double, int, double)
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.
getLink
in class AnnotationObject
Link.setUrl(java.lang.String)
,
Link.setTarget(java.lang.String)
,
Link
public AnnotationObject getList(int n)
instead.
public AnnotationListBase getList()
Allows you to access the CollectionBase members used modify the annotation group.
This property exposes the supported members of the AnnotationListBase class. The supported members include AnnotationListBase.add(java.lang.Object)
, AnnotationListBase.contains(java.lang.Object)
, AnnotationListBase#insert
, AnnotationListBase.remove(int)
and AnnotationListBase.getItem(int)
.
Creating an annotation group allows you to control attributes for all the objects included in the list with one property assignment to the group.
AnnotationListBase.getItem(int)
,
AnnotationListBase.add(java.lang.Object)
,
AnnotationListBase.contains(java.lang.Object)
,
AnnotationListBase#insert
,
AnnotationListBase.remove(int)
,
AnnotationObject
,
AnnotationX
public java.awt.Rectangle getObjectBounds()
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.
getObjectBounds
in class AnnotationObject
AnnotationObject.attach(int, double, int, double)
public int getPattern()
Used to set a pattern style for a group of annotation objects.
HatchStyle :
Specifies the different hatch patterns available.Value | Description |
BACKWARD_DIAGONAL | A pattern of lines on a diagonal from upper right to lower left. |
CROSS | Specifies horizontal and vertical lines that cross. |
DARK_DOWNWARD_DIAGONAL | Specifies diagonal lines that slant to the right from top points to bottom points, are spaced 50 percent closer together than, and are twice the width of ForwardDiagonal. This hatch pattern is not antialiased. |
DARK_HORIZONTAL | Specifies horizontal lines that are spaced 50 percent closer together than Horizontal and are twice the width of HatchStyleHorizontal. |
DARK_UPWARD_DIAGONAL | Specifies diagonal lines that slant to the left from top points to bottom points, are spaced 50 percent closer together than BackwardDiagonal, and are twice its width, but the lines are not antialiased. |
DARK_VERTICAL | Specifies vertical lines that are spaced 50 percent closer together than Vertical and are twice its width. |
DASHED_DOWNWARD_DIAGONAL | Specifies dashed diagonal lines, that slant to the right from top points to bottom points. |
DASHED_HORIZONTAL | Specifies dashed horizontal lines. |
DASHED_UPWARD_DIAGONAL | Specifies dashed diagonal lines, that slant to the left from top points to bottom points. |
DASHED_VERTICAL | Specifies dashed vertical lines. |
DIAGONAL_BRICK | Specifies a hatch that has the appearance of layered bricks that slant to the left from top points to bottom points. |
DIAGONAL_CROSS | Specifies forward diagonal and backward diagonal lines that cross. The lines are antialiased. |
DIVOT | Specifies a hatch that has the appearance of divots. |
DOTTED_DIAMOND | Specifies forward diagonal and backward diagonal lines, each of which is composed of dots, that cross. |
DOTTED_GRID | Specifies horizontal and vertical lines, each of which is composed of dots, that cross. |
FORWARD_DIAGONAL | A pattern of lines on a diagonal from upper left to lower right. |
HORIZONTAL | A pattern of horizontal lines. |
HORIZONTAL_BRICK | Specifies a hatch that has the appearance of horizontally layered bricks. |
LARGE_CHECKER_BOARD | Specifies a hatch that has the appearance of a checkerboard with squares that are twice the size of SmallCheckerBoard. |
LARGE_CONFETTI | Specifies a hatch that has the appearance of confetti, and is composed of larger pieces than SmallConfetti. |
LARGE_GRID | Specifies the hatch style Cross. |
LIGHT_DOWNWARD_DIAGONAL | Specifies diagonal lines that slant to the right from top points to bottom points and are spaced 50 percent closer together than DownwardDiagonal, but they are not antialiased. |
LIGHT_HORIZONTAL | Specifies horizontal lines that are spaced 50 percent closer together than Horizontal. |
LIGHT_UPWARD_DIAGONAL | Specifies diagonal lines that slant to the left from top points to bottom points and are spaced 50 percent closer together than BackwardDiagonal, but they are not antialiased. |
LIGHT_VERTICAL | Specifies vertical lines that are spaced 50 percent closer together than Vertical. |
MAX | Specifies hatch style SolidDiamond. |
MIN | Specifies hatch style Horizonal. |
NARROW_HORIZONTAL | Specifies horizontal lines that are spaced 75 percent closer together than hatch style Horizontal (or 25 percent closer together than LightHorizontal). |
NARROW_VERTICAL | Specifies vertical lines that are spaced 75 percent closer together than hatch style Vertical (or 25 percent closer together than LightVertical). |
OUTLINED_DIAMOND | Specifies forward diagonal and backward diagonal lines that cross but are not antialiased. |
PERCENT_05 | Specifies a 5-percent hatch. The ratio of foreground color to background color is 5:100. |
PERCENT_10 | Specifies a 10-percent hatch. The ratio of foreground color to background color is 10:100. |
PERCENT_20 | Specifies a 20-percent hatch. The ratio of foreground color to background color is 20:100. |
PERCENT_25 | Specifies a 25-percent hatch. The ratio of foreground color to background color is 25:100. |
PERCENT_30 | Specifies a 30-percent hatch. The ratio of foreground color to background color is 30:100. |
PERCENT_40 | Specifies a 40-percent hatch. The ratio of foreground color to background color is 40:100. |
PERCENT_50 | Specifies a 50-percent hatch. The ratio of foreground color to background color is 50:100. |
PERCENT_60 | Specifies a 60-percent hatch. The ratio of foreground color to background color is 60:100. |
PERCENT_70 | Specifies a 70-percent hatch. The ratio of foreground color to background color is 70:100. |
PERCENT_75 | Specifies a 75-percent hatch. The ratio of foreground color to background color is 75:100. |
PERCENT_80 | Specifies a 80-percent hatch. The ratio of foreground color to background color is 80:100. |
PERCENT_90 | Specifies a 90-percent hatch. The ratio of foreground color to background color is 90:100. |
PLAID | Specifies a hatch that has the appearance of a plaid material. |
SHINGLE | Specifies a hatch that has the appearance of diagonally-layered shingles that slant to the right from top points to bottom points. |
SMALL_CHECKER_BOARD | Specifies a hatch that has the appearance of a checkerboard. |
SMALL_CONFETTI | Specifies a hatch that has the appearance of confetti. |
SMALL_GRID | Specifies horizontal and vertical lines that cross and are spaced 50 percent closer together than hatch style Cross. |
SOLID_DIAMOND | Specifies a hatch that has the appearance of a checkerboard placed diagonally. |
SPHERE | Specifies a hatch that has the appearance of spheres laid adjacent to one another. |
TRELLIS | Specifies a hatch that has the appearance of a trellis. |
VERTICAL | A pattern of vertical lines. |
WAVE | Specifies horizontal lines that are composed of tildes. |
WEAVE | Specifies a hatch that has the appearance of a woven material. |
WIDE_DOWNWARD_DIAGONAL | Specifies diagonal lines that slant to the right from top points to bottom points, have the same spacing as hatch style ForwardDiagonal, and are triple its width, but are not antialiased. |
WIDE_UPWARD_DIAGONAL | Specifies diagonal lines that slant to the left from top points to bottom points, have the same spacing as hatch style BackwardDiagonal, and are triple its width, but are not antialiased. |
ZIG_ZAG | Specifies horizontal lines that are composed of zigzags. |
Creating an annotation group allows you to control attributes for all the objects included in the list with one property assignment to the group.
The setBorder(SoftwareFX.ChartFX.Annotation.Line)
and setColor(java.awt.Color)
property allow you to set a border style and color for all the annotation objects in a annotation group.
getPattern
in class AnnotationObject
setBorder(SoftwareFX.ChartFX.Annotation.Line)
,
setColor(java.awt.Color)
public java.lang.Object getTag()
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.
getTag
in class AnnotationObject
public int getTop()
Allows you to specify or read the top position of a selected annotation object.
This property should be used in conjunction with the AnnotationObject.setLeft(int)
property to position the object in the chart area. Both the Top and AnnotationObject.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 AnnotationObject.attach(int, double, int, double)
method may also be used to attach an annotation object to a chart based on X and Y Axis values.
getTop
in class AnnotationObject
AnnotationObject.setLeft(int)
,
AnnotationObject.attach(int, double, int, double)
public java.lang.String getURL()
AnnotationGroup.getLink().getUrl
instead.
getURL
in class AnnotationObject
getLink()
public java.lang.String getURLTarget()
AnnotationGroup.getLink().getTarget
instead.
getURLTarget
in class AnnotationObject
getLink()
public int getWidth()
Gets or Sets the Width in pixels for the selected annotation object.
Important note: It is very important to set the AnnotationObject.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 AnnotationObject.attach(int, double, int, double)
method can be used instead of setting these properties, see next remark.)
When you call the AnnotationObject.attach(int, double, int, 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.
getWidth
in class AnnotationObject
AnnotationObject.setHeight(int)
,
AnnotationObject.attach(int, double, int, double)
public boolean isAllowModify()
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 AnnotationX.setEnabled(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 AnnotationX.setEnabled(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 AnnotationObject.setAllowMove(boolean)
property.
isAllowModify
in class AnnotationObject
AnnotationObject.setAllowMove(boolean)
,
AnnotationX.setEnabled(boolean)
,
AnnotationX
public boolean isAllowMove()
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 AnnotationX.setEnabled(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 AnnotationX.setEnabled(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 AnnotationObject.setAllowModify(boolean)
property.
isAllowMove
in class AnnotationObject
AnnotationObject.setAllowModify(boolean)
,
AnnotationX.setEnabled(boolean)
,
AnnotationX
public boolean isDrawingArea()
Allows the AnnotationObject margins to go outside of the chart's drawing area.
When set to true, Annotation objects will not be displayed outside the chart's plot area. This includes the margins where axis labels are printed.
isDrawingArea
in class AnnotationObject
LegendBoxBase
public boolean isPaintBefore()
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.
isPaintBefore
in class AnnotationObject
AnnotationObject.refresh()
,
AnnotationObject
public boolean isVisible()
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.
isVisible
in class AnnotationObject
AnnotationObject.refresh()
,
Chart
public void recalcBounds()
Used to recalculate the bounding rectangle for a group of objects.
This method should be invoked every time an object is added to a group or when any of the objects contained in a group is resized or moved.
AnnotationListBase.add(java.lang.Object)
,
AnnotationListBase.remove(int)
,
AnnotationObject.refresh()
,
AnnotationObject
,
AnnotationListBase
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.
refresh
in class AnnotationObject
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 AnnotationObject.flip(boolean)
method to flip objects horizontally and vertically.
rotate
in class AnnotationObject
clockWise
- Boolean specifying rotation direction.AnnotationObject.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 AnnotationX.setEnabled(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 AnnotationX.setEnabled(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 AnnotationObject.setAllowMove(boolean)
property.
setAllowModify
in class AnnotationObject
AnnotationObject.setAllowMove(boolean)
,
AnnotationX.setEnabled(boolean)
,
AnnotationX
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 AnnotationX.setEnabled(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 AnnotationX.setEnabled(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 AnnotationObject.setAllowModify(boolean)
property.
setAllowMove
in class AnnotationObject
AnnotationObject.setAllowModify(boolean)
,
AnnotationX.setEnabled(boolean)
,
AnnotationX
public void setAnchor(int value)
Gets or sets the Anchor style for the AnnotationObject.
AnchorStyles :
Specifies how an object anchors to the edges of its container.Value | Description |
BOTTOM | The object is anchored to the bottom edge of its container. |
LEFT | The object is anchored to the left edge of its container. |
NONE | The object is not anchored to any edges of its container. |
RIGHT | The object is anchored to the right edge of its container. |
TOP | The object is anchored to the top edge of its container. |
This property is used to set the AnchorStyle for selected annotation object.
Be sure to configure a AnnotationObject.setHeight(int)
and AnnotationObject.setWidth(int)
for the annotation objects in the chart, otherwise, they will not be visible.
setAnchor
in class AnnotationObject
AnnotationObject.setHeight(int)
,
AnnotationObject.setWidth(int)
public void setBorder(Line value)
Allows you to apply border attributes to a selected annotation group.
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(int)
, Line.setWidth(int)
, Line.setEndCap(int)
and Line.setStartCap(int)
of selected line annotation group.
setBorder
in class AnnotationObject
Line.setColor(java.awt.Color)
,
Line.setStyle(int)
,
Line.setWidth(int)
,
Line.setEndCap(int)
,
Line.setStartCap(int)
,
Line
public void setColor(java.awt.Color value)
Sets the inside fill color for the objects included in an annotation group.
When setting this property for an annotation group, all objects included in the group will be set the configured color of this property. The border of the annotation objects can be modified using the setBorder(SoftwareFX.ChartFX.Annotation.Line)
property.Line.setColor(java.awt.Color)
Line
For more information regarding the Color type, please refer to the Java API Documentation.
setColor
in class AnnotationObject
Line.setColor(java.awt.Color)
,
setBorder(SoftwareFX.ChartFX.Annotation.Line)
public void setDrawingArea(boolean value)
Allows the AnnotationObject margins to go outside of the chart's drawing area.
When set to true, Annotation objects will not be displayed outside the chart's plot area. This includes the margins where axis labels are printed.
setDrawingArea
in class AnnotationObject
LegendBoxBase
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 AnnotationObject.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 AnnotationObject.attach(int, double, int, double)
method can be used instead of setting these properties, see next remark.)
When you call the AnnotationObject.attach(int, double, int, 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
in class AnnotationObject
AnnotationObject.setWidth(int)
,
AnnotationObject.attach(int, double, int, 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 AnnotationObject.setTop(int)
property to position the object in the chart area. Both the AnnotationObject.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 AnnotationObject.attach(int, double, int, double)
method may also be used to attach an annotation object to a chart based on X and Y Axis values.
setLeft
in class AnnotationObject
AnnotationObject.setTop(int)
,
AnnotationObject.attach(int, double, int, double)
public void setObjectBounds(java.awt.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.
setObjectBounds
in class AnnotationObject
AnnotationObject.attach(int, double, int, 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.
setPaintBefore
in class AnnotationObject
AnnotationObject.refresh()
,
AnnotationObject
public void setPattern(int value)
Used to set a pattern style for a group of annotation objects.
HatchStyle :
Specifies the different hatch patterns available.Value | Description |
BACKWARD_DIAGONAL | A pattern of lines on a diagonal from upper right to lower left. |
CROSS | Specifies horizontal and vertical lines that cross. |
DARK_DOWNWARD_DIAGONAL | Specifies diagonal lines that slant to the right from top points to bottom points, are spaced 50 percent closer together than, and are twice the width of ForwardDiagonal. This hatch pattern is not antialiased. |
DARK_HORIZONTAL | Specifies horizontal lines that are spaced 50 percent closer together than Horizontal and are twice the width of HatchStyleHorizontal. |
DARK_UPWARD_DIAGONAL | Specifies diagonal lines that slant to the left from top points to bottom points, are spaced 50 percent closer together than BackwardDiagonal, and are twice its width, but the lines are not antialiased. |
DARK_VERTICAL | Specifies vertical lines that are spaced 50 percent closer together than Vertical and are twice its width. |
DASHED_DOWNWARD_DIAGONAL | Specifies dashed diagonal lines, that slant to the right from top points to bottom points. |
DASHED_HORIZONTAL | Specifies dashed horizontal lines. |
DASHED_UPWARD_DIAGONAL | Specifies dashed diagonal lines, that slant to the left from top points to bottom points. |
DASHED_VERTICAL | Specifies dashed vertical lines. |
DIAGONAL_BRICK | Specifies a hatch that has the appearance of layered bricks that slant to the left from top points to bottom points. |
DIAGONAL_CROSS | Specifies forward diagonal and backward diagonal lines that cross. The lines are antialiased. |
DIVOT | Specifies a hatch that has the appearance of divots. |
DOTTED_DIAMOND | Specifies forward diagonal and backward diagonal lines, each of which is composed of dots, that cross. |
DOTTED_GRID | Specifies horizontal and vertical lines, each of which is composed of dots, that cross. |
FORWARD_DIAGONAL | A pattern of lines on a diagonal from upper left to lower right. |
HORIZONTAL | A pattern of horizontal lines. |
HORIZONTAL_BRICK | Specifies a hatch that has the appearance of horizontally layered bricks. |
LARGE_CHECKER_BOARD | Specifies a hatch that has the appearance of a checkerboard with squares that are twice the size of SmallCheckerBoard. |
LARGE_CONFETTI | Specifies a hatch that has the appearance of confetti, and is composed of larger pieces than SmallConfetti. |
LARGE_GRID | Specifies the hatch style Cross. |
LIGHT_DOWNWARD_DIAGONAL | Specifies diagonal lines that slant to the right from top points to bottom points and are spaced 50 percent closer together than DownwardDiagonal, but they are not antialiased. |
LIGHT_HORIZONTAL | Specifies horizontal lines that are spaced 50 percent closer together than Horizontal. |
LIGHT_UPWARD_DIAGONAL | Specifies diagonal lines that slant to the left from top points to bottom points and are spaced 50 percent closer together than BackwardDiagonal, but they are not antialiased. |
LIGHT_VERTICAL | Specifies vertical lines that are spaced 50 percent closer together than Vertical. |
MAX | Specifies hatch style SolidDiamond. |
MIN | Specifies hatch style Horizonal. |
NARROW_HORIZONTAL | Specifies horizontal lines that are spaced 75 percent closer together than hatch style Horizontal (or 25 percent closer together than LightHorizontal). |
NARROW_VERTICAL | Specifies vertical lines that are spaced 75 percent closer together than hatch style Vertical (or 25 percent closer together than LightVertical). |
OUTLINED_DIAMOND | Specifies forward diagonal and backward diagonal lines that cross but are not antialiased. |
PERCENT_05 | Specifies a 5-percent hatch. The ratio of foreground color to background color is 5:100. |
PERCENT_10 | Specifies a 10-percent hatch. The ratio of foreground color to background color is 10:100. |
PERCENT_20 | Specifies a 20-percent hatch. The ratio of foreground color to background color is 20:100. |
PERCENT_25 | Specifies a 25-percent hatch. The ratio of foreground color to background color is 25:100. |
PERCENT_30 | Specifies a 30-percent hatch. The ratio of foreground color to background color is 30:100. |
PERCENT_40 | Specifies a 40-percent hatch. The ratio of foreground color to background color is 40:100. |
PERCENT_50 | Specifies a 50-percent hatch. The ratio of foreground color to background color is 50:100. |
PERCENT_60 | Specifies a 60-percent hatch. The ratio of foreground color to background color is 60:100. |
PERCENT_70 | Specifies a 70-percent hatch. The ratio of foreground color to background color is 70:100. |
PERCENT_75 | Specifies a 75-percent hatch. The ratio of foreground color to background color is 75:100. |
PERCENT_80 | Specifies a 80-percent hatch. The ratio of foreground color to background color is 80:100. |
PERCENT_90 | Specifies a 90-percent hatch. The ratio of foreground color to background color is 90:100. |
PLAID | Specifies a hatch that has the appearance of a plaid material. |
SHINGLE | Specifies a hatch that has the appearance of diagonally-layered shingles that slant to the right from top points to bottom points. |
SMALL_CHECKER_BOARD | Specifies a hatch that has the appearance of a checkerboard. |
SMALL_CONFETTI | Specifies a hatch that has the appearance of confetti. |
SMALL_GRID | Specifies horizontal and vertical lines that cross and are spaced 50 percent closer together than hatch style Cross. |
SOLID_DIAMOND | Specifies a hatch that has the appearance of a checkerboard placed diagonally. |
SPHERE | Specifies a hatch that has the appearance of spheres laid adjacent to one another. |
TRELLIS | Specifies a hatch that has the appearance of a trellis. |
VERTICAL | A pattern of vertical lines. |
WAVE | Specifies horizontal lines that are composed of tildes. |
WEAVE | Specifies a hatch that has the appearance of a woven material. |
WIDE_DOWNWARD_DIAGONAL | Specifies diagonal lines that slant to the right from top points to bottom points, have the same spacing as hatch style ForwardDiagonal, and are triple its width, but are not antialiased. |
WIDE_UPWARD_DIAGONAL | Specifies diagonal lines that slant to the left from top points to bottom points, have the same spacing as hatch style BackwardDiagonal, and are triple its width, but are not antialiased. |
ZIG_ZAG | Specifies horizontal lines that are composed of zigzags. |
Creating an annotation group allows you to control attributes for all the objects included in the list with one property assignment to the group.
The setBorder(SoftwareFX.ChartFX.Annotation.Line)
and setColor(java.awt.Color)
property allow you to set a border style and color for all the annotation objects in a annotation group.
setPattern
in class AnnotationObject
setBorder(SoftwareFX.ChartFX.Annotation.Line)
,
setColor(java.awt.Color)
public 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.
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.
setTag
in class AnnotationObject
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 AnnotationObject.setLeft(int)
property to position the object in the chart area. Both the Top and AnnotationObject.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 AnnotationObject.attach(int, double, int, double)
method may also be used to attach an annotation object to a chart based on X and Y Axis values.
setTop
in class AnnotationObject
AnnotationObject.setLeft(int)
,
AnnotationObject.attach(int, double, int, double)
public void setURL(java.lang.String value)
AnnotationGroup.getLink().setUrl
instead.
setURL
in class AnnotationObject
getLink()
public void setURLTarget(java.lang.String value)
AnnotationGroup.getLink().setTarget
instead.
setURLTarget
in class AnnotationObject
getLink()
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.
setVisible
in class AnnotationObject
AnnotationObject.refresh()
,
Chart
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 AnnotationObject.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 AnnotationObject.attach(int, double, int, double)
method can be used instead of setting these properties, see next remark.)
When you call the AnnotationObject.attach(int, double, int, 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
in class AnnotationObject
AnnotationObject.setHeight(int)
,
AnnotationObject.attach(int, double, int, double)
|
http://www.softwarefx.com | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |