1 22 package info.monitorenter.gui.chart.traces.painters; 23 24 25 26 import java.awt.Graphics2D ; 27 28 38 public class TracePainterDisc extends ATracePainter { 39 40 41 private int m_discSize; 42 43 44 private int m_halfDiscSize; 45 46 50 public TracePainterDisc() { 51 this.setDiscSize(4); 52 } 53 54 60 public TracePainterDisc(final int discSize) { 61 this.setDiscSize(discSize); 62 } 63 64 67 public void endPaintIteration() { 68 Graphics2D g2d = this.getGraphics(); 69 if (g2d != null) { 70 this.getGraphics().drawOval(this.getPreviousX() - this.m_halfDiscSize, 71 this.getPreviousY() - this.m_halfDiscSize, this.m_discSize, this.m_discSize); 72 } 73 } 74 75 81 public int getDiscSize() { 82 return this.m_discSize; 83 } 84 85 89 public void paintPoint(final int absoluteX, final int absoluteY, final int nextX, 90 final int nextY, final Graphics2D g) { 91 super.paintPoint(absoluteX, absoluteY, nextX, nextY, g); 92 g.drawOval(absoluteX - this.m_halfDiscSize, absoluteY - this.m_halfDiscSize, this.m_discSize, 93 this.m_discSize); 94 } 95 96 103 public void setDiscSize(final int discSize) { 104 this.m_discSize = discSize; 105 this.m_halfDiscSize = this.m_discSize / 2; 106 } 107 } 108 | Popular Tags |