com.ijchart.xychart.shape
Interface IChartShape

All Known Implementing Classes:
AbstractChartShape, AbstractImageChartShape, AbstractRectangleTextChartShape, AbstractTextChartShape, BoxAndWhiskerChartShape, CylinderTextChartShape, DblHeadMatchstickChartShape, DualBreakLineChartShape, EllipseTextChartShape, ErrorCrossChartShape, GeneralPathChartShape, GranttChartShape, HighLowChartShape, IShapedChartShape, LegendItemChartShape, LineAndShapeChartShape, LineChartShape, MeterArcChartShape, MinMaxChartShape, PaintScaleLegendChartShape, ParallelepipedTextChartShape, PieOutsideLabelChartShape, RectangleImageChartShape, RectangleTextChartShape, RingChartShape, SectorChartShape, StatisticalBarChartShape, StatisticalLineChartShape, StockChartShape, TextAndPointerChartShape

public interface IChartShape

Title: IJChart

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

Described in the chart for the use of graphical interfaces, for a variety of graphic charts are seen as a separate graphic objects

Copyright: Copyright (c) 2013

Company:

Version:
1.0
Author:
zhang feng min,shanghai china. Contract me by email.

Field Summary
static java.awt.Paint DEFAULT_BORDER_PAINT
           The default border Paint
static java.awt.Stroke DEFAULT_BORDER_STROKE
           The default border Stroke
static java.awt.Paint DEFAULT_CONTENT_PAINT
           The default content Paint
static boolean DEFAULT_DRAW_BORDER
           Default draw outline is false
static float DEFAULT_FILL_ALPHA
           Thedefault alpha value for fill background.
static java.awt.Paint DEFAULT_FILL_PAINT
           The default fill Paint
static boolean DEFAULT_FILL_SHAPE
           Default fill shape is true
static GradientPaintTransformType DEFAULT_GRADIENT_PAINT_TRANSFORM_TYPE
           The defeault GradientPaint transform type.
static RectangleInsets DEFAULT_MARGIN
           Default margin.
static java.awt.Paint DEFAULT_SELECT_FILL_PAINT
           The fill paint of selected area.
static float DEFAULT_SELECT_RECT_ALPHA
           The alpha value of selected area.
static double DEFAULT_SELECT_RECT_WIDTH
           The width of selected area.
static boolean DEFAULT_SELECTED
           The default value of shape selected.
static java.awt.Font DEFAULT_TEXT_FONT
           The default font.
static double DEFAULT_TOOLTIP_SHAPE_WIDTH
           The default tooltip shape width.
static java.lang.String HOTSPOT_TYPE_CIRCLE
           The circle shape of a hyperlink AREA in an image MAP.
static java.lang.String HOTSPOT_TYPE_POLYGON
           The polygon shape of a hyperlink AREA in an image MAP.
static java.lang.String HOTSPOT_TYPE_RECTANGLE
           The rectangle shape of a hyperlink AREA in an image MAP.
 
Method Summary
 void addChangeListener(IChartShapeChangeListener listener)
           Registers an object for notification of changes to the IChartShape
 boolean contains(double x, double y)
           Tests if a specified Point2D is inside the boundary of the ChartShape.
 boolean contains(java.awt.geom.Point2D point)
           Tests if a specified Point2D is inside the boundary of the ChartShape.
 void draw(java.awt.Graphics2D g2)
           Draw the ChartShape on a Java 2d graphics device(such as the screen or the printer).
 void forceChartShapeChanged()
           If the data object of IChartShape changed and no event triggered,set IChartShape changed by this method.
 java.awt.Paint getBorderPaint()
           Get the ChartShape border Paint
 java.awt.Stroke getBorderStroke()
           Get the ChartShape border Stroke
 java.awt.geom.Rectangle2D getBound()
           Returns a Rectangle2D that completely encloses the Shape.
 IChartData getData()
           Returns the IChartData object.
 float getFillAlpha()
           Returns the alpha value for fill background.
 java.awt.Paint getFillPaint()
           Get the ChartShape fill paint
 GradientPaintTransformType getGradientPaintTransformType()
           Get the ChartShape GradientPaintTransformType type
 java.lang.String getHotspotPolyCoords(java.awt.Shape clipArea)
           Returns a string containing the coordinates for a given shape.This string is intended for use in an image map.
 java.lang.String getHotspotType()
           Returns the shape type of hotspot.
 int getId()
           Returns the ID.
 java.awt.geom.Point2D getLockPoint()
           Returns the lock coordinates of this shape.
 java.awt.Shape getOriginTooltipShape()
           Returns the original tooltip shape.
 double getRotate()
           Return the angle of rotation in radians.
 IShapeChange getShapeChange()
           Returns the IShapeChange object.
 ChartShapeDrawType getShapeDrawType()
           Returns the chart shape draw type.
 ShapeType getShapeType()
           The type for describe this shape.
 java.awt.Shape getTooltipShape()
           Returns the tooltip shape.
 java.lang.String getTooltipText()
           Returns the tooltip text.
 java.awt.geom.Point2D getTopLeftPoint()
           Returns the top left corner coordinates of this shape (not consider rotation).
 java.lang.String getURL()
           Returns the URL text.
 boolean isDrawBorder()
           A flag that controls whether or not the shape border is visible
 boolean isFillShape()
           A flag that controls whether or not the shape is filled
 boolean isSelected()
           Returns whether or not this shape is selected.
 boolean isVisible()
           Returns whether or not the shape is visible.
 void removeAllChangeListener()
           Deregisters all object for notification of changes to the IChartShape.
 void removeChangeListener(IChartShapeChangeListener listener)
           Deregisters an object for notification of changes to the IChartShape.
 void setBorderPaint(java.awt.Paint paint)
           Sets the shape border Paint
 void setBorderStroke(java.awt.Stroke stroke)
           Sets the shape border Stroke
 void setData(IChartData data)
           Sets the IChartData object.
 void setDrawBorder(boolean flag)
           Sets a flag that controls whether or not the shape border is visible
 void setFillAlpha(float alpha)
           The alpha value for fill background,and sends a ChartShapeChangeEvent to all registered listeners.
 void setFillPaint(java.awt.Paint paint)
           Sets the shape fill Paint
 void setFillShape(boolean bFillShape)
           Sets a flag that controls whether or not the shape is filled
 void setGradientPaintTransformType(GradientPaintTransformType transformType)
           Sets the ChartShape GradientPaintTransformType type,use only when fill Paint is GradientPaint
 void setId(int shapeId)
           Sets an ID for this shape,the shape ID is unique and continuous in a chart.
 void setOriginTooltipShape(java.awt.Shape shape)
           Sets the original tooltip shape.
 void setRotate(double theta)
           Sets a flag controls whether or not the shape is selected.
 void setShapeChange(IShapeChange change)
           Sets the IShapeChange object.
 void setShapeDrawType(ChartShapeDrawType drawType)
           Returns the chart shape draw type.
 void setTooltipText(java.lang.String tooltip)
           Sets the tooltip text.
 void setURL(java.lang.String url)
           Sets the URL text.
 void setVisible(boolean flag)
           Sets whether or not the shape is visible.
 void translate(double tx, double ty)
           Concatenates the current Graphics2D Transform with a translation transform.and sends a ChartShapeChangeEvent to all registered listeners.
 

Field Detail

DEFAULT_DRAW_BORDER

static final boolean DEFAULT_DRAW_BORDER
Default draw outline is false

See Also:
Constant Field Values

DEFAULT_FILL_SHAPE

static final boolean DEFAULT_FILL_SHAPE
Default fill shape is true

See Also:
Constant Field Values

DEFAULT_FILL_ALPHA

static final float DEFAULT_FILL_ALPHA
Thedefault alpha value for fill background.

See Also:
Constant Field Values

DEFAULT_CONTENT_PAINT

static final java.awt.Paint DEFAULT_CONTENT_PAINT
The default content Paint


DEFAULT_FILL_PAINT

static final java.awt.Paint DEFAULT_FILL_PAINT
The default fill Paint


DEFAULT_BORDER_PAINT

static final java.awt.Paint DEFAULT_BORDER_PAINT
The default border Paint


DEFAULT_MARGIN

static final RectangleInsets DEFAULT_MARGIN
Default margin.


DEFAULT_GRADIENT_PAINT_TRANSFORM_TYPE

static final GradientPaintTransformType DEFAULT_GRADIENT_PAINT_TRANSFORM_TYPE
The defeault GradientPaint transform type.


DEFAULT_BORDER_STROKE

static final java.awt.Stroke DEFAULT_BORDER_STROKE
The default border Stroke


DEFAULT_SELECT_RECT_WIDTH

static final double DEFAULT_SELECT_RECT_WIDTH
The width of selected area.

See Also:
Constant Field Values

DEFAULT_SELECT_RECT_ALPHA

static final float DEFAULT_SELECT_RECT_ALPHA
The alpha value of selected area.

See Also:
Constant Field Values

DEFAULT_SELECT_FILL_PAINT

static final java.awt.Paint DEFAULT_SELECT_FILL_PAINT
The fill paint of selected area.


DEFAULT_TEXT_FONT

static final java.awt.Font DEFAULT_TEXT_FONT
The default font.


DEFAULT_TOOLTIP_SHAPE_WIDTH

static final double DEFAULT_TOOLTIP_SHAPE_WIDTH
The default tooltip shape width.

See Also:
Constant Field Values

DEFAULT_SELECTED

static final boolean DEFAULT_SELECTED
The default value of shape selected.

See Also:
Constant Field Values

HOTSPOT_TYPE_CIRCLE

static final java.lang.String HOTSPOT_TYPE_CIRCLE
The circle shape of a hyperlink AREA in an image MAP.

See Also:
Constant Field Values

HOTSPOT_TYPE_POLYGON

static final java.lang.String HOTSPOT_TYPE_POLYGON
The polygon shape of a hyperlink AREA in an image MAP.

See Also:
Constant Field Values

HOTSPOT_TYPE_RECTANGLE

static final java.lang.String HOTSPOT_TYPE_RECTANGLE
The rectangle shape of a hyperlink AREA in an image MAP.

See Also:
Constant Field Values
Method Detail

getId

int getId()
Returns the ID.

Returns:
int The shape ID.

setId

void setId(int shapeId)
Sets an ID for this shape,the shape ID is unique and continuous in a chart.

Parameters:
shapeId - int

isDrawBorder

boolean isDrawBorder()
A flag that controls whether or not the shape border is visible

Returns:
boolean A boolean flag

setDrawBorder

void setDrawBorder(boolean flag)
Sets a flag that controls whether or not the shape border is visible

Parameters:
flag - boolean true,draw the border of the shape;false otherwise

getBorderStroke

java.awt.Stroke getBorderStroke()
Get the ChartShape border Stroke

Returns:
Stroke The border Stroke

setBorderStroke

void setBorderStroke(java.awt.Stroke stroke)
Sets the shape border Stroke

Parameters:
stroke - Stroke The ChartShape border Stroke(null permitted).

getBorderPaint

java.awt.Paint getBorderPaint()
Get the ChartShape border Paint

Returns:
Paint The border Paint

setBorderPaint

void setBorderPaint(java.awt.Paint paint)
Sets the shape border Paint

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

isFillShape

boolean isFillShape()
A flag that controls whether or not the shape is filled

Returns:
boolean A boolean flag

setFillShape

void setFillShape(boolean bFillShape)
Sets a flag that controls whether or not the shape is filled

Parameters:
bFillShape - boolean true,fill the shape;false otherwise

getFillPaint

java.awt.Paint getFillPaint()
Get the ChartShape fill paint

Returns:
Paint The ChartShape fill paint

setFillPaint

void setFillPaint(java.awt.Paint paint)
Sets the shape fill Paint

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

setFillAlpha

void setFillAlpha(float alpha)
The alpha value for fill background,and sends a ChartShapeChangeEvent to all registered listeners.

Parameters:
alpha - float The alpha transparency (in the range 0.0f to 1.0f, where 0.0f is fully transparent, and 1.0f is fully opaque).

getFillAlpha

float getFillAlpha()
Returns the alpha value for fill background.

Returns:
float The alpha value.

getGradientPaintTransformType

GradientPaintTransformType getGradientPaintTransformType()
Get the ChartShape GradientPaintTransformType type

Returns:
GradientPaintTransformType

setGradientPaintTransformType

void setGradientPaintTransformType(GradientPaintTransformType transformType)
Sets the ChartShape GradientPaintTransformType type,use only when fill Paint is GradientPaint

Parameters:
transformType - GradientPaintTransformType (null permitted)

getTooltipText

java.lang.String getTooltipText()
Returns the tooltip text.

Returns:
String The tooltip text (maybe null).

setTooltipText

void setTooltipText(java.lang.String tooltip)
Sets the tooltip text.

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

getURL

java.lang.String getURL()
Returns the URL text.

Returns:
String The URL text (maybe null).

setURL

void setURL(java.lang.String url)
Sets the URL text.

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

draw

void draw(java.awt.Graphics2D g2)
Draw the ChartShape on a Java 2d graphics device(such as the screen or the printer).

Parameters:
g2 - Graphics2D The graphics device (such as the screen or the printer) (null not permitted).

contains

boolean contains(double x,
                 double y)
Tests if a specified Point2D is inside the boundary of the ChartShape.

Parameters:
x - double the x position.
y - double the y position.
Returns:
boolean Returns true if this shape contains point(x,y),otherwise return false.

contains

boolean contains(java.awt.geom.Point2D point)
Tests if a specified Point2D is inside the boundary of the ChartShape.

Parameters:
point - Point2D The position,maybe a mouse point (null not permitted).
Returns:
boolean Returns true if this shape contains point(x,y),otherwise return false.

getShapeType

ShapeType getShapeType()
The type for describe this shape.

Returns:
ShapeType The constant value in class ShapeType.

getRotate

double getRotate()
Return the angle of rotation in radians.

Returns:
double The angle of rotation in radians.

setRotate

void setRotate(double theta)
Concatenates the current Graphics2D Transform with a rotation transform.Subsequent rendering is rotated by the specified radians relative to the previous origin.This is equivalent to calling transform(R), where R is an AffineTransform represented by the following matrix:
                [   cos(theta)    -sin(theta)    0   ]
                [   sin(theta)     cos(theta)    0   ]
                [       0              0         1   ]
 
Rotating with a positive angle theta rotates points on the positive x axis toward the positive y axis.

Parameters:
theta - the angle of rotation in radians.

isSelected

boolean isSelected()
Returns whether or not this shape is selected.

Returns:
boolean A boolean.

setSelected

void setSelected(boolean flag)
Sets a flag controls whether or not the shape is selected.

Parameters:
flag - boolean A boolean.

getOriginTooltipShape

java.awt.Shape getOriginTooltipShape()
Returns the original tooltip shape.

Returns:
Shape A shape (null permitted).

setOriginTooltipShape

void setOriginTooltipShape(java.awt.Shape shape)
Sets the original tooltip shape.

Parameters:
shape - Shape A shape (null permitted).

getTooltipShape

java.awt.Shape getTooltipShape()
Returns the tooltip shape.

Returns:
Shape A shape (null permitted).

translate

void translate(double tx,
               double ty)
Concatenates the current Graphics2D Transform with a translation transform.and sends a 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   ]
 
.

Parameters:
tx - double The distance to translate along the x-axis.
ty - double The distance to translate along the y-axis.

getTopLeftPoint

java.awt.geom.Point2D getTopLeftPoint()
Returns the top left corner coordinates of this shape (not consider rotation).

Returns:
Point2D The coordinate.

getLockPoint

java.awt.geom.Point2D getLockPoint()
Returns the lock coordinates of this shape.

Returns:
Point2D The coordinate.

getData

IChartData getData()
Returns the IChartData object.

Returns:
IChartData (maybe null).

setData

void setData(IChartData data)
Sets the IChartData object.

Parameters:
data - IChartData (null permitted).

getBound

java.awt.geom.Rectangle2D getBound()
Returns a Rectangle2D that completely encloses the Shape.

Returns:
Rectangle2D A Rectangle2D that completely encloses the Shape.

addChangeListener

void addChangeListener(IChartShapeChangeListener listener)
Registers an object for notification of changes to the IChartShape

Parameters:
listener - the object to register.

removeChangeListener

void removeChangeListener(IChartShapeChangeListener listener)
Deregisters an object for notification of changes to the IChartShape.

Parameters:
listener - the object to deregister.

removeAllChangeListener

void removeAllChangeListener()
Deregisters all object for notification of changes to the IChartShape.


forceChartShapeChanged

void forceChartShapeChanged()
If the data object of IChartShape changed and no event triggered,set IChartShape changed by this method.


getShapeDrawType

ChartShapeDrawType getShapeDrawType()
Returns the chart shape draw type.

Returns:
ChartShapeDrawType (never null).

setShapeDrawType

void setShapeDrawType(ChartShapeDrawType drawType)
Returns the chart shape draw type.

Parameters:
drawType - ChartShapeDrawType (null not permitted).

isVisible

boolean isVisible()
Returns whether or not the shape is visible.

Returns:
boolean A boolean.

setVisible

void setVisible(boolean flag)
Sets whether or not the shape is visible.

Parameters:
flag - boolean A boolean.

setShapeChange

void setShapeChange(IShapeChange change)
Sets the IShapeChange object.

Parameters:
change - IShapeChange IShapeChange object (null permitted).

getShapeChange

IShapeChange getShapeChange()
Returns the IShapeChange object.

Returns:
IShapeChange IShapeChange object (maybe null).

getHotspotType

java.lang.String getHotspotType()
Returns the shape type of hotspot.

Returns:
String The shape type of hotspot,the value can be poly or rect.

getHotspotPolyCoords

java.lang.String getHotspotPolyCoords(java.awt.Shape clipArea)
Returns a string containing the coordinates for a given shape.This string is intended for use in an image map.

Parameters:
clipArea - Shape The clip area.
Returns:
String The coordinates of hotspot (maybe null).