View Javadoc

1   package org.sat4j.sat.visu;
2   
3   import info.monitorenter.gui.chart.Chart2D;
4   import info.monitorenter.gui.chart.IErrorBarPolicy;
5   import info.monitorenter.gui.chart.IPointPainter;
6   import info.monitorenter.gui.chart.ITrace2D;
7   import info.monitorenter.gui.chart.ITracePainter;
8   import info.monitorenter.gui.chart.ITracePoint2D;
9   
10  import java.awt.Color;
11  import java.awt.Stroke;
12  import java.beans.PropertyChangeEvent;
13  import java.beans.PropertyChangeListener;
14  import java.util.ArrayList;
15  import java.util.Arrays;
16  import java.util.Iterator;
17  import java.util.List;
18  import java.util.Set;
19  
20  /**
21   * Every time a point is added to this trace, it is also added to the cloneTrace
22   * 
23   * @author stephanieroussel
24   * 
25   */
26  public class TraceComposite implements ITrace2D {
27  
28      /**
29       * 
30       */
31      private static final long serialVersionUID = 1L;
32  
33      private static final int DEFAULT_HASHCODE_VALUE = 42;
34  
35      private List<ITrace2D> traces;
36  
37      public TraceComposite(List<ITrace2D> traces) {
38          this.traces = traces;
39      }
40  
41      public List<ITrace2D> getTraces() {
42          return traces;
43      }
44  
45      public TraceComposite(ITrace2D... traces) {
46          this.traces = new ArrayList<ITrace2D>();
47          this.traces.addAll(Arrays.asList(traces));
48      }
49  
50      public boolean addPoint(ITracePoint2D arg0) {
51          boolean result = true;
52          for (ITrace2D trace : this.traces) {
53              result = result && trace.addPoint(arg0);
54          }
55          return result;
56      }
57  
58      public boolean addPoint(double x, double y) {
59          boolean result = true;
60          for (ITrace2D trace : this.traces) {
61              result = result && trace.addPoint(x, y);
62          }
63  
64          return result;
65      }
66  
67      public void propertyChange(PropertyChangeEvent evt) {
68          // TODO Auto-generated method stub
69  
70      }
71  
72      public int compareTo(ITrace2D o) {
73          if (this.equals(o)) {
74              return 0;
75          } else {
76              return -1;
77          }
78      }
79  
80      public int hashCode() {
81          assert false : "hashCode not designed";
82          // any arbitrary constant will do
83          return DEFAULT_HASHCODE_VALUE;
84      }
85  
86      @Override
87      public boolean equals(Object o) {
88          if (o instanceof TraceComposite) {
89              return ((TraceComposite) o).getTraces().equals(this.getTraces());
90          }
91          return false;
92      }
93  
94      public void addComputingTrace(ITrace2D arg0) {
95          // TODO Auto-generated method stub
96  
97      }
98  
99      public boolean addErrorBarPolicy(IErrorBarPolicy<?> arg0) {
100         // TODO Auto-generated method stub
101         return false;
102     }
103 
104     public boolean addPointHighlighter(IPointPainter<?> arg0) {
105         // TODO Auto-generated method stub
106         return false;
107     }
108 
109     public void addPropertyChangeListener(String arg0,
110             PropertyChangeListener arg1) {
111         // TODO Auto-generated method stub
112 
113     }
114 
115     public boolean addTracePainter(ITracePainter<?> arg0) {
116         // TODO Auto-generated method stub
117         return false;
118     }
119 
120     public boolean containsTracePainter(ITracePainter<?> arg0) {
121         // TODO Auto-generated method stub
122         return false;
123     }
124 
125     public void firePointChanged(ITracePoint2D arg0, int arg1) {
126         // TODO Auto-generated method stub
127 
128     }
129 
130     public Color getColor() {
131         // TODO Auto-generated method stub
132         return null;
133     }
134 
135     public Set<IErrorBarPolicy<?>> getErrorBarPolicies() {
136         // TODO Auto-generated method stub
137         return null;
138     }
139 
140     public boolean getHasErrorBars() {
141         // TODO Auto-generated method stub
142         return false;
143     }
144 
145     public String getLabel() {
146         // TODO Auto-generated method stub
147         return null;
148     }
149 
150     public int getMaxSize() {
151         // TODO Auto-generated method stub
152         return 0;
153     }
154 
155     public double getMaxX() {
156         // TODO Auto-generated method stub
157         return 0;
158     }
159 
160     public double getMaxY() {
161         // TODO Auto-generated method stub
162         return 0;
163     }
164 
165     public double getMinX() {
166         // TODO Auto-generated method stub
167         return 0;
168     }
169 
170     public double getMinY() {
171         // TODO Auto-generated method stub
172         return 0;
173     }
174 
175     public String getName() {
176         // TODO Auto-generated method stub
177         return null;
178     }
179 
180     public DistancePoint getNearestPointEuclid(double arg0, double arg1) {
181         // TODO Auto-generated method stub
182         return null;
183     }
184 
185     public DistancePoint getNearestPointManhattan(double arg0, double arg1) {
186         // TODO Auto-generated method stub
187         return null;
188     }
189 
190     public String getPhysicalUnits() {
191         // TODO Auto-generated method stub
192         return null;
193     }
194 
195     public String getPhysicalUnitsX() {
196         // TODO Auto-generated method stub
197         return null;
198     }
199 
200     public String getPhysicalUnitsY() {
201         // TODO Auto-generated method stub
202         return null;
203     }
204 
205     public Set<IPointPainter<?>> getPointHighlighters() {
206         // TODO Auto-generated method stub
207         return null;
208     }
209 
210     public PropertyChangeListener[] getPropertyChangeListeners(String arg0) {
211         // TODO Auto-generated method stub
212         return null;
213     }
214 
215     public Chart2D getRenderer() {
216         // TODO Auto-generated method stub
217         return null;
218     }
219 
220     public int getSize() {
221         // TODO Auto-generated method stub
222         return 0;
223     }
224 
225     public Stroke getStroke() {
226         // TODO Auto-generated method stub
227         return null;
228     }
229 
230     public Set<ITracePainter<?>> getTracePainters() {
231         // TODO Auto-generated method stub
232         return null;
233     }
234 
235     public Integer getZIndex() {
236         // TODO Auto-generated method stub
237         return null;
238     }
239 
240     public boolean isEmpty() {
241         // TODO Auto-generated method stub
242         return false;
243     }
244 
245     public boolean isVisible() {
246         // TODO Auto-generated method stub
247         return false;
248     }
249 
250     public Iterator<ITracePoint2D> iterator() {
251         // TODO Auto-generated method stub
252         return null;
253     }
254 
255     public Set<IPointPainter<?>> removeAllPointHighlighters() {
256         // TODO Auto-generated method stub
257         return null;
258     }
259 
260     public void removeAllPoints() {
261         // TODO Auto-generated method stub
262 
263     }
264 
265     public boolean removeComputingTrace(ITrace2D arg0) {
266         // TODO Auto-generated method stub
267         return false;
268     }
269 
270     public boolean removeErrorBarPolicy(IErrorBarPolicy<?> arg0) {
271         // TODO Auto-generated method stub
272         return false;
273     }
274 
275     public boolean removePoint(ITracePoint2D arg0) {
276         // TODO Auto-generated method stub
277         return false;
278     }
279 
280     public boolean removePointHighlighter(IPointPainter<?> arg0) {
281         // TODO Auto-generated method stub
282         return false;
283     }
284 
285     public void removePropertyChangeListener(PropertyChangeListener arg0) {
286         // TODO Auto-generated method stub
287 
288     }
289 
290     public void removePropertyChangeListener(String arg0,
291             PropertyChangeListener arg1) {
292         // TODO Auto-generated method stub
293 
294     }
295 
296     public boolean removeTracePainter(ITracePainter<?> arg0) {
297         // TODO Auto-generated method stub
298         return false;
299     }
300 
301     public void setColor(Color arg0) {
302         // TODO Auto-generated method stub
303 
304     }
305 
306     public Set<IErrorBarPolicy<?>> setErrorBarPolicy(IErrorBarPolicy<?> arg0) {
307         // TODO Auto-generated method stub
308         return null;
309     }
310 
311     public void setName(String arg0) {
312         // TODO Auto-generated method stub
313 
314     }
315 
316     public void setPhysicalUnits(String arg0, String arg1) {
317         // TODO Auto-generated method stub
318 
319     }
320 
321     public Set<IPointPainter<?>> setPointHighlighter(IPointPainter<?> arg0) {
322         // TODO Auto-generated method stub
323         return null;
324     }
325 
326     public void setRenderer(Chart2D arg0) {
327         // TODO Auto-generated method stub
328 
329     }
330 
331     public void setStroke(Stroke arg0) {
332         // TODO Auto-generated method stub
333 
334     }
335 
336     public Set<ITracePainter<?>> setTracePainter(ITracePainter<?> arg0) {
337         // TODO Auto-generated method stub
338         return null;
339     }
340 
341     public void setVisible(boolean arg0) {
342         // TODO Auto-generated method stub
343 
344     }
345 
346     public void setZIndex(Integer arg0) {
347         // TODO Auto-generated method stub
348 
349     }
350 
351     public boolean showsErrorBars() {
352         // TODO Auto-generated method stub
353         return false;
354     }
355 
356     public boolean showsNegativeXErrorBars() {
357         // TODO Auto-generated method stub
358         return false;
359     }
360 
361     public boolean showsNegativeYErrorBars() {
362         // TODO Auto-generated method stub
363         return false;
364     }
365 
366     public boolean showsPositiveXErrorBars() {
367         // TODO Auto-generated method stub
368         return false;
369     }
370 
371     public boolean showsPositiveYErrorBars() {
372         // TODO Auto-generated method stub
373         return false;
374     }
375 
376 }