de.erichseifert.gral.graphics
Class AbstractDrawable
- java.lang.Object
-
- de.erichseifert.gral.graphics.AbstractDrawable
-
- All Implemented Interfaces:
- Drawable, java.io.Serializable
- Direct Known Subclasses:
- AbstractLegend.AbstractSymbol, DrawableContainer, Label, PlotArea
public abstract class AbstractDrawable extends java.lang.Object implements Drawable, java.io.Serializable
Abstract implementation of theDrawableinterface. This class implements common functionality like the different ways for getting and setting the bounding rectangle of the drawable object.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description AbstractDrawable()Creates an AbstractDrawable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description 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
public java.awt.geom.Rectangle2D getBounds()
Returns the bounds of thisDrawable.
-
getX
public double getX()
Returns the x-position of the bounds.
-
getY
public double getY()
Returns the y-position of the bounds.
-
getWidth
public double getWidth()
Returns the width of the bounds.
-
getHeight
public double getHeight()
Returns the height of the bounds.
-
setBounds
public void setBounds(java.awt.geom.Rectangle2D bounds)
Sets the bounds to the specified bounding rectangle.
-
setBounds
public 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.
-
getPreferredSize
public java.awt.geom.Dimension2D getPreferredSize()
Returns the preferred size of theDrawable.- Specified by:
getPreferredSizein interfaceDrawable- Returns:
- horizontal and vertical extent that wants to be reached
-
setPosition
public void setPosition(double x, double y)Description copied from interface:DrawableSets the position to the specified coordinates.- Specified by:
setPositionin interfaceDrawable- Parameters:
x- Coordinate on the x-axis.y- Coordinate on the y-axis.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG