JIDE 3.5.15

com.jidesoft.chart.style
Class ChartStyle

java.lang.Object
  extended by com.jidesoft.chart.style.ChartStyle

public class ChartStyle
extends Object

Contains style information for a point by combining PointStyle, LineStyle and BarStyle.


Field Summary
static ChartStyle DEFAULT_STYLE
           
 
Constructor Summary
ChartStyle()
          Create a default ChartStyle
ChartStyle(ChartStyle style)
          Copy constructor for a ChartStyle
ChartStyle(Color color)
          Constructs a style for showing the lines only
ChartStyle(Color color, boolean pointsVisible, boolean linesVisible)
          Constructs a style for showing lines and/or points of the same color
ChartStyle(Color color, boolean pointsVisible, boolean linesVisible, boolean barsVisible)
          Constructs a style for showing lines, points and bars of the same color
ChartStyle(Color pointColor, PointShape shape)
          Constructs a style for showing the points only
ChartStyle(Color pointColor, PointShape shape, Color lineColor)
          Constructs a style for showing lines and points with specified colors
ChartStyle(Color pointColor, PointShape shape, int pointSize)
          Constructs a style for showing the points only
 
Method Summary
 boolean equals(Object obj)
           
 Color getBarColor()
          Returns the color of bars for this style
 Orientation getBarOrientation()
          Returns the current orientation of the bars
 Paint getBarPaint()
          Returns the paint used for rendering bars or filling the segments of a pie chart
 BarStyle getBarStyle()
          Returns the style to use for rendering the bars of a bar chart
 Integer getBarWidth()
          Returns the preferred width of bars according to this style
 Double getBarWidthProportion()
           
 Color getLineColor()
          Returns the currently specified line color
 Paint getLineFill()
          The paint to use in area charts when filling from the line to the axis
 LineFillExtent getLineFillExtent()
           
 Orientation getLineFillOrientation()
           
 Paint getLinePaint()
          Deprecated. in favour of getLineFill() Note that this method will be removed some time after release 2.10
 BasicStroke getLineStroke()
          Returns the current stroke used for lines
 LineStyle getLineStyle()
          Returns the style to use when rendering lines
 int getLineWidth()
          Returns the width of lines according to the style
 float getPieExplosionRatio()
          Returns the amount by which exploded segments are displaced when selected
 float getPieOffsetAngle()
          Returns the angular offset of the pie chart in degrees
 Color getPointColor()
          Returns the color to use when rendering points
 PointShape getPointShape()
          Returns the current shape of points
 int getPointSize()
          Returns the currently specified point size
 PointStyle getPointStyle()
          Returns the style used for rendering points
 PointShape getShape()
          Deprecated. in favour of getPointShape()
 int hashCode()
           
 boolean isBarsVisible()
          Returns whether bars are visible in this style
 boolean isBarVisible()
          Deprecated. in favour of isBarsVisible
 boolean isLinesVisible()
          Returns whether lines are currently visible
 boolean isPieSegmentsAlwaysExploded()
          Returns a boolean to indicate whether pie segments are exploded, regardless of selection
 boolean isPointsVisible()
          Returns whether points are currently visible
 void setBarColor(Color color)
          Specify the bar color for rendering bars
 void setBarOrientation(Orientation orientation)
          Specify the orientation of bars when drawing bar charts
 void setBarPaint(Paint paint)
          Specify the bar paint for rendering bars or filling the segments of a pie chart
 void setBarStyle(BarStyle barStyle)
          Set the style to use when rendering the bars of a bar chart
 void setBarsVisible(boolean visible)
          Specify whether bars are visible in this style (that is, the bars of a bar chart)
 void setBarVisible(boolean visible)
          Deprecated. please use setBarsVisible() instead
 void setBarWidth(Integer barWidth)
          Specify the width of bars
 void setBarWidthProportion(Double barWidthProportion)
           
 void setLineColor(Color lineColor)
          Sets the color of lines used in this style
 void setLineFill(Paint fill)
          Specify the paint to use in area charts when filling from the line to the axis
 void setLineFillExtent(LineFillExtent extent)
           
 void setLineFillOrientation(Orientation orientation)
           
 void setLineStroke(BasicStroke stroke)
          Set the stroke to use for lines
 void setLineStyle(LineStyle lineStyle)
          Specify the style to use when rendering lines
 void setLinesVisible(boolean linesVisible)
          Sets the visibility of lines in this style
 void setLineWidth(int width)
          Set the width of lines
 void setPieExplosionRatio(float explosionRatio)
          Specifies the amount by which exploded segments are displaced when selected
 void setPieOffsetAngle(float offsetAngle)
          Specifies the angular offset of the pie chart in degrees
 void setPieSegmentsAlwaysExploded(boolean alwaysExploded)
          Specify whether pie segments should always be exploded, regardless of selection
 void setPointColor(Color color)
          Set the Color used for painting points
 void setPointShape(PointShape newShape)
          Set the shape of points used by this style
 void setPointSize(int newSize)
          Set the size of points (in pixels)
 void setPointStyle(PointStyle pointStyle)
          Specify the style to use when rendering points
 void setPointsVisible(boolean pointsVisible)
          Determine whether points are visible in this style
 void setShape(PointShape shape)
          Deprecated. in favour of setPointShape()
 String toString()
           
 ChartStyle withBars()
          A chaining style method that specifies that we want to use bars only
 ChartStyle withBars(Paint barPaint)
          A chaining style method that specifies that we want to use bars only, and also allows you to specify the fill for the bars
 ChartStyle withLineFill(Paint lineFill)
          A chaining style method that specifies to use lines, but also using the supplied line fill.
 ChartStyle withLines()
          A chaining style method that specifies that we want to use lines only
 ChartStyle withNothing()
          A chaining style method that specifies that we want to display none of points, lines or bars.
 ChartStyle withPoints()
          A chaining style method that specifies that we want to use points only
 ChartStyle withPointsAndLines()
          A chaining style method that specifies that we want to use points and lines
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_STYLE

public static final ChartStyle DEFAULT_STYLE
Constructor Detail

ChartStyle

public ChartStyle()
Create a default ChartStyle


ChartStyle

public ChartStyle(ChartStyle style)
Copy constructor for a ChartStyle

Parameters:
style - the chart style object to copy

ChartStyle

public ChartStyle(Color color)
Constructs a style for showing the lines only

Parameters:
color - the color to use for the lines

ChartStyle

public ChartStyle(Color pointColor,
                  PointShape shape)
Constructs a style for showing the points only

Parameters:
pointColor - the color to use for the points
shape - the shape to use for the points

ChartStyle

public ChartStyle(Color pointColor,
                  PointShape shape,
                  int pointSize)
Constructs a style for showing the points only

Parameters:
pointColor - the color to use for the points
shape - the shape to use for the points
pointSize - the size of the points

ChartStyle

public ChartStyle(Color color,
                  boolean pointsVisible,
                  boolean linesVisible)
Constructs a style for showing lines and/or points of the same color

Parameters:
color - the color to use for points, lines and bars as appropriate
pointsVisible - whether points should be visible
linesVisible - whether lines should be visible

ChartStyle

public ChartStyle(Color color,
                  boolean pointsVisible,
                  boolean linesVisible,
                  boolean barsVisible)
Constructs a style for showing lines, points and bars of the same color

Parameters:
color - the color to use for points, lines and bars as appropriate
pointsVisible - whether points should be visible
linesVisible - whether lines should be visible
barsVisible - whether bars should be visible

ChartStyle

public ChartStyle(Color pointColor,
                  PointShape shape,
                  Color lineColor)
Constructs a style for showing lines and points with specified colors

Parameters:
pointColor - the color to use for points
shape - the (suggested) shape to use for points
lineColor - the color to use for lines
Method Detail

withPoints

public ChartStyle withPoints()
A chaining style method that specifies that we want to use points only

Returns:
this ChartStyle instance

withLines

public ChartStyle withLines()
A chaining style method that specifies that we want to use lines only

Returns:
this ChartStyle instance

withLineFill

public ChartStyle withLineFill(Paint lineFill)
A chaining style method that specifies to use lines, but also using the supplied line fill. This effectively creates an Area chart.

Returns:
this ChartStyle instance

withNothing

public ChartStyle withNothing()
A chaining style method that specifies that we want to display none of points, lines or bars. Useful when using a highlight to mark a point as a discontinuity in the model.

Returns:
this ChartStyle instance

withBars

public ChartStyle withBars()
A chaining style method that specifies that we want to use bars only

Returns:
this ChartStyle instance

withBars

public ChartStyle withBars(Paint barPaint)
A chaining style method that specifies that we want to use bars only, and also allows you to specify the fill for the bars

Returns:
this ChartStyle instance

withPointsAndLines

public ChartStyle withPointsAndLines()
A chaining style method that specifies that we want to use points and lines

Returns:
this ChartStyle instance

getPointColor

public Color getPointColor()
Returns the color to use when rendering points

Returns:
the Color used for painting points for any model to which this style is applied

setPointColor

public void setPointColor(Color color)
Set the Color used for painting points

Parameters:
color - the color to use for the points

getPointSize

public int getPointSize()
Returns the currently specified point size

Returns:
the size of points used according to this style (in pixels)

setPointSize

public void setPointSize(int newSize)
Set the size of points (in pixels)

Parameters:
newSize - the new size

getPointShape

public PointShape getPointShape()
Returns the current shape of points

Returns:
the shape of points, as defined by the PointShape enum

setPointShape

public void setPointShape(PointShape newShape)
Set the shape of points used by this style

Parameters:
newShape - the new shape of points

getLineColor

public Color getLineColor()
Returns the currently specified line color

Returns:
the color of lines used in this style

setLineColor

public void setLineColor(Color lineColor)
Sets the color of lines used in this style

Parameters:
lineColor - the new line color

isLinesVisible

public boolean isLinesVisible()
Returns whether lines are currently visible

Returns:
whether lines are visible in this style

setLinesVisible

public void setLinesVisible(boolean linesVisible)
Sets the visibility of lines in this style

Parameters:
linesVisible - whether lines should be visible

isPointsVisible

public boolean isPointsVisible()
Returns whether points are currently visible

Returns:
whether points are visible in this style

setPointsVisible

public void setPointsVisible(boolean pointsVisible)
Determine whether points are visible in this style

Parameters:
pointsVisible - specifies whether points should be rendered for this style

isBarVisible

public boolean isBarVisible()
Deprecated. in favour of isBarsVisible

This has been deprecated and will be removed sometime after 2.10

Returns:
whether bars are visible in this style

isBarsVisible

public boolean isBarsVisible()
Returns whether bars are visible in this style

Returns:
whether bars are visible in this style

setBarVisible

public void setBarVisible(boolean visible)
Deprecated. please use setBarsVisible() instead

Note that this method will be removed some time after version 2.9.4

Parameters:
visible - whether bars should be visible

setBarsVisible

public void setBarsVisible(boolean visible)
Specify whether bars are visible in this style (that is, the bars of a bar chart)

Parameters:
visible - state whether bars should be rendered

getBarColor

public Color getBarColor()
Returns the color of bars for this style

Returns:
the color of bars for this style

getBarPaint

public Paint getBarPaint()
Returns the paint used for rendering bars or filling the segments of a pie chart

Returns:
the paint used for rendering bars

setBarColor

public void setBarColor(Color color)
Specify the bar color for rendering bars

Parameters:
color - the new color

setBarPaint

public void setBarPaint(Paint paint)
Specify the bar paint for rendering bars or filling the segments of a pie chart

Parameters:
paint - the paint to use when rendering bars

getBarWidth

public Integer getBarWidth()
Returns the preferred width of bars according to this style

Returns:
the preferred width of bars according to this style. This might not be used depending on other layout factors.

setBarWidth

public void setBarWidth(Integer barWidth)
Specify the width of bars

Parameters:
barWidth - the width of bars in pixels

getBarWidthProportion

public Double getBarWidthProportion()

setBarWidthProportion

public void setBarWidthProportion(Double barWidthProportion)

getShape

public PointShape getShape()
Deprecated. in favour of getPointShape()

This method is deprecated and will be removed some time after release 2.10

Returns:
the shape of points

setShape

public void setShape(PointShape shape)
Deprecated. in favour of setPointShape()

Sets the shape to use for rendering points. The shape may be overridden by a custom renderer.

Parameters:
shape - the shape to use

getLineStyle

public LineStyle getLineStyle()
Returns the style to use when rendering lines

Returns:
the style to use when rendering lines

setLineStyle

public void setLineStyle(LineStyle lineStyle)
Specify the style to use when rendering lines

Parameters:
lineStyle - the new line style

getBarStyle

public BarStyle getBarStyle()
Returns the style to use for rendering the bars of a bar chart

Returns:
the style to use for rendering the bars of a bar chart

setBarStyle

public void setBarStyle(BarStyle barStyle)
Set the style to use when rendering the bars of a bar chart

Parameters:
barStyle - the style to use for the rendering of bars

getLinePaint

public Paint getLinePaint()
Deprecated. in favour of getLineFill() Note that this method will be removed some time after release 2.10

The paint to use in area charts when filling from the line to the axis

Returns:
the paint

getLineFill

public Paint getLineFill()
The paint to use in area charts when filling from the line to the axis

Returns:
the paint

setLineFill

public void setLineFill(Paint fill)
Specify the paint to use in area charts when filling from the line to the axis

Parameters:
fill - the paint to use

getLineFillOrientation

public Orientation getLineFillOrientation()

setLineFillOrientation

public void setLineFillOrientation(Orientation orientation)

getLineFillExtent

public LineFillExtent getLineFillExtent()

setLineFillExtent

public void setLineFillExtent(LineFillExtent extent)

getLineWidth

public int getLineWidth()
Returns the width of lines according to the style

Returns:
the width of lines

setLineWidth

public void setLineWidth(int width)
Set the width of lines

Parameters:
width - the width in pixels

setLineStroke

public void setLineStroke(BasicStroke stroke)
Set the stroke to use for lines

Parameters:
stroke - the stroke to use for lines

getLineStroke

public BasicStroke getLineStroke()
Returns the current stroke used for lines

Returns:
the current Stroke used when rendering lines

getPointStyle

public PointStyle getPointStyle()
Returns the style used for rendering points

Returns:
the style used for rendering points

setPointStyle

public void setPointStyle(PointStyle pointStyle)
Specify the style to use when rendering points

Parameters:
pointStyle - the new point style

getBarOrientation

public Orientation getBarOrientation()
Returns the current orientation of the bars

Returns:
the orientation of bars when drawing bar charts

setBarOrientation

public void setBarOrientation(Orientation orientation)
Specify the orientation of bars when drawing bar charts

Parameters:
orientation - the orientation of the bars (horizontal or vertical)

getPieOffsetAngle

public float getPieOffsetAngle()
Returns the angular offset of the pie chart in degrees

Returns:
the angular offset of the pie chart in degrees

setPieOffsetAngle

public void setPieOffsetAngle(float offsetAngle)
Specifies the angular offset of the pie chart in degrees

Parameters:
offsetAngle - the angular offset of the pie chart in degrees

getPieExplosionRatio

public float getPieExplosionRatio()
Returns the amount by which exploded segments are displaced when selected

Returns:
the amount by which exploded segments are displaced, as a proportion of the radius of the pie chart

setPieExplosionRatio

public void setPieExplosionRatio(float explosionRatio)
Specifies the amount by which exploded segments are displaced when selected

Parameters:
explosionRatio - the amount by which exploded segments are displaced when selected

setPieSegmentsAlwaysExploded

public void setPieSegmentsAlwaysExploded(boolean alwaysExploded)
Specify whether pie segments should always be exploded, regardless of selection

Parameters:
alwaysExploded - whether to explode segments regardless of selection

isPieSegmentsAlwaysExploded

public boolean isPieSegmentsAlwaysExploded()
Returns a boolean to indicate whether pie segments are exploded, regardless of selection

Returns:
a boolean to indicate whether pie segments are exploded regardless of selection

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

JIDE 3.5.15