Package ucar.nc2.ui.grid
Class GridRenderer
- java.lang.Object
-
- ucar.nc2.ui.grid.GridRenderer
-
public class GridRenderer extends Object
Render grids using Java2D API.
-
-
Constructor Summary
Constructors Constructor Description GridRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()intfindLevelCoordElement(double pos)find the level (z) index that is represented by this pointintfindSliceFromPoint(ucar.unidata.geoloc.ProjectionPoint pp)ColorScalegetColorScale()get the current ColorScaleucar.ma2.ArraygetCurrentHorizDataSlice()ucar.unidata.geoloc.ProjectionImplgetDataProjection()get the current GridDatatype data projectionbooleangetDrawContourLabels()booleangetDrawContours()booleangetDrawGrid()intgetEnsemble()ucar.nc2.dt.GridDatatypegetGeoGrid()get the current GridDatatypeintgetHorizStride()intgetLevel()ucar.unidata.geoloc.ProjectionImplgetProjection()get the current display projectionintgetRunTime()intgetSlice()intgetTime()StringgetXYvalueStr(ucar.unidata.geoloc.ProjectionPoint loc)Get the data value at this projection (x,y) point.StringgetYZpositionStr(Point2D loc)Get the (y,z) position from the vertical view coordinates.StringgetYZvalueStr(Point2D loc)find the data value at this pointvoidmakeStridedGrid()voidrenderPlanView(Graphics2D g, AffineTransform dFromN)Do the rendering to the given Graphics2D object.voidrenderVertView(Graphics2D g, AffineTransform dFromN)Do the rendering to the given Graphics2D object.voidsetColorScale(ColorScale cs)set the ColorScale to usevoidsetDataMinMaxType(ColorScale.MinMaxType type)set the ColorScale data min/max typevoidsetDrawContourLabels(boolean drawContourLabels)voidsetDrawContours(boolean drawContours)voidsetDrawGridLines(boolean drawGrid)voidsetEnsemble(int ensemble)voidsetGeoGrid(ucar.nc2.dt.GridDatatype grid)set the GridvoidsetHorizStride(int horizStride)voidsetLevel(int level)voidsetProjection(ucar.unidata.geoloc.ProjectionImpl project)set the Projection to use for drawingvoidsetRunTime(int runtime)voidsetSlice(int slice)voidsetTime(int time)
-
-
-
Method Detail
-
getColorScale
public ColorScale getColorScale()
get the current ColorScale
-
setColorScale
public void setColorScale(ColorScale cs)
set the ColorScale to use
-
setDataMinMaxType
public void setDataMinMaxType(ColorScale.MinMaxType type)
set the ColorScale data min/max type- Parameters:
type- MinMaxType
-
getGeoGrid
public ucar.nc2.dt.GridDatatype getGeoGrid()
get the current GridDatatype
-
clear
public void clear()
-
setGeoGrid
public void setGeoGrid(ucar.nc2.dt.GridDatatype grid)
set the Grid
-
getCurrentHorizDataSlice
public ucar.ma2.Array getCurrentHorizDataSlice()
-
getDataProjection
public ucar.unidata.geoloc.ProjectionImpl getDataProjection()
get the current GridDatatype data projection
-
getProjection
public ucar.unidata.geoloc.ProjectionImpl getProjection()
get the current display projection
-
setProjection
public void setProjection(ucar.unidata.geoloc.ProjectionImpl project)
set the Projection to use for drawing
-
getDrawGrid
public boolean getDrawGrid()
-
setDrawGridLines
public void setDrawGridLines(boolean drawGrid)
-
getDrawContours
public boolean getDrawContours()
-
setDrawContours
public void setDrawContours(boolean drawContours)
-
getDrawContourLabels
public boolean getDrawContourLabels()
-
setDrawContourLabels
public void setDrawContourLabels(boolean drawContourLabels)
-
getLevel
public int getLevel()
-
setLevel
public void setLevel(int level)
-
getTime
public int getTime()
-
setTime
public void setTime(int time)
-
getRunTime
public int getRunTime()
-
setRunTime
public void setRunTime(int runtime)
-
getEnsemble
public int getEnsemble()
-
setEnsemble
public void setEnsemble(int ensemble)
-
getSlice
public int getSlice()
-
setSlice
public void setSlice(int slice)
-
getHorizStride
public int getHorizStride()
-
setHorizStride
public void setHorizStride(int horizStride)
-
makeStridedGrid
public void makeStridedGrid()
-
findLevelCoordElement
public int findLevelCoordElement(double pos)
find the level (z) index that is represented by this point- Parameters:
pos- coord in data z coordinate space.
-
findSliceFromPoint
public int findSliceFromPoint(ucar.unidata.geoloc.ProjectionPoint pp)
- Returns:
- x index for given point
-
getXYvalueStr
public String getXYvalueStr(ucar.unidata.geoloc.ProjectionPoint loc)
Get the data value at this projection (x,y) point.- Parameters:
loc- : point in display projection coordinates (plan view)- Returns:
- String representation of value
-
getYZpositionStr
public String getYZpositionStr(Point2D loc)
Get the (y,z) position from the vertical view coordinates.- Parameters:
loc- : point in display projection coordinates (vertical view)- Returns:
- String representation of position
-
getYZvalueStr
public String getYZvalueStr(Point2D loc)
find the data value at this point- Parameters:
loc- : point in display projection coordinates (vertical view)- Returns:
- String representation of value
-
renderVertView
public void renderVertView(Graphics2D g, AffineTransform dFromN)
Do the rendering to the given Graphics2D object.- Parameters:
g- Graphics2D object: has clipRect and AffineTransform set.dFromN- transforms "Normalized Device" to Device coordinates
-
renderPlanView
public void renderPlanView(Graphics2D g, AffineTransform dFromN) throws IOException
Do the rendering to the given Graphics2D object.- Parameters:
g- Graphics2D object: has clipRect and AffineTransform set.dFromN- transforms "Normalized Device" to Device coordinates- Throws:
IOException
-
-