1 package JSci.awt; 2 3 import JSci.maths.*; 4 5 12 public final class ArgandDiagramModel extends AbstractGraphModel implements Graph2DModel { 13 private Complex data[] = new Complex[0]; 14 15 public ArgandDiagramModel() {} 16 19 public void setData(Complex z[]) { 20 if(data.length!=z.length) 21 data=new Complex[z.length]; 22 System.arraycopy(z,0,data,0,z.length); 23 fireGraphDataChanged(); 24 } 25 26 28 public float getXCoord(int i) { 29 return (float)data[i].real(); 30 } 31 public float getYCoord(int i) { 32 return (float)data[i].imag(); 33 } 34 public int seriesLength() { 35 return data.length; 36 } 37 public void firstSeries() {} 38 public boolean nextSeries() { 39 return false; 40 } 41 } 42 43 | Popular Tags |