1 23 package info.monitorenter.gui.chart.traces; 24 25 26 import info.monitorenter.gui.chart.TracePoint2D; 27 28 import java.util.Iterator ; 29 30 45 public class Trace2DLtdReplacing extends Trace2DLtd { 46 50 public Trace2DLtdReplacing() { 51 this(100); 52 } 53 54 61 public Trace2DLtdReplacing(final int bufsize) { 62 super(bufsize); 63 } 64 65 68 public boolean addPointInternal(final TracePoint2D p) { 69 TracePoint2D tmp; 70 double tmpx, tmpy; 71 Iterator it = this.m_buffer.iteratorF2L(); 72 while (it.hasNext()) { 73 tmp = (TracePoint2D) it.next(); 74 tmpx = tmp.getX(); 75 if (tmpx == p.getX()) { 76 tmpy = p.getY(); 77 if (tmpy == tmp.getY()) { 78 tmp.setLocation(tmpx, tmpy); 80 return false; 82 } 83 } 84 } 85 return super.addPointInternal(p); 86 } 87 } 88 | Popular Tags |