|
|||||||||
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
com.ijchart.xychart.shape.RectangleTextChartShape
public class RectangleTextChartShape
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 |
---|
Fields inherited from class com.ijchart.xychart.shape.AbstractRectangleTextChartShape |
---|
DEFAULT_DRAW_AUTO_WRAP, DEFAULT_FORCE_INSIDE_TEXT_NO_WRAP, DEFAULT_FORCE_SHOW_ALL, DEFAULT_TEXT_MAX_SHOW_LINE |
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 | |
---|---|
RectangleTextChartShape(java.awt.geom.Rectangle2D drawArea,
java.lang.String text)
Draw text in area drawArea. |
|
RectangleTextChartShape(java.awt.geom.Rectangle2D drawArea,
java.lang.String text,
java.awt.Font font)
Draw text in area drawArea. |
Method Summary | |
---|---|
protected void |
calculateTransformedShape()
Calculate the transformed shape. |
java.lang.Object |
clone()
Creates and returns a copy of this object. |
void |
draw(java.awt.Graphics2D g2)
Draw the ChartShape on a Java 2d graphics device(such as the screen or the printer). |
protected void |
drawBorder(java.awt.Graphics2D g2,
java.awt.Shape drawArea)
Draw border(override parent class method). |
protected void |
drawSelect(java.awt.Graphics2D g2)
Draw the selected ChartShape on a Java 2d graphics device(such as the screen or the printer). |
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one. |
protected java.awt.Shape |
getHotspotShape()
Returns the hotspot shape. |
Rectangle |
getMinimumBound(java.awt.Graphics2D g2)
Returns the minimum bounds of the specified string in the specified Graphics context, the width is less or equal than drawArea.getWidth() (width<=drawArea.getWidth()). |
ShapeType |
getShapeType()
The type for describe this shape. |
int |
hashCode()
Returns a hash code value for the object. |
boolean |
isBorderVisible(RectangleEdge edge)
Returns whether or not the specified border is visible. |
void |
setBorderVisible(RectangleEdge edge,
boolean visible)
Sets whether or not a border is visible. |
java.lang.String |
toString()
Returns a string representation of the object. |
Methods inherited from class com.ijchart.xychart.shape.AbstractRectangleTextChartShape |
---|
drawText, drawTextWithTrimMarginRect, getDrawArea, getLockPoint, getTextMaxShowLine, getTooltipShapeTranslatePoint, getTopLeftPoint, isAutoWrap, isForceInsideTextNoWrap, isForceShowAll, setAutoWrap, setDrawArea, setForceInsideTextNoWrap, setForceShowAllText, setTextMaxShowLine, splitString, translate |
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 |
Constructor Detail |
---|
public RectangleTextChartShape(java.awt.geom.Rectangle2D drawArea, java.lang.String text)
drawArea
- Rectangle2D
The draw area (null not permitted).text
- String
The text (null permitted).public RectangleTextChartShape(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 Rectangle getMinimumBound(java.awt.Graphics2D g2)
g2
- Graphics2D
The specified Graphics context (null not permitted).
public void draw(java.awt.Graphics2D g2)
draw
in interface IChartShape
g2
- Graphics2D
The graphics device (such as the screen or the printer) (null not permitted).protected void drawSelect(java.awt.Graphics2D g2)
drawSelect
in class AbstractChartShape
g2
- Graphics2D
the graphics device (such as the screen or the printer) (null not permitted).protected void calculateTransformedShape()
calculateTransformedShape
in class AbstractChartShape
protected java.awt.Shape getHotspotShape()
getHotspotShape
in class AbstractChartShape
public ShapeType getShapeType()
getShapeType
in interface IChartShape
ShapeType
.public void setBorderVisible(RectangleEdge edge, boolean visible)
edge
- RectangleEdge
The rectangle edge (null not permitted).visible
- boolean
A boolean.public boolean isBorderVisible(RectangleEdge edge)
edge
- RectangleEdge
The rectangle edge (null not permitted).
protected void drawBorder(java.awt.Graphics2D g2, java.awt.Shape drawArea)
drawBorder
in class AbstractChartShape
g2
- Graphics2D
The specified Graphics context.drawArea
- Shape
The draw area.public boolean equals(java.lang.Object obj)
equals
in class AbstractRectangleTextChartShape
obj
-
the reference object with which to compare.
public int hashCode()
hashCode
in class AbstractRectangleTextChartShape
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class AbstractRectangleTextChartShape
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 AbstractRectangleTextChartShape
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |