ComplexDataset stores and plots a complex dataset (x,z) where the dependent variable has real and imaginary parts, z=(real, imaginary). In Re_Im mode, both the real and imaginary parts are shown as separate curves. In Phase mode, the vertical coordinate represents magnitude and color represents pha
| 39 | * @version 1.0 |
| 40 | */ |
| 41 | public class ComplexDataset extends DataTable.DataModel implements Drawable, Measurable, Data { |
| 42 | |
| 43 | final public Model model; |
| 44 | |
| 45 | public class Model extends DataTable.OSPTableModel { |
| 46 | |
| 47 | @Override |
| 48 | public int getStride() { |
| 49 | return stride; |
| 50 | } |
| 51 | |
| 52 | @Override |
| 53 | public int getRowCount() { |
| 54 | return ComplexDataset.this.getRowCount(); |
| 55 | } |
| 56 | |
| 57 | @Override |
| 58 | public int getColumnCount() { |
| 59 | return ComplexDataset.this.getColumnCount(); |
| 60 | } |
| 61 | |
| 62 | @Override |
| 63 | public Object getValueAt(int rowIndex, int columnIndex) { |
| 64 | return Double.valueOf(ComplexDataset.this.getValueAt(rowIndex, columnIndex)); |
| 65 | } |
| 66 | |
| 67 | |
| 68 | @Override |
| 69 | public Class<?> getColumnClass(int columnIndex) { |
| 70 | return Double.class; |
| 71 | } |
| 72 | |
| 73 | |
| 74 | } |
| 75 | |
| 76 | |
| 77 | |
| 78 | static final double PI2 = Math.PI * 2; |
| 79 | |
| 80 | /** AMP height equal to |z|.. */ |
| 81 | public static final int AMP_CURVE = 0; // marker type |
| 82 | |
| 83 | /** RE_IM real and imaginary curves. */ |
| 84 | public static final int RE_IM_CURVE = 1; // marker type |
| 85 | |
| 86 | /** PHASE_CURVE the phase is shown as color. */ |
| 87 | public static final int PHASE_CURVE = 2; // marker type |
| 88 | |
| 89 | /** PHASE_BAR the phase is shown as the bar's color */ |
| 90 | public static final int PHASE_BAR = 3; // marker type |
| 91 | |
| 92 | /** Field POST */ |
| 93 | public final static int PHASE_POST = 4; // marker type |
| 94 | |
| 95 | /** visible in drawing panel */ |
| 96 | protected boolean visible = true; |
| 97 | |
| 98 | /** affect autoscaled drawing panels */ |