Package javafx.scene.shape

Examples of javafx.scene.shape.Path


      circle.setFill(Color.rgb(0xcc, 0xff, 0x00, 1.0));
      circle.setOpacity(0.9);
      circle.setSmooth(true);
      circle.setStroke(Color.rgb(0xa7, 0xd1, 0x00, 1.0));
      circle.setStrokeWidth(2.0 * scale);
      final Path path = new Path();
      path.setStroke(null);
      path.setOpacity(0.74);
      path.setSmooth(true);
      final MoveTo mt = new MoveTo(123.143 * scale, 61.088 * scale);
      mt.setAbsolute(true);
      path.getElements().add(mt);
      final RadialGradient rg = new RadialGradient(0, 0, 118.0 * scale, 90.0 * scale, 53.625 * scale, false, CycleMethod.NO_CYCLE,
          new Stop(0.0 * scale, Color.rgb(0xFF, 0xFF, 0xFF, 1.0)),
          new Stop(0.2033 * scale, Color.rgb(0xFE, 0xFF, 0xFD, 1.0)),
          new Stop(0.2765 * scale, Color.rgb(0xFD, 0xFD, 0xF6, 1.0)),
          new Stop(0.3286 * scale, Color.rgb(0xF9, 0xFB, 0xEB, 1.0)),
          new Stop(0.3708 * scale, Color.rgb(0xF4, 0xF7, 0xDA, 1.0)),
          new Stop(0.4065 * scale, Color.rgb(0xEE, 0xF2, 0xC4, 1.0)),
          new Stop(0.4157 * scale, Color.rgb(0xEC, 0xF1, 0xBD, 1.0)),
          new Stop(1.0 * scale, Color.rgb(0xCC, 0xFF, 0x00, 1.0)));
      path.setFill(rg);
      final CubicCurveTo cct1 = new CubicCurveTo(130.602 * scale, 70.889 * scale, 129.01 * scale,
          84.643 * scale, 119.59 * scale, 91.813 * scale);
      cct1.setAbsolute(true);
      path.getElements().add(cct1);
      final CubicCurveTo cct2 = new CubicCurveTo(110.171 * scale, 98.981 * scale, 96.489 * scale,
          96.843 * scale, 89.032 * scale, 87.043 * scale);
      cct2.setAbsolute(true);
      path.getElements().add(cct2);
      final CubicCurveTo cct3 = new CubicCurveTo(81.573 * scale, 77.24 * scale, 83.165 * scale,
          63.486 * scale, 92.584 * scale, 56.316 * scale);
      cct3.setAbsolute(true);
      path.getElements().add(cct3);
      final CubicCurveTo cct4 = new CubicCurveTo(102.004 * scale, 49.149 * scale, 115.686 * scale,
          51.285 * scale, 123.143 * scale, 61.088 * scale);
      cct4.setAbsolute(true);
      path.getElements().add(cct4);
      path.getElements().add(new ClosePath());
//      final Ellipse ellipse = new Ellipse(96.5 * scale, 62.5 * scale, 8.294 * scale, 4.906 * scale);
//      ellipse.setFill(Color.rgb(0xff, 0xff, 0xff, 1.0));
//      ellipse.setSmooth(true);
//      ellipse.getTransforms().add(Transform.affine(0.7958 * scale, -0.6055 * scale, 0.655 * scale,
//          0.7958 * scale, -18.1424 * scale, 71.1966 * scale));
 
View Full Code Here


    final Label monthYear = new Label(getMonthYear((new GregorianCalendar()).getTime()));
    monthYear.setMinHeight(CELL_HEIGHT * 1.5);
    monthYear.setMinWidth(CELL_WIDTH * 6.0);
    monthYear.setAlignment(Pos.CENTER);
    monthYearRow.getStyleClass().add(DATEPICKER_MONTHYEAR);
    Path decrementArrow = new Path();
    decrementArrow.setId(DATEPICKER_ARROW);
    decrementArrow.getElements().addAll(new MoveTo(0, ARROW_SIZE), new LineTo(0, -ARROW_SIZE),
        new LineTo(-ARROW_SIZE, 0), new LineTo(0, ARROW_SIZE));
    decrementArrow.setOnMouseClicked(new EventHandler<MouseEvent>() {
      @Override
      public void handle(MouseEvent me) {
        month--;
        if(month < 0) {
          month = Calendar.DECEMBER;
          year--;
        }
        monthYear.setText(getMonthYear((new GregorianCalendar(year, month, 1)).getTime()));
        setDayCells();
        me.consume();
      }
    });
    Path inreamentArrow = new Path();
    inreamentArrow.setId(DATEPICKER_ARROW);
    inreamentArrow.getElements().addAll(new MoveTo(0, ARROW_SIZE), new LineTo(0, -ARROW_SIZE),
        new LineTo(ARROW_SIZE, 0), new LineTo(0, ARROW_SIZE));
    inreamentArrow.setOnMouseClicked(new EventHandler<MouseEvent>() {
      @Override
      public void handle(MouseEvent me) {
        month++;
        if(month > Calendar.DECEMBER) {
          month = Calendar.JANUARY;
View Full Code Here

                arrowH.set(currentToolButton.getBoundsInParent().getMinY()+(currentToolButton.getLayoutBounds().getHeight()/2));
            }
        };
       
        // create toolbar background path
        Path toolBarBackground = createToolBarPath(null,Color.web("#606060"));
       
        // create toolbar
        toolBar = new VBox(0);
        toolBar.setId("ToolsToolbar");
        toolBar.setClip(createToolBarPath(Color.BLACK, null));
View Full Code Here

        );
        primaryStage.show();
    }
   
    private Path createToolBarPath(Paint fill, Paint stroke) {
        Path toolBarBackground = new Path();
        toolBarBackground.setFill(fill);
        toolBarBackground.setStroke(stroke);
        toolBarBackground.setStrokeType(StrokeType.OUTSIDE);
        LineTo arrowTop = new LineTo(TOOLBAR_WIDTH,0);
        arrowTop.yProperty().bind(arrowH.add(-8));
        LineTo arrowTip = new LineTo(TOOLBAR_WIDTH-10,0);
        arrowTip.yProperty().bind(arrowH);
        LineTo arrowBottom = new LineTo(TOOLBAR_WIDTH,0);
        arrowBottom.yProperty().bind(arrowH.add(8));
        LineTo bottomRight = new LineTo(TOOLBAR_WIDTH,0);
        bottomRight.yProperty().bind(root.heightProperty());
        LineTo bottomLeft = new LineTo(0,0);
        bottomLeft.yProperty().bind(root.heightProperty());
        toolBarBackground.getElements().addAll(
                new MoveTo(0,0),
                new LineTo(TOOLBAR_WIDTH,0),
                arrowTop, arrowTip, arrowBottom,
                bottomRight, bottomLeft,
                new ClosePath()
View Full Code Here

        background.getStyleClass().setAll("background");

        ticksAndSectionsCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
        ticksAndSections = ticksAndSectionsCanvas.getGraphicsContext2D();

        histogram = new Path();
        histogram.setFillRule(FillRule.NON_ZERO);
        histogram.getStyleClass().add("histogram-fill");

        minMeasuredValue = new Region();
        minMeasuredValue.getStyleClass().setAll("min-measured-value");
View Full Code Here

        }
        return fxPath.toString();
    }

    private static Path processPath(final List<String> PATH_LIST, final PathReader READER) {
        final Path PATH = new Path();
        PATH.setFillRule(FillRule.EVEN_ODD);
        while (!PATH_LIST.isEmpty()) {
            if ("M".equals(READER.read())) {
                PATH.getElements().add(new MoveTo(READER.nextX(), READER.nextY()));
            } else if ("L".equals(READER.read())) {
                PATH.getElements().add(new LineTo(READER.nextX(), READER.nextY()));
            } else if ("C".equals(READER.read())) {
                PATH.getElements().add(new CubicCurveTo(READER.nextX(), READER.nextY(), READER.nextX(), READER.nextY(), READER.nextX(), READER.nextY()));
            } else if ("Q".equals(READER.read())) {
                PATH.getElements().add(new QuadCurveTo(READER.nextX(), READER.nextY(), READER.nextX(), READER.nextY()));
            } else if ("H".equals(READER.read())) {
                PATH.getElements().add(new HLineTo(READER.nextX()));
            } else if ("L".equals(READER.read())) {
                PATH.getElements().add(new VLineTo(READER.nextY()));
            } else if ("A".equals(READER.read())) {
                PATH.getElements().add(new ArcTo(READER.nextX(), READER.nextY(), 0, READER.nextX(), READER.nextY(), false, false));
            } else if ("Z".equals(READER.read())) {
                PATH.getElements().add(new ClosePath());
            }
        }
        return PATH;
    }
View Full Code Here

        } else if (Circle.class.equals(SHAPE.getClass())) {
            fxPath.append(convertCircle((Circle) SHAPE));
        } else if (Ellipse.class.equals(SHAPE.getClass())) {
            fxPath.append(convertEllipse((Ellipse) SHAPE));
        } else if (Text.class.equals(SHAPE.getClass())) {
            Path path = (Path)(Shape.subtract(SHAPE, new Rectangle(0, 0)));
            fxPath.append(convertPath(path));
        } else if (Path.class.equals(SHAPE.getClass())) {
            fxPath.append(convertPath((Path) SHAPE));
        } else if (Polygon.class.equals(SHAPE.getClass())) {
            fxPath.append(convertPolygon((Polygon) SHAPE));
View Full Code Here

        }

        angleStep = getSkinnable().getAngleRange() / (getSkinnable().getMaxValue() - getSkinnable().getMinValue());
        needleRotate.setAngle(needleRotate.getAngle() + (getSkinnable().getValue() - getSkinnable().getOldValue()) * angleStep);

        needle = new Path();
        needle.setFillRule(FillRule.EVEN_ODD);
        needle.getStyleClass().setAll("needle");
        needle.getTransforms().setAll(needleRotate);      

        value = new Text(String.format(Locale.US, "%." + getSkinnable().getDecimals() + "f", getSkinnable().getMinValue()) + getSkinnable().getUnit());
View Full Code Here

            fixtureLeft.setPrefSize(0.0476190476 * height, 0.164021164021164 * height);
            fixtureLeft.setTranslateY(0.41798941798941797 * height);

            if (width > height && width > 0 && height > 0) {
                final Path UPPER = new Path();
                UPPER.setFillRule(FillRule.EVEN_ODD);
                UPPER.getElements().add(new MoveTo(width, 0.0));
                UPPER.getElements().add(new LineTo(width, 0.4074074074074074 * height));
                UPPER.getElements().add(new LineTo(width - 0.0582010582 * height, 0.4074074074074074 * height));
                UPPER.getElements().add(new LineTo(width - 0.0582010582 * height, 0.49206349206349204 * height));
                UPPER.getElements().add(new LineTo(0.0582010582 * height, 0.49206349206349204 * height));
                UPPER.getElements().add(new LineTo(0.0582010582 * height, 0.4074074074074074 * height));
                UPPER.getElements().add(new LineTo(0.0, 0.4074074074074074 * height));
                UPPER.getElements().add(new LineTo(0.0, 0.0));
                UPPER.getElements().add(new LineTo(width, 0.0));
                UPPER.getElements().add(new ClosePath());
                final String UPPER_SVG = ShapeConverter.shapeToSvgString(UPPER);

                final Path LOWER = new Path();
                LOWER.setFillRule(FillRule.EVEN_ODD);
                LOWER.getElements().add(new MoveTo(width, height));
                LOWER.getElements().add(new LineTo(width, 0.5925925925925926 * height));
                LOWER.getElements().add(new LineTo(width - 0.0582010582 * height, 0.5925925925925926 * height));
                LOWER.getElements().add(new LineTo(width - 0.0582010582 * height, 0.5079365079365079 * height));
                LOWER.getElements().add(new LineTo(0.0582010582 * height, 0.5079365079365079 * height));
                LOWER.getElements().add(new LineTo(0.0582010582 * height, 0.5925925925925926 * height));
                LOWER.getElements().add(new LineTo(0.0, 0.5925925925925926 * height));
                LOWER.getElements().add(new LineTo(0.0, height));
                LOWER.getElements().add(new LineTo(width, height));
                LOWER.getElements().add(new ClosePath());
                final String LOWER_SVG = ShapeConverter.shapeToSvgString(LOWER);

                upperBackground.setStyle(new StringBuilder("-fx-shape:").append("\"").append(UPPER_SVG).append("\";").toString());
                lowerBackground.setStyle(new StringBuilder("-fx-shape:").append("\"").append(LOWER_SVG).append("\";").toString());
                flap.setStyle(new StringBuilder("-fx-shape:").append("\"").append(UPPER_SVG).append("\";").toString());
View Full Code Here

  this.strokeColor.addListener(this);
  this.backgroundMouseOnColor.addListener(this);
  this.strokeMouseOnColor.addListener(this);
  this.startAngle.addListener(this);

  this.path = new Path();
  this.moveTo = new MoveTo();
  this.arcToInner = new ArcTo();
  this.arcTo = new ArcTo();
  this.lineTo = new LineTo();
  this.lineTo2 = new LineTo();
View Full Code Here

TOP

Related Classes of javafx.scene.shape.Path

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.