diff options
Diffstat (limited to 'src/de/lmu/ifi/dbs/elki/visualization/style/lines/SolidLineStyleLibrary.java')
-rw-r--r-- | src/de/lmu/ifi/dbs/elki/visualization/style/lines/SolidLineStyleLibrary.java | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/src/de/lmu/ifi/dbs/elki/visualization/style/lines/SolidLineStyleLibrary.java b/src/de/lmu/ifi/dbs/elki/visualization/style/lines/SolidLineStyleLibrary.java index 2adcaa3e..051bff0a 100644 --- a/src/de/lmu/ifi/dbs/elki/visualization/style/lines/SolidLineStyleLibrary.java +++ b/src/de/lmu/ifi/dbs/elki/visualization/style/lines/SolidLineStyleLibrary.java @@ -4,7 +4,7 @@ package de.lmu.ifi.dbs.elki.visualization.style.lines; This file is part of ELKI: Environment for Developing KDD-Applications Supported by Index-Structures - Copyright (C) 2011 + Copyright (C) 2012 Ludwig-Maximilians-Universität München Lehr- und Forschungseinheit für Datenbanksysteme ELKI Development Team @@ -31,17 +31,18 @@ import de.lmu.ifi.dbs.elki.visualization.style.StyleLibrary; import de.lmu.ifi.dbs.elki.visualization.svg.SVGUtil; /** - * Line style library featuring solid lines for default styles only - * (combine with a color library to obtain enough classes!) + * Line style library featuring solid lines for default styles only (combine + * with a color library to obtain enough classes!) * * {@link LineStyleLibrary#FLAG_STRONG} will result in thicker lines. * - * {@link LineStyleLibrary#FLAG_WEAK} will result in thinner and semi-transparent lines. + * {@link LineStyleLibrary#FLAG_WEAK} will result in thinner and + * semi-transparent lines. * * {@link LineStyleLibrary#FLAG_INTERPOLATED} will result in dashed lines. * * @author Erich Schubert - * + * * @apiviz.composedOf ColorLibrary */ public class SolidLineStyleLibrary implements LineStyleLibrary { @@ -49,7 +50,17 @@ public class SolidLineStyleLibrary implements LineStyleLibrary { * Reference to the color library. */ private ColorLibrary colors; - + + /** + * Color of "uncolored" dots + */ + private String dotcolor; + + /** + * Color of "greyed out" dots + */ + private String greycolor; + /** * Constructor. * @@ -58,11 +69,21 @@ public class SolidLineStyleLibrary implements LineStyleLibrary { public SolidLineStyleLibrary(StyleLibrary style) { super(); this.colors = style.getColorSet(StyleLibrary.PLOT); + this.dotcolor = style.getColor(StyleLibrary.MARKERPLOT); + this.greycolor = style.getColor(StyleLibrary.PLOTGREY); } @Override public void formatCSSClass(CSSClass cls, int style, double width, Object... flags) { - cls.setStatement(CSSConstants.CSS_STROKE_PROPERTY, colors.getColor(style)); + if(style == -2) { + cls.setStatement(CSSConstants.CSS_STROKE_PROPERTY, greycolor); + } + else if(style == -1) { + cls.setStatement(CSSConstants.CSS_STROKE_PROPERTY, dotcolor); + } + else { + cls.setStatement(CSSConstants.CSS_STROKE_PROPERTY, colors.getColor(style)); + } boolean interpolated = false; // process flavoring flags for(Object flag : flags) { @@ -79,7 +100,7 @@ public class SolidLineStyleLibrary implements LineStyleLibrary { } cls.setStatement(CSSConstants.CSS_STROKE_WIDTH_PROPERTY, SVGUtil.fmt(width)); if(interpolated) { - cls.setStatement(CSSConstants.CSS_STROKE_DASHARRAY_PROPERTY, ""+SVGUtil.fmt(width/StyleLibrary.SCALE*2)+","+SVGUtil.fmt(width/StyleLibrary.SCALE*2)); + cls.setStatement(CSSConstants.CSS_STROKE_DASHARRAY_PROPERTY, "" + SVGUtil.fmt(width / StyleLibrary.SCALE * 2) + "," + SVGUtil.fmt(width / StyleLibrary.SCALE * 2)); } } } |