schmitzm.jfree.chart.style
Class ChartPlotStyle

java.lang.Object
  extended by schmitzm.jfree.chart.style.ChartPlotStyle

public class ChartPlotStyle
extends Object

This class defines the rendering style the charts plot(s). The following properties are available:

Version:
1.0
Author:
Martin Schmitz

Field Summary
protected  Float backgroundAlpha
          Holds the background transparency.
protected  Color backgroundPaint
          Holds the background color of the plot.
protected  Color domainGridlinePaint
          Holds the color of the domain grid line.
protected  Boolean domainGridlineVisible
          Holds whether the domain grid line is visible.
protected  Float foregroundAlpha
          Holds the foreground transparency.
protected  RectangleInsets insets
          Holds the inner margins of the plot.
protected  Category LOGGER
          Logger for this class
protected  Color rangeGridlinePaint
          Holds the color of the range grid line.
protected  Boolean rangeGridlineVisible
          Holds whether the range grid line is visible.
 
Constructor Summary
ChartPlotStyle()
          Creates a new style with default values.
 
Method Summary
protected  void applyToCategoryPlot(CategoryPlot plot)
          Applies style properties which can only be applied to CategoryPlot.
protected  void applyToCategoryPlot(XYPlot plot)
          Applies style properties which can only be applied to XYPlot.
 void applyToPlot(Plot plot)
          Applies the style to a specific plot.
 Float getBackgroundAlpha()
          Returns the transparency of the background.
 Color getBackgroundPaint()
          Returns the background color of the plot.
 Color getDomainGridlinePaint()
          Returns the color of the plot's domain grid line.
 Float getForegroundAlpha()
          Returns the transparency of the foreground.
 RectangleInsets getInsets()
          Returns the inner margin of the plot.
 Color getRangeGridlinePaint()
          Returns the color of the plot's range grid line.
 Boolean isDomainGridlineVisible()
          Returns whether the plot's domain grid line is visible.
 Boolean isRangeGridlineVisible()
          Returns whether the plot's range grid line is visible.
 void setBackgroundAlpha(Float alpha)
          Sets the transparency of the background.
 void setBackgroundPaint(Color color)
          Sets the background color of the plot.
 void setDomainGridlinePaint(Color color)
          Sets the color of the plot's domain grid line.
 void setDomainGridlineVisible(Boolean visible)
          Sets whether the plot's domain grid line is visible.
 void setForegroundAlpha(Float alpha)
          Sets the transparency of the foreground.
 void setInsets(RectangleInsets insets)
          Sets the inner margin of the plot.
 void setRangeGridlinePaint(Color color)
          Sets the color of the plot's range grid line.
 void setRangeGridlineVisible(Boolean visible)
          Sets whether the plot's range grid line is visible.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

protected final Category LOGGER
Logger for this class


insets

protected RectangleInsets insets
Holds the inner margins of the plot.


foregroundAlpha

protected Float foregroundAlpha
Holds the foreground transparency.


backgroundPaint

protected Color backgroundPaint
Holds the background color of the plot.


backgroundAlpha

protected Float backgroundAlpha
Holds the background transparency.


domainGridlineVisible

protected Boolean domainGridlineVisible
Holds whether the domain grid line is visible.


domainGridlinePaint

protected Color domainGridlinePaint
Holds the color of the domain grid line.


rangeGridlineVisible

protected Boolean rangeGridlineVisible
Holds whether the range grid line is visible.


rangeGridlinePaint

protected Color rangeGridlinePaint
Holds the color of the range grid line.

Constructor Detail

ChartPlotStyle

public ChartPlotStyle()
Creates a new style with default values.

Method Detail

getInsets

public RectangleInsets getInsets()
Returns the inner margin of the plot.


setInsets

public void setInsets(RectangleInsets insets)
Sets the inner margin of the plot.


getForegroundAlpha

public Float getForegroundAlpha()
Returns the transparency of the foreground.

Returns:
null if no specific transparency is set for the plot

setForegroundAlpha

public void setForegroundAlpha(Float alpha)
Sets the transparency of the foreground.

Parameters:
alpha - transparency value (0..1); can be null to reset to a non-specific value

getBackgroundAlpha

public Float getBackgroundAlpha()
Returns the transparency of the background.

Returns:
null if no specific transparency is set for the plot

setBackgroundAlpha

public void setBackgroundAlpha(Float alpha)
Sets the transparency of the background.

Parameters:
alpha - transparency value (0..1); can be null to reset to a non-specific value

getBackgroundPaint

public Color getBackgroundPaint()
Returns the background color of the plot.

Returns:
null if no specific color is set

setBackgroundPaint

public void setBackgroundPaint(Color color)
Sets the background color of the plot.

Parameters:
color - background color for the plot (can be null to reset to a non-specific color)

isDomainGridlineVisible

public Boolean isDomainGridlineVisible()
Returns whether the plot's domain grid line is visible.

Returns:
null if property is not set for the plot

setDomainGridlineVisible

public void setDomainGridlineVisible(Boolean visible)
Sets whether the plot's domain grid line is visible.

Parameters:
visible - indicates the visibility of the grid line (can be null to reset to a non-specific property)

getDomainGridlinePaint

public Color getDomainGridlinePaint()
Returns the color of the plot's domain grid line.

Returns:
null if no specific color is set

setDomainGridlinePaint

public void setDomainGridlinePaint(Color color)
Sets the color of the plot's domain grid line.

Parameters:
color - color for the domain grid line (can be null to reset to a non-specific color)

isRangeGridlineVisible

public Boolean isRangeGridlineVisible()
Returns whether the plot's range grid line is visible.

Returns:
null if property is not set for the plot

setRangeGridlineVisible

public void setRangeGridlineVisible(Boolean visible)
Sets whether the plot's range grid line is visible.

Parameters:
visible - indicates the visibility of the grid line (can be null to reset to a non-specific property)

getRangeGridlinePaint

public Color getRangeGridlinePaint()
Returns the color of the plot's range grid line.

Returns:
null if no specific color is set

setRangeGridlinePaint

public void setRangeGridlinePaint(Color color)
Sets the color of the plot's range grid line.

Parameters:
color - color for the range grid line (can be null to reset to a non-specific color)

applyToPlot

public void applyToPlot(Plot plot)
Applies the style to a specific plot.
Note: Some style properties can only be applied to specific plot types.

Parameters:
plot - a plot

applyToCategoryPlot

protected void applyToCategoryPlot(CategoryPlot plot)
Applies style properties which can only be applied to CategoryPlot.
Called by applyToPlot(Plot).

Parameters:
plot - a CategoryPlot

applyToCategoryPlot

protected void applyToCategoryPlot(XYPlot plot)
Applies style properties which can only be applied to XYPlot.
Called by applyToPlot(Plot).

Parameters:
plot - a XYPlot