com.ijchart.xychart.shape
Class AbstractImageChartShape

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

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

Title: IJChart

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

Abstract class for draw a IChartShape with an image in it. You can define the vertical alignment,horizontal alignment,x-repeat,y-repeat,auto fit features.

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 float DEFAULT_IMAGE_ALPHA
           The default alpha for draw an image.
static HorizontalAlignment DEFAULT_IMAGE_HORIZONTAL_ALIGNMENT
           The default image horizontal alignment.
static VerticalAlignment DEFAULT_IMAGE_VERTICAL_ALIGNMENT
           The default image 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 AbstractImageChartShape(java.awt.Image image)
           Construct a IChartShape with an image argument.
 
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.awt.Image getImage()
           Returns the image in this rectangle.
 float getImageAlpha()
           Returns the alpha value for draw an image.
 HorizontalAlignment getImageHorizontalAlign()
           Returns the image horizontal alignment.
 VerticalAlignment getImageVerticalAlign()
           Returns the image vertical alignment.
 int hashCode()
           Returns a hash code value for the object.
 boolean isHorizontalRepeat()
           Returns a booleaen flag controls whether or not the image is horizontal repeat.
 boolean isVerticalRepeat()
           Returns a booleaen flag controls whether or not the image is vertical repeat.
 void setHorizontalRepeat(boolean horizontalRepeat)
           Sets whether or not the image is horizontal repeat.
 void setImage(java.awt.Image image)
           Sets the image in this rectangle (null permitted).
 void setImageAlpha(float alpha)
           The alpha value for draw an image,and sends a ChartShapeChangeEvent to all registered listeners.
 void setImageHorizontalAlign(HorizontalAlignment horizontalAlign)
           Sets the image horizontal alignment.
 void setImageVerticalAlign(VerticalAlignment verticalAlign)
           Sets the image vertical alignment.
 void setVerticalRepeat(boolean verticalRepeat)
           Sets whether or not the image is vertical repeat.
 
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_IMAGE_HORIZONTAL_ALIGNMENT

public static final HorizontalAlignment DEFAULT_IMAGE_HORIZONTAL_ALIGNMENT
The default image horizontal alignment.


DEFAULT_IMAGE_VERTICAL_ALIGNMENT

public static final VerticalAlignment DEFAULT_IMAGE_VERTICAL_ALIGNMENT
The default image vertical alignment.


DEFAULT_IMAGE_ALPHA

public static final float DEFAULT_IMAGE_ALPHA
The default alpha for draw an image.

See Also:
Constant Field Values
Constructor Detail

AbstractImageChartShape

protected AbstractImageChartShape(java.awt.Image image)
Construct a IChartShape with an image argument.

Parameters:
image - Image A image,and the image data must has been loaded (null permitted).
Method Detail

setImageHorizontalAlign

public void setImageHorizontalAlign(HorizontalAlignment horizontalAlign)
Sets the image horizontal alignment.

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

getImageHorizontalAlign

public HorizontalAlignment getImageHorizontalAlign()
Returns the image horizontal alignment.

Returns:
HorizontalAlignment The image horizontal alignment.

setImageVerticalAlign

public void setImageVerticalAlign(VerticalAlignment verticalAlign)
Sets the image vertical alignment.

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

getImageVerticalAlign

public VerticalAlignment getImageVerticalAlign()
Returns the image vertical alignment.

Returns:
VerticalAlignment The image vertical alignment.

setImage

public void setImage(java.awt.Image image)
Sets the image in this rectangle (null permitted).

Parameters:
image - Image The image (null permitted).

getImage

public java.awt.Image getImage()
Returns the image in this rectangle.

Returns:
Image

setHorizontalRepeat

public void setHorizontalRepeat(boolean horizontalRepeat)
Sets whether or not the image is horizontal repeat.

Parameters:
horizontalRepeat - boolean A boolean flag controls whether or not the image is x-repeat.

isHorizontalRepeat

public boolean isHorizontalRepeat()
Returns a booleaen flag controls whether or not the image is horizontal repeat.

Returns:
boolean Returns true if horizontal repeat is true,otherwise return false.

setVerticalRepeat

public void setVerticalRepeat(boolean verticalRepeat)
Sets whether or not the image is vertical repeat.

Parameters:
verticalRepeat - boolean A boolean flag controls whether or not the image is vertical repeat.

isVerticalRepeat

public boolean isVerticalRepeat()
Returns a booleaen flag controls whether or not the image is vertical repeat.

Returns:
boolean Returns true if vertical repeat is true,otherwise return false.

setImageAlpha

public void setImageAlpha(float alpha)
The alpha value for draw an image,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).

getImageAlpha

public float getImageAlpha()
Returns the alpha value for draw an image.

Returns:
float The alpha value.

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.