1 package org.sat4j.sat.visu;
2
3 import info.monitorenter.gui.chart.ITracePoint2D;
4 import info.monitorenter.gui.chart.pointpainters.APointPainter;
5
6 import java.awt.Graphics;
7
8 public class PointPainterPlus extends APointPainter<PointPainterPlus> {
9
10
11
12
13 private static final long serialVersionUID = 1L;
14
15
16
17
18 private int plusSize;
19
20
21
22
23
24 public PointPainterPlus(int plusSize) {
25 this.plusSize = plusSize;
26 }
27
28
29
30
31
32
33
34 public PointPainterPlus() {
35 this.plusSize = 6;
36 }
37
38
39
40
41 @Override
42 public boolean equals(final Object obj) {
43 if (this == obj) {
44 return true;
45 }
46 if (!super.equals(obj)) {
47 return false;
48 }
49 if (this.getClass() != obj.getClass()) {
50 return false;
51 }
52 final PointPainterPlus other = (PointPainterPlus) obj;
53 if (this.plusSize != other.plusSize) {
54 return false;
55 }
56 return true;
57 }
58
59
60
61
62 @Override
63 public int hashCode() {
64 final int prime = 31;
65 int result = super.hashCode();
66 result = prime * result + this.plusSize;
67 return result;
68 }
69
70
71
72
73
74 public void paintPoint(final int absoluteX, final int absoluteY,
75 final int nextX, final int nextY, final Graphics g,
76 final ITracePoint2D original) {
77 g.drawLine(absoluteX - this.plusSize / 2, absoluteY, absoluteX
78 + this.plusSize / 2, absoluteY);
79 g.drawLine(absoluteX, absoluteY - this.plusSize / 2, absoluteX,
80 absoluteY + this.plusSize / 2);
81 }
82
83
84
85
86
87
88
89 public int getPlusSize() {
90 return this.plusSize;
91 }
92
93
94
95
96
97
98
99 public void setPlusSize(int plusSize) {
100 this.plusSize = plusSize;
101 }
102
103 }