kcl.waterloo.graphics.plots2D.contour
Class ContourExtra
- java.lang.Object
-
- kcl.waterloo.graphics.plots2D.contour.ContourExtra
-
- Direct Known Subclasses:
- ContourExtra
public class ContourExtra extends java.lang.ObjectClass for representing contour data.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classContourExtra.SortedContour
-
Constructor Summary
Constructors Constructor and Description ContourExtra()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddContour(java.util.ArrayList<java.util.ArrayList<java.lang.Double>> data, double level)voidaddContour(GJXYSeries data, double level)static ContourExtracreateFromMatrix(double[][] C)Accepts a MATLAB-style contour matrix on input and returns a Waterloo ContourExtra object.static ContourExtracreateInstance()voidgenerateCompounds()voidgenerateContours()Generates the contour lines from the data stored inlevelData.voidgenerateContours(GJContour plot)Generates the contour lines from the data stored inlevelData.intgetColorIndex(java.lang.Double key)Returns the index into the fill & edgeColor arrays for a level.java.awt.geom.AreagetCommonPath()java.awt.geom.Path2DgetCompound(java.lang.Double level)java.util.TreeMap<java.lang.Double,java.awt.geom.Path2D>getCompounds()java.util.ArrayList<Contour>getLevel(java.lang.Double level)java.util.TreeMap<java.lang.Double,java.util.ArrayList<GJXYSeries>>getLevelData()java.lang.Double[]getLevels()Returns the levels for the contours.java.awt.PaintgetNegativeLineColor()java.awt.PaintgetPositiveLineColor()java.util.ArrayList<ContourExtra.SortedContour>getSortedSet()java.awt.BasicStrokegetZeroStroke()java.util.Set<java.lang.Double>keySet()voidsetLevelData(java.util.TreeMap<java.lang.Double,java.util.ArrayList<GJXYSeries>> levels)Sets the levels for this instancevoidsetNegativeLineColor(java.awt.Paint negativeLineColor)voidsetPositiveLineColor(java.awt.Paint positiveLineColor)voidsetZeroStroke(java.awt.BasicStroke s)intsize()java.util.ArrayList<ContourExtra.SortedContour>sort()
-
-
-
Method Detail
-
sort
public java.util.ArrayList<ContourExtra.SortedContour> sort()
-
getColorIndex
public final int getColorIndex(java.lang.Double key)
Returns the index into the fill & edgeColor arrays for a level.- Parameters:
key- the level to find the index for- Returns:
- integer index
-
getLevels
public java.lang.Double[] getLevels()
Returns the levels for the contours.- Returns:
- the levels as a Double[]
-
getLevelData
public final java.util.TreeMap<java.lang.Double,java.util.ArrayList<GJXYSeries>> getLevelData()
- Returns:
- the level data as a LinkedHashMap
>
-
setLevelData
public final void setLevelData(java.util.TreeMap<java.lang.Double,java.util.ArrayList<GJXYSeries>> levels)
Sets the levels for this instance- Parameters:
levels- a TreeMap>
-
getCommonPath
public final java.awt.geom.Area getCommonPath()
-
getLevel
public final java.util.ArrayList<Contour> getLevel(java.lang.Double level)
-
size
public final int size()
-
keySet
public final java.util.Set<java.lang.Double> keySet()
-
getCompounds
public final java.util.TreeMap<java.lang.Double,java.awt.geom.Path2D> getCompounds()
-
getCompound
public final java.awt.geom.Path2D getCompound(java.lang.Double level)
-
generateCompounds
public final void generateCompounds()
-
generateContours
public void generateContours()
Generates the contour lines from the data stored inlevelData.
-
generateContours
public final void generateContours(GJContour plot)
Generates the contour lines from the data stored inlevelData.- Parameters:
plot- the plot to generate contours for
-
createInstance
public static ContourExtra createInstance()
-
addContour
public void addContour(java.util.ArrayList<java.util.ArrayList<java.lang.Double>> data, double level)
-
addContour
public void addContour(GJXYSeries data, double level)
-
createFromMatrix
public static ContourExtra createFromMatrix(double[][] C)
Accepts a MATLAB-style contour matrix on input and returns a Waterloo ContourExtra object. If a filled contour might be required, use the MATLABcontourffunction to generate the matrix.- Parameters:
C- MATLAB-style contour matrix- Returns:
- Waterloo contour object.
-
getSortedSet
public java.util.ArrayList<ContourExtra.SortedContour> getSortedSet()
- Returns:
- the sortedSet
-
setZeroStroke
public void setZeroStroke(java.awt.BasicStroke s)
-
getZeroStroke
public java.awt.BasicStroke getZeroStroke()
-
getPositiveLineColor
public java.awt.Paint getPositiveLineColor()
- Returns:
- the positiveLineColor
-
setPositiveLineColor
public void setPositiveLineColor(java.awt.Paint positiveLineColor)
- Parameters:
positiveLineColor- the positiveLineColor to set
-
getNegativeLineColor
public java.awt.Paint getNegativeLineColor()
- Returns:
- the negativeLineColor
-
setNegativeLineColor
public void setNegativeLineColor(java.awt.Paint negativeLineColor)
- Parameters:
negativeLineColor- the negativeLineColor to set
-
-
DMelt 3.0 © DataMelt by jWork.ORG