|
|||||||||
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.PaintScaleLegendChartShape
public class PaintScaleLegendChartShape
Title: IJChart
Description: a chart library for the Java(tm) platform.
A legend shape for block chart.Copyright: Copyright (c) 2013
Company:
Field Summary | |
---|---|
static double |
DEFAULT_AXIS_OFFSET
The default offset between the axis and the strip. |
static int |
DEFAULT_DIVISION
The default number of divisions. |
static boolean |
DEFAULT_DRAW_STRIP_BORDER
A default boolean flag controls whether or not draw strip border. |
static java.awt.Paint |
DEFAULT_STRIP_BORDER_PAINT
The default paint used to draw strip border. |
static java.awt.Stroke |
DEFAULT_STRIP_BORDER_STROKE
The default stroke used to draw strip border. |
static double |
DEFAULT_STRIP_WIDTH
The width of strip. |
Fields inherited from class com.ijchart.xychart.shape.AbstractChartShape |
---|
DEFAULT_DRAW_TYPE, DEFAULT_SHAPE_ID, DEFAULT_VISIBLE, transformedShape |
Constructor Summary | |
---|---|
PaintScaleLegendChartShape(IPaintScale paintScale,
java.lang.String label,
RectangleEdge position,
java.awt.geom.Rectangle2D drawArea,
IMatrixDataset dataset)
A 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. |
double |
getAxisOffset()
Returns the offset between the axis and the strip. |
AxisShapeCollection |
getAxisShapes()
Returns the axis shapes collection. |
IMatrixDataset |
getDataset()
Returns the dataset. |
NumberRange |
getDatasetRange()
Calculate the range of dataset. |
int |
getDivisions()
Returns the number of divisions. |
java.awt.geom.Rectangle2D |
getDrawArea()
Returns the drawing area. |
protected java.awt.Shape |
getHotspotShape()
Returns the hotspot shape. |
java.lang.String |
getLabel()
Returns the label. |
protected java.lang.String |
getMaximumLengthLabel()
Returns the label of maximum length. |
IPaintScale |
getPaintScale()
Returns the IPaintScale object. |
RectangleEdge |
getPosition()
Returns the position of legend. |
ShapeType |
getShapeType()
The type for describe this shape. |
java.awt.Paint |
getStripBorderPaint()
Returns the paint used to draw strip border. |
java.awt.Stroke |
getStripBorderStroke()
Returns the stroke used to draw strip border. |
double |
getStripWidth()
Returns the width of strip. |
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 |
isDrawStripBorder()
Returns the boolean flag controls whether or not draw strip border. |
void |
setAxisOffset(double offset)
Sets the offset between the axis and the strip and sends a ChartShapeChangeEvent to all registered listeners. |
void |
setDataset(IMatrixDataset dataset)
Sets the dataset and sends a ChartShapeChangeEvent to all registered listeners. |
void |
setDivisions(int divisions)
Sets the number of divisions and sends a ChartShapeChangeEvent to all registered listeners. |
void |
setDrawArea(java.awt.geom.Rectangle2D drawArea)
Sets the drawing area and sends a ChartShapeChangeEvent to all registered listeners. |
void |
setDrawStripBorder(boolean flag)
Sets the boolean flag controls whether or not draw strip border and sends a ChartShapeChangeEvent to all registered listeners. |
void |
setLabel(java.lang.String label)
Sets the label of the strip and sends a ChartShapeChangeEvent to all registered listeners. |
void |
setPaintScale(IPaintScale paintScale)
Sets the IPaintScale object and sends a
ChartShapeChangeEvent to all registered listeners. |
void |
setPosition(RectangleEdge position)
Sets the position of legend and sends a ChartShapeChangeEvent to all registered listeners. |
void |
setStripBorderPaint(java.awt.Paint paint)
Sets the paint used to draw strip border and sends a ChartShapeChangeEvent to all registered listeners. |
void |
setStripBorderStroke(java.awt.Stroke stroke)
Sets the stroke used to draw strip border and sends a ChartShapeChangeEvent to all registered listeners. |
void |
setStripWidth(double width)
Sets the width of strip 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 java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_DIVISION
public static final double DEFAULT_STRIP_WIDTH
public static final boolean DEFAULT_DRAW_STRIP_BORDER
public static final java.awt.Paint DEFAULT_STRIP_BORDER_PAINT
public static final java.awt.Stroke DEFAULT_STRIP_BORDER_STROKE
public static final double DEFAULT_AXIS_OFFSET
Constructor Detail |
---|
public PaintScaleLegendChartShape(IPaintScale paintScale, java.lang.String label, RectangleEdge position, java.awt.geom.Rectangle2D drawArea, IMatrixDataset dataset)
paintScale
- IPaintScale
An object implements IPaintScale
interface.label
- String
The label.position
- RectangleEdge
The position of legend (null not permitted).drawArea
- Rectangle2D
The drawing area (null not permitted).dataset
- IMatrixDataset
The dataset (null not permitted).Method Detail |
---|
public IPaintScale getPaintScale()
IPaintScale
object.
IPaintScale
object (never null).public void setPaintScale(IPaintScale paintScale)
IPaintScale
object and sends a
ChartShapeChangeEvent
to all registered listeners.
paintScale
- IPaintScale
The IPaintScale
object (null not permitted).public RectangleEdge getPosition()
public void setPosition(RectangleEdge position)
ChartShapeChangeEvent
to all registered listeners.
position
- RectangleEdge
The position of legend.public java.awt.geom.Rectangle2D getDrawArea()
public void setDrawArea(java.awt.geom.Rectangle2D drawArea)
ChartShapeChangeEvent
to all registered listeners.
drawArea
- Rectangle2D
The rectangle (null not permitted).public int getDivisions()
public void setDivisions(int divisions)
ChartShapeChangeEvent
to all registered listeners.
divisions
- int
The count and must be >0.public double getStripWidth()
public void setStripWidth(double width)
ChartShapeChangeEvent
to all registered listeners.
width
- double
The width.public boolean isDrawStripBorder()
public void setDrawStripBorder(boolean flag)
ChartShapeChangeEvent
to all registered listeners.
flag
- boolean
A boolean.public java.awt.Paint getStripBorderPaint()
public void setStripBorderPaint(java.awt.Paint paint)
ChartShapeChangeEvent
to all registered listeners.
paint
- Paint
The paint (null not permitted).public java.awt.Stroke getStripBorderStroke()
public void setStripBorderStroke(java.awt.Stroke stroke)
ChartShapeChangeEvent
to all registered listeners.
stroke
- Stroke
The stroke (null not permitted).public double getAxisOffset()
public void setAxisOffset(double offset)
ChartShapeChangeEvent
to all registered listeners.
offset
- double
The offset.public AxisShapeCollection getAxisShapes()
public java.lang.String getLabel()
public void setLabel(java.lang.String label)
ChartShapeChangeEvent
to all registered listeners.
label
- String
The label (null permitted).public IMatrixDataset getDataset()
public void setDataset(IMatrixDataset dataset)
ChartShapeChangeEvent
to all registered listeners.
dataset
- IMatrixDataset
The dataset (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 java.awt.Shape getHotspotShape()
getHotspotShape
in class AbstractChartShape
public ShapeType getShapeType()
getShapeType
in interface IChartShape
ShapeType
.public java.awt.geom.Point2D getTopLeftPoint()
getTopLeftPoint
in interface IChartShape
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.protected void calculateTransformedShape()
calculateTransformedShape
in class AbstractChartShape
protected java.lang.String getMaximumLengthLabel()
public NumberRange getDatasetRange()
public boolean equals(java.lang.Object obj)
equals
in class AbstractChartShape
obj
-
the reference object with which to compare.
public int hashCode()
hashCode
in class AbstractChartShape
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.public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |