View Javadoc

1   /*
2   
3       dsh-piccolo-venn  Piccolo2D venn diagram nodes and supporting classes.
4       Copyright (c) 2009-2013 held jointly by the individual authors.
5   
6       This library is free software; you can redistribute it and/or modify it
7       under the terms of the GNU Lesser General Public License as published
8       by the Free Software Foundation; either version 3 of the License, or (at
9       your option) any later version.
10  
11      This library is distributed in the hope that it will be useful, but WITHOUT
12      ANY WARRANTY; with out even the implied warranty of MERCHANTABILITY or
13      FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
14      License for more details.
15  
16      You should have received a copy of the GNU Lesser General Public License
17      along with this library;  if not, write to the Free Software Foundation,
18      Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA.
19  
20      > http://www.fsf.org/licensing/licenses/lgpl.html
21      > http://www.opensource.org/licenses/lgpl-license.php
22  
23  */
24  package org.dishevelled.piccolo.venn;
25  
26  import java.util.Arrays;
27  import java.util.List;
28  import java.util.Set;
29  
30  import org.piccolo2d.nodes.PText;
31  import org.dishevelled.observable.event.SetChangeEvent;
32  import org.dishevelled.observable.event.SetChangeListener;
33  import org.dishevelled.venn.TernaryVennModel;
34  import org.dishevelled.venn.model.TernaryVennModelImpl;
35  
36  /**
37   * Abstract ternary venn diagram node.
38   *
39   * @param <E> value type
40   * @author  Michael Heuer
41   * @version $Revision$ $Date$
42   */
43  public abstract class AbstractTernaryVennNode<E>
44      extends AbstractVennNode<E>
45  {
46      /** Ternary venn model. */
47      private TernaryVennModel<E> model;
48  
49      /** Label text for the first set. */
50      private String firstLabelText = DEFAULT_FIRST_LABEL_TEXT;
51  
52      /** Label text for the second set. */
53      private String secondLabelText = DEFAULT_SECOND_LABEL_TEXT;
54  
55      /** Label text for the third set. */
56      private String thirdLabelText = DEFAULT_THIRD_LABEL_TEXT;
57  
58      /** Label text for the first only view. */
59      private String firstOnlyLabelText = DEFAULT_FIRST_ONLY_LABEL_TEXT;
60  
61      /** Label text for the second only view. */
62      private String secondOnlyLabelText = DEFAULT_SECOND_ONLY_LABEL_TEXT;
63  
64      /** Label text for the third only view. */
65      private String thirdOnlyLabelText = DEFAULT_THIRD_ONLY_LABEL_TEXT;
66  
67      /** Label text for the first second view. */
68      private String firstSecondLabelText = DEFAULT_FIRST_SECOND_LABEL_TEXT;
69  
70      /** Label text for the first third view. */
71      private String firstThirdLabelText = DEFAULT_FIRST_THIRD_LABEL_TEXT;
72  
73      /** Label text for the second third view. */
74      private String secondThirdLabelText = DEFAULT_SECOND_THIRD_LABEL_TEXT;
75  
76      /** Label text for the intersection view. */
77      private String intersectionLabelText = DEFAULT_INTERSECTION_LABEL_TEXT;
78  
79      /** Label text for the union view. */
80      private String unionLabelText = DEFAULT_UNION_LABEL_TEXT;
81  
82      /** Label for the first set. */
83      private final PText firstLabel = new PText();
84  
85      /** Label for the second set. */
86      private final PText secondLabel = new PText();
87  
88      /** Label for the third set. */
89      private final PText thirdLabel = new PText();
90  
91      /** Label for the first only view. */
92      private final PText firstOnlyLabel = new PText();
93  
94      /** Label for the second only view. */
95      private final PText secondOnlyLabel = new PText();
96  
97      /** Label for the third only view. */
98      private final PText thirdOnlyLabel = new PText();
99  
100     /** Label for the first second view. */
101     private final PText firstSecondLabel = new PText();
102 
103     /** Label for the first third view. */
104     private final PText firstThirdLabel = new PText();
105 
106     /** Label for the second third view. */
107     private final PText secondThirdLabel = new PText();
108 
109     /** Label for the intersection view. */
110     private final PText intersectionLabel = new PText();
111 
112     /** Label for the union view. */
113     private final PText unionLabel = new PText();
114 
115     /** List of labels. */
116     private final List<PText> labels = Arrays.asList(new PText[] { firstLabel, secondLabel, thirdLabel, firstOnlyLabel,
117                                                                    secondOnlyLabel, thirdOnlyLabel, firstSecondLabel, firstThirdLabel,
118                                                                    secondThirdLabel, intersectionLabel, unionLabel });
119 
120     /** Update labels and contents. */
121     private final SetChangeListener<E> update = new SetChangeListener<E>()
122         {
123             @Override
124             public void setChanged(final SetChangeEvent<E> event)
125             {
126                 updateLabels();
127                 updateContents();
128             }
129         };
130 
131     /** Default label text for the first set, <code>"First set"</code>. */
132     public static final String DEFAULT_FIRST_LABEL_TEXT = "First set";
133 
134     /** Default label text for the second set, <code>"Second set"</code>. */
135     public static final String DEFAULT_SECOND_LABEL_TEXT = "Second set";
136 
137     /** Default label text for the third set, <code>"Third set"</code>. */
138     public static final String DEFAULT_THIRD_LABEL_TEXT = "Third set";
139 
140     /** Default label text for the first only view, <code>"First only"</code>. */
141     public static final String DEFAULT_FIRST_ONLY_LABEL_TEXT = "First only";
142 
143     /** Default label text for the second only view, <code>"Second only"</code>. */
144     public static final String DEFAULT_SECOND_ONLY_LABEL_TEXT = "Second only";
145 
146     /** Default label text for the third only view, <code>"Third only"</code>. */
147     public static final String DEFAULT_THIRD_ONLY_LABEL_TEXT = "Third only";
148 
149     /** Default label text for the first second view, <code>"First and second only"</code>. */
150     public static final String DEFAULT_FIRST_SECOND_LABEL_TEXT = "First and second only";
151 
152     /** Default label text for the first third view, <code>"First and third only"</code>. */
153     public static final String DEFAULT_FIRST_THIRD_LABEL_TEXT = "First and third only";
154 
155     /** Default label text for the second third view, <code>"Second and third only"</code>. */
156     public static final String DEFAULT_SECOND_THIRD_LABEL_TEXT = "Second and third only";
157 
158     /** Default label text for the intersection view, <code>"Intersection"</code>. */
159     public static final String DEFAULT_INTERSECTION_LABEL_TEXT = "Intersection";
160 
161     /** Default label text for the union view, <code>"Union"</code>. */
162     public static final String DEFAULT_UNION_LABEL_TEXT = "Union";
163 
164 
165     /**
166      * Create a new empty abstract ternary venn diagram node.
167      */
168     protected AbstractTernaryVennNode()
169     {
170         super();
171         model = new TernaryVennModelImpl<E>();
172 
173         installListeners();
174         updateLabels();
175     }
176 
177     /**
178      * Create a new abstract ternary venn diagram node with the specified sets.
179      *
180      * @param firstLabelText label text for the first set
181      * @param first first set, must not be null
182      * @param secondLabelText label text for the second set
183      * @param second second set, must not be null
184      * @param thirdLabelText label text for the third set
185      * @param third third set, must not be null
186      */
187     protected AbstractTernaryVennNode(final String firstLabelText, final Set<? extends E> first,
188                                        final String secondLabelText, final Set<? extends E> second,
189                                        final String thirdLabelText, final Set<? extends E> third)
190     {
191         super();
192         model = new TernaryVennModelImpl<E>(first, second, third);
193         this.firstLabelText = firstLabelText;
194         this.secondLabelText = secondLabelText;
195         this.thirdLabelText = thirdLabelText;
196         this.firstOnlyLabelText = firstLabelText + " only";
197         this.secondOnlyLabelText = secondLabelText + " only";
198         this.thirdOnlyLabelText = thirdLabelText + " only";
199         this.firstSecondLabelText = firstLabelText + " and " + secondLabelText + " only";
200         this.firstThirdLabelText = firstLabelText + " and " + thirdLabelText + " only";
201         this.secondThirdLabelText = secondLabelText + " and " + thirdLabelText + " only";
202 
203         installListeners();
204         updateLabels();
205     }
206 
207     /**
208      * Create a new abstract ternary venn diagram node with the specified model.
209      *
210      * @param model model for this abstract ternary venn diagram node, must not be null
211      */
212     protected AbstractTernaryVennNode(final TernaryVennModel<E> model)
213     {
214         super();
215         if (model == null)
216         {
217             throw new IllegalArgumentException("model must not be null");
218         }
219         this.model = model;
220 
221         installListeners();
222         updateLabels();
223     }
224 
225 
226     /**
227      * Install listeners.
228      */
229     private void installListeners()
230     {
231         model.first().addSetChangeListener(update);
232         model.second().addSetChangeListener(update);
233         model.third().addSetChangeListener(update);
234     }
235 
236     /**
237      * Uninstall listeners.
238      */
239     private void uninstallListeners()
240     {
241         model.first().removeSetChangeListener(update);
242         model.second().removeSetChangeListener(update);
243         model.third().removeSetChangeListener(update);
244     }
245 
246     @Override
247     protected void updateLabels()
248     {
249         firstLabel.setText(buildLabel(firstLabelText, model.first().size()));
250         secondLabel.setText(buildLabel(secondLabelText, model.second().size()));
251         thirdLabel.setText(buildLabel(thirdLabelText, model.third().size()));
252         firstOnlyLabel.setText(buildLabel(firstOnlyLabelText, model.firstOnly().size()));
253         secondOnlyLabel.setText(buildLabel(secondOnlyLabelText, model.secondOnly().size()));
254         thirdOnlyLabel.setText(buildLabel(thirdOnlyLabelText, model.thirdOnly().size()));
255         firstSecondLabel.setText(buildLabel(firstSecondLabelText, model.firstSecond().size()));
256         firstThirdLabel.setText(buildLabel(firstThirdLabelText, model.firstThird().size()));
257         secondThirdLabel.setText(buildLabel(secondThirdLabelText, model.secondThird().size()));
258         intersectionLabel.setText(buildLabel(intersectionLabelText, model.intersection().size()));
259         unionLabel.setText(buildLabel(unionLabelText, model.union().size()));
260 
261         firstLabel.setVisible(getDisplayLabels());
262         secondLabel.setVisible(getDisplayLabels());
263         thirdLabel.setVisible(getDisplayLabels());
264         firstOnlyLabel.setVisible(getDisplayLabels());
265         secondOnlyLabel.setVisible(getDisplayLabels());
266         thirdOnlyLabel.setVisible(getDisplayLabels());
267         firstSecondLabel.setVisible(getDisplayLabels());
268         firstThirdLabel.setVisible(getDisplayLabels());
269         secondThirdLabel.setVisible(getDisplayLabels());
270         intersectionLabel.setVisible(getDisplayLabels());
271         unionLabel.setVisible(getDisplayLabels());
272     }
273 
274     /**
275      * Update contents.
276      */
277     protected abstract void updateContents();
278 
279 
280     @Override
281     public final Iterable<PText> labels()
282     {
283         return labels;
284     }
285 
286     /**
287      * Return the model for this ternary venn label.  The model will not be null.
288      *
289      * @return the model for this ternary venn label
290      */
291     public final TernaryVennModel<E> getModel()
292     {
293         return model;
294     }
295 
296     /**
297      * Set the model for this ternary venn label to <code>model</code>.
298      *
299      * <p>This is a bound property.</p>
300      *
301      * @param model model for this ternary venn label, must not be null
302      */
303     public final void setModel(final TernaryVennModel<E> model)
304     {
305         if (model == null)
306         {
307             throw new IllegalArgumentException("model must not be null");
308         }
309         TernaryVennModel<E> oldModel = this.model;
310         uninstallListeners();
311         this.model = model;
312         installListeners();
313         updateLabels();
314         firePropertyChange(-1, "model", oldModel, this.model);
315     }
316 
317     /**
318      * Return the label text for the first set.  Defaults to {@link #DEFAULT_FIRST_LABEL_TEXT}.
319      *
320      * @return the label text for the first set
321      */
322     public final String getFirstLabelText()
323     {
324         return firstLabelText;
325     }
326 
327     /**
328      * Set the label text for the first set to <code>firstLabelText</code>.
329      *
330      * <p>This is a bound property.</p>
331      *
332      * @param firstLabelText label text for the first set
333      */
334     public final void setFirstLabelText(final String firstLabelText)
335     {
336         String oldFirstLabelText = this.firstLabelText;
337         this.firstLabelText = firstLabelText;
338         firstLabel.setText(buildLabel(this.firstLabelText, model.first().size()));
339         firePropertyChange(-1, "firstLabelText", this.firstLabelText, oldFirstLabelText);
340     }
341 
342     /**
343      * Return the label text for the second set.  Defaults to {@link #DEFAULT_SECOND_LABEL_TEXT}.
344      *
345      * @return the label text for the second set
346      */
347     public final String getSecondLabelText()
348     {
349         return secondLabelText;
350     }
351 
352     /**
353      * Set the label text for the second set to <code>secondLabelText</code>.
354      *
355      * <p>This is a bound property.</p>
356      *
357      * @param secondLabelText label text for the second set
358      */
359     public final void setSecondLabelText(final String secondLabelText)
360     {
361         String oldSecondLabelText = this.secondLabelText;
362         this.secondLabelText = secondLabelText;
363         secondLabel.setText(buildLabel(this.secondLabelText, model.second().size()));
364         firePropertyChange(-1, "secondLabelText", this.secondLabelText, oldSecondLabelText);
365     }
366 
367     /**
368      * Return the label text for the third set.  Defaults to {@link #DEFAULT_THIRD_LABEL_TEXT}.
369      *
370      * @return the label text for the third set
371      */
372     public final String getThirdLabelText()
373     {
374         return thirdLabelText;
375     }
376 
377     /**
378      * Set the label text for the third set to <code>thirdLabelText</code>.
379      *
380      * <p>This is a bound property.</p>
381      *
382      * @param thirdLabelText label text for the third set
383      */
384     public final void setThirdLabelText(final String thirdLabelText)
385     {
386         String oldThirdLabelText = this.thirdLabelText;
387         this.thirdLabelText = thirdLabelText;
388         thirdLabel.setText(buildLabel(this.thirdLabelText, model.third().size()));
389         firePropertyChange(-1, "thirdLabelText", this.thirdLabelText, oldThirdLabelText);
390     }
391 
392     /**
393      * Return the label text for the first only view.  Defaults to {@link #DEFAULT_FIRST_ONLY_LABEL_TEXT}.
394      *
395      * @return the label text for the first only view
396      */
397     public final String getFirstOnlyLabelText()
398     {
399         return firstOnlyLabelText;
400     }
401 
402     /**
403      * Set the label text for the first only view to <code>firstOnlyLabelText</code>.
404      *
405      * <p>This is a bound property.</p>
406      *
407      * @param firstOnlyLabelText label text for the first only view
408      */
409     public final void setFirstOnlyLabelText(final String firstOnlyLabelText)
410     {
411         String oldFirstOnlyLabelText = this.firstOnlyLabelText;
412         this.firstOnlyLabelText = firstOnlyLabelText;
413         firstOnlyLabel.setText(buildLabel(this.firstOnlyLabelText, model.firstOnly().size()));
414         firePropertyChange(-1, "firstOnlyLabelText", this.firstOnlyLabelText, oldFirstOnlyLabelText);
415     }
416 
417     /**
418      * Return the label text for the second only view.  Defaults to {@link #DEFAULT_SECOND_ONLY_LABEL_TEXT}.
419      *
420      * @return the label text for the second only view
421      */
422     public final String getSecondOnlyLabelText()
423     {
424         return secondOnlyLabelText;
425     }
426 
427     /**
428      * Set the label text for the second only view to <code>secondOnlyLabelText</code>.
429      *
430      * <p>This is a bound property.</p>
431      *
432      * @param secondOnlyLabelText label text for the second only view
433      */
434     public final void setSecondOnlyLabelText(final String secondOnlyLabelText)
435     {
436         String oldSecondOnlyLabelText = this.secondOnlyLabelText;
437         this.secondOnlyLabelText = secondOnlyLabelText;
438         secondOnlyLabel.setText(buildLabel(this.secondOnlyLabelText, model.secondOnly().size()));
439         firePropertyChange(-1, "secondOnlyLabelText", this.secondOnlyLabelText, oldSecondOnlyLabelText);
440     }
441 
442     /**
443      * Return the label text for the third only view.  Defaults to {@link #DEFAULT_THIRD_ONLY_LABEL_TEXT}.
444      *
445      * @return the label text for the third only view
446      */
447     public final String getThirdOnlyLabelText()
448     {
449         return thirdOnlyLabelText;
450     }
451 
452     /**
453      * Set the label text for the third only view to <code>thirdOnlyLabelText</code>.
454      *
455      * <p>This is a bound property.</p>
456      *
457      * @param thirdOnlyLabelText label text for the third only view
458      */
459     public final void setThirdOnlyLabelText(final String thirdOnlyLabelText)
460     {
461         String oldThirdOnlyLabelText = this.thirdOnlyLabelText;
462         this.thirdOnlyLabelText = thirdOnlyLabelText;
463         thirdOnlyLabel.setText(buildLabel(this.thirdOnlyLabelText, model.thirdOnly().size()));
464         firePropertyChange(-1, "thirdOnlyLabelText", this.thirdOnlyLabelText, oldThirdOnlyLabelText);
465     }
466 
467     /**
468      * Return the label text for the first second view.  Defaults to {@link #DEFAULT_FIRST_SECOND_LABEL_TEXT}.
469      *
470      * @return the label text for the first second view
471      */
472     public final String getFirstSecondLabelText()
473     {
474         return firstSecondLabelText;
475     }
476 
477     /**
478      * Set the label text for the first second view to <code>firstSecondLabelText</code>.
479      *
480      * <p>This is a bound property.</p>
481      *
482      * @param firstSecondLabelText label text for the first second view
483      */
484     public final void setFirstSecondLabelText(final String firstSecondLabelText)
485     {
486         String oldFirstSecondLabelText = this.firstSecondLabelText;
487         this.firstSecondLabelText = firstSecondLabelText;
488         firstSecondLabel.setText(buildLabel(this.firstSecondLabelText, model.firstSecond().size()));
489         firePropertyChange(-1, "firstSecondLabelText", this.firstSecondLabelText, oldFirstSecondLabelText);
490     }
491 
492     /**
493      * Return the label text for the first third view.  Defaults to {@link #DEFAULT_FIRST_THIRD_LABEL_TEXT}.
494      *
495      * @return the label text for the first third view
496      */
497     public final String getFirstThirdLabelText()
498     {
499         return firstThirdLabelText;
500     }
501 
502     /**
503      * Set the label text for the first third view to <code>firstThirdLabelText</code>.
504      *
505      * <p>This is a bound property.</p>
506      *
507      * @param firstThirdLabelText label text for the first third view
508      */
509     public final void setFirstThirdLabelText(final String firstThirdLabelText)
510     {
511         String oldFirstThirdLabelText = this.firstThirdLabelText;
512         this.firstThirdLabelText = firstThirdLabelText;
513         firstThirdLabel.setText(buildLabel(this.firstThirdLabelText, model.firstThird().size()));
514         firePropertyChange(-1, "firstThirdLabelText", this.firstThirdLabelText, oldFirstThirdLabelText);
515     }
516 
517     /**
518      * Return the label text for the second third view.  Defaults to {@link #DEFAULT_SECOND_THIRD_LABEL_TEXT}.
519      *
520      * @return the label text for the second third view
521      */
522     public final String getSecondThirdLabelText()
523     {
524         return secondThirdLabelText;
525     }
526 
527     /**
528      * Set the label text for the second third view to <code>secondThirdLabelText</code>.
529      *
530      * <p>This is a bound property.</p>
531      *
532      * @param secondThirdLabelText label text for the second third view
533      */
534     public final void setSecondThirdLabelText(final String secondThirdLabelText)
535     {
536         String oldSecondThirdLabelText = this.secondThirdLabelText;
537         this.secondThirdLabelText = secondThirdLabelText;
538         secondThirdLabel.setText(buildLabel(this.secondThirdLabelText, model.secondThird().size()));
539         firePropertyChange(-1, "secondThirdLabelText", this.secondThirdLabelText, oldSecondThirdLabelText);
540     }
541 
542     /**
543      * Return the label text for the intersection view.  Defaults to {@link #DEFAULT_INTERSECTION_LABEL_TEXT}.
544      *
545      * @return the label text for the intersection view
546      */
547     public final String getIntersectionLabelText()
548     {
549         return intersectionLabelText;
550     }
551 
552     /**
553      * Set the label text for the intersection view to <code>intersectionLabelText</code>.
554      *
555      * <p>This is a bound property.</p>
556      *
557      * @param intersectionLabelText label text for the intersection view
558      */
559     public final void setIntersectionLabelText(final String intersectionLabelText)
560     {
561         String oldIntersectionLabelText = this.intersectionLabelText;
562         this.intersectionLabelText = intersectionLabelText;
563         intersectionLabel.setText(buildLabel(this.intersectionLabelText, model.intersection().size()));
564         firePropertyChange(-1, "intersectionLabelText", this.intersectionLabelText, oldIntersectionLabelText);
565     }
566 
567     /**
568      * Return the label text for the union view.  Defaults to {@link #DEFAULT_UNION_LABEL_TEXT}.
569      *
570      * @return the label text for the union view
571      */
572     public final String getUnionLabelText()
573     {
574         return unionLabelText;
575     }
576 
577     /**
578      * Set the label text for the union view to <code>unionLabelText</code>.
579      *
580      * <p>This is a bound property.</p>
581      *
582      * @param unionLabelText label text for the union view
583      */
584     public final void setUnionLabelText(final String unionLabelText)
585     {
586         String oldUnionLabelText = this.unionLabelText;
587         this.unionLabelText = unionLabelText;
588         unionLabel.setText(buildLabel(this.unionLabelText, model.union().size()));
589         firePropertyChange(-1, "unionLabelText", this.unionLabelText, oldUnionLabelText);
590     }
591 
592     /**
593      * Return the label for the first set.  The text for the returned PText
594      * should not be changed, as the text is synchronized to the ternary
595      * venn model backing this venn diagram.  Use methods
596      * {@link #setFirstLabelText(String)} and {@link #setDisplaySizes(boolean)}
597      * to set the label text and whether to display sizes respectively.
598      *
599      * @return the label for the first set
600      */
601     public final PText getFirstLabel()
602     {
603         return firstLabel;
604     }
605 
606     /**
607      * Return the label for the second set.  The text for the returned PText
608      * should not be changed, as the text is synchronized to the ternary
609      * venn model backing this venn diagram.  Use methods
610      * {@link #setSecondLabelText(String)} and {@link #setDisplaySizes(boolean)}
611      * to set the label text and whether to display sizes respectively.
612      *
613      * @return the label for the second set
614      */
615     public final PText getSecondLabel()
616     {
617         return secondLabel;
618     }
619 
620     /**
621      * Return the label for the third set.  The text for the returned PText
622      * should not be changed, as the text is synchronized to the ternary
623      * venn model backing this venn diagram.  Use methods
624      * {@link #setThirdLabelText(String)} and {@link #setDisplaySizes(boolean)}
625      * to set the label text and whether to display sizes respectively.
626      *
627      * @return the label for the third set
628      */
629     public final PText getThirdLabel()
630     {
631         return thirdLabel;
632     }
633 
634     /**
635      * Return the label for the first only view.  The text for the returned PText
636      * should not be changed, as the text is synchronized to the ternary
637      * venn model backing this venn diagram.  Use methods
638      * {@link #setFirstOnlyLabelText(String)} and {@link #setDisplaySizes(boolean)}
639      * to set the label text and whether to display sizes respectively.
640      *
641      * @return the label for the first only view
642      */
643     public final PText getFirstOnlyLabel()
644     {
645         return firstOnlyLabel;
646     }
647 
648     /**
649      * Return the label for the second only view.  The text for the returned PText
650      * should not be changed, as the text is synchronized to the ternary
651      * venn model backing this venn diagram.  Use methods
652      * {@link #setSecondOnlyLabelText(String)} and {@link #setDisplaySizes(boolean)}
653      * to set the label text and whether to display sizes respectively.
654      *
655      * @return the label for the second only view
656      */
657     public final PText getSecondOnlyLabel()
658     {
659         return secondOnlyLabel;
660     }
661 
662     /**
663      * Return the label for the third only view.  The text for the returned PText
664      * should not be changed, as the text is synchronized to the ternary
665      * venn model backing this venn diagram.  Use methods
666      * {@link #setThirdOnlyLabelText(String)} and {@link #setDisplaySizes(boolean)}
667      * to set the label text and whether to display sizes respectively.
668      *
669      * @return the label for the third only view
670      */
671     public final PText getThirdOnlyLabel()
672     {
673         return thirdOnlyLabel;
674     }
675 
676     /**
677      * Return the label for the first second view.  The text for the returned PText
678      * should not be changed, as the text is synchronized to the ternary
679      * venn model backing this venn diagram.  Use methods
680      * {@link #setFirstSecondLabelText(String)} and {@link #setDisplaySizes(boolean)}
681      * to set the label text and whether to display sizes respectively.
682      *
683      * @return the label for the first second view
684      */
685     public final PText getFirstSecondLabel()
686     {
687         return firstSecondLabel;
688     }
689 
690     /**
691      * Return the label for the first third view.  The text for the returned PText
692      * should not be changed, as the text is synchronized to the ternary
693      * venn model backing this venn diagram.  Use methods
694      * {@link #setFirstThirdLabelText(String)} and {@link #setDisplaySizes(boolean)}
695      * to set the label text and whether to display sizes respectively.
696      *
697      * @return the label for the first third view
698      */
699     public final PText getFirstThirdLabel()
700     {
701         return firstThirdLabel;
702     }
703 
704     /**
705      * Return the label for the second third view.  The text for the returned PText
706      * should not be changed, as the text is synchronized to the ternary
707      * venn model backing this venn diagram.  Use methods
708      * {@link #setSecondThirdLabelText(String)} and {@link #setDisplaySizes(boolean)}
709      * to set the label text and whether to display sizes respectively.
710      *
711      * @return the label for the second third view
712      */
713     public final PText getSecondThirdLabel()
714     {
715         return secondThirdLabel;
716     }
717 
718     /**
719      * Return the label for the intersection view.  The text for the returned PText
720      * should not be changed, as the text is synchronized to the ternary
721      * venn model backing this venn diagram.  Use methods
722      * {@link #setIntersectionLabelText(String)} and {@link #setDisplaySizes(boolean)}
723      * to set the label text and whether to display sizes respectively.
724      *
725      * @return the label for the intersection view
726      */
727     public final PText getIntersectionLabel()
728     {
729         return intersectionLabel;
730     }
731 
732     /**
733      * Return the label for the union view.  The text for the returned PText
734      * should not be changed, as the text is synchronized to the ternary
735      * venn model backing this venn diagram.  Use methods
736      * {@link #setUnionLabelText(String)} and {@link #setDisplaySizes(boolean)}
737      * to set the label text and whether to display sizes respectively.
738      *
739      * @return the label for the union view
740      */
741     public final PText getUnionLabel()
742     {
743         return unionLabel;
744     }
745 }