|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ijchart.xychart.title.AbstractTitle
com.ijchart.xychart.title.ImageTitle
public class ImageTitle
Title: IJChart
Description: a chart library for the Java(tm) platform.
A chart title that displays an image. This is useful, for example, if you have an image of your corporate logo and want to use as a footnote or part of a title in a chart you create.Copyright: Copyright (c) 2013
Company:
Field Summary | |
---|---|
static boolean |
DEFAULT_IMAGE_FILL_TITLE_AREA
A default flag controls whether or not to fill the title area by image. |
Fields inherited from class com.ijchart.xychart.title.AbstractTitle |
---|
DEFAULT_BACKGROUND_ALPHA, DEFAULT_BACKGROUND_PAINT, DEFAULT_BORDER_VISIBLE, DEFAULT_FILL_BACKGROUND, DEFAULT_HORIZONTAL_ALIGNMENT, DEFAULT_NOTIFY, DEFAULT_PADDING, DEFAULT_TITLE_POSITION, DEFAULT_VERTICAL_ALIGNMENT |
Constructor Summary | |
---|---|
ImageTitle(java.awt.Image image)
Creates a new image title. |
|
ImageTitle(java.awt.Image image,
int imageDrawWidth,
int imageDrawHeight)
Creates a new image title with the given image scaled to the given width and height in the given location. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Returns a clone of this object. |
Rectangle |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D chartArea,
ChartShapeCollection shapeCollection)
Draw the title on chart area(chartArea).All title shape is stored in shapeCollection. |
boolean |
equals(java.lang.Object obj)
Tests this title for equality with another object. |
java.awt.Image |
getImage()
Returns the image for the title. |
int |
getImageDrawHeight()
Returns the height used to draw the image. |
int |
getImageDrawWidth()
Returns the width used to draw the image. |
int |
hashCode()
Returns a hash code. |
boolean |
isImageFill()
Returns whether or not fill title area by image. |
protected java.awt.Image |
scaleImage()
Creates a scaled version of this image. |
void |
setImage(java.awt.Image image)
Sets the image for the title and notifies registered listeners that the title has been modified. |
void |
setImageDrawHeight(int imageDrawHeight)
Sets the height used to draw the image,and sends a TitleChangeEvent to all registered listeners. |
void |
setImageDrawWidth(int imageDrawWidth)
Sets the width used to draw the image,and sends a TitleChangeEvent to all registered listeners. |
void |
setImageFill(boolean fill)
Sets whether or not fill title area by image,and sends a TitleChangeEvent to all registered listeners. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final boolean DEFAULT_IMAGE_FILL_TITLE_AREA
Constructor Detail |
---|
public ImageTitle(java.awt.Image image)
image
- Image
The image,you must have already loaded this image from its source.public ImageTitle(java.awt.Image image, int imageDrawWidth, int imageDrawHeight)
image
- Image
The image,you must have already loaded this image from its source.imageDrawWidth
- int
The width used to draw the image.imageDrawHeight
- int
The height used to draw the image.Method Detail |
---|
public java.awt.Image getImage()
public void setImage(java.awt.Image image)
image
- Image
The new image (null permitted).public int getImageDrawWidth()
public void setImageDrawWidth(int imageDrawWidth)
TitleChangeEvent
to all registered listeners.
imageDrawWidth
- int
The width used to draw the image.public int getImageDrawHeight()
public void setImageDrawHeight(int imageDrawHeight)
TitleChangeEvent
to all registered listeners.
imageDrawHeight
- int
The height used to draw the image.public boolean isImageFill()
public void setImageFill(boolean fill)
TitleChangeEvent
to all registered listeners.
fill
- boolean
A boolean.public Rectangle draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D chartArea, ChartShapeCollection shapeCollection)
draw
in interface ITitle
g2
- Graphics2D
The graphics device (null not permitted).chartArea
- Rectangle2D
The area within which the chart should be drawn.shapeCollection
- ChartShapeCollection
Collects information about the plot (null permitted).
protected java.awt.Image scaleImage()
public boolean equals(java.lang.Object obj)
equals
in class AbstractTitle
obj
- the object (null permitted).
public int hashCode()
hashCode
in class AbstractTitle
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class AbstractTitle
java.lang.CloneNotSupportedException
- never.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |