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 void
clear()
int
findLevelCoordElement(double pos)
find the level (z) index that is represented by this pointint
findSliceFromPoint(ProjectionPoint pp)
ColorScale
getColorScale()
get the current ColorScaleArray
getCurrentHorizDataSlice()
ProjectionImpl
getDataProjection()
get the current GridDatatype data projectionboolean
getDrawContourLabels()
boolean
getDrawContours()
boolean
getDrawGrid()
int
getEnsemble()
GridDatatype
getGeoGrid()
get the current GridDatatypeint
getHorizStride()
int
getLevel()
ProjectionImpl
getProjection()
get the current display projectionint
getRunTime()
int
getSlice()
int
getTime()
String
getXYvalueStr(ProjectionPoint loc)
Get the data value at this projection (x,y) point.String
getYZpositionStr(Point2D loc)
Get the (y,z) position from the vertical view coordinates.String
getYZvalueStr(Point2D loc)
find the data value at this pointvoid
makeStridedGrid()
void
renderPlanView(Graphics2D g, AffineTransform dFromN)
Do the rendering to the given Graphics2D object.void
renderVertView(Graphics2D g, AffineTransform dFromN)
Do the rendering to the given Graphics2D object.void
setColorScale(ColorScale cs)
set the ColorScale to usevoid
setDataMinMaxType(ColorScale.MinMaxType type)
set the ColorScale data min/max typevoid
setDrawContourLabels(boolean drawContourLabels)
void
setDrawContours(boolean drawContours)
void
setDrawGridLines(boolean drawGrid)
void
setEnsemble(int ensemble)
void
setGeoGrid(GridDatatype grid)
set the Gridvoid
setHorizStride(int horizStride)
void
setLevel(int level)
void
setProjection(ProjectionImpl project)
set the Projection to use for drawingvoid
setRunTime(int runtime)
void
setSlice(int slice)
void
setTime(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 GridDatatype getGeoGrid()
get the current GridDatatype
-
clear
public void clear()
-
setGeoGrid
public void setGeoGrid(GridDatatype grid)
set the Grid
-
getCurrentHorizDataSlice
public Array getCurrentHorizDataSlice()
-
getDataProjection
public ProjectionImpl getDataProjection()
get the current GridDatatype data projection
-
getProjection
public ProjectionImpl getProjection()
get the current display projection
-
setProjection
public void setProjection(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(ProjectionPoint pp)
- Returns:
- x index for given point
-
getXYvalueStr
public String getXYvalueStr(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
-
-