org.jfree.chart.axis

Class CategoryLabelPosition

public class CategoryLabelPosition extends Object implements Serializable

The attributes that control the position of the labels for the categories on a CategoryAxis. Instances of this class are immutable and other JFreeChart classes rely upon this.
Constructor Summary
CategoryLabelPosition()
Creates a new position record with default settings.
CategoryLabelPosition(RectangleAnchor categoryAnchor, TextBlockAnchor labelAnchor)
Creates a new category label position record.
CategoryLabelPosition(RectangleAnchor categoryAnchor, TextBlockAnchor labelAnchor, CategoryLabelWidthType widthType, float widthRatio)
Creates a new category label position record.
CategoryLabelPosition(RectangleAnchor categoryAnchor, TextBlockAnchor labelAnchor, TextAnchor rotationAnchor, double angle, CategoryLabelWidthType widthType, float widthRatio)
Creates a new position record.
Method Summary
booleanequals(Object obj)
Tests this instance for equality with an arbitrary object.
doublegetAngle()
Returns the angle of rotation for the label.
RectangleAnchorgetCategoryAnchor()
Returns the item label anchor.
TextBlockAnchorgetLabelAnchor()
Returns the text block anchor.
TextAnchorgetRotationAnchor()
Returns the rotation anchor point.
floatgetWidthRatio()
Returns the ratio used to calculate the maximum category label width.
CategoryLabelWidthTypegetWidthType()
Returns the width calculation type.
inthashCode()
Returns a hash code for this object.

Constructor Detail

CategoryLabelPosition

public CategoryLabelPosition()
Creates a new position record with default settings.

CategoryLabelPosition

public CategoryLabelPosition(RectangleAnchor categoryAnchor, TextBlockAnchor labelAnchor)
Creates a new category label position record.

Parameters: categoryAnchor the category anchor (null not permitted). labelAnchor the label anchor (null not permitted).

CategoryLabelPosition

public CategoryLabelPosition(RectangleAnchor categoryAnchor, TextBlockAnchor labelAnchor, CategoryLabelWidthType widthType, float widthRatio)
Creates a new category label position record.

Parameters: categoryAnchor the category anchor (null not permitted). labelAnchor the label anchor (null not permitted). widthType the width type (null not permitted). widthRatio the maximum label width as a percentage (of the category space or the range space).

CategoryLabelPosition

public CategoryLabelPosition(RectangleAnchor categoryAnchor, TextBlockAnchor labelAnchor, TextAnchor rotationAnchor, double angle, CategoryLabelWidthType widthType, float widthRatio)
Creates a new position record. The item label anchor is a point relative to the data item (dot, bar or other visual item) on a chart. The item label is aligned by aligning the text anchor with the item label anchor.

Parameters: categoryAnchor the category anchor (null not permitted). labelAnchor the label anchor (null not permitted). rotationAnchor the rotation anchor (null not permitted). angle the rotation angle (null not permitted). widthType the width type (null not permitted). widthRatio the maximum label width as a percentage (of the category space or the range space).

Method Detail

equals

public boolean equals(Object obj)
Tests this instance for equality with an arbitrary object.

Parameters: obj the object (null permitted).

Returns: A boolean.

getAngle

public double getAngle()
Returns the angle of rotation for the label.

Returns: The angle (in radians).

getCategoryAnchor

public RectangleAnchor getCategoryAnchor()
Returns the item label anchor.

Returns: The item label anchor (never null).

getLabelAnchor

public TextBlockAnchor getLabelAnchor()
Returns the text block anchor.

Returns: The text block anchor (never null).

getRotationAnchor

public TextAnchor getRotationAnchor()
Returns the rotation anchor point.

Returns: The rotation anchor point (never null).

getWidthRatio

public float getWidthRatio()
Returns the ratio used to calculate the maximum category label width.

Returns: The ratio.

getWidthType

public CategoryLabelWidthType getWidthType()
Returns the width calculation type.

Returns: The width calculation type (never null).

hashCode

public int hashCode()
Returns a hash code for this object.

Returns: A hash code.

Copyright © 2000-2009 by Object Refinery Limited. All Rights Reserved.