|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ijchart.xychart.shape.AbstractChartShape
com.ijchart.xychart.shape.AbstractTextChartShape
com.ijchart.xychart.shape.AbstractRectangleTextChartShape
public abstract class AbstractRectangleTextChartShape
Title: IJChart
Description: a chart library for the Java(tm) platform.
Draw a text inside or outside a Rectangle,with or not have a border.Copyright: Copyright (c) 2013
Company:
Field Summary | |
---|---|
static boolean |
DEFAULT_DRAW_AUTO_WRAP
The default auto wrap. |
static boolean |
DEFAULT_FORCE_INSIDE_TEXT_NO_WRAP
A default boolean flag controls whether or not the inside text is no wrap. |
static boolean |
DEFAULT_FORCE_SHOW_ALL
A default boolean flag controls whether or not draw text even if it's too long to show. |
static int |
DEFAULT_TEXT_MAX_SHOW_LINE
The default maximum number of lines for text (default is all). |
Fields inherited from class com.ijchart.xychart.shape.AbstractTextChartShape |
---|
DEFAULT_TEXT_DIRECTION, DEFAULT_TEXT_HORIZONTAL_ALIGNMENT, DEFAULT_TEXT_POSITION, DEFAULT_TEXT_VERTICAL_ALIGNMENT |
Fields inherited from class com.ijchart.xychart.shape.AbstractChartShape |
---|
DEFAULT_DRAW_TYPE, DEFAULT_SHAPE_ID, DEFAULT_VISIBLE, transformedShape |
Constructor Summary | |
---|---|
protected |
AbstractRectangleTextChartShape(java.awt.geom.Rectangle2D drawArea,
java.lang.String text)
Draw text in area drawArea. |
protected |
AbstractRectangleTextChartShape(java.awt.geom.Rectangle2D drawArea,
java.lang.String text,
java.awt.Font font)
Draw text in area drawArea. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Creates and returns a copy of this object. |
protected void |
drawText(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D area)
Draw text. |
protected void |
drawTextWithTrimMarginRect(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D drawArea)
Draw text on rectangle area. |
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one. |
java.awt.geom.Rectangle2D |
getDrawArea()
Returns the text draw area. |
java.awt.geom.Point2D |
getLockPoint()
Returns the lock coordinates of this shape. |
int |
getTextMaxShowLine()
Returns the maximum number of lines for text. |
protected java.awt.geom.Point2D |
getTooltipShapeTranslatePoint()
Returns the translate point of tooltip shape. |
java.awt.geom.Point2D |
getTopLeftPoint()
Returns the top left corner coordinates of this shape. |
int |
hashCode()
Returns a hash code value for the object. |
boolean |
isAutoWrap()
Returns a boolean flag controls whether or not the string is auto wrap when text can not be drawn in one line. |
boolean |
isForceInsideTextNoWrap()
Returns whether or not the inside text is no wrap. |
boolean |
isForceShowAll()
Returns whether or not draw text even if it's too long to show. |
void |
setAutoWrap(boolean autoWrap)
Sets a boolean flag controls whether or not the string is auto wrap when text can not be drawn in one line,and sends a ChartShapeChangeEvent to all
registered listeners. |
void |
setDrawArea(java.awt.geom.Rectangle2D drawArea)
Sets the text draw area,and sends a ChartShapeChangeEvent
to all registered listeners. |
void |
setForceInsideTextNoWrap(boolean flag)
Sets whether or not the inside text is no wrap,and sends a ChartShapeChangeEvent to all registered listeners. |
void |
setForceShowAllText(boolean flag)
Sets the boolean flag whether or not draw text even if it's too long to show,and sends a ChartShapeChangeEvent to all registered listeners. |
void |
setTextMaxShowLine(int textMaxShowLine)
Sets the maximum number of lines for text,and sends a ChartShapeChangeEvent to all registered listeners. |
protected java.lang.String[] |
splitString(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D area)
Split a line to multiple line for drawing in the canvas. |
java.lang.String |
toString()
Returns a string representation of the object. |
void |
translate(double tx,
double ty)
Concatenates the current Graphics2D Transform with a translation transform.and sends a ChartShapeChangeEvent to all registered listeners. |
Methods inherited from class com.ijchart.xychart.shape.AbstractTextChartShape |
---|
getText, getTextDirection, getTextFont, getTextHorizontalAlign, getTextPaint, getTextPosition, getTextVerticalAlign, isDrawText, setDrawText, setText, setTextDirection, setTextFont, setTextHorizontalAlign, setTextPaint, setTextPosition, setTextVerticalAlign |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.ijchart.xychart.shape.IChartShape |
---|
draw, getShapeType |
Field Detail |
---|
public static final boolean DEFAULT_DRAW_AUTO_WRAP
public static final int DEFAULT_TEXT_MAX_SHOW_LINE
public static final boolean DEFAULT_FORCE_INSIDE_TEXT_NO_WRAP
public static final boolean DEFAULT_FORCE_SHOW_ALL
Constructor Detail |
---|
protected AbstractRectangleTextChartShape(java.awt.geom.Rectangle2D drawArea, java.lang.String text)
drawArea
- Rectangle2D
The draw area (null not permitted).text
- String
The text (null permitted).protected AbstractRectangleTextChartShape(java.awt.geom.Rectangle2D drawArea, java.lang.String text, java.awt.Font font)
drawArea
- Rectangle2D
The draw area (null not permitted).text
- String
The text (null permitted).font
-
The specified font (null permitted).If font is null,
IChartShape.DEFAULT_TEXT_FONT
is used.Method Detail |
---|
public java.awt.geom.Rectangle2D getDrawArea()
public void setDrawArea(java.awt.geom.Rectangle2D drawArea)
ChartShapeChangeEvent
to all registered listeners.
drawArea
- Rectangle2D
The text draw area (null not permitted).public boolean isAutoWrap()
public void setAutoWrap(boolean autoWrap)
ChartShapeChangeEvent
to all
registered listeners.
autoWrap
- A boolean.public boolean isForceInsideTextNoWrap()
public void setForceInsideTextNoWrap(boolean flag)
ChartShapeChangeEvent
to all registered listeners.
flag
- booleanpublic int getTextMaxShowLine()
public void setTextMaxShowLine(int textMaxShowLine)
ChartShapeChangeEvent
to all registered listeners.
textMaxShowLine
- int
The maximum number of lines for text,must greater or equal to 1 .public boolean isForceShowAll()
public void setForceShowAllText(boolean flag)
ChartShapeChangeEvent
to all registered listeners.
flag
- boolean
A boolean.protected void drawText(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D area)
g2
- Graphics2D
the graphics device (such as the screen or the printer) (null not permitted).area
- Rectangle2D
The draw area (null not permitted).protected void drawTextWithTrimMarginRect(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D drawArea)
g2
- Graphics2D
the graphics device (such as the screen or the printer) (null not permitted).drawArea
- Rectangle2D
The draw area (null not permitted).public void translate(double tx, double ty)
ChartShapeChangeEvent
to all registered listeners.
Subsequent rendering is translated by the specified
distance relative to the previous position.
This is equivalent to calling transform(T), where T is an
AffineTransform represented by the following matrix:
[ 1 0 tx ] [ 0 1 ty ] [ 0 0 1 ].
translate
in interface IChartShape
tx
- double
The distance to translate along the x-axis.ty
- double
The distance to translate along the y-axis.public java.awt.geom.Point2D getTopLeftPoint()
getTopLeftPoint
in interface IChartShape
public java.awt.geom.Point2D getLockPoint()
getLockPoint
in interface IChartShape
getLockPoint
in class AbstractChartShape
protected java.lang.String[] splitString(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D area)
g2
- Graphics2D
The specified Graphics context.area
- Rectangle2D
The area of draw text.
protected java.awt.geom.Point2D getTooltipShapeTranslatePoint()
getTooltipShapeTranslatePoint
in class AbstractChartShape
public boolean equals(java.lang.Object obj)
equals
in class AbstractTextChartShape
obj
-
the reference object with which to compare.
public int hashCode()
hashCode
in class AbstractTextChartShape
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class AbstractTextChartShape
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.public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |