Search in sources :

Example 1 with SmallmultipleModel

use of org.sirix.gui.view.smallmultiple.SmallmultipleModel in project sirix by sirixdb.

the class ViewUtilities method legend.

/**
 * Legend of a SunburstView.
 *
 * @param pGUI
 *          GUI which provides a SunburstView and therefore extends
 *          {@link AbstractSunburstGUI}
 * @param applet
 *          Processing {@link applet} reference
 */
public static void legend(final AbstractSunburstGUI pGUI, final Model<SunburstContainer, SunburstItem> pModel) {
    final PApplet applet = pGUI.getApplet();
    // applet.translate(0, 0);
    applet.textAlign(PConstants.LEFT, PConstants.TOP);
    applet.strokeWeight(0);
    if (pGUI.isShowArcs()) {
        applet.fill(pGUI.getHueStart(), pGUI.getSaturationStart(), pGUI.getBrightnessStart());
        applet.rect(20f, applet.height - 70f, 50, 17);
        color(pGUI);
        applet.text("-", 78, applet.height - 70f);
        applet.fill(pGUI.getHueEnd(), pGUI.getSaturationEnd(), pGUI.getBrightnessEnd());
        applet.rect(90f, applet.height - 70f, 50, 17);
        color(pGUI);
        if (pModel instanceof SunburstModel) {
            applet.text("text node length", 150f, applet.height - 70f);
        }
        if (pModel instanceof SunburstCompareModel || pModel instanceof SmallmultipleModel) {
            applet.text("text node similarity", 150f, applet.height - 70f);
        }
        applet.fill(0, 0, pGUI.getInnerNodeBrightnessStart());
        applet.rect(20f, applet.height - 50f, 50, 17);
        color(pGUI);
        applet.text("-", 78, applet.height - 50f);
        applet.fill(0, 0, pGUI.getInnerNodeBrightnessEnd());
        applet.rect(90f, applet.height - 50f, 50, 17);
        color(pGUI);
        if (pModel instanceof SunburstModel) {
            applet.text("descendant-or-self count of element nodes", 150f, applet.height - 50f);
        }
        if (pModel instanceof SunburstCompareModel || pModel instanceof SmallmultipleModel) {
            applet.text("element node similarity", 150f, applet.height - 50f);
        }
    }
    if (pGUI.isSavePDF()) {
        applet.translate(applet.width / 2f, applet.height / 2f);
        pGUI.setSavePDF(false);
        applet.endRecord();
        PApplet.println("saving to pdf – done");
    }
}
Also used : SunburstCompareModel(org.sirix.gui.view.sunburst.model.SunburstCompareModel) PApplet(processing.core.PApplet) SmallmultipleModel(org.sirix.gui.view.smallmultiple.SmallmultipleModel) SunburstModel(org.sirix.gui.view.sunburst.model.SunburstModel)

Aggregations

SmallmultipleModel (org.sirix.gui.view.smallmultiple.SmallmultipleModel)1 SunburstCompareModel (org.sirix.gui.view.sunburst.model.SunburstCompareModel)1 SunburstModel (org.sirix.gui.view.sunburst.model.SunburstModel)1 PApplet (processing.core.PApplet)1