org.ujac.chart
Interface ChartItem

All Known Implementing Classes:
BaseChartItem, PieChartDescriptionItem, TextChartItem

public interface ChartItem

Name: ChartItem
Description: Interface for chart items.

Author:
lauerc

Method Summary
 void alignItem(Rectangle2D viewport)
          Aligns the item inside the given viewport.
 void draw(Rectangle2D viewport, Graphics2D graphics)
          Draws the item to the given graphic instance.
 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.
 

Method Detail

getPosition

ChartItemPosition getPosition()
Gets the position of the chart item.

Returns:
The current position.

getOutputArea

Rectangle2D getOutputArea(Rectangle2D viewport,
                          Graphics2D graphics)
Gets the output area ot the chart item.

Parameters:
viewport - The viewport for chart output.
graphics - The graphics object, needed to calculate the metrics.
Returns:
The output area the item will be rendered to.

resetMetrics

void resetMetrics()
Resets the calculated metrics to enforce re-calculation of the item's output area.


draw

void draw(Rectangle2D viewport,
          Graphics2D graphics)
Draws the item to the given graphic instance.

Parameters:
viewport - The viewport for chart output.
graphics - The graphics object, used for output.

getWidth

double getWidth(Rectangle2D viewport,
                Graphics2D graphics)
Gets the width of the item box.

Parameters:
viewport - The viewport for chart output.
graphics - The graphics object, used for output.
Returns:
The width of the item box.

getHeight

double getHeight(Rectangle2D viewport,
                 Graphics2D graphics)
Gets the height of the item box.

Parameters:
viewport - The viewport for chart output.
graphics - The graphics object, used for output.
Returns:
The height of the item box.

move

void move(double x,
          double y)
Moves the item position.

Parameters:
x - The number of pixels by which to move the item horizontally.
y - The number of pixels by which to move the item vertically.

moveTo

void moveTo(double x,
            double y)
Moves the item to the desired position.

Parameters:
x - The new horizontal position.
y - The new vertical position.

alignItem

void alignItem(Rectangle2D viewport)
Aligns the item inside the given viewport.

Parameters:
viewport - The area to place the item.


Copyright © 2003-2004 UJAC.org. All Rights Reserved.