|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.davisor.graphics.chart.AxisMarker
AxisMarker represents one marker line or area positioned in an
ChartAxis. Markers are used to emphasize a special value on a
coordinate axis. A marker consists of a line, a shape in the other end of
the line, and a label.
An axis marker is positioned on axis by its position attribute.
Every marker needs a position. It is given as String and it is
parsed using the Type of the axis minimum value.
Markers with positions not inside the axis min and max values are not drawn
but they may affect to area filling as well as the following four position
keywords defined in AxisAttributes:
A descriptive label and a special shape can be associated to each marker
line. The label is set by labelText attribute. If no label is
given, the position string is used as label. Use an empty String to get
no label at all.
Value ranges can be emphasized by painting the areas between markers.
That is done by defining two markers so that the one with bigger position
(according to the natural order of the values in the axis) has got a
linePaint. In other words, defining a linePaint
for a marker means that the area between that and the previous marker is
filled with that paint. If there is no previous marker, then the whole
chart background drawing area below the marker defining the paint is filled.
The smallest value of the special 'max' and 'after' values and the values
bigger than the axis maximum defines the upmost filled area paint.
The following rendering attributes can be used to modify the marker's appearance.
ChartAxis| Field Summary | |
protected java.lang.Number |
M_labelRotation
Label rotation |
protected java.lang.String |
M_labelText
Marker label. |
protected java.lang.String |
M_position
Marker position. |
protected MarkerRenderAttributes |
M_render
Marker render attributes. |
| Constructor Summary | |
AxisMarker(AxisMarker am)
Deep copy constructor. |
|
AxisMarker(java.lang.String position)
Creates a new axis marker. |
|
AxisMarker(java.lang.String position,
java.lang.String labelText,
java.lang.Number labelRotation,
MarkerRenderAttributes render)
Creates a new axis marker with all the information. |
|
| Method Summary | |
com.davisor.core.Dupable |
dup()
Duplicates this object. |
boolean |
equals(java.lang.Object object)
Test if this axis equals to given axis. |
DataValue |
getDataValue(Type type)
Returns the position as DataValue. |
java.lang.Number |
getLabelRotation()
Returns the label rotation (radians). |
java.lang.String |
getLabelText()
Returns the set label text. |
java.lang.String |
getPosition()
Returns the position set in construction. |
MarkerRenderAttributes |
getRender()
Returns reference to the render attributes instance. |
int |
hashCode()
|
boolean |
isAbove()
Returns true if the given position is a special value which is above all the data values (that is max or after). |
boolean |
isBelow()
Returns true if the given position is a special value which is below all the data values (that is min or before). |
boolean |
isInfinite()
Returns whether the given position is any of the special positions defined in AxisAttributes (that is
min,max,after,before) or not. |
void |
setLabelRotation(java.lang.Number labelRotation)
Sets the label rotation (radians). |
void |
setLabelText(java.lang.String labelText)
Sets the label text. |
java.lang.String |
toString()
Gets axis marker XML representation. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.lang.String M_position
protected java.lang.String M_labelText
protected MarkerRenderAttributes M_render
protected java.lang.Number M_labelRotation
| Constructor Detail |
public AxisMarker(java.lang.String position)
Sets the position as String.
The value will be interpreted to DataValue using the type of the
MIN value of the axis this marker is associated to.
There is a special value 'Infinity' which will represent
a value above the drawing area. It is useful when you want e.g. to fill
the area above the topmost marker.
public AxisMarker(AxisMarker am)
public AxisMarker(java.lang.String position,
java.lang.String labelText,
java.lang.Number labelRotation,
MarkerRenderAttributes render)
position - marker positionlabelText - marker name (may be null)labelRotation - rotation in radians counter-clockwise (may be null)render - render attributes (may be null)AxisMarker(String)| Method Detail |
public DataValue getDataValue(Type type)
throws InvalidDataException
InvalidDataException - if chart data iteration failsType.toData(String,ParsePosition)public java.lang.String getLabelText()
public java.lang.Number getLabelRotation()
public java.lang.String getPosition()
public MarkerRenderAttributes getRender()
public boolean isInfinite()
AxisAttributes (that is
min,max,after,before) or not.
isBelow(),
isAbove()public boolean isAbove()
isBelow(),
isInfinite()public boolean isBelow()
isAbove(),
isInfinite()public void setLabelText(java.lang.String labelText)
NULL, then the
position value is shown as label.
public void setLabelRotation(java.lang.Number labelRotation)
public com.davisor.core.Dupable dup()
dup in interface com.davisor.core.Dupablepublic boolean equals(java.lang.Object object)
public int hashCode()
public java.lang.String toString()
Strings.toXML(String,Object)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||