1 package org.sat4j.sat.visu;
2
3 import info.monitorenter.gui.chart.ITracePoint2D;
4 import info.monitorenter.gui.chart.traces.painters.ATracePainter;
5
6 import java.awt.Graphics;
7
8 public class TracePainterPlus extends ATracePainter {
9
10
11
12
13 private static final long serialVersionUID = 1L;
14
15
16 private final PointPainterPlus m_pointPainter;
17
18
19
20
21
22 public TracePainterPlus() {
23 this.m_pointPainter = new PointPainterPlus(6);
24 }
25
26
27
28
29
30
31
32 public TracePainterPlus(final int plusSize) {
33 this.m_pointPainter = new PointPainterPlus(plusSize);
34 }
35
36
37
38
39 @Override
40 public void endPaintIteration(final Graphics g2d) {
41 if (g2d != null) {
42 int previousX = this.getPreviousX();
43 int previousY = this.getPreviousY();
44 if (previousX != Integer.MIN_VALUE
45 || previousY != Integer.MIN_VALUE) {
46 this.m_pointPainter.paintPoint(previousX, previousY, 0, 0, g2d,
47 this.getPreviousPoint());
48 }
49 }
50 this.m_pointPainter.endPaintIteration(g2d);
51 }
52
53
54
55
56 @Override
57 public boolean equals(final Object obj) {
58 if (this == obj) {
59 return true;
60 }
61 if (!super.equals(obj)) {
62 return false;
63 }
64 if (this.getClass() != obj.getClass()) {
65 return false;
66 }
67 final TracePainterPlus other = (TracePainterPlus) obj;
68 if (this.m_pointPainter == null) {
69 if (other.m_pointPainter != null) {
70 return false;
71 }
72 } else if (!this.m_pointPainter.equals(other.m_pointPainter)) {
73 return false;
74 }
75 return true;
76 }
77
78
79
80
81
82
83
84 public int getPlusSize() {
85 return this.m_pointPainter.getPlusSize();
86 }
87
88
89
90
91 @Override
92 public int hashCode() {
93 final int prime = 31;
94 int result = super.hashCode();
95 result = prime
96 * result
97 + (this.m_pointPainter == null ? 0 : this.m_pointPainter
98 .hashCode());
99 return result;
100 }
101
102
103
104
105
106
107 @Override
108 public void paintPoint(final int absoluteX, final int absoluteY,
109 final int nextX, final int nextY, final Graphics g,
110 final ITracePoint2D original) {
111 super.paintPoint(absoluteX, absoluteY, nextX, nextY, g, original);
112 this.m_pointPainter.paintPoint(absoluteX, absoluteY, nextX, nextY, g,
113 original);
114 }
115
116
117
118
119
120
121
122
123 public void setPlusSize(final int plusSize) {
124 this.m_pointPainter.setPlusSize(plusSize);
125 }
126
127
128
129
130 @Override
131 public void startPaintIteration(final Graphics g2d) {
132 super.startPaintIteration(g2d);
133 this.m_pointPainter.startPaintIteration(g2d);
134 }
135 }