1 23 package info.monitorenter.gui.chart.traces; 24 25 import info.monitorenter.gui.chart.Chart2D; 26 import info.monitorenter.gui.chart.ITrace2D; 27 import info.monitorenter.gui.chart.ITracePainter; 28 import info.monitorenter.gui.chart.TracePoint2D; 29 import info.monitorenter.util.Range; 30 31 import java.awt.Color ; 32 import java.awt.Stroke ; 33 import java.beans.PropertyChangeListener ; 34 import java.util.Iterator ; 35 import java.util.Set ; 36 37 72 public class Trace2DDebugger implements ITrace2D { 73 74 77 private ITrace2D m_delegate; 78 79 83 private Range m_xRange = new Range(-Double.MAX_VALUE, +Double.MAX_VALUE); 84 85 89 private Range m_yRange = new Range(-Double.MAX_VALUE, +Double.MAX_VALUE); 90 91 98 public Trace2DDebugger(final ITrace2D debug) { 99 if (debug == null) { 100 throw new IllegalArgumentException ("Argument must not be null."); 101 } 102 this.m_delegate = debug; 103 } 104 105 109 110 113 public boolean addPoint(final double x, final double y) { 114 TracePoint2D p = new TracePoint2D(x, y); 115 return this.addPoint(p); 116 } 117 118 121 124 public boolean addPoint(final TracePoint2D p) { 125 double x = p.getX(); 126 double y = p.getY(); 127 if (!this.m_xRange.isContained(x)) { 128 throw new IllegalArgumentException (p.toString() + " is not within the valid x-range " 129 + this.m_xRange.toString()); 130 } 131 if (!this.m_yRange.isContained(y)) { 132 throw new IllegalArgumentException (p.toString() + " is not within the valid x-range " 133 + this.m_xRange.toString()); 134 } 135 return this.m_delegate.addPoint(p); 136 } 137 138 141 public void addPropertyChangeListener(final String propertyName, 142 final PropertyChangeListener listener) { 143 this.m_delegate.addPropertyChangeListener(propertyName, listener); 144 } 145 146 149 public boolean addTracePainter(final ITracePainter painter) { 150 return this.m_delegate.addTracePainter(painter); 151 } 152 153 156 public boolean containsTracePainter(final ITracePainter painter) { 157 return this.m_delegate.containsTracePainter(painter); 158 } 159 160 163 public boolean equals(final Object obj) { 164 return this.m_delegate.equals(obj); 165 } 166 167 170 public Color getColor() { 171 return this.m_delegate.getColor(); 172 } 173 174 177 public Number getComparableProperty() { 178 return this.m_delegate.getComparableProperty(); 179 } 180 181 184 public boolean getisible() { 185 return this.m_delegate.isVisible(); 186 } 187 188 191 public String getLable() { 192 return this.m_delegate.getLable(); 193 } 194 195 198 public int getMaxSize() { 199 return this.m_delegate.getMaxSize(); 200 } 201 202 205 public double getMaxX() { 206 return this.m_delegate.getMaxX(); 207 } 208 209 212 public double getMaxY() { 213 return this.m_delegate.getMaxY(); 214 } 215 216 219 public double getMinX() { 220 return this.m_delegate.getMinX(); 221 } 222 223 226 public double getMinY() { 227 return this.m_delegate.getMinY(); 228 } 229 230 233 public String getName() { 234 return this.m_delegate.getName(); 235 } 236 237 241 public String getPhysicalUnits() { 242 return this.m_delegate.getPhysicalUnits(); 243 } 244 245 248 public PropertyChangeListener [] getPropertyChangeListeners(final String property) { 249 return this.m_delegate.getPropertyChangeListeners(property); 250 } 251 252 255 public Chart2D getRenderer() { 256 return this.m_delegate.getRenderer(); 257 } 258 259 262 public int getSize() { 263 return this.m_delegate.getSize(); 264 } 265 266 269 public Stroke getStroke() { 270 return this.m_delegate.getStroke(); 271 } 272 273 276 public final Set getTracePainters() { 277 return this.m_delegate.getTracePainters(); 278 } 279 280 283 public boolean isVisible() { 284 return this.m_delegate.isVisible(); 285 } 286 287 293 public Range getXRange() { 294 return this.m_xRange; 295 } 296 297 303 public Range getYRange() { 304 return this.m_yRange; 305 } 306 307 310 public Integer getZIndex() { 311 return this.m_delegate.getZIndex(); 312 } 313 314 317 public int hashCode() { 318 return this.m_delegate.hashCode(); 319 } 320 321 324 public boolean isEmpty() { 325 return this.m_delegate.isEmpty(); 326 } 327 328 331 public Iterator iterator() { 332 return this.m_delegate.iterator(); 333 } 334 335 338 public void removeAllPoints() { 339 this.m_delegate.removeAllPoints(); 340 } 341 342 345 public boolean removePoint(final TracePoint2D point) { 346 return this.m_delegate.removePoint(point); 347 } 348 349 352 public void removePropertyChangeListener(final PropertyChangeListener listener) { 353 this.m_delegate.removePropertyChangeListener(listener); 354 } 355 356 360 public void removePropertyChangeListener(final String property, 361 final PropertyChangeListener listener) { 362 this.m_delegate.removePropertyChangeListener(property, listener); 363 } 364 365 368 public boolean removeTracePainter(final ITracePainter painter) { 369 return this.m_delegate.removeTracePainter(painter); 370 } 371 372 375 public void setColor(final Color color) { 376 this.m_delegate.setColor(color); 377 } 378 379 382 public void setComparableProperty(final Number n) { 383 this.m_delegate.setComparableProperty(n); 384 } 385 386 389 public void setName(final String name) { 390 this.m_delegate.setName(name); 391 } 392 393 397 public void setPhysicalUnits(final String xunit, final String yunit) { 398 this.m_delegate.setPhysicalUnits(xunit, yunit); 399 } 400 401 404 public void setRenderer(final Chart2D renderer) { 405 this.m_delegate.setRenderer(renderer); 406 } 407 408 411 public void setStroke(final Stroke stroke) { 412 this.m_delegate.setStroke(stroke); 413 } 414 415 419 public final Set setTracePainter(final ITracePainter painter) { 420 return this.m_delegate.setTracePainter(painter); 421 } 422 423 426 public void setVisible(final boolean visible) { 427 this.m_delegate.setVisible(visible); 428 } 429 430 438 public void setXRange(final Range range) { 439 if (range == null) { 440 throw new IllegalArgumentException ("Argument must not be null."); 441 } 442 this.m_xRange = range; 443 } 444 445 453 public void setYRange(final Range range) { 454 if (range == null) { 455 throw new IllegalArgumentException ("Argument must not be null."); 456 } 457 this.m_yRange = range; 458 } 459 460 463 public void setZIndex(final Integer zIndex) { 464 this.m_delegate.setZIndex(zIndex); 465 } 466 467 470 public String toString() { 471 return this.m_delegate.toString(); 472 } 473 } 474 | Popular Tags |