| Method from org.jfree.chart.annotations.TextAnnotation Detail: |
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
// now try to reject equality...
if (!(obj instanceof TextAnnotation)) {
return false;
}
TextAnnotation that = (TextAnnotation) obj;
if (!ObjectUtilities.equal(this.text, that.getText())) {
return false;
}
if (!ObjectUtilities.equal(this.font, that.getFont())) {
return false;
}
if (!PaintUtilities.equal(this.paint, that.getPaint())) {
return false;
}
if (!ObjectUtilities.equal(this.textAnchor, that.getTextAnchor())) {
return false;
}
if (!ObjectUtilities.equal(this.rotationAnchor,
that.getRotationAnchor())) {
return false;
}
if (this.rotationAngle != that.getRotationAngle()) {
return false;
}
// seem to be the same...
return true;
}
Tests this object for equality with an arbitrary object. |
public Font getFont() {
return this.font;
}
Returns the font for the annotation. |
public Paint getPaint() {
return this.paint;
}
Returns the paint for the annotation. |
public TextAnchor getRotationAnchor() {
return this.rotationAnchor;
}
Returns the rotation anchor. |
public double getRotationAngle() {
return this.rotationAngle;
}
Returns the rotation angle in radians. |
public String getText() {
return this.text;
}
Returns the text for the annotation. |
public TextAnchor getTextAnchor() {
return this.textAnchor;
}
|
public int hashCode() {
int result = 193;
result = 37 * result + this.font.hashCode();
result = 37 * result + HashUtilities.hashCodeForPaint(this.paint);
result = 37 * result + this.rotationAnchor.hashCode();
long temp = Double.doubleToLongBits(this.rotationAngle);
result = 37 * result + (int) (temp ^ (temp > > > 32));
result = 37 * result + this.text.hashCode();
result = 37 * result + this.textAnchor.hashCode();
return result;
}
Returns a hash code for this instance. |
public void setFont(Font font) {
if (font == null) {
throw new IllegalArgumentException("Null 'font' argument.");
}
this.font = font;
}
Sets the font for the annotation. |
public void setPaint(Paint paint) {
if (paint == null) {
throw new IllegalArgumentException("Null 'paint' argument.");
}
this.paint = paint;
}
Sets the paint for the annotation. |
public void setRotationAnchor(TextAnchor anchor) {
this.rotationAnchor = anchor;
}
Sets the rotation anchor point. |
public void setRotationAngle(double angle) {
this.rotationAngle = angle;
}
Sets the rotation angle. The angle is measured clockwise in radians. |
public void setText(String text) {
if (text == null) {
throw new IllegalArgumentException("Null 'text' argument.");
}
this.text = text;
}
Sets the text for the annotation. |
public void setTextAnchor(TextAnchor anchor) {
if (anchor == null) {
throw new IllegalArgumentException("Null 'anchor' argument.");
}
this.textAnchor = anchor;
}
Sets the text anchor (the point on the text bounding rectangle that is
aligned to the (x, y) coordinate of the annotation). |