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 private static final int DEFAULT_SIZE = 6;
21
22
23
24
25
26 public PointPainterPlus(int plusSize) {
27 this.plusSize = plusSize;
28 }
29
30
31
32
33
34
35
36 public PointPainterPlus() {
37 this.plusSize = DEFAULT_SIZE;
38 }
39
40
41
42
43 @Override
44 public boolean equals(final Object obj) {
45 if (this == obj) {
46 return true;
47 }
48 if (!super.equals(obj)) {
49 return false;
50 }
51 if (this.getClass() != obj.getClass()) {
52 return false;
53 }
54 final PointPainterPlus other = (PointPainterPlus) obj;
55 if (this.plusSize != other.plusSize) {
56 return false;
57 }
58 return true;
59 }
60
61
62
63
64 @Override
65 public int hashCode() {
66 final int prime = 31;
67 int result = super.hashCode();
68 result = prime * result + this.plusSize;
69 return result;
70 }
71
72
73
74
75
76 public void paintPoint(final int absoluteX, final int absoluteY,
77 final int nextX, final int nextY, final Graphics g,
78 final ITracePoint2D original) {
79 g.drawLine(absoluteX - this.plusSize / 2, absoluteY, absoluteX
80 + this.plusSize / 2, absoluteY);
81 g.drawLine(absoluteX, absoluteY - this.plusSize / 2, absoluteX,
82 absoluteY + this.plusSize / 2);
83 }
84
85
86
87
88
89
90
91 public int getPlusSize() {
92 return this.plusSize;
93 }
94
95
96
97
98
99
100
101 public void setPlusSize(int plusSize) {
102 this.plusSize = plusSize;
103 }
104
105 }