com.ijchart.xychart.shape
Class AbstractTextChartShape

java.lang.Object
  extended by com.ijchart.xychart.shape.AbstractChartShape
      extended by com.ijchart.xychart.shape.AbstractTextChartShape
All Implemented Interfaces:
IChartShapeChangeListener, IChartShape, java.io.Serializable, java.lang.Cloneable, java.util.EventListener
Direct Known Subclasses:
AbstractRectangleTextChartShape

public abstract class AbstractTextChartShape
extends AbstractChartShape
implements java.lang.Cloneable, java.io.Serializable

Title: IJChart

Description: a chart library for the Java(tm) platform.

Abstract class for draw text ChartShape.

Copyright: Copyright (c) 2013

Company:

Version:
1.0
Author:
zhang feng min,shanghai china. Contract me by email.
See Also:
Serialized Form

Field Summary
static TextDirection DEFAULT_TEXT_DIRECTION
           The default text direction.
static HorizontalAlignment DEFAULT_TEXT_HORIZONTAL_ALIGNMENT
           The default text horizontal alignment.
static TextPosition DEFAULT_TEXT_POSITION
           The default text position.
static VerticalAlignment DEFAULT_TEXT_VERTICAL_ALIGNMENT
           The default text vertical alignment.
 
Fields inherited from class com.ijchart.xychart.shape.AbstractChartShape
DEFAULT_DRAW_TYPE, DEFAULT_SHAPE_ID, DEFAULT_VISIBLE, transformedShape
 
Fields inherited from interface com.ijchart.xychart.shape.IChartShape
DEFAULT_BORDER_PAINT, DEFAULT_BORDER_STROKE, DEFAULT_CONTENT_PAINT, DEFAULT_DRAW_BORDER, DEFAULT_FILL_ALPHA, DEFAULT_FILL_PAINT, DEFAULT_FILL_SHAPE, DEFAULT_GRADIENT_PAINT_TRANSFORM_TYPE, DEFAULT_MARGIN, DEFAULT_SELECT_FILL_PAINT, DEFAULT_SELECT_RECT_ALPHA, DEFAULT_SELECT_RECT_WIDTH, DEFAULT_SELECTED, DEFAULT_TEXT_FONT, DEFAULT_TOOLTIP_SHAPE_WIDTH, HOTSPOT_TYPE_CIRCLE, HOTSPOT_TYPE_POLYGON, HOTSPOT_TYPE_RECTANGLE
 
Constructor Summary
protected AbstractTextChartShape()
           No argument constructor.
 
Method Summary
 java.lang.Object clone()
           Creates and returns a copy of this object.
 boolean equals(java.lang.Object obj)
           Indicates whether some other object is "equal to" this one.
 java.lang.String getText()
           Returns the text.
 TextDirection getTextDirection()
           Returns the text direction.
 java.awt.Font getTextFont()
           Returns the text font.
 HorizontalAlignment getTextHorizontalAlign()
           Returns the text horizontal alignment.
 java.awt.Paint getTextPaint()
           Get the ChartShape text Paint.
 TextPosition getTextPosition()
           Returns the text position.
 VerticalAlignment getTextVerticalAlign()
           Returns the text vertical alignment.
 int hashCode()
           Returns a hash code value for the object.
 boolean isDrawText()
           Returns a flag that controls whether or not the text is drawn.
 void setDrawText(boolean flag)
           Sets a flag that controls whether or not the text is drawn and sends a ChartShapeChangeEvent to all registered listeners.
 void setText(java.lang.String text)
           Sets the text,and sends a ChartShapeChangeEvent to all registered listeners.
 void setTextDirection(TextDirection direction)
           Sets the text direction and sends a ChartShapeChangeEvent to all registered listeners.
 void setTextFont(java.awt.Font font)
           Sets the text font and sends a ChartShapeChangeEvent to all registered listeners.
 void setTextHorizontalAlign(HorizontalAlignment horizontalAlign)
           Sets the text horizontal alignment and sends a ChartShapeChangeEvent to all registered listeners.
 void setTextPaint(java.awt.Paint paint)
           Sets the shape text Paint and sends a ChartShapeChangeEvent to all registered listeners.
 void setTextPosition(TextPosition position)
           Sets the text position and sends a ChartShapeChangeEvent to all registered listeners.
 void setTextVerticalAlign(VerticalAlignment verticalAlign)
           Sets the text vertical alignment and sends a ChartShapeChangeEvent to all registered listeners.
 
Methods inherited from class com.ijchart.xychart.shape.AbstractChartShape
addChangeListener, afterDraw, beforeDraw, calculateTransformedShape, chartShapeChanged, contains, contains, drawAnchorByPoints, drawBackground, drawBorder, drawSelect, drawShapeBorder, fillShape, fireChartShapeChanged, forceChartShapeChanged, getBorderPaint, getBorderStroke, getBound, getData, getFillAlpha, getFillPaint, getGradientPaintTransformType, getHotspotPolyCoords, getHotspotShape, getHotspotType, getHotspotType, getId, getLockPoint, getMargin, getOriginTooltipShape, getRotate, getSelectAnchorPaint, getSelectRectAlpha, getSelectRectWidth, getShapeChange, getShapeDrawType, getTooltipShape, getTooltipShapeRotate, getTooltipShapeTranslatePoint, getTooltipText, getURL, hasListener, isDrawBorder, isFillShape, isSelected, isVisible, notifyListeners, removeAllChangeListener, removeChangeListener, setBorderPaint, setBorderStroke, setData, setDrawBorder, setFillAlpha, setFillPaint, setFillShape, setGradientPaintTransformType, setId, setMargin, setOriginTooltipShape, setRotate, setSelectAnchorPaint, setSelected, setSelectRectAlpha, setSelectRectWidth, setShapeChange, setShapeDrawType, setTooltipText, setURL, setVisible
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ijchart.xychart.shape.IChartShape
draw, getShapeType, getTopLeftPoint, translate
 

Field Detail

DEFAULT_TEXT_HORIZONTAL_ALIGNMENT

public static final HorizontalAlignment DEFAULT_TEXT_HORIZONTAL_ALIGNMENT
The default text horizontal alignment.


DEFAULT_TEXT_VERTICAL_ALIGNMENT

public static final VerticalAlignment DEFAULT_TEXT_VERTICAL_ALIGNMENT
The default text vertical alignment.


DEFAULT_TEXT_POSITION

public static final TextPosition DEFAULT_TEXT_POSITION
The default text position.


DEFAULT_TEXT_DIRECTION

public static final TextDirection DEFAULT_TEXT_DIRECTION
The default text direction.

Constructor Detail

AbstractTextChartShape

protected AbstractTextChartShape()
No argument constructor.

Method Detail

setTextPaint

public void setTextPaint(java.awt.Paint paint)
Sets the shape text Paint and sends a ChartShapeChangeEvent to all registered listeners.

Parameters:
paint - Paint The ChartShape text Paint(null not permitted).

getTextPaint

public java.awt.Paint getTextPaint()
Get the ChartShape text Paint.

Returns:
Paint The text Paint.

setDrawText

public void setDrawText(boolean flag)
Sets a flag that controls whether or not the text is drawn and sends a ChartShapeChangeEvent to all registered listeners.

Parameters:
flag - boolean

isDrawText

public boolean isDrawText()
Returns a flag that controls whether or not the text is drawn.

Returns:
boolean

getText

public java.lang.String getText()
Returns the text.

Returns:
String The text,maybe null.

getTextFont

public java.awt.Font getTextFont()
Returns the text font.

Returns:
Font

getTextHorizontalAlign

public HorizontalAlignment getTextHorizontalAlign()
Returns the text horizontal alignment.

Returns:
HorizontalAlignment The text horizontal alignment.

setTextHorizontalAlign

public void setTextHorizontalAlign(HorizontalAlignment horizontalAlign)
Sets the text horizontal alignment and sends a ChartShapeChangeEvent to all registered listeners.

Parameters:
horizontalAlign - HorizontalAlignment The text horizontal alignment (null not permitted).

getTextVerticalAlign

public VerticalAlignment getTextVerticalAlign()
Returns the text vertical alignment.

Returns:
VerticalAlignment The text vertical alignment.

setTextVerticalAlign

public void setTextVerticalAlign(VerticalAlignment verticalAlign)
Sets the text vertical alignment and sends a ChartShapeChangeEvent to all registered listeners.

Parameters:
verticalAlign - VerticalAlignment The text vertical alignment (null not permitted).

setText

public void setText(java.lang.String text)
Sets the text,and sends a ChartShapeChangeEvent to all registered listeners.

Parameters:
text - String The text (null permitted).

setTextFont

public void setTextFont(java.awt.Font font)
Sets the text font and sends a ChartShapeChangeEvent to all registered listeners.

Parameters:
font - Font The text font (null not permitted).

setTextPosition

public void setTextPosition(TextPosition position)
Sets the text position and sends a ChartShapeChangeEvent to all registered listeners.

Parameters:
position - TextPosition The text position (null not permitted).

getTextPosition

public TextPosition getTextPosition()
Returns the text position.

Returns:
TextPosition The text position.

getTextDirection

public TextDirection getTextDirection()
Returns the text direction.

Returns:
TextDirection The labe direction (never null).

setTextDirection

public void setTextDirection(TextDirection direction)
Sets the text direction and sends a ChartShapeChangeEvent to all registered listeners.

Parameters:
direction - TextDirection The text direction (null not permitted).

hashCode

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

Overrides:
hashCode in class AbstractChartShape
Returns:
int A hash code value for this object.

equals

public boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.

Overrides:
equals in class AbstractChartShape
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Creates and returns a copy of this object.

Overrides:
clone in class AbstractChartShape
Returns:
object a clone of this instance.
Throws:
java.lang.CloneNotSupportedException - if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.