1 package JSci.awt; 2 3 import java.awt.geom.Point2D ; 4 import java.util.List ; 5 6 12 public final class Point2DListModel extends AbstractGraphModel implements Graph2DModel { 13 private List data; 14 15 public Point2DListModel() {} 16 19 public void setData(List points) { 20 data = points; 21 fireGraphDataChanged(); 22 } 23 24 26 public float getXCoord(int i) { 27 Point2D p = (Point2D ) data.get(i); 28 return (float) p.getX(); 29 } 30 public float getYCoord(int i) { 31 Point2D p = (Point2D ) data.get(i); 32 return (float) p.getY(); 33 } 34 public int seriesLength() { 35 return data.size(); 36 } 37 public void firstSeries() {} 38 public boolean nextSeries() { 39 return false; 40 } 41 } 42 43 | Popular Tags |