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 PointPainterCross extends APointPainter<PointPainterPlus> {
9
10
11
12
13 private static final long serialVersionUID = 1L;
14
15
16
17
18 private int crossSize;
19
20
21
22
23
24 public PointPainterCross(int crossSize) {
25 this.crossSize = crossSize;
26 }
27
28
29
30
31
32
33
34 public PointPainterCross() {
35 this.crossSize = 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 PointPainterCross other = (PointPainterCross) obj;
53 if (this.crossSize != other.crossSize) {
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.crossSize;
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.crossSize / 2, absoluteY - this.crossSize
78 / 2, absoluteX + this.crossSize / 2, absoluteY + this.crossSize
79 / 2);
80 g.drawLine(absoluteX - this.crossSize / 2, absoluteY + this.crossSize
81 / 2, absoluteX + this.crossSize / 2, absoluteY - this.crossSize
82 / 2);
83 }
84
85
86
87
88
89
90
91 public int getCrossSize() {
92 return this.crossSize;
93 }
94
95
96
97
98
99
100
101 public void setCrossSize(int crossSize) {
102 this.crossSize = crossSize;
103 }
104
105 }