de.erichseifert.gral.graphics
Interface Drawable
-
- All Known Implementing Classes:
- AbstractDrawable, AbstractLegend, AbstractLegend.AbstractSymbol, AbstractLegend.Item, AbstractPlot, BarPlot, BarPlot.BarPlotLegend, BoxPlot, BoxPlot.BoxPlotLegend, DrawableContainer, Label, PiePlot, PiePlot.PiePlotArea2D, PiePlot.PiePlotLegend, PlotArea, RasterPlot, SeriesLegend, ValueLegend, XYPlot, XYPlot.XYLegend, XYPlot.XYPlotArea2D
public interface DrawableInterface providing functions for a lightweight component that can be drawn on the screen. Functions include management of the bounding rectangle, returning a preferred size for layout operations, or drawing using a specified context.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description voiddraw(DrawingContext context)Draws theDrawablewith the specified drawing context.java.awt.geom.Rectangle2DgetBounds()Returns the bounds of thisDrawable.doublegetHeight()Returns the height of the bounds.java.awt.geom.Dimension2DgetPreferredSize()Returns the preferred size of theDrawable.doublegetWidth()Returns the width of the bounds.doublegetX()Returns the x-position of the bounds.doublegetY()Returns the y-position of the bounds.voidsetBounds(double x, double y, double width, double height)Sets the bounds to the specified coordinates, width and height.voidsetBounds(java.awt.geom.Rectangle2D bounds)Sets the bounds to the specified bounding rectangle.voidsetPosition(double x, double y)Sets the position to the specified coordinates.
-
-
-
Method Detail
-
getBounds
java.awt.geom.Rectangle2D getBounds()
Returns the bounds of thisDrawable.- Returns:
- a bounding rectangle
-
setBounds
void setBounds(java.awt.geom.Rectangle2D bounds)
Sets the bounds to the specified bounding rectangle.- Parameters:
bounds- rectangle containing the component.
-
setBounds
void setBounds(double x, double y, double width, double height)Sets the bounds to the specified coordinates, width and height. This method should be used when overriding functionality.- Parameters:
x- horizontal position of the upper-left cornery- vertical position of the upper-left cornerwidth- horizontal extentheight- vertical extent
-
getX
double getX()
Returns the x-position of the bounds.- Returns:
- horizontal position of the upper-left corner of the bounding rectangle
-
getY
double getY()
Returns the y-position of the bounds.- Returns:
- vertical position of the upper-left corner of the bounding rectangle
-
setPosition
void setPosition(double x, double y)Sets the position to the specified coordinates.- Parameters:
x- Coordinate on the x-axis.y- Coordinate on the y-axis.
-
getWidth
double getWidth()
Returns the width of the bounds.- Returns:
- horizontal extent
-
getHeight
double getHeight()
Returns the height of the bounds.- Returns:
- vertical extent
-
getPreferredSize
java.awt.geom.Dimension2D getPreferredSize()
Returns the preferred size of theDrawable.- Returns:
- horizontal and vertical extent that wants to be reached
-
draw
void draw(DrawingContext context)
Draws theDrawablewith the specified drawing context.- Parameters:
context- Environment used for drawing
-
-
DataMelt 3.0 © DataMelt by jWork.ORG