de.erichseifert.gral.plots
Class PlotArea
- java.lang.Object
-
- de.erichseifert.gral.graphics.AbstractDrawable
-
- de.erichseifert.gral.plots.PlotArea
-
- All Implemented Interfaces:
- Drawable, java.io.Serializable
- Direct Known Subclasses:
- PiePlot.PiePlotArea2D, XYPlot.XYPlotArea2D
public abstract class PlotArea extends AbstractDrawable
Abstract class that represents a canvas on which plot data will be drawn. It serves as base for specialized implementations for different plot types. Derived classes have to implement how the actual drawing is done.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description PlotArea()Initializes a new instance with default background color and border.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.awt.PaintgetBackground()Returns the paint which is used to draw the background of the plot area.java.awt.FontgetBaseFont()Returns the current font used as a default for sub-components ans for calculation of relative sizes.java.awt.PaintgetBorderColor()Returns the paint which is used to fill the border of the plot area.java.awt.StrokegetBorderStroke()Returns the stroke which is used to draw the border of the plot area.Insets2DgetClippingOffset()Returns the clipping offset of the plotted data relative to the plot area.voidsetBackground(java.awt.Paint background)Sets the paint which will be used to fill the background of the plot area.voidsetBaseFont(java.awt.Font baseFont)Sets the new font that will be used as a default for sub-components and for calculation of relative sizes.voidsetBorderColor(java.awt.Paint color)Sets the paint which will be used to fill the border of the plot area.voidsetBorderStroke(java.awt.Stroke stroke)Sets the stroke which will be used to draw the border of the plot area.voidsetClippingArea(Insets2D offset)Sets the clipping offset of the plotted data relative to the plot area.-
Methods inherited from class de.erichseifert.gral.graphics.AbstractDrawable
getBounds, getHeight, getPreferredSize, getWidth, getX, getY, setBounds, setBounds, setPosition
-
-
-
-
Constructor Detail
-
PlotArea
public PlotArea()
Initializes a new instance with default background color and border.
-
-
Method Detail
-
getBaseFont
public java.awt.Font getBaseFont()
Returns the current font used as a default for sub-components ans for calculation of relative sizes.- Returns:
- Current base font.
-
setBaseFont
public void setBaseFont(java.awt.Font baseFont)
Sets the new font that will be used as a default for sub-components and for calculation of relative sizes. This method is only used internally to propagate the base font and shouldn't be used manually.- Parameters:
baseFont- New base font.
-
getBackground
public java.awt.Paint getBackground()
Returns the paint which is used to draw the background of the plot area.- Returns:
- Paint which is used to fill the background.
-
setBackground
public void setBackground(java.awt.Paint background)
Sets the paint which will be used to fill the background of the plot area.- Parameters:
background- Paint which should be used to fill the background.
-
getBorderStroke
public java.awt.Stroke getBorderStroke()
Returns the stroke which is used to draw the border of the plot area.- Returns:
- Stroke which is used to draw the border.
-
setBorderStroke
public void setBorderStroke(java.awt.Stroke stroke)
Sets the stroke which will be used to draw the border of the plot area.- Parameters:
stroke- Stroke which should be used to draw the border.
-
getBorderColor
public java.awt.Paint getBorderColor()
Returns the paint which is used to fill the border of the plot area.- Returns:
- Paint which is used to fill the border.
-
setBorderColor
public void setBorderColor(java.awt.Paint color)
Sets the paint which will be used to fill the border of the plot area.- Parameters:
color- Paint which should be used to fill the border.
-
getClippingOffset
public Insets2D getClippingOffset()
Returns the clipping offset of the plotted data relative to the plot area. Positive inset values result in clipping inside the plot area, negative values result in clipping outside the plot area. Specifying anullvalues will turn off clipping.- Returns:
- Clipping offset in pixels relative to the outline of the plot area.
-
setClippingArea
public void setClippingArea(Insets2D offset)
Sets the clipping offset of the plotted data relative to the plot area. Positive inset values result in clipping inside the plot area, negative values result in clipping outside the plot area. Specifying anullvalues will turn off clipping.- Parameters:
offset- Clipping offset in pixels relative to the outline of the plot area.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG