Examples of SVGPath


Examples of de.lmu.ifi.dbs.elki.visualization.svg.SVGPath

        }
        Polygon chres = hull.getHull();

        // Plot the convex hull:
        if(chres != null && chres.size() > 1) {
          SVGPath path = new SVGPath(chres);
          // Approximate area (using bounding box)
          double hullarea = SpatialUtil.volume(chres);
          final double relativeArea = (projarea - hullarea) / projarea;
          final double relativeSize = (double) ids.size() / rel.size();
          opacity = Math.sqrt(relativeSize * relativeArea);

          Element hulls = path.makeElement(svgp);
          addCSSClasses(svgp, cnum, opacity);
          SVGUtil.addCSSClass(hulls, CLUSTERHULL + cnum);
          layer.appendChild(hulls);
        }
      }
      else {
        ArrayList<Vector> ps = new ArrayList<Vector>(ids.size());
        for(DBID clpnum : ids) {
          double[] projP = proj.fastProjectDataToRenderSpace(rel.get(clpnum));
          ps.add(new Vector(projP));
        }
        List<Polygon> polys = (new AlphaShape(ps, alpha * Projection.SCALE)).compute();
        for(Polygon p : polys) {
          SVGPath path = new SVGPath(p);
          Element hulls = path.makeElement(svgp);
          addCSSClasses(svgp, cnum, 0.5);
          SVGUtil.addCSSClass(hulls, CLUSTERHULL + cnum);
          layer.appendChild(hulls);
        }
      }
View Full Code Here

Examples of de.lmu.ifi.dbs.elki.visualization.svg.SVGPath

  protected void drawSphere2D(int cnum, Vector cent, Vector[] pc) {
    for(int dim1 = 0; dim1 < pc.length - 1; dim1++) {
      for(int dim2 = dim1 + 1; dim2 < pc.length; dim2++) {
        for(int i = 1; i <= times; i++) {
          SVGPath path = new SVGPath();

          Vector direction1 = pc[dim1].times(KAPPA * i);
          Vector direction2 = pc[dim2].times(KAPPA * i);

          Vector p1 = cent.plusTimes(pc[dim1], i);
          Vector p2 = cent.plusTimes(pc[dim2], i);
          Vector p3 = cent.minusTimes(pc[dim1], i);
          Vector p4 = cent.minusTimes(pc[dim2], i);

          path.moveTo(p1);
          path.cubicTo(p1.plus(direction2), p2.plus(direction1), p2);
          path.cubicTo(p2.minus(direction1), p3.plus(direction2), p3);
          path.cubicTo(p3.minus(direction2), p4.minus(direction1), p4);
          path.cubicTo(p4.plus(direction1), p1.minus(direction2), p1);
          path.close();

          Element ellipse = path.makeElement(svgp);
          SVGUtil.addCSSClass(ellipse, EMBORDER + cnum);
          if(opacStyle == 1) {
            CSSClass cls = new CSSClass(null, "temp");
            double s = (i >= 1 && i <= sigma.length) ? sigma[i - 1] : 0.0;
            cls.setStatement(SVGConstants.CSS_FILL_OPACITY_PROPERTY, s);
View Full Code Here

Examples of de.lmu.ifi.dbs.elki.visualization.svg.SVGPath

          // ignore
        }
      }
      Polygon chres = hull.getHull();
      if(chres != null && chres.size() >= 3) {
        SVGPath path = new SVGPath(chres);

        Element selHull = path.makeElement(svgp);
        SVGUtil.addCSSClass(selHull, SELECTEDHULL);
        // TODO: use relative selection size for opacity?
        layer.appendChild(selHull);
      }
    }
View Full Code Here

Examples of de.lmu.ifi.dbs.elki.visualization.svg.SVGPath

    }
  }

  protected void drawHullLines(int cnum, Vector cent, Polygon chres) {
    for(int i = 1; i <= times; i++) {
      SVGPath path = new SVGPath();
      for(int p = 0; p < chres.size(); p++) {
        Vector cur = cent.plusTimes(chres.get(p), i);
        path.drawTo(cur);
      }
      path.close();
      Element ellipse = path.makeElement(svgp);
      SVGUtil.addCSSClass(ellipse, EMBORDER + cnum);
      if(opacStyle == 1) {
        CSSClass cls = new CSSClass(null, "temp");
        double s = (i >= 1 && i <= sigma.length) ? sigma[i - 1] : 0.0;
        cls.setStatement(SVGConstants.CSS_FILL_OPACITY_PROPERTY, s);
View Full Code Here

Examples of de.lmu.ifi.dbs.elki.visualization.svg.SVGPath

    return chres;
  }

  protected void drawHullArc(int cnum, Vector cent, Polygon chres) {
    for(int i = 1; i <= times; i++) {
      SVGPath path = new SVGPath();

      ArrayList<Vector> delta = new ArrayList<Vector>(chres.size());
      for(int p = 0; p < chres.size(); p++) {
        Vector prev = chres.get((p - 1 + chres.size()) % chres.size());
        Vector curr = chres.get(p);
        Vector next = chres.get((p + 1) % chres.size());
        Vector d1 = next.minus(curr).normalize();
        Vector d2 = curr.minus(prev).normalize();
        delta.add(d1.plus(d2));
        // delta.add(next.minus(prev));
      }

      for(int p = 0; p < chres.size(); p++) {
        Vector cur = cent.plus(chres.get(p));
        Vector nex = cent.plus(chres.get((p + 1) % chres.size()));
        Vector dcur = delta.get(p);
        Vector dnex = delta.get((p + 1) % chres.size());
        drawArc(path, cent, cur, nex, dcur, dnex, i);
      }
      path.close();

      Element ellipse = path.makeElement(svgp);

      SVGUtil.addCSSClass(ellipse, EMBORDER + cnum);
      if(opacStyle == 1) {
        CSSClass cls = new CSSClass(null, "temp");
        double s = (i >= 1 && i <= sigma.length) ? sigma[i - 1] : 0.0;
View Full Code Here

Examples of de.lmu.ifi.dbs.elki.visualization.svg.SVGPath

      double step = 1.0;
      if(resolution < dim) {
        step = (double) dim / (double) resolution;
      }

      SVGPath path = new SVGPath();
      for(double id = 0; id < dim; id += step) {
        int i = (int) Math.floor(id);
        path.drawTo(StyleLibrary.SCALE * ratio * (((double) i) / (dim - 1)), StyleLibrary.SCALE * (1.0 - s.getScaled(series.doubleValue(i + 1))));
      }
      Element p = path.makeElement(plot);
      return p;
    }
View Full Code Here

Examples of de.lmu.ifi.dbs.elki.visualization.svg.SVGPath

      double right = left;

      SVGPath[] paths = new SVGPath[cols];
      double[] lasty = new double[cols];
      for(int i = 0; i < cols; i++) {
        paths[i] = new SVGPath(xsize * left, ysize * 1);
        lasty[i] = 0;
      }

      // draw histogram lines
      for(Pair<Double, double[]> bin : histogram) {
View Full Code Here

Examples of javafx.scene.shape.SVGPath

        }
        return fxPath.toString();
    }

    public static SVGPath shapeToSvgPath(final Shape SHAPE) {
        SVGPath svgPath = new SVGPath();
        svgPath.setContent(shapeToSvgString(SHAPE));
        return svgPath;
    }
View Full Code Here

Examples of javafx.scene.shape.SVGPath

    public BreadcrumbItemSkin(BreadcrumbItem c) {
        super(c, new BehaviorBase<BreadcrumbItem>(c,new ArrayList<KeyBinding>()));

        HBox box = new HBox();
       
        final SVGPath leftSide = new SVGPath();
        if(!c.isFirst()) {
            leftSide.setContent("M0 0 L15 0 l0 30 L0 30 l10 -15 Z");
        } else {
            leftSide.setContent("M0 0 L15 0 l0 30 L0 30 Z");
        }
        leftSide.getStyleClass().add("breadcrumbitem-ui");
       
        final SVGPath rightSide = new SVGPath();
        rightSide.setContent("M0,0 L5,0 15,15 5,30 0,30 Z");
        rightSide.getStyleClass().add("breadcrumbitem-ui");
        rightSide.setLayoutY(10);
        final StackPane stackPane = new StackPane();
        stackPane.getStyleClass().add("breadcrumbitem-ui");
        stackPane.setAlignment(Pos.CENTER);
       
        final HBox stackContent = new HBox(10);
        stackContent.setAlignment(Pos.CENTER);
       
        stackPane.getChildren().add(stackContent);
       
        box.getChildren().add(leftSide);
        box.getChildren().add(stackPane);

        final Label textLabel = new Label();
        if (c != null) {
            if (c.getIcon() != null) {
                ImageView iv = new ImageView(c.getIcon());
                iv.setPreserveRatio(true);
                iv.setFitHeight(20);
                stackContent.getChildren().add(iv);
            }
           
            if(c.getSvgIcon() != null) {
                stackContent.getChildren().add(c.getSvgIcon());
            }
           
            if (c.getText() != null) {
                textLabel.setText(c.getText());
                textLabel.getStyleClass().add("breadcrumbitem-text");
                stackContent.getChildren().add(textLabel);
            }
        }
        box.getChildren().add(rightSide);
       
        leftSide.addEventHandler(MouseEvent.ANY, new BreadcrumbItemMouseHandler(){
            {
                getNodes().add(rightSide);
                getNodes().add(stackPane);
                if(!textLabel.getText().isEmpty()) {
                    getNodes().add(textLabel);
                }
            }
        });
       
        rightSide.addEventHandler(MouseEvent.ANY, new BreadcrumbItemMouseHandler(){
            {
                getNodes().add(leftSide);
                getNodes().add(stackPane);
                if(!textLabel.getText().isEmpty()) {
                    getNodes().add(textLabel);
View Full Code Here

Examples of javafx.scene.shape.SVGPath

                .height(0.5319148936 * HEIGHT)
                .arcWidth(0.079787234 * HEIGHT)
                .arcHeight(0.079787234 * HEIGHT)
                .build();

        SVGPath glareRect = SVGPathBuilder.create()
                .fill(LinearGradientBuilder.create()
                        .proportional(true)
                        .startX(0)
                        .startY(0)
                        .endX(0)
                        .endY(1)
                        .stops(new Stop(0, Color.web("f0f0f0", 1)),
                                new Stop(1, Color.web("f0f0f0", 0))
                        )
                        .build()
                )
                .opacity(.274)
                .transforms(SCALE)
                .content("m 0,0 0,94 32,0 0,-27.218747 C 30.998808,55.222973 37.761737,45.9354 46.156457,45.93665 l 431.687503,0.06427 c 8.39472,0.0013 15.15487,9.290837 15.15315,20.814756 l -0.004,27.218754 30.28125,0 0,-94.0000031 L 0,0 z")
                .id("glare-frame")
                .build();
        glareRect.visibleProperty().bind(CONTROL.backgroundVisibleProperty());

        text.setText(CONTROL.getText());
        text.setId("slide-text");
        text.getTransforms().clear();
        text.getTransforms().add(SCALE);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.