Class ContourLayer
- java.lang.Object
-
- uk.ac.rdg.resc.edal.graphics.style.Drawable
-
- uk.ac.rdg.resc.edal.graphics.style.ImageLayer
-
- uk.ac.rdg.resc.edal.graphics.style.GriddedImageLayer
-
- uk.ac.rdg.resc.edal.graphics.style.ContourLayer
-
public class ContourLayer extends GriddedImageLayer
AGriddedImageLayer
which plots contours- Author:
- Charles Roberts, Guy Griffiths
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ContourLayer.ContourLineStyle
-
Nested classes/interfaces inherited from class uk.ac.rdg.resc.edal.graphics.style.GriddedImageLayer
GriddedImageLayer.MapFeatureDataReader
-
Nested classes/interfaces inherited from class uk.ac.rdg.resc.edal.graphics.style.ImageLayer
ImageLayer.MetadataFilter
-
Nested classes/interfaces inherited from class uk.ac.rdg.resc.edal.graphics.style.Drawable
Drawable.NameAndRange
-
-
Constructor Summary
Constructors Constructor Description ContourLayer(String dataFieldName, ScaleRange scale, boolean autoscaleEnabled, double numberOfContours, Color contourLineColour, String contourPalette, int contourLineWidth, ContourLayer.ContourLineStyle contourLineStyle, boolean labelEnabled)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
drawIntoImage(BufferedImage image, GriddedImageLayer.MapFeatureDataReader dataReader)
Draws the data into the supplied image.Set<Drawable.NameAndRange>
getFieldsWithScales()
ImageLayer.MetadataFilter
getMetadataFilter()
-
Methods inherited from class uk.ac.rdg.resc.edal.graphics.style.GriddedImageLayer
drawIntoImage, supportedFeatureTypes
-
Methods inherited from class uk.ac.rdg.resc.edal.graphics.style.ImageLayer
drawImage
-
Methods inherited from class uk.ac.rdg.resc.edal.graphics.style.Drawable
getOpacityTransform, setOpacityTransform
-
-
-
-
Constructor Detail
-
ContourLayer
public ContourLayer(String dataFieldName, ScaleRange scale, boolean autoscaleEnabled, double numberOfContours, Color contourLineColour, String contourPalette, int contourLineWidth, ContourLayer.ContourLineStyle contourLineStyle, boolean labelEnabled)
- Parameters:
dataFieldName
- The data field to plotscale
- TheScaleRange
spanned by the contoursautoscaleEnabled
- Whether to auto-scale the datanumberOfContours
- The number of contours to plotcontourLineColour
- The colour to plot contours. This defaults to black, and will be ignored if a palette is specified.contourPalette
- The name of the colour palette to use. This can benull
, in which case all contours have the same colour.contourLineWidth
- The width, in pixels, to draw contour linescontourLineStyle
- TheContourLayer.ContourLineStyle
in which to plot contours.labelEnabled
- Whether or not to add value labels to contour lines.
-
-
Method Detail
-
drawIntoImage
protected void drawIntoImage(BufferedImage image, GriddedImageLayer.MapFeatureDataReader dataReader) throws EdalException
Description copied from class:GriddedImageLayer
Draws the data into the supplied image.- Specified by:
drawIntoImage
in classGriddedImageLayer
- Parameters:
image
- ABufferedImage
to draw intodataReader
- AGriddedImageLayer.MapFeatureDataReader
which is used to obtain the actual data values and domain. TheMapDomain
returned will match the size of the image, and pixels are georeferenced to the GridCell2Ds which comprise the domain- Throws:
EdalException
- If there is a problem reading the data or drawing into the image
-
getFieldsWithScales
public Set<Drawable.NameAndRange> getFieldsWithScales()
- Specified by:
getFieldsWithScales
in classDrawable
- Returns:
- A list of all the fields used in this image layer, and their
appropriate scale ranges. If there is NO scale range there can be
NO data field and vice versa - i.e. a
Drawable.NameAndRange
object must have all non-null fields. If the layer doesn't depend on any data, this should return an empty set. It should never returnnull
.
-
getMetadataFilter
public ImageLayer.MetadataFilter getMetadataFilter()
- Overrides:
getMetadataFilter
in classImageLayer
- Returns:
- A
ImageLayer.MetadataFilter
to filter certain types of data for plotting. The default behaviour is to allow all (supported) layers to be plotted. This is essentially an exclusionary filter which users can implement (e.g. for disallowing directional fields from being plotted as rasters)
-
-