|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ujac.chart.BaseChartItem
public abstract class BaseChartItem
Name: BaseChartItem
Description: Base ChartItem implementation.
Field Summary | |
---|---|
protected Rectangle2D |
outputArea
The output area. |
protected ChartItemPosition |
position
The position of the chart item. |
Constructor Summary | |
---|---|
BaseChartItem(ChartItemPosition position)
Constructs a BaseChartItem instance with specific attributes. |
Method Summary | |
---|---|
void |
alignItem(Rectangle2D viewport)
Aligns the item inside the given viewport. |
protected abstract Rectangle2D |
calculateOutputArea(Rectangle2D viewport,
Graphics2D graphics)
Calculates the position of the item. |
double |
getHeight(Rectangle2D viewport,
Graphics2D graphics)
Gets the height of the item box. |
Rectangle2D |
getOutputArea(Rectangle2D viewport,
Graphics2D graphics)
Gets the output area ot the chart item. |
ChartItemPosition |
getPosition()
Gets the position of the chart item. |
double |
getWidth(Rectangle2D viewport,
Graphics2D graphics)
Gets the width of the item box. |
void |
move(double x,
double y)
Moves the item position. |
void |
moveTo(double x,
double y)
Moves the item to the desired position. |
void |
resetMetrics()
Resets the calculated metrics to enforce re-calculation of the item's output area. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.ujac.chart.ChartItem |
---|
draw |
Field Detail |
---|
protected ChartItemPosition position
protected Rectangle2D outputArea
Constructor Detail |
---|
public BaseChartItem(ChartItemPosition position)
position
- The position of the chart item.Method Detail |
---|
public ChartItemPosition getPosition()
getPosition
in interface ChartItem
public Rectangle2D getOutputArea(Rectangle2D viewport, Graphics2D graphics)
getOutputArea
in interface ChartItem
viewport
- The viewport for chart output.graphics
- The graphics object, needed to calculate the metrics.
public void resetMetrics()
resetMetrics
in interface ChartItem
protected abstract Rectangle2D calculateOutputArea(Rectangle2D viewport, Graphics2D graphics)
viewport
- The viewport for chart output.graphics
- The graphics object, needed to calculate the metrics.
public double getWidth(Rectangle2D viewport, Graphics2D graphics)
getWidth
in interface ChartItem
viewport
- The viewport for chart output.graphics
- The graphics object, used for output.
public double getHeight(Rectangle2D viewport, Graphics2D graphics)
getHeight
in interface ChartItem
viewport
- The viewport for chart output.graphics
- The graphics object, used for output.
public void move(double x, double y)
move
in interface ChartItem
x
- The number of pixels by which to move the item horizontally.y
- The number of pixels by which to move the item vertically.public void moveTo(double x, double y)
moveTo
in interface ChartItem
x
- The new horizontal position.y
- The new vertical position.public void alignItem(Rectangle2D viewport)
alignItem
in interface ChartItem
viewport
- The area to place the item.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |