Package de.lmu.ifi.dbs.elki.visualization.style.lines

Examples of de.lmu.ifi.dbs.elki.visualization.style.lines.LineStyleLibrary


   *
   * @param svgp SVG-Plot
   */
  private void addCSSClasses(SVGPlot svgp, StylingPolicy sp) {
    final StyleLibrary style = context.getStyleLibrary();
    final LineStyleLibrary lines = style.lines();
    final double width = .5 * style.getLineWidth(StyleLibrary.PLOT);
    if(sp instanceof ClassStylingPolicy) {
      ClassStylingPolicy csp = (ClassStylingPolicy) sp;
      for(int i = csp.getMinStyle(); i < csp.getMaxStyle(); i++) {
        String key = DATALINE + "_" + i;
        if(!svgp.getCSSClassManager().contains(key)) {
          CSSClass cls = new CSSClass(this, key);
          cls.setStatement(SVGConstants.CSS_STROKE_LINECAP_PROPERTY, SVGConstants.CSS_ROUND_VALUE);
          cls.setStatement(SVGConstants.CSS_STROKE_LINEJOIN_PROPERTY, SVGConstants.CSS_ROUND_VALUE);
          cls.setStatement(SVGConstants.CSS_FILL_PROPERTY, SVGConstants.CSS_NONE_VALUE);
          lines.formatCSSClass(cls, i, width);
          svgp.addCSSClassOrLogError(cls);
        }
      }
    }
    else {
      // Class for the distance function
      if(!svgp.getCSSClassManager().contains(DATALINE)) {
        CSSClass cls = new CSSClass(this, DATALINE);
        cls.setStatement(SVGConstants.CSS_STROKE_LINECAP_PROPERTY, SVGConstants.CSS_ROUND_VALUE);
        cls.setStatement(SVGConstants.CSS_STROKE_LINEJOIN_PROPERTY, SVGConstants.CSS_ROUND_VALUE);
        cls.setStatement(SVGConstants.CSS_FILL_PROPERTY, SVGConstants.CSS_NONE_VALUE);
        lines.formatCSSClass(cls, -1, width);
        svgp.addCSSClassOrLogError(cls);
      }
    }
    svgp.updateStyleElement();
  }
View Full Code Here

TOP

Related Classes of de.lmu.ifi.dbs.elki.visualization.style.lines.LineStyleLibrary

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.