GridPlot plots a scalar field by coloring pixels using a buffered image. The buffered image is scaled before it is copied to a drawing panel. @author Wolfgang Christian @created February 15, 2003 @version 1.0
| 28 | * @version 1.0 |
| 29 | */ |
| 30 | public class GridPlot extends MeasuredImage implements Plot2D { |
| 31 | boolean autoscaleZ = true; |
| 32 | boolean symmetricZ = false; |
| 33 | GridData griddata; |
| 34 | int[] rgbData; |
| 35 | Grid grid; |
| 36 | ColorMapper colorMap; |
| 37 | private int ampIndex = 0; // amplitude index |
| 38 | |
| 39 | /** |
| 40 | * Constructs the GridPlot using the given griddata. |
| 41 | * |
| 42 | * @param griddata the point data |
| 43 | */ |
| 44 | public GridPlot(GridData griddata) { |
| 45 | setGridData(griddata); |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Constructs a GridPlot without any data. |
| 50 | */ |
| 51 | public GridPlot() {} |
| 52 | |
| 53 | /** |
| 54 | * Sets the indexes for the data component that will be plotted. |
| 55 | * |
| 56 | * @param indexes the sample-component |
| 57 | */ |
| 58 | @Override |
| 59 | public void setIndexes(int[] indexes) { |
| 60 | ampIndex = indexes[0]; |
| 61 | } |
| 62 | |
| 63 | /** |
| 64 | * Gets the GridData object. |
| 65 | * @return GridData |
| 66 | */ |
| 67 | @Override |
| 68 | public GridData getGridData() { |
| 69 | return griddata; |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * Sets the data storage to the given value. |
| 74 | * |
| 75 | * @param _griddata new data storage |
| 76 | */ |
| 77 | @Override |
| 78 | public void setGridData(GridData _griddata) { |
| 79 | griddata = _griddata; |
| 80 | if(colorMap==null) { |
| 81 | colorMap = new ColorMapper(100, -1, 1, ColorMapper.SPECTRUM); |
| 82 | } |
| 83 | if(griddata==null) { |
| 84 | return; |
| 85 | } |
| 86 | int nx = griddata.getNx(); |
| 87 | int ny = griddata.getNy(); |
nothing calls this directly
no outgoing calls
no test coverage detected