org.dishevelled.piccolo.venn.AbstractQuaternaryVennNode Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dsh-piccolo-venn Show documentation
Show all versions of dsh-piccolo-venn Show documentation
Piccolo2D venn diagram nodes and supporting classes.
/*
dsh-piccolo-venn Piccolo2D venn diagram nodes and supporting classes.
Copyright (c) 2009-2013 held jointly by the individual authors.
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or (at
your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; with out even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this library; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
> http://www.fsf.org/licensing/licenses/lgpl.html
> http://www.opensource.org/licenses/lgpl-license.php
*/
package org.dishevelled.piccolo.venn;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import org.piccolo2d.nodes.PText;
import org.dishevelled.observable.event.SetChangeEvent;
import org.dishevelled.observable.event.SetChangeListener;
import org.dishevelled.venn.QuaternaryVennModel;
import org.dishevelled.venn.model.QuaternaryVennModelImpl;
/**
* Abstract quaternary venn diagram node.
*
* @param value type
* @author Michael Heuer
* @version $Revision$ $Date$
*/
public abstract class AbstractQuaternaryVennNode
extends AbstractVennNode
{
/** Quaternary venn model. */
private QuaternaryVennModel model;
/** Label text for the first set. */
private String firstLabelText = DEFAULT_FIRST_LABEL_TEXT;
/** Label text for the second set. */
private String secondLabelText = DEFAULT_SECOND_LABEL_TEXT;
/** Label text for the third set. */
private String thirdLabelText = DEFAULT_THIRD_LABEL_TEXT;
/** Label text for the fourth set. */
private String fourthLabelText = DEFAULT_FOURTH_LABEL_TEXT;
/** Label text for the first only view. */
private String firstOnlyLabelText = DEFAULT_FIRST_ONLY_LABEL_TEXT;
/** Label text for the second only view. */
private String secondOnlyLabelText = DEFAULT_SECOND_ONLY_LABEL_TEXT;
/** Label text for the third only view. */
private String thirdOnlyLabelText = DEFAULT_THIRD_ONLY_LABEL_TEXT;
/** Label text for the fourth only view. */
private String fourthOnlyLabelText = DEFAULT_FOURTH_ONLY_LABEL_TEXT;
/** Label text for the first second view. */
private String firstSecondLabelText = DEFAULT_FIRST_SECOND_LABEL_TEXT;
/** Label text for the first third view. */
private String firstThirdLabelText = DEFAULT_FIRST_THIRD_LABEL_TEXT;
/** Label text for the second third view. */
private String secondThirdLabelText = DEFAULT_SECOND_THIRD_LABEL_TEXT;
/** Label text for the first fourth view. */
private String firstFourthLabelText = DEFAULT_FIRST_FOURTH_LABEL_TEXT;
/** Label text for the second fourth view. */
private String secondFourthLabelText = DEFAULT_SECOND_FOURTH_LABEL_TEXT;
/** Label text for the third fourth view. */
private String thirdFourthLabelText = DEFAULT_THIRD_FOURTH_LABEL_TEXT;
/** Label text for the first second third view. */
private String firstSecondThirdLabelText = DEFAULT_FIRST_SECOND_THIRD_LABEL_TEXT;
/** Label text for the first second fourth view. */
private String firstSecondFourthLabelText = DEFAULT_FIRST_SECOND_FOURTH_LABEL_TEXT;
/** Label text for the first third fourth view. */
private String firstThirdFourthLabelText = DEFAULT_FIRST_THIRD_FOURTH_LABEL_TEXT;
/** Label text for the second third fourth view. */
private String secondThirdFourthLabelText = DEFAULT_SECOND_THIRD_FOURTH_LABEL_TEXT;
/** Label text for the intersection view. */
private String intersectionLabelText = DEFAULT_INTERSECTION_LABEL_TEXT;
/** Label text for the union view. */
private String unionLabelText = DEFAULT_UNION_LABEL_TEXT;
/** Label for the first set. */
private final PText firstLabel = new PText();
/** Label for the second set. */
private final PText secondLabel = new PText();
/** Label for the third set. */
private final PText thirdLabel = new PText();
/** Label for the fourth set. */
private final PText fourthLabel = new PText();
/** Label for the first only view. */
private final PText firstOnlyLabel = new PText();
/** Label for the second only view. */
private final PText secondOnlyLabel = new PText();
/** Label for the third only view. */
private final PText thirdOnlyLabel = new PText();
/** Label for the fourth only view. */
private final PText fourthOnlyLabel = new PText();
/** Label for the first second view. */
private final PText firstSecondLabel = new PText();
/** Label for the first third view. */
private final PText firstThirdLabel = new PText();
/** Label for the second third view. */
private final PText secondThirdLabel = new PText();
/** Label for the first fourth view. */
private final PText firstFourthLabel = new PText();
/** Label for the second fourth view. */
private final PText secondFourthLabel = new PText();
/** Label for the third fourth view. */
private final PText thirdFourthLabel = new PText();
/** Label for the first second third view. */
private final PText firstSecondThirdLabel = new PText();
/** Label for the first second fourth view. */
private final PText firstSecondFourthLabel = new PText();
/** Label for the first third fourth view. */
private final PText firstThirdFourthLabel = new PText();
/** Label for the second third fourth view. */
private final PText secondThirdFourthLabel = new PText();
/** Label for the intersection view. */
private final PText intersectionLabel = new PText();
/** Label for the union view. */
private final PText unionLabel = new PText();
/** List of labels. */
private final List labels = Arrays.asList(new PText[] { firstLabel, secondLabel, thirdLabel, fourthLabel,
firstOnlyLabel, secondOnlyLabel, thirdOnlyLabel, fourthOnlyLabel,
firstSecondLabel, firstThirdLabel, secondThirdLabel, firstFourthLabel,
secondFourthLabel, thirdFourthLabel, firstSecondThirdLabel,
firstSecondFourthLabel, firstThirdFourthLabel, secondThirdFourthLabel,
intersectionLabel, unionLabel });
/** Update labels and contents. */
private final SetChangeListener update = new SetChangeListener()
{
@Override
public void setChanged(final SetChangeEvent event)
{
updateLabels();
updateContents();
}
};
/** Default label text for the first set, "First set"
. */
public static final String DEFAULT_FIRST_LABEL_TEXT = "First set";
/** Default label text for the second set, "Second set"
. */
public static final String DEFAULT_SECOND_LABEL_TEXT = "Second set";
/** Default label text for the third set, "Third set"
. */
public static final String DEFAULT_THIRD_LABEL_TEXT = "Third set";
/** Default label text for the fourth set, "Fourth set"
. */
public static final String DEFAULT_FOURTH_LABEL_TEXT = "Fourth set";
/** Default label text for the first only view, "First only"
. */
public static final String DEFAULT_FIRST_ONLY_LABEL_TEXT = "First only";
/** Default label text for the second only view, "Second only"
. */
public static final String DEFAULT_SECOND_ONLY_LABEL_TEXT = "Second only";
/** Default label text for the third only view, "Third only"
. */
public static final String DEFAULT_THIRD_ONLY_LABEL_TEXT = "Third only";
/** Default label text for the fourth only view, "Fourth only"
. */
public static final String DEFAULT_FOURTH_ONLY_LABEL_TEXT = "Fourth only";
/** Default label text for the first second view, "First and second only"
. */
public static final String DEFAULT_FIRST_SECOND_LABEL_TEXT = "First and second only";
/** Default label text for the first third view, "First and third only"
. */
public static final String DEFAULT_FIRST_THIRD_LABEL_TEXT = "First and third only";
/** Default label text for the second third view, "Second and third only"
. */
public static final String DEFAULT_SECOND_THIRD_LABEL_TEXT = "Second and third only";
/** Default label text for the first fourth view, "First and fourth only"
. */
public static final String DEFAULT_FIRST_FOURTH_LABEL_TEXT = "First and fourth only";
/** Default label text for the second fourth view, "Second and fourth only"
. */
public static final String DEFAULT_SECOND_FOURTH_LABEL_TEXT = "Second and fourth only";
/** Default label text for the third fourth view, "Third and fourth only"
. */
public static final String DEFAULT_THIRD_FOURTH_LABEL_TEXT = "Third and fourth only";
/** Default label text for the first second third view, "First, second, and third only"
. */
public static final String DEFAULT_FIRST_SECOND_THIRD_LABEL_TEXT = "First, second, and third only";
/** Default label text for the first second fourth view, "First, second, and fourth only"
. */
public static final String DEFAULT_FIRST_SECOND_FOURTH_LABEL_TEXT = "First, second, and fourth only";
/** Default label text for the first third fourth view, "First, third, and fourth only"
. */
public static final String DEFAULT_FIRST_THIRD_FOURTH_LABEL_TEXT = "First, third, and fourth only";
/** Default label text for the second third fourth view, "Second, third, and fourth only"
. */
public static final String DEFAULT_SECOND_THIRD_FOURTH_LABEL_TEXT = "Second, third, and fourth only";
/** Default label text for the intersection view, "Intersection"
. */
public static final String DEFAULT_INTERSECTION_LABEL_TEXT = "Intersection";
/** Default label text for the union view, "Union"
. */
public static final String DEFAULT_UNION_LABEL_TEXT = "Union";
/**
* Create a new empty abstract quaternary venn diagram node.
*/
protected AbstractQuaternaryVennNode()
{
super();
model = new QuaternaryVennModelImpl();
installListeners();
updateLabels();
}
/**
* Create a new abstract quaternary venn diagram node with the specified sets.
*
* @param firstLabelText label text for the first set
* @param first first set, must not be null
* @param secondLabelText label text for the second set
* @param second second set, must not be null
* @param thirdLabelText label text for the third set
* @param third third set, must not be null
* @param fourthLabelText label text for the fourth set
* @param fourth fourth set, must not be null
*/
protected AbstractQuaternaryVennNode(final String firstLabelText, final Set extends E> first,
final String secondLabelText, final Set extends E> second,
final String thirdLabelText, final Set extends E> third,
final String fourthLabelText, final Set extends E> fourth)
{
super();
model = new QuaternaryVennModelImpl(first, second, third, fourth);
this.firstLabelText = firstLabelText;
this.secondLabelText = secondLabelText;
this.thirdLabelText = thirdLabelText;
this.fourthLabelText = fourthLabelText;
this.firstOnlyLabelText = firstLabelText + " only";
this.secondOnlyLabelText = secondLabelText + " only";
this.thirdOnlyLabelText = thirdLabelText + " only";
this.fourthOnlyLabelText = fourthLabelText + " only";
this.firstSecondLabelText = firstLabelText + " and " + secondLabelText + " only";
this.firstThirdLabelText = firstLabelText + " and " + thirdLabelText + " only";
this.secondThirdLabelText = secondLabelText + " and " + thirdLabelText + " only";
this.firstFourthLabelText = firstLabelText + " and " + fourthLabelText + " only";
this.secondFourthLabelText = secondLabelText + " and " + fourthLabelText + " only";
this.thirdFourthLabelText = thirdLabelText + " and " + fourthLabelText + " only";
this.firstSecondThirdLabelText = firstLabelText + ", " + secondLabelText + ", and " + thirdLabelText + " only";
this.firstSecondFourthLabelText = firstLabelText + ", " + secondLabelText + ", and " + fourthLabelText + " only";
this.firstThirdFourthLabelText = firstLabelText + ", " + thirdLabelText + ", and " + fourthLabelText + " only";
this.secondThirdFourthLabelText = secondLabelText + ", " + thirdLabelText + ", and " + fourthLabelText + " only";
installListeners();
updateLabels();
}
/**
* Create a new abstract quaternary venn diagram node with the specified model.
*
* @param model model for this abstract quaternary venn diagram node, must not be null
*/
protected AbstractQuaternaryVennNode(final QuaternaryVennModel model)
{
super();
if (model == null)
{
throw new IllegalArgumentException("model must not be null");
}
this.model = model;
installListeners();
updateLabels();
}
/**
* Install listeners.
*/
private void installListeners()
{
model.first().addSetChangeListener(update);
model.second().addSetChangeListener(update);
model.third().addSetChangeListener(update);
model.fourth().addSetChangeListener(update);
}
/**
* Uninstall listeners.
*/
private void uninstallListeners()
{
model.first().removeSetChangeListener(update);
model.second().removeSetChangeListener(update);
model.third().removeSetChangeListener(update);
model.fourth().removeSetChangeListener(update);
}
@Override
protected void updateLabels()
{
firstLabel.setText(buildLabel(firstLabelText, model.first().size()));
secondLabel.setText(buildLabel(secondLabelText, model.second().size()));
thirdLabel.setText(buildLabel(thirdLabelText, model.third().size()));
fourthLabel.setText(buildLabel(fourthLabelText, model.fourth().size()));
firstOnlyLabel.setText(buildLabel(firstOnlyLabelText, model.firstOnly().size()));
secondOnlyLabel.setText(buildLabel(secondOnlyLabelText, model.secondOnly().size()));
thirdOnlyLabel.setText(buildLabel(thirdOnlyLabelText, model.thirdOnly().size()));
fourthOnlyLabel.setText(buildLabel(fourthOnlyLabelText, model.fourthOnly().size()));
firstSecondLabel.setText(buildLabel(firstSecondLabelText, model.firstSecond().size()));
firstThirdLabel.setText(buildLabel(firstThirdLabelText, model.firstThird().size()));
secondThirdLabel.setText(buildLabel(secondThirdLabelText, model.secondThird().size()));
firstFourthLabel.setText(buildLabel(firstFourthLabelText, model.firstFourth().size()));
secondFourthLabel.setText(buildLabel(secondFourthLabelText, model.secondFourth().size()));
thirdFourthLabel.setText(buildLabel(thirdFourthLabelText, model.thirdFourth().size()));
firstSecondThirdLabel.setText(buildLabel(firstSecondThirdLabelText, model.firstSecondThird().size()));
firstSecondFourthLabel.setText(buildLabel(firstSecondFourthLabelText, model.firstSecondFourth().size()));
firstThirdFourthLabel.setText(buildLabel(firstThirdFourthLabelText, model.firstThirdFourth().size()));
secondThirdFourthLabel.setText(buildLabel(secondThirdFourthLabelText, model.secondThirdFourth().size()));
intersectionLabel.setText(buildLabel(intersectionLabelText, model.intersection().size()));
unionLabel.setText(buildLabel(unionLabelText, model.union().size()));
firstLabel.setVisible(getDisplayLabels());
secondLabel.setVisible(getDisplayLabels());
thirdLabel.setVisible(getDisplayLabels());
fourthLabel.setVisible(getDisplayLabels());
firstOnlyLabel.setVisible(getDisplayLabels());
secondOnlyLabel.setVisible(getDisplayLabels());
thirdOnlyLabel.setVisible(getDisplayLabels());
fourthOnlyLabel.setVisible(getDisplayLabels());
firstSecondLabel.setVisible(getDisplayLabels());
firstThirdLabel.setVisible(getDisplayLabels());
secondThirdLabel.setVisible(getDisplayLabels());
firstFourthLabel.setVisible(getDisplayLabels());
secondFourthLabel.setVisible(getDisplayLabels());
thirdFourthLabel.setVisible(getDisplayLabels());
firstSecondThirdLabel.setVisible(getDisplayLabels());
firstSecondFourthLabel.setVisible(getDisplayLabels());
firstThirdFourthLabel.setVisible(getDisplayLabels());
secondThirdFourthLabel.setVisible(getDisplayLabels());
intersectionLabel.setVisible(getDisplayLabels());
unionLabel.setVisible(getDisplayLabels());
}
/**
* Update contents.
*/
protected abstract void updateContents();
@Override
public Iterable labels()
{
return labels;
}
/**
* Return the model for this quaternary venn label. The model will not be null.
*
* @return the model for this quaternary venn label
*/
public final QuaternaryVennModel getModel()
{
return model;
}
/**
* Set the model for this quaternary venn label to model
.
*
* This is a bound property.
*
* @param model model for this quaternary venn label, must not be null
*/
public final void setModel(final QuaternaryVennModel model)
{
if (model == null)
{
throw new IllegalArgumentException("model must not be null");
}
QuaternaryVennModel oldModel = this.model;
uninstallListeners();
this.model = model;
installListeners();
updateLabels();
firePropertyChange(-1, "model", oldModel, this.model);
}
/**
* Return the label text for the first set. Defaults to {@link #DEFAULT_FIRST_LABEL_TEXT}.
*
* @return the label text for the first set
*/
public final String getFirstLabelText()
{
return firstLabelText;
}
/**
* Set the label text for the first set to firstLabelText
.
*
* This is a bound property.
*
* @param firstLabelText label text for the first set
*/
public final void setFirstLabelText(final String firstLabelText)
{
String oldFirstLabelText = this.firstLabelText;
this.firstLabelText = firstLabelText;
firstLabel.setText(buildLabel(this.firstLabelText, model.first().size()));
firePropertyChange(-1, "firstLabelText", this.firstLabelText, oldFirstLabelText);
}
/**
* Return the label text for the second set. Defaults to {@link #DEFAULT_SECOND_LABEL_TEXT}.
*
* @return the label text for the second set
*/
public final String getSecondLabelText()
{
return secondLabelText;
}
/**
* Set the label text for the second set to secondLabelText
.
*
* This is a bound property.
*
* @param secondLabelText label text for the second set
*/
public final void setSecondLabelText(final String secondLabelText)
{
String oldSecondLabelText = this.secondLabelText;
this.secondLabelText = secondLabelText;
secondLabel.setText(buildLabel(this.secondLabelText, model.second().size()));
firePropertyChange(-1, "secondLabelText", this.secondLabelText, oldSecondLabelText);
}
/**
* Return the label text for the third set. Defaults to {@link #DEFAULT_THIRD_LABEL_TEXT}.
*
* @return the label text for the third set
*/
public final String getThirdLabelText()
{
return thirdLabelText;
}
/**
* Set the label text for the third set to thirdLabelText
.
*
* This is a bound property.
*
* @param thirdLabelText label text for the third set
*/
public final void setThirdLabelText(final String thirdLabelText)
{
String oldThirdLabelText = this.thirdLabelText;
this.thirdLabelText = thirdLabelText;
thirdLabel.setText(buildLabel(this.thirdLabelText, model.third().size()));
firePropertyChange(-1, "thirdLabelText", this.thirdLabelText, oldThirdLabelText);
}
/**
* Return the label text for the fourth set. Defaults to {@link #DEFAULT_FOURTH_LABEL_TEXT}.
*
* @return the label text for the fourth set
*/
public final String getFourthLabelText()
{
return fourthLabelText;
}
/**
* Set the label text for the fourth set to fourthLabelText
.
*
* This is a bound property.
*
* @param fourthLabelText label text for the fourth set
*/
public final void setFourthLabelText(final String fourthLabelText)
{
String oldFourthLabelText = this.fourthLabelText;
this.fourthLabelText = fourthLabelText;
fourthLabel.setText(buildLabel(this.fourthLabelText, model.fourth().size()));
firePropertyChange(-1, "fourthLabelText", this.fourthLabelText, oldFourthLabelText);
}
/**
* Return the label text for the first only view. Defaults to {@link #DEFAULT_FIRST_ONLY_LABEL_TEXT}.
*
* @return the label text for the first only view
*/
public final String getFirstOnlyLabelText()
{
return firstOnlyLabelText;
}
/**
* Set the label text for the first only view to firstOnlyLabelText
.
*
* This is a bound property.
*
* @param firstOnlyLabelText label text for the first only view
*/
public final void setFirstOnlyLabelText(final String firstOnlyLabelText)
{
String oldFirstOnlyLabelText = this.firstOnlyLabelText;
this.firstOnlyLabelText = firstOnlyLabelText;
firstOnlyLabel.setText(buildLabel(this.firstOnlyLabelText, model.firstOnly().size()));
firePropertyChange(-1, "firstOnlyLabelText", this.firstOnlyLabelText, oldFirstOnlyLabelText);
}
/**
* Return the label text for the second only view. Defaults to {@link #DEFAULT_SECOND_ONLY_LABEL_TEXT}.
*
* @return the label text for the second only view
*/
public final String getSecondOnlyLabelText()
{
return secondOnlyLabelText;
}
/**
* Set the label text for the second only view to secondOnlyLabelText
.
*
* This is a bound property.
*
* @param secondOnlyLabelText label text for the second only view
*/
public final void setSecondOnlyLabelText(final String secondOnlyLabelText)
{
String oldSecondOnlyLabelText = this.secondOnlyLabelText;
this.secondOnlyLabelText = secondOnlyLabelText;
secondOnlyLabel.setText(buildLabel(this.secondOnlyLabelText, model.secondOnly().size()));
firePropertyChange(-1, "secondOnlyLabelText", this.secondOnlyLabelText, oldSecondOnlyLabelText);
}
/**
* Return the label text for the third only view. Defaults to {@link #DEFAULT_THIRD_ONLY_LABEL_TEXT}.
*
* @return the label text for the third only view
*/
public final String getThirdOnlyLabelText()
{
return thirdOnlyLabelText;
}
/**
* Set the label text for the third only view to thirdOnlyLabelText
.
*
* This is a bound property.
*
* @param thirdOnlyLabelText label text for the third only view
*/
public final void setThirdOnlyLabelText(final String thirdOnlyLabelText)
{
String oldThirdOnlyLabelText = this.thirdOnlyLabelText;
this.thirdOnlyLabelText = thirdOnlyLabelText;
thirdOnlyLabel.setText(buildLabel(this.thirdOnlyLabelText, model.thirdOnly().size()));
firePropertyChange(-1, "thirdOnlyLabelText", this.thirdOnlyLabelText, oldThirdOnlyLabelText);
}
/**
* Return the label text for the fourth only view. Defaults to {@link #DEFAULT_FOURTH_ONLY_LABEL_TEXT}.
*
* @return the label text for the fourth only view
*/
public final String getFourthOnlyLabelText()
{
return fourthOnlyLabelText;
}
/**
* Set the label text for the fourth only view to fourthOnlyLabelText
.
*
* This is a bound property.
*
* @param fourthOnlyLabelText label text for the fourth only view
*/
public final void setFourthOnlyLabelText(final String fourthOnlyLabelText)
{
String oldFourthOnlyLabelText = this.fourthOnlyLabelText;
this.fourthOnlyLabelText = fourthOnlyLabelText;
fourthOnlyLabel.setText(buildLabel(this.fourthOnlyLabelText, model.fourthOnly().size()));
firePropertyChange(-1, "fourthOnlyLabelText", this.fourthOnlyLabelText, oldFourthOnlyLabelText);
}
/**
* Return the label text for the first second view. Defaults to {@link #DEFAULT_FIRST_SECOND_LABEL_TEXT}.
*
* @return the label text for the first second view
*/
public final String getFirstSecondLabelText()
{
return firstSecondLabelText;
}
/**
* Set the label text for the first second view to firstSecondLabelText
.
*
* This is a bound property.
*
* @param firstSecondLabelText label text for the first second view
*/
public final void setFirstSecondLabelText(final String firstSecondLabelText)
{
String oldFirstSecondLabelText = this.firstSecondLabelText;
this.firstSecondLabelText = firstSecondLabelText;
firstSecondLabel.setText(buildLabel(this.firstSecondLabelText, model.firstSecond().size()));
firePropertyChange(-1, "firstSecondLabelText", this.firstSecondLabelText, oldFirstSecondLabelText);
}
/**
* Return the label text for the first third view. Defaults to {@link #DEFAULT_FIRST_THIRD_LABEL_TEXT}.
*
* @return the label text for the first third view
*/
public final String getFirstThirdLabelText()
{
return firstThirdLabelText;
}
/**
* Set the label text for the first third view to firstThirdLabelText
.
*
* This is a bound property.
*
* @param firstThirdLabelText label text for the first third view
*/
public final void setFirstThirdLabelText(final String firstThirdLabelText)
{
String oldFirstThirdLabelText = this.firstThirdLabelText;
this.firstThirdLabelText = firstThirdLabelText;
firstThirdLabel.setText(buildLabel(this.firstThirdLabelText, model.firstThird().size()));
firePropertyChange(-1, "firstThirdLabelText", this.firstThirdLabelText, oldFirstThirdLabelText);
}
/**
* Return the label text for the second third view. Defaults to {@link #DEFAULT_SECOND_THIRD_LABEL_TEXT}.
*
* @return the label text for the second third view
*/
public final String getSecondThirdLabelText()
{
return secondThirdLabelText;
}
/**
* Set the label text for the second third view to secondThirdLabelText
.
*
* This is a bound property.
*
* @param secondThirdLabelText label text for the second third view
*/
public final void setSecondThirdLabelText(final String secondThirdLabelText)
{
String oldSecondThirdLabelText = this.secondThirdLabelText;
this.secondThirdLabelText = secondThirdLabelText;
secondThirdLabel.setText(buildLabel(this.secondThirdLabelText, model.secondThird().size()));
firePropertyChange(-1, "secondThirdLabelText", this.secondThirdLabelText, oldSecondThirdLabelText);
}
/**
* Return the label text for the intersection view. Defaults to {@link #DEFAULT_INTERSECTION_LABEL_TEXT}.
*
* @return the label text for the intersection view
*/
public final String getIntersectionLabelText()
{
return intersectionLabelText;
}
/**
* Set the label text for the intersection view to intersectionLabelText
.
*
* This is a bound property.
*
* @param intersectionLabelText label text for the intersection view
*/
public final void setIntersectionLabelText(final String intersectionLabelText)
{
String oldIntersectionLabelText = this.intersectionLabelText;
this.intersectionLabelText = intersectionLabelText;
intersectionLabel.setText(buildLabel(this.intersectionLabelText, model.intersection().size()));
firePropertyChange(-1, "intersectionLabelText", this.intersectionLabelText, oldIntersectionLabelText);
}
/**
* Return the label text for the union view. Defaults to {@link #DEFAULT_UNION_LABEL_TEXT}.
*
* @return the label text for the union view
*/
public final String getUnionLabelText()
{
return unionLabelText;
}
/**
* Set the label text for the union view to unionLabelText
.
*
* This is a bound property.
*
* @param unionLabelText label text for the union view
*/
public final void setUnionLabelText(final String unionLabelText)
{
String oldUnionLabelText = this.unionLabelText;
this.unionLabelText = unionLabelText;
unionLabel.setText(buildLabel(this.unionLabelText, model.union().size()));
firePropertyChange(-1, "unionLabelText", this.unionLabelText, oldUnionLabelText);
}
/**
* Return the label for the first set. The text for the returned PText
* should not be changed, as the text is synchronized to the quaternary
* venn model backing this venn diagram. Use methods
* {@link #setFirstLabelText(String)} and {@link #setDisplaySizes(boolean)}
* to set the label text and whether to display sizes respectively.
*
* @return the label for the first set
*/
public final PText getFirstLabel()
{
return firstLabel;
}
/**
* Return the label for the second set. The text for the returned PText
* should not be changed, as the text is synchronized to the quaternary
* venn model backing this venn diagram. Use methods
* {@link #setSecondLabelText(String)} and {@link #setDisplaySizes(boolean)}
* to set the label text and whether to display sizes respectively.
*
* @return the label for the second set
*/
public final PText getSecondLabel()
{
return secondLabel;
}
/**
* Return the label for the third set. The text for the returned PText
* should not be changed, as the text is synchronized to the quaternary
* venn model backing this venn diagram. Use methods
* {@link #setThirdLabelText(String)} and {@link #setDisplaySizes(boolean)}
* to set the label text and whether to display sizes respectively.
*
* @return the label for the third set
*/
public final PText getThirdLabel()
{
return thirdLabel;
}
/**
* Return the label for the fourth set. The text for the returned PText
* should not be changed, as the text is synchronized to the quaternary
* venn model backing this venn diagram. Use methods
* {@link #setFourthLabelText(String)} and {@link #setDisplaySizes(boolean)}
* to set the label text and whether to display sizes respectively.
*
* @return the label for the fourth set
*/
public final PText getFourthLabel()
{
return fourthLabel;
}
/**
* Return the label for the first only view. The text for the returned PText
* should not be changed, as the text is synchronized to the quaternary
* venn model backing this venn diagram. Use methods
* {@link #setFirstOnlyLabelText(String)} and {@link #setDisplaySizes(boolean)}
* to set the label text and whether to display sizes respectively.
*
* @return the label for the first only view
*/
public final PText getFirstOnlyLabel()
{
return firstOnlyLabel;
}
/**
* Return the label for the second only view. The text for the returned PText
* should not be changed, as the text is synchronized to the quaternary
* venn model backing this venn diagram. Use methods
* {@link #setSecondOnlyLabelText(String)} and {@link #setDisplaySizes(boolean)}
* to set the label text and whether to display sizes respectively.
*
* @return the label for the second only view
*/
public final PText getSecondOnlyLabel()
{
return secondOnlyLabel;
}
/**
* Return the label for the third only view. The text for the returned PText
* should not be changed, as the text is synchronized to the quaternary
* venn model backing this venn diagram. Use methods
* {@link #setThirdOnlyLabelText(String)} and {@link #setDisplaySizes(boolean)}
* to set the label text and whether to display sizes respectively.
*
* @return the label for the third only view
*/
public final PText getThirdOnlyLabel()
{
return thirdOnlyLabel;
}
/**
* Return the label for the fourth only view. The text for the returned PText
* should not be changed, as the text is synchronized to the quaternary
* venn model backing this venn diagram. Use methods
* {@link #setFourthOnlyLabelText(String)} and {@link #setDisplaySizes(boolean)}
* to set the label text and whether to display sizes respectively.
*
* @return the label for the fourth only view
*/
public final PText getFourthOnlyLabel()
{
return fourthOnlyLabel;
}
/**
* Return the label for the first second view. The text for the returned PText
* should not be changed, as the text is synchronized to the quaternary
* venn model backing this venn diagram. Use methods
* {@link #setFirstSecondLabelText(String)} and {@link #setDisplaySizes(boolean)}
* to set the label text and whether to display sizes respectively.
*
* @return the label for the first second view
*/
public final PText getFirstSecondLabel()
{
return firstSecondLabel;
}
/**
* Return the label for the first third view. The text for the returned PText
* should not be changed, as the text is synchronized to the quaternary
* venn model backing this venn diagram. Use methods
* {@link #setFirstThirdLabelText(String)} and {@link #setDisplaySizes(boolean)}
* to set the label text and whether to display sizes respectively.
*
* @return the label for the first third view
*/
public final PText getFirstThirdLabel()
{
return firstThirdLabel;
}
/**
* Return the label for the second third view. The text for the returned PText
* should not be changed, as the text is synchronized to the quaternary
* venn model backing this venn diagram. Use methods
* {@link #setSecondThirdLabelText(String)} and {@link #setDisplaySizes(boolean)}
* to set the label text and whether to display sizes respectively.
*
* @return the label for the second third view
*/
public final PText getSecondThirdLabel()
{
return secondThirdLabel;
}
/**
* Return the label for the intersection view. The text for the returned PText
* should not be changed, as the text is synchronized to the quaternary
* venn model backing this venn diagram. Use methods
* {@link #setIntersectionLabelText(String)} and {@link #setDisplaySizes(boolean)}
* to set the label text and whether to display sizes respectively.
*
* @return the label for the intersection view
*/
public final PText getIntersectionLabel()
{
return intersectionLabel;
}
/**
* Return the label for the union view. The text for the returned PText
* should not be changed, as the text is synchronized to the quaternary
* venn model backing this venn diagram. Use methods
* {@link #setUnionLabelText(String)} and {@link #setDisplaySizes(boolean)}
* to set the label text and whether to display sizes respectively.
*
* @return the label for the union view
*/
public final PText getUnionLabel()
{
return unionLabel;
}
/**
* Return the label text for the first fourth view. Defaults to {@link #DEFAULT_FIRST_FOURTH_LABEL_TEXT}.
*
* @return the label text for the first fourth view
*/
public final String getFirstFourthLabelText()
{
return firstFourthLabelText;
}
/**
* Set the label text for the first fourth view to firstFourthLabelText
.
*
* This is a bound property.
*
* @param firstFourthLabelText label text for the first fourth view
*/
public final void setFirstFourthLabelText(final String firstFourthLabelText)
{
String oldFirstFourthLabelText = this.firstFourthLabelText;
this.firstFourthLabelText = firstFourthLabelText;
firstFourthLabel.setText(buildLabel(this.firstFourthLabelText, model.firstFourth().size()));
firePropertyChange(-1, "firstFourthLabelText", this.firstFourthLabelText, oldFirstFourthLabelText);
}
/**
* Return the label for the first fourth view. The text for the returned PText
* should not be changed, as the text is synchronized to the quaternary
* venn model backing this venn diagram. Use methods
* {@link #setFirstFourthLabelText(String)} and {@link #setDisplaySizes(boolean)}
* to set the label text and whether to display sizes respectively.
*
* @return the label for the first fourth view
*/
public final PText getFirstFourthLabel()
{
return firstFourthLabel;
}
/**
* Return the label text for the second fourth view. Defaults to {@link #DEFAULT_SECOND_FOURTH_LABEL_TEXT}.
*
* @return the label text for the second fourth view
*/
public final String getSecondFourthLabelText()
{
return secondFourthLabelText;
}
/**
* Set the label text for the second fourth view to secondFourthLabelText
.
*
* This is a bound property.
*
* @param secondFourthLabelText label text for the second fourth view
*/
public final void setSecondFourthLabelText(final String secondFourthLabelText)
{
String oldSecondFourthLabelText = this.secondFourthLabelText;
this.secondFourthLabelText = secondFourthLabelText;
secondFourthLabel.setText(buildLabel(this.secondFourthLabelText, model.secondFourth().size()));
firePropertyChange(-1, "secondFourthLabelText", this.secondFourthLabelText, oldSecondFourthLabelText);
}
/**
* Return the label for the second fourth view. The text for the returned PText
* should not be changed, as the text is synchronized to the quaternary
* venn model backing this venn diagram. Use methods
* {@link #setSecondFourthLabelText(String)} and {@link #setDisplaySizes(boolean)}
* to set the label text and whether to display sizes respectively.
*
* @return the label for the second fourth view
*/
public final PText getSecondFourthLabel()
{
return secondFourthLabel;
}
/**
* Return the label text for the third fourth view. Defaults to {@link #DEFAULT_THIRD_FOURTH_LABEL_TEXT}.
*
* @return the label text for the third fourth view
*/
public final String getThirdFourthLabelText()
{
return thirdFourthLabelText;
}
/**
* Set the label text for the third fourth view to thirdFourthLabelText
.
*
* This is a bound property.
*
* @param thirdFourthLabelText label text for the third fourth view
*/
public final void setThirdFourthLabelText(final String thirdFourthLabelText)
{
String oldThirdFourthLabelText = this.thirdFourthLabelText;
this.thirdFourthLabelText = thirdFourthLabelText;
thirdFourthLabel.setText(buildLabel(this.thirdFourthLabelText, model.thirdFourth().size()));
firePropertyChange(-1, "thirdFourthLabelText", this.thirdFourthLabelText, oldThirdFourthLabelText);
}
/**
* Return the label for the third fourth view. The text for the returned PText
* should not be changed, as the text is synchronized to the quaternary
* venn model backing this venn diagram. Use methods
* {@link #setThirdFourthLabelText(String)} and {@link #setDisplaySizes(boolean)}
* to set the label text and whether to display sizes respectively.
*
* @return the label for the third fourth view
*/
public final PText getThirdFourthLabel()
{
return thirdFourthLabel;
}
/**
* Return the label text for the first second third view. Defaults to
* {@link #DEFAULT_FIRST_SECOND_THIRD_LABEL_TEXT}.
*
* @return the label text for the first second third view
*/
public final String getFirstSecondThirdLabelText()
{
return firstSecondThirdLabelText;
}
/**
* Set the label text for the first second third view to firstSecondThirdLabelText
.
*
* This is a bound property.
*
* @param firstSecondThirdLabelText label text for the first second third view
*/
public final void setFirstSecondThirdLabelText(final String firstSecondThirdLabelText)
{
String oldFirstSecondThirdLabelText = this.firstSecondThirdLabelText;
this.firstSecondThirdLabelText = firstSecondThirdLabelText;
firstSecondThirdLabel.setText(buildLabel(this.firstSecondThirdLabelText, model.firstSecondThird().size()));
firePropertyChange(-1,
"firstSecondThirdLabelText",
this.firstSecondThirdLabelText,
oldFirstSecondThirdLabelText);
}
/**
* Return the label for the first second third view. The text for the returned PText
* should not be changed, as the text is synchronized to the quaternary
* venn model backing this venn diagram. Use methods
* {@link #setFirstSecondThirdLabelText(String)} and {@link #setDisplaySizes(boolean)}
* to set the label text and whether to display sizes respectively.
*
* @return the label for the first second third view
*/
public final PText getFirstSecondThirdLabel()
{
return firstSecondThirdLabel;
}
/**
* Return the label text for the first second fourth view. Defaults to
* {@link #DEFAULT_FIRST_SECOND_FOURTH_LABEL_TEXT}.
*
* @return the label text for the first second fourth view
*/
public final String getFirstSecondFourthLabelText()
{
return firstSecondFourthLabelText;
}
/**
* Set the label text for the first second fourth view to firstSecondFourthLabelText
.
*
* This is a bound property.
*
* @param firstSecondFourthLabelText label text for the first second fourth view
*/
public final void setFirstSecondFourthLabelText(final String firstSecondFourthLabelText)
{
String oldFirstSecondFourthLabelText = this.firstSecondFourthLabelText;
this.firstSecondFourthLabelText = firstSecondFourthLabelText;
firstSecondFourthLabel.setText(buildLabel(this.firstSecondFourthLabelText, model.firstSecondFourth().size()));
firePropertyChange(-1,
"firstSecondFourthLabelText",
this.firstSecondFourthLabelText,
oldFirstSecondFourthLabelText);
}
/**
* Return the label for the first second fourth view. The text for the returned PText
* should not be changed, as the text is synchronized to the quaternary
* venn model backing this venn diagram. Use methods
* {@link #setFirstSecondFourthLabelText(String)} and {@link #setDisplaySizes(boolean)}
* to set the label text and whether to display sizes respectively.
*
* @return the label for the first second fourth view
*/
public final PText getFirstSecondFourthLabel()
{
return firstSecondFourthLabel;
}
/**
* Return the label text for the first third fourth view. Defaults to
* {@link #DEFAULT_FIRST_THIRD_FOURTH_LABEL_TEXT}.
*
* @return the label text for the first third fourth view
*/
public final String getFirstThirdFourthLabelText()
{
return firstThirdFourthLabelText;
}
/**
* Set the label text for the first third fourth view to firstThirdFourthLabelText
.
*
* This is a bound property.
*
* @param firstThirdFourthLabelText label text for the first third fourth view
*/
public final void setFirstThirdFourthLabelText(final String firstThirdFourthLabelText)
{
String oldFirstThirdFourthLabelText = this.firstThirdFourthLabelText;
this.firstThirdFourthLabelText = firstThirdFourthLabelText;
firstThirdFourthLabel.setText(buildLabel(this.firstThirdFourthLabelText, model.firstThirdFourth().size()));
firePropertyChange(-1,
"firstThirdFourthLabelText",
this.firstThirdFourthLabelText,
oldFirstThirdFourthLabelText);
}
/**
* Return the label for the first third fourth view. The text for the returned PText
* should not be changed, as the text is synchronized to the quaternary
* venn model backing this venn diagram. Use methods
* {@link #setFirstThirdFourthLabelText(String)} and {@link #setDisplaySizes(boolean)}
* to set the label text and whether to display sizes respectively.
*
* @return the label for the first third fourth view
*/
public final PText getFirstThirdFourthLabel()
{
return firstThirdFourthLabel;
}
/**
* Return the label text for the second third fourth view. Defaults to
* {@link #DEFAULT_SECOND_THIRD_FOURTH_LABEL_TEXT}.
*
* @return the label text for the second third fourth view
*/
public final String getSecondThirdFourthLabelText()
{
return secondThirdFourthLabelText;
}
/**
* Set the label text for the second third fourth view to secondThirdFourthLabelText
.
*
* This is a bound property.
*
* @param secondThirdFourthLabelText label text for the second third fourth view
*/
public final void setSecondThirdFourthLabelText(final String secondThirdFourthLabelText)
{
String oldSecondThirdFourthLabelText = this.secondThirdFourthLabelText;
this.secondThirdFourthLabelText = secondThirdFourthLabelText;
secondThirdFourthLabel.setText(buildLabel(this.secondThirdFourthLabelText, model.secondThirdFourth().size()));
firePropertyChange(-1,
"secondThirdFourthLabelText",
this.secondThirdFourthLabelText,
oldSecondThirdFourthLabelText);
}
/**
* Return the label for the second third fourth view. The text for the returned PText
* should not be changed, as the text is synchronized to the quaternary
* venn model backing this venn diagram. Use methods
* {@link #setSecondThirdFourthLabelText(String)} and {@link #setDisplaySizes(boolean)}
* to set the label text and whether to display sizes respectively.
*
* @return the label for the second third fourth view
*/
public final PText getSecondThirdFourthLabel()
{
return secondThirdFourthLabel;
}
}