org.jfree.chart

Class ClipPath

public class ClipPath extends Object implements Cloneable

Deprecated: This class is no longer supported (as of version 1.0.4). If you are creating contour plots, please try to use XYPlot and XYBlockRenderer.

This class would typically be used with a ContourPlot. It allows the user to define a GeneralPath curve in plot coordinates. This curve can then be used mask off or define regions within the contour plot. The data must be sorted.
Constructor Summary
ClipPath()
Constructor for ClipPath.
ClipPath(double[] xValue, double[] yValue)
Constructor for ClipPath.
ClipPath(double[] xValue, double[] yValue, boolean clip, boolean fillPath, boolean drawPath)
Constructor for ClipPath.
ClipPath(double[] xValue, double[] yValue, boolean fillPath, boolean drawPath, Paint fillPaint, Paint drawPaint, Stroke drawStroke, Composite composite)
Constructor for ClipPath.
Method Summary
Objectclone()
Returns a clone of the object (a deeper clone than default to avoid bugs when setting values in cloned object).
GeneralPathdraw(Graphics2D g2, Rectangle2D dataArea, ValueAxis horizontalAxis, ValueAxis verticalAxis)
Draws the clip path.
GeneralPathgenerateClipPath(Rectangle2D dataArea, ValueAxis horizontalAxis, ValueAxis verticalAxis)
Generates the clip path.
CompositegetComposite()
Returns the composite.
PaintgetDrawPaint()
Returns the drawPaint.
StrokegetDrawStroke()
Returns the drawStroke.
PaintgetFillPaint()
Returns the fillPaint.
double[]getXValue()
Returns the xValue.
double[]getYValue()
Returns the yValue.
booleanisClip()
Returns the clip.
booleanisDrawPath()
Returns the drawPath.
booleanisFillPath()
Returns the fillPath.
voidsetClip(boolean clip)
Sets the clip.
voidsetComposite(Composite composite)
Sets the composite.
voidsetDrawPaint(Paint drawPaint)
Sets the drawPaint.
voidsetDrawPath(boolean drawPath)
Sets the drawPath.
voidsetDrawStroke(Stroke drawStroke)
Sets the drawStroke.
voidsetFillPaint(Paint fillPaint)
Sets the fillPaint.
voidsetFillPath(boolean fillPath)
Sets the fillPath.
voidsetXValue(double[] xValue)
Sets the xValue.
voidsetYValue(double[] yValue)
Sets the yValue.

Constructor Detail

ClipPath

public ClipPath()
Constructor for ClipPath.

ClipPath

public ClipPath(double[] xValue, double[] yValue)
Constructor for ClipPath. Default values are assumed for the fillPath and drawPath options as false and true respectively. The fillPaint is set to Color.GRAY, the drawColor is Color.BLUE, the stroke is BasicStroke(1) and the composite is AlphaComposite.Src.

Parameters: xValue x coordinates of curved to be created yValue y coordinates of curved to be created

ClipPath

public ClipPath(double[] xValue, double[] yValue, boolean clip, boolean fillPath, boolean drawPath)
Constructor for ClipPath. The fillPaint is set to Color.GRAY, the drawColor is Color.BLUE, the stroke is BasicStroke(1) and the composite is AlphaComposite.Src.

Parameters: xValue x coordinates of curved to be created yValue y coordinates of curved to be created clip clip? fillPath whether the path is to filled drawPath whether the path is to drawn as an outline

ClipPath

public ClipPath(double[] xValue, double[] yValue, boolean fillPath, boolean drawPath, Paint fillPaint, Paint drawPaint, Stroke drawStroke, Composite composite)
Constructor for ClipPath.

Parameters: xValue x coordinates of curved to be created yValue y coordinates of curved to be created fillPath whether the path is to filled drawPath whether the path is to drawn as an outline fillPaint the fill paint drawPaint the outline stroke color drawStroke the stroke style composite the composite rule

Method Detail

clone

public Object clone()
Returns a clone of the object (a deeper clone than default to avoid bugs when setting values in cloned object).

Returns: The clone.

Throws: CloneNotSupportedException if cloning is not supported.

draw

public GeneralPath draw(Graphics2D g2, Rectangle2D dataArea, ValueAxis horizontalAxis, ValueAxis verticalAxis)
Draws the clip path.

Parameters: g2 current graphics2D. dataArea the dataArea that the plot is being draw in. horizontalAxis the horizontal axis. verticalAxis the vertical axis.

Returns: The GeneralPath defining the outline

generateClipPath

public GeneralPath generateClipPath(Rectangle2D dataArea, ValueAxis horizontalAxis, ValueAxis verticalAxis)
Generates the clip path.

Parameters: dataArea the dataArea that the plot is being draw in. horizontalAxis the horizontal axis. verticalAxis the vertical axis.

Returns: The GeneralPath defining the outline

getComposite

public Composite getComposite()
Returns the composite.

Returns: Composite

getDrawPaint

public Paint getDrawPaint()
Returns the drawPaint.

Returns: Paint

getDrawStroke

public Stroke getDrawStroke()
Returns the drawStroke.

Returns: Stroke

getFillPaint

public Paint getFillPaint()
Returns the fillPaint.

Returns: Paint

getXValue

public double[] getXValue()
Returns the xValue.

Returns: double[]

getYValue

public double[] getYValue()
Returns the yValue.

Returns: double[]

isClip

public boolean isClip()
Returns the clip.

Returns: boolean

isDrawPath

public boolean isDrawPath()
Returns the drawPath.

Returns: boolean

isFillPath

public boolean isFillPath()
Returns the fillPath.

Returns: boolean

setClip

public void setClip(boolean clip)
Sets the clip.

Parameters: clip The clip to set

setComposite

public void setComposite(Composite composite)
Sets the composite.

Parameters: composite The composite to set

setDrawPaint

public void setDrawPaint(Paint drawPaint)
Sets the drawPaint.

Parameters: drawPaint The drawPaint to set

setDrawPath

public void setDrawPath(boolean drawPath)
Sets the drawPath.

Parameters: drawPath The drawPath to set

setDrawStroke

public void setDrawStroke(Stroke drawStroke)
Sets the drawStroke.

Parameters: drawStroke The drawStroke to set

setFillPaint

public void setFillPaint(Paint fillPaint)
Sets the fillPaint.

Parameters: fillPaint The fillPaint to set

setFillPath

public void setFillPath(boolean fillPath)
Sets the fillPath.

Parameters: fillPath The fillPath to set

setXValue

public void setXValue(double[] xValue)
Sets the xValue.

Parameters: xValue The xValue to set

setYValue

public void setYValue(double[] yValue)
Sets the yValue.

Parameters: yValue The yValue to set