com.ijchart.xychart.shape
Class MinMaxChartShape

java.lang.Object
  extended by com.ijchart.xychart.shape.AbstractChartShape
      extended by com.ijchart.xychart.shape.MinMaxChartShape
All Implemented Interfaces:
IChartShapeChangeListener, IChartShape, java.io.Serializable, java.lang.Cloneable, java.util.EventListener

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

Title: IJChart

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

Draw a min and max value IChartShape.

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 boolean DEFAULT_DRAW_GROUP_LINE
           A default flag controls whether or not draw group line.
static java.awt.Paint DEFAULT_GROUP_LINE_PAINT
           The default paint used to draw group line.
static java.awt.Stroke DEFAULT_GROUP_LINE_STROKE
           The default stroke used to draw group line.
static java.awt.Shape DEFAULT_MAX_SHAPE
           The default maximum value shape.
static java.awt.Paint DEFAULT_MAX_SHAPE_PAINT
           The default paint used to draw maximum value shape.
static java.awt.Stroke DEFAULT_MAX_SHAPE_STROKE
           The default stroke used to draw maximum value shape.
static java.awt.Shape DEFAULT_MIN_SHAPE
           The default minimum value shape.
static java.awt.Paint DEFAULT_MIN_SHAPE_PAINT
           The default paint used to draw minimum value shape.
static java.awt.Stroke DEFAULT_MIN_SHAPE_STROKE
           The default stroke used to draw minimum value shape.
 
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
MinMaxChartShape(java.awt.geom.Point2D minShapePos, java.awt.geom.Point2D maxShapePos)
           Constructor.
MinMaxChartShape(java.awt.geom.Point2D minShapePos, java.awt.geom.Point2D maxShapePos, java.awt.Shape minShape, java.awt.Shape maxShape)
           Constructor.
 
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 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.
 java.awt.Paint getGroupLinePaint()
           Returns the paint used to draw group line.
 java.awt.Stroke getGroupLineStroke()
           Returns the stroke used to draw group line.
protected  java.awt.Shape getHotspotShape()
           Returns the hotspot shape.
 java.awt.geom.Point2D getLockPoint()
           Returns the lock coordinates of this shape.
 java.awt.Shape getMaxShape()
           Returns the maximum value shape.
 java.awt.Paint getMaxShapePaint()
           Returns the paint used to draw maximum value shape.
 java.awt.geom.Point2D getMaxShapePos()
           Returns the position of maximum value shape.
 java.awt.Stroke getMaxShapeStroke()
           Returns the stroke used to draw maximum value shape.
 java.awt.Shape getMinShape()
           Returns the minimum value shape.
 java.awt.Paint getMinShapePaint()
           Returns the paint used to draw minimum value shape.
 java.awt.geom.Point2D getMinShapePos()
           Returns the position of minimum value shape.
 java.awt.Stroke getMinShapeStroke()
           Returns the stroke used to draw minimum value shape.
 ShapeType getShapeType()
           The type for describe this shape.
 java.awt.geom.Point2D getTopLeftPoint()
           Returns the top left corner coordinates of this shape (not consider rotation).
 int hashCode()
           Returns a hash code value for the object.
 boolean isDrawGroupLine()
           Returns a flag controls whether or not draw group line.
 void setDrawGroupLine(boolean flag)
           Sets a flag controls whether or not draw group line and sends a ChartShapeChangeEvent to all registered listeners.
 void setGroupLinePaint(java.awt.Paint paint)
           Sets the paint used to draw group line and sends a ChartShapeChangeEvent to all registered listeners.
 void setGroupLineStroke(java.awt.Stroke stroke)
           Sets the stroke used to draw group line and sends a ChartShapeChangeEvent to all registered listeners.
 void setMaxShape(java.awt.Shape shape)
           Sets the maximum value shape and sends a ChartShapeChangeEvent to all registered listeners.
 void setMaxShapePaint(java.awt.Paint paint)
           Sets the paint used to draw maximum value shape and sends a ChartShapeChangeEvent to all registered listeners.
 void setMaxShapePos(java.awt.geom.Point2D point)
           Sets the position of maximum value shape and sends a ChartShapeChangeEvent to all registered listeners.
 void setMaxShapeStroke(java.awt.Stroke stroke)
           Sets the stroke used to draw maximum value shape and sends a ChartShapeChangeEvent to all registered listeners.
 void setMinShape(java.awt.Shape shape)
           Sets the minimum value shape and sends a ChartShapeChangeEvent to all registered listeners.
 void setMinShapePaint(java.awt.Paint paint)
           Sets the paint used to draw minimum value shape and sends a ChartShapeChangeEvent to all registered listeners.
 void setMinShapePos(java.awt.geom.Point2D point)
           Sets the position of minimum value shape and sends a ChartShapeChangeEvent to all registered listeners.
 void setMinShapeStroke(java.awt.Stroke stroke)
           Sets the stroke used to draw minimum value shape and sends a ChartShapeChangeEvent to all registered listeners.
 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.AbstractChartShape
addChangeListener, afterDraw, beforeDraw, chartShapeChanged, contains, contains, drawAnchorByPoints, drawBackground, drawBorder, drawShapeBorder, fillShape, fireChartShapeChanged, forceChartShapeChanged, getBorderPaint, getBorderStroke, getBound, getData, getFillAlpha, getFillPaint, getGradientPaintTransformType, getHotspotPolyCoords, getHotspotType, getHotspotType, getId, 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, wait, wait, wait
 

Field Detail

DEFAULT_MIN_SHAPE

public static final java.awt.Shape DEFAULT_MIN_SHAPE
The default minimum value shape.


DEFAULT_MAX_SHAPE

public static final java.awt.Shape DEFAULT_MAX_SHAPE
The default maximum value shape.


DEFAULT_MIN_SHAPE_PAINT

public static final java.awt.Paint DEFAULT_MIN_SHAPE_PAINT
The default paint used to draw minimum value shape.


DEFAULT_MAX_SHAPE_PAINT

public static final java.awt.Paint DEFAULT_MAX_SHAPE_PAINT
The default paint used to draw maximum value shape.


DEFAULT_GROUP_LINE_PAINT

public static final java.awt.Paint DEFAULT_GROUP_LINE_PAINT
The default paint used to draw group line.


DEFAULT_MIN_SHAPE_STROKE

public static final java.awt.Stroke DEFAULT_MIN_SHAPE_STROKE
The default stroke used to draw minimum value shape.


DEFAULT_MAX_SHAPE_STROKE

public static final java.awt.Stroke DEFAULT_MAX_SHAPE_STROKE
The default stroke used to draw maximum value shape.


DEFAULT_GROUP_LINE_STROKE

public static final java.awt.Stroke DEFAULT_GROUP_LINE_STROKE
The default stroke used to draw group line.


DEFAULT_DRAW_GROUP_LINE

public static final boolean DEFAULT_DRAW_GROUP_LINE
A default flag controls whether or not draw group line.

See Also:
Constant Field Values
Constructor Detail

MinMaxChartShape

public MinMaxChartShape(java.awt.geom.Point2D minShapePos,
                        java.awt.geom.Point2D maxShapePos)
Constructor.

Parameters:
minShapePos - Point2D The position of minimum value shape (null permitted).
maxShapePos - Point2D The position of maximum value shape (null permitted).

MinMaxChartShape

public MinMaxChartShape(java.awt.geom.Point2D minShapePos,
                        java.awt.geom.Point2D maxShapePos,
                        java.awt.Shape minShape,
                        java.awt.Shape maxShape)
Constructor.

Parameters:
minShapePos - Point2D The position of minimum value shape (null permitted).
maxShapePos - Point2D The position of maximum value shape (null permitted).
minShape - Shape The minimum value shape (null permitted).
maxShape - Shape The maximum value shape (null permitted).
Method Detail

getMinShape

public java.awt.Shape getMinShape()
Returns the minimum value shape.

Returns:
Shape The minimum value shape (maybe null).

setMinShape

public void setMinShape(java.awt.Shape shape)
Sets the minimum value shape and sends a ChartShapeChangeEvent to all registered listeners.

Parameters:
shape - Shape The minimum value shape (null permitted).

getMaxShape

public java.awt.Shape getMaxShape()
Returns the maximum value shape.

Returns:
Shape The maximum value shape (maybe null).

setMaxShape

public void setMaxShape(java.awt.Shape shape)
Sets the maximum value shape and sends a ChartShapeChangeEvent to all registered listeners.

Parameters:
shape - Shape The maximum value shape (null permitted).

getMinShapePaint

public java.awt.Paint getMinShapePaint()
Returns the paint used to draw minimum value shape.

Returns:
Paint The paint used to draw minimum value shape (maybe null).

setMinShapePaint

public void setMinShapePaint(java.awt.Paint paint)
Sets the paint used to draw minimum value shape and sends a ChartShapeChangeEvent to all registered listeners.

Parameters:
paint - Paint The paint used to draw minimum value shape (null permitted).

getMaxShapePaint

public java.awt.Paint getMaxShapePaint()
Returns the paint used to draw maximum value shape.

Returns:
Paint The paint used to draw maximum value shape (maybe null).

setMaxShapePaint

public void setMaxShapePaint(java.awt.Paint paint)
Sets the paint used to draw maximum value shape and sends a ChartShapeChangeEvent to all registered listeners.

Parameters:
paint - Paint The paint used to draw maximum value shape (null permitted).

getGroupLinePaint

public java.awt.Paint getGroupLinePaint()
Returns the paint used to draw group line.

Returns:
Paint The paint used to draw group line (maybe null).

setGroupLinePaint

public void setGroupLinePaint(java.awt.Paint paint)
Sets the paint used to draw group line and sends a ChartShapeChangeEvent to all registered listeners.

Parameters:
paint - Paint The paint used to draw group line (null permitted).

getMinShapeStroke

public java.awt.Stroke getMinShapeStroke()
Returns the stroke used to draw minimum value shape.

Returns:
Stroke The stroke used to draw minimum value shape (maybe null).

setMinShapeStroke

public void setMinShapeStroke(java.awt.Stroke stroke)
Sets the stroke used to draw minimum value shape and sends a ChartShapeChangeEvent to all registered listeners.

Parameters:
stroke - Stroke The stroke used to draw minimum value shape (null permitted).

getMaxShapeStroke

public java.awt.Stroke getMaxShapeStroke()
Returns the stroke used to draw maximum value shape.

Returns:
Stroke The stroke used to draw maximum value shape (maybe null).

setMaxShapeStroke

public void setMaxShapeStroke(java.awt.Stroke stroke)
Sets the stroke used to draw maximum value shape and sends a ChartShapeChangeEvent to all registered listeners.

Parameters:
stroke - Stroke The stroke used to draw maximum value shape (null permitted).

getGroupLineStroke

public java.awt.Stroke getGroupLineStroke()
Returns the stroke used to draw group line.

Returns:
Stroke The stroke used to draw group line (maybe null).

setGroupLineStroke

public void setGroupLineStroke(java.awt.Stroke stroke)
Sets the stroke used to draw group line and sends a ChartShapeChangeEvent to all registered listeners.

Parameters:
stroke - Stroke The stroke used to draw group line (null permitted).

getMinShapePos

public java.awt.geom.Point2D getMinShapePos()
Returns the position of minimum value shape.

Returns:
Point2D The position of minimum value shape (maybe null).

setMinShapePos

public void setMinShapePos(java.awt.geom.Point2D point)
Sets the position of minimum value shape and sends a ChartShapeChangeEvent to all registered listeners.

Parameters:
point - Point2D The position of minimum value shape (null permitted).

getMaxShapePos

public java.awt.geom.Point2D getMaxShapePos()
Returns the position of maximum value shape.

Returns:
Point2D The position of maximum value shape (maybe null).

setMaxShapePos

public void setMaxShapePos(java.awt.geom.Point2D point)
Sets the position of maximum value shape and sends a ChartShapeChangeEvent to all registered listeners.

Parameters:
point - Point2D The position of maximum value shape (null permitted).

isDrawGroupLine

public boolean isDrawGroupLine()
Returns a flag controls whether or not draw group line.

Returns:
boolean A flag controls whether or not draw group line.

setDrawGroupLine

public void setDrawGroupLine(boolean flag)
Sets a flag controls whether or not draw group line and sends a ChartShapeChangeEvent to all registered listeners.

Parameters:
flag - boolean A flag controls whether or not draw group line.

draw

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

Specified by:
draw in interface IChartShape
Parameters:
g2 - Graphics2D The graphics device (such as the screen or the printer) (null not permitted).

drawSelect

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

Specified by:
drawSelect in class AbstractChartShape
Parameters:
g2 - Graphics2D the graphics device (such as the screen or the printer) (null not permitted).

translate

public 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   ]
 
.

Specified by:
translate in interface IChartShape
Parameters:
tx - double The distance to translate along the x-axis.
ty - double The distance to translate along the y-axis.

getTopLeftPoint

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

Specified by:
getTopLeftPoint in interface IChartShape
Returns:
Point2D The coordinate.

getLockPoint

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

Specified by:
getLockPoint in interface IChartShape
Overrides:
getLockPoint in class AbstractChartShape
Returns:
Point2D The coordinate.

calculateTransformedShape

protected void calculateTransformedShape()
Calculate the transformed shape.

Specified by:
calculateTransformedShape in class AbstractChartShape

getHotspotShape

protected java.awt.Shape getHotspotShape()
Returns the hotspot shape.

Specified by:
getHotspotShape in class AbstractChartShape
Returns:
Shape The hotspot shape (maybe null).

getShapeType

public ShapeType getShapeType()
The type for describe this shape.

Specified by:
getShapeType in interface IChartShape
Returns:
ShapeType The constant value in class ShapeType.

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.

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.

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.

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the object.