kcl.waterloo.graphics.plots2D
Class GJFill
- java.lang.Object
-
- kcl.waterloo.graphics.plots2D.GJFill
-
- All Implemented Interfaces:
- GJFillableInterface<java.awt.Shape,java.awt.Paint>
public class GJFill extends java.lang.Object implements GJFillableInterface<java.awt.Shape,java.awt.Paint>
GJFill class used to set or modify painted area fill for a plot.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classGJFill.MODEUse the arbitrary area (if orientation is ARBITRARY as follows:static classGJFill.ORIENTATIONOrientation of the fill.
-
Constructor Summary
Constructors Constructor and Description GJFill()Null constructor.GJFill(GJPlotInterface p)Constructs an instance and associates it with a plot.GJFill(GJPlotInterface p, double ref)Constructs a fully usable instance with default VERTICAL fill.GJFill(GJPlotInterface p, double ref, GJFill.ORIENTATION or)Constructs a usable instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.awt.geom.AreagetArbitraryArea()Returns the arbitraryArea in graph units.java.awt.PaintgetAreaPaint()Returns the Paint instance to be used for filling.java.awt.ShapegetFillable()Gets the fillable area for HORIZONTAL & VERTICAL fillsfloatgetFillAlpha()java.awt.AlphaCompositegetFillComposite()GJFill.MODEgetMode()Gets the mode used when orientation is ARBITRARY.GJFill.ORIENTATIONgetOrientation()GJPlotInterfacegetParentPlot()java.awt.geom.AreagetPixelArea()Returns the aritraryArea scaled and translated to pixels according to the current axes limits of the parent graph.doublegetReference()java.util.ArrayList<GJPathSegmentInfo>getSegments()Returns an ArrayListfor use in XML serialization. voidsetArbitraryArea(java.awt.geom.Area arbitraryArea)Sets the arbitraryArea in graph units.voidsetAreaPaint(java.awt.Paint paint)Sets the Paint instance.voidsetFillAlpha(float alpha)voidsetFillComposite(java.awt.AlphaComposite composite)voidsetMode(GJFill.MODE mode)Sets the mode used when orientation is ARBITRARY.voidsetOrientation(GJFill.ORIENTATION orientation)voidsetParentPlot(GJPlotInterface parentPlot)voidsetReference(double reference)voidsetSegments(java.util.ArrayList<GJPathSegmentInfo> arr)Reconstructs an arbitraryArea on XML de-serialization using an ArrayListas input.
-
-
-
Constructor Detail
-
GJFill
public GJFill()
Null constructor. Need for serialization/de-serialization. Do not use.
-
GJFill
public GJFill(GJPlotInterface p)
Constructs an instance and associates it with a plot.- Parameters:
p- a GJPlotInterface
-
GJFill
public GJFill(GJPlotInterface p, double ref)
Constructs a fully usable instance with default VERTICAL fill.- Parameters:
p- the associated plotref- the reference level for HORIZONTAL & VERTICAL fills
-
GJFill
public GJFill(GJPlotInterface p, double ref, GJFill.ORIENTATION or)
Constructs a usable instance.- Parameters:
p- the associated ploatref- the reference level for HORIZONTAL & VERTICAL fillsor- the orientation: HORIZONTAL, VERTICAL or ARBITRARY
-
-
Method Detail
-
getFillable
public java.awt.Shape getFillable()
Gets the fillable area for HORIZONTAL & VERTICAL fills- Specified by:
getFillablein interfaceGJFillableInterface<java.awt.Shape,java.awt.Paint>- Returns:
- an Area instance
-
getAreaPaint
public java.awt.Paint getAreaPaint()
Returns the Paint instance to be used for filling.- Specified by:
getAreaPaintin interfaceGJFillableInterface<java.awt.Shape,java.awt.Paint>- Returns:
- a Paint instance
-
setAreaPaint
public void setAreaPaint(java.awt.Paint paint)
Sets the Paint instance.- Specified by:
setAreaPaintin interfaceGJFillableInterface<java.awt.Shape,java.awt.Paint>- Parameters:
paint- a Paint instance
-
getParentPlot
public GJPlotInterface getParentPlot()
- Returns:
- the parentPlot
-
setParentPlot
public void setParentPlot(GJPlotInterface parentPlot)
- Parameters:
parentPlot- the parentPlot to set
-
getReference
public double getReference()
- Returns:
- the reference
-
setReference
public void setReference(double reference)
- Parameters:
reference- the reference to set
-
getOrientation
public GJFill.ORIENTATION getOrientation()
- Returns:
- the orientation
-
setOrientation
public void setOrientation(GJFill.ORIENTATION orientation)
- Parameters:
orientation- the orientation to set
-
getArbitraryArea
public java.awt.geom.Area getArbitraryArea()
Returns the arbitraryArea in graph units.- Returns:
- the arbitraryArea
-
setArbitraryArea
public void setArbitraryArea(java.awt.geom.Area arbitraryArea)
Sets the arbitraryArea in graph units.- Parameters:
arbitraryArea- the arbitraryArea to set
-
getSegments
public final java.util.ArrayList<GJPathSegmentInfo> getSegments()
Returns an ArrayListfor use in XML serialization. - Returns:
- an ArrayList
-
setSegments
public final void setSegments(java.util.ArrayList<GJPathSegmentInfo> arr)
Reconstructs an arbitraryArea on XML de-serialization using an ArrayListas input. - Parameters:
arr- the ArrayList
-
getMode
public GJFill.MODE getMode()
Gets the mode used when orientation is ARBITRARY. Possible values are SET, ADD, SUBTRACT, INTERSECT, XOR.- Returns:
- the mode
-
setMode
public void setMode(GJFill.MODE mode)
Sets the mode used when orientation is ARBITRARY. Possible values are SET, ADD, SUBTRACT, INTERSECT, XOR.- Parameters:
mode- the mode to set
-
getPixelArea
public java.awt.geom.Area getPixelArea()
Returns the aritraryArea scaled and translated to pixels according to the current axes limits of the parent graph.- Returns:
- a pixelArea
-
getFillComposite
public java.awt.AlphaComposite getFillComposite()
- Specified by:
getFillCompositein interfaceGJFillableInterface<java.awt.Shape,java.awt.Paint>- Returns:
- the composite
-
setFillComposite
public void setFillComposite(java.awt.AlphaComposite composite)
- Specified by:
setFillCompositein interfaceGJFillableInterface<java.awt.Shape,java.awt.Paint>- Parameters:
composite- the composite to set
-
getFillAlpha
public float getFillAlpha()
- Specified by:
getFillAlphain interfaceGJFillableInterface<java.awt.Shape,java.awt.Paint>
-
setFillAlpha
public void setFillAlpha(float alpha)
- Specified by:
setFillAlphain interfaceGJFillableInterface<java.awt.Shape,java.awt.Paint>
-
-
DMelt 3.0 © DataMelt by jWork.ORG