|
|||||||||
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.LegendItemChartShape
public class LegendItemChartShape
Title: IJChart
Description: a chart library for the Java(tm) platform.
A legend item chart shape,composite by a chart shape and a label. Note:Some super class method does not affect graphicsCopyright: Copyright (c) 2013
Company:
Field Summary | |
---|---|
static boolean |
DEFAULT_DRAW_LABEL
A default flag that controls whether or not the label is drawn. |
static double |
DEFAULT_GAP_SIZE
The default space between shape and label. |
Fields inherited from class com.ijchart.xychart.shape.AbstractChartShape |
---|
DEFAULT_DRAW_TYPE, DEFAULT_SHAPE_ID, DEFAULT_VISIBLE, transformedShape |
Constructor Summary | |
---|---|
LegendItemChartShape(IChartShape shape,
java.lang.String label)
Construct a legend shape by chart shape and label. |
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. |
Rectangle |
estimateDrawBound(java.awt.Graphics2D g2)
Estimate the Rectangle of draw this shape. |
java.awt.geom.Rectangle2D |
getDrawArea()
Returns the area of draw this legend shape. |
double |
getGapSize()
Returns the space between shape and label. |
java.lang.String |
getHotspotPolyCoords()
Returns a string containing the coordinates for a given shape.This string is intended for use in an image map. |
protected java.awt.Shape |
getHotspotShape()
Returns the hotspot shape. |
java.lang.String |
getLabel()
Returns the label text. |
java.awt.Font |
getLabelFont()
Returns the label font. |
java.awt.Paint |
getLabelPaint()
Get the ChartShape label Paint |
IChartShape |
getShape()
Returns the chart shape. |
ShapeType |
getShapeType()
The type for describe this shape. |
java.awt.geom.Point2D |
getTopLeftPoint()
Returns the top left corner coordinates of this shape. |
int |
hashCode()
Returns a hash code value for the object. |
boolean |
isDrawLabel()
Returns a flag that controls whether or not the label is drawn. |
void |
setDrawArea(java.awt.geom.Rectangle2D drawArea)
Sets the area of draw this legend shape and sends a ChartShapeChangeEvent to all registered listeners. |
void |
setDrawLabel(boolean drawLabel)
Sets a flag that controls whether or not the label is drawn and sends a ChartShapeChangeEvent to all registered listeners. |
void |
setGapSize(double gap)
Sets the space between shape and label and sends a ChartShapeChangeEvent to all registered listeners. |
void |
setLabel(java.lang.String label)
Sets the label text,and sends a ChartShapeChangeEvent to all registered listeners.. |
void |
setLabelFont(java.awt.Font font)
Sets the label font and sends a ChartShapeChangeEvent to all registered listeners. |
void |
setLabelPaint(java.awt.Paint paint)
Sets the shape label Paint and sends a ChartShapeChangeEvent to all registered listeners. |
void |
setShape(IChartShape shape)
Sets the chart shape and sends a ChartShapeChangeEvent to all registered listeners. |
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 java.lang.Object |
---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final boolean DEFAULT_DRAW_LABEL
public static final double DEFAULT_GAP_SIZE
Constructor Detail |
---|
public LegendItemChartShape(IChartShape shape, java.lang.String label)
shape
- IChartShape
The chart shape (null not permitted).label
- String
The label (null permitted).Method Detail |
---|
public IChartShape getShape()
public void setShape(IChartShape shape)
ChartShapeChangeEvent
to all registered listeners.
shape
- IChartShape
The chart shape (null not permitted).public void setDrawLabel(boolean drawLabel)
ChartShapeChangeEvent
to all registered listeners.
drawLabel
- booleanpublic boolean isDrawLabel()
public void setLabelPaint(java.awt.Paint paint)
ChartShapeChangeEvent
to all registered listeners.
paint
- Paint
The ChartShape label Paint(null not permitted).public java.awt.Paint getLabelPaint()
public java.lang.String getLabel()
public void setLabel(java.lang.String label)
ChartShapeChangeEvent
to all registered listeners..
label
- String
The label text (null permitted).public java.awt.Font getLabelFont()
public void setLabelFont(java.awt.Font font)
ChartShapeChangeEvent
to all registered listeners.
font
- Font
The label font (null not permitted).public double getGapSize()
public void setGapSize(double gap)
ChartShapeChangeEvent
to all registered listeners.
gap
- double
The space between shape and label.public java.awt.geom.Rectangle2D getDrawArea()
public void setDrawArea(java.awt.geom.Rectangle2D drawArea)
ChartShapeChangeEvent
to all registered listeners.
drawArea
- Rectangle2D
The draw area (null permitted).public Rectangle estimateDrawBound(java.awt.Graphics2D g2)
Rectangle
of draw this shape.
g2
- Graphics2D
The graphics device (such as the screen or the printer) (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
public void translate(double tx, double ty)
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 ].
translate
in interface IChartShape
tx
- double
The distance to translate along the x-axis.ty
- double
The distance to translate along the y-axis.public java.awt.geom.Point2D getTopLeftPoint()
getTopLeftPoint
in interface IChartShape
public java.lang.String getHotspotPolyCoords()
protected java.awt.Shape getHotspotShape()
getHotspotShape
in class AbstractChartShape
public ShapeType getShapeType()
getShapeType
in interface IChartShape
ShapeType
.public int hashCode()
hashCode
in class AbstractChartShape
public boolean equals(java.lang.Object obj)
equals
in class AbstractChartShape
obj
-
the reference object with which to compare.
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class AbstractChartShape
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |