Package javafx.scene.shape

Examples of javafx.scene.shape.Polygon


        createPolygon(new double[] { 0 * scale, 56 * scale, 10 * scale, 61 * scale, 10 * scale, 96 * scale, 0 * scale, 106 * scale }),
        createPolygon(new double[] { 44 * scale, 61 * scale, 54 * scale, 56 * scale, 54 * scale, 106 * scale, 44 * scale, 96 * scale }) };
  }
 
  protected static Polygon createPolygon(final double... points) {
    final Polygon pg = new Polygon(points);
    pg.setCache(true);
    pg.setCacheHint(CacheHint.SPEED);
    pg.setSmooth(false);
    return pg;
  }
View Full Code Here


      }
      final Circle dialCutout = new Circle(centerX, centerY, innerRadius);
      final Circle gaugeCutout = new Circle(centerX, centerY, dialCenterBackgroundRadius
          + rimThickness);
      // create the border rectangle
      final Polygon rec = new Polygon(centerX, offsetY, centerX + width, offsetY,
          centerX + width, offsetY + height, centerX, offsetY + height);
      // carve out outer rim rectangle edge
      final Shape recArc = Shape.intersect(rec, dialCutout);
      // carve out inner dial rectangle edge
      border = Shape.subtract(recArc, gaugeCutout);
View Full Code Here

    final Circle gaugeCutout = new Circle(centerX, centerY, dialCenterBackgroundRadius
        + rimRadius);
    // create the opposing background border
    final double offsetX = centerX - innerRadius;
    final double offsetY = centerY + rimRadius;
    final Polygon rec2 = new Polygon(centerX, offsetY, offsetX, offsetY,
        offsetX, offsetY + height, centerX, offsetY + height);
    final Shape recArc2 = Shape.intersect(rec2, dialCutout);
    final Shape border2 = Shape.subtract(recArc2, gaugeCutout);
   
    border2.setTranslateX(offsetX);
View Full Code Here

      Shape indicatorShape;
      switch (indicatorType) {
      case RECTANGLE: indicatorShape = new Rectangle(x, y, width, height);
        Bindings.bindBidirectional(indicatorShape.fillProperty(), indicatorFillProperty);
        break;
      case CLOCK: indicatorShape = new Polygon(
          x, y,
          x - pointDistance, y + (height / 2d)
          x, y + height,
          x + width, y + (height / 2d) + (height / 4d),
          x + width, y + (height / 4d));
        Bindings.bindBidirectional(indicatorShape.fillProperty(), indicatorFillProperty);
        break;
      case KNOB:
        indicatorShape = new Polygon(
              x, y,
              x - pointDistance, y + (indicatorHeight / 2d)
              x, y + indicatorHeight,
              x + (indicatorWidth / 2d), y + (indicatorHeight / 2d) + (indicatorHeight / 4d),
              x + (indicatorWidth / 2d), y + (indicatorHeight / 4d));
        Bindings.bindBidirectional(indicatorShape.fillProperty(), indicatorFillProperty);
        indicatorShape.setStroke(Color.WHITESMOKE);
        indicatorShape.setStrokeWidth(2d);
        indicatorShape.setStrokeType(StrokeType.CENTERED);
        indicatorShape.setEffect(createLighting());
        break;
      case NEEDLE: default: indicatorShape = new Polygon(
        x, y + (height / 2.5d),
        x, y + height - (height / 2.5d),
        x + width - pointDistance, y + height,
        x + width, y + (height / 2d),
        x + width - pointDistance, y);
View Full Code Here

      points[++p] = x + Math.cos(angle + (teethSlope * sideCnt) - teethQuarterSlope) * outerRadius;
      points[++p] = y - Math.sin(angle + (teethSlope * sideCnt) - teethQuarterSlope) * outerRadius;
      points[++p] = x + Math.cos(angle + (teethSlope * sideCnt)) * outerRadius;
      points[++p] = y - Math.sin(angle + (teethSlope * sideCnt)) * outerRadius;
    }
    final Polygon dial = new Polygon(points);
    dial.setCache(true);
    dial.setCacheHint(CacheHint.ROTATE);
    Bindings.bindBidirectional(dial.fillProperty(), dialFillProperty);
    return dial;
  }
View Full Code Here

   * @param isUp
   *            true for an up arrow, false for a down arrow
   * @return the arrow
   */
  protected Shape createArrowButton(final boolean isUp) {
    final Polygon arrow = isUp ? new Polygon(NUMERIC_STEPPER_EIGHTH_HEIGHT,
        0, 0, NUMERIC_STEPPER_QUARTER_HEIGHT,
        NUMERIC_STEPPER_QUARTER_HEIGHT, NUMERIC_STEPPER_QUARTER_HEIGHT,
        NUMERIC_STEPPER_EIGHTH_HEIGHT, 0) : new Polygon(0, 0,
        NUMERIC_STEPPER_EIGHTH_HEIGHT, NUMERIC_STEPPER_QUARTER_HEIGHT,
        NUMERIC_STEPPER_QUARTER_HEIGHT, 0, 0, 0);
    arrow.setFill(Color.WHITESMOKE);
    arrow.setCursor(Cursor.HAND);
    arrow.addEventHandler(MouseEvent.ANY, new EventHandler<MouseEvent>() {
      @Override
      public void handle(final MouseEvent event) {
        if (event.getEventType() == MouseEvent.MOUSE_PRESSED
            && GuiUtil.isPrimaryPress(event)) {
          Number newValue;
View Full Code Here

    public Shape getReflectionClip() {
      if(reflection == null || !getSkinnable().getClipReflections()) {
        return null;
      }

      return new Polygon(
        ulReflection2d.getX(), ulReflection2d.getY(),
        urReflection2d.getX(), urReflection2d.getY(),
        perspectiveTransform.getLrx(), perspectiveTransform.getLry(),
        perspectiveTransform.getLlx(), perspectiveTransform.getLly()
      );
View Full Code Here

    super(world);
  }

  @Override
  public Node createResource(GameObject gameObject) {
    Polygon polygon = new Polygon();
    polygon.getPoints().addAll(
            World.TILE_WIDTH / 2.0, 0.0,
            World.TILE_WIDTH * 1.0, World.TILE_HEIGHT / 2.0,
            World.TILE_WIDTH / 2.0, World.TILE_HEIGHT * 1.0,
            0.0, World.TILE_HEIGHT / 2.0);
    if (gameObject.equals(Scenery.HOVER_TILE)) {
      polygon.setStrokeType(StrokeType.INSIDE);
      polygon.getStrokeDashArray().addAll(4.0, 8.0);
      polygon.setStroke(Color.ORANGE);
      polygon.setStrokeWidth(2.0);
      polygon.setFill(Color.TRANSPARENT);
    } else {
      polygon.setFill(getFill(gameObject));
    }
    return polygon;
  }
View Full Code Here

  }

  @Override
  public Node createResource(GameObject object) {
    if (object.equals(Scenery.HOVER_TILE)) {
      Polygon polygon = new Polygon();
      polygon.getPoints().addAll(
              World.TILE_WIDTH / 2.0, 0.0,
              World.TILE_WIDTH * 1.0, World.TILE_HEIGHT / 2.0,
              World.TILE_WIDTH / 2.0, World.TILE_HEIGHT * 1.0,
              0.0, World.TILE_HEIGHT / 2.0);
      polygon.setStrokeType(StrokeType.INSIDE);
      polygon.getStrokeDashArray().addAll(4.0, 8.0);
      polygon.setStroke(Color.ORANGE);
      polygon.setStrokeWidth(2.0);
      polygon.setFill(Color.TRANSPARENT);
      return polygon;
    } else {
      Image image;
      if ("tree".equals(object.getName())) {
        image = Assets.getTile(Assets.IMAGE_TILES_SPRING_TREE_01);
View Full Code Here

    }

    @Override
    protected Control createWidget() {
      final Label b = new Label();
      Polygon p = new Polygon(6, 1, 15, 1, 11, 5, 10, 5);
      p.getStyleClass().add("view-menu-button-icon");
      p.setFill(Color.WHITE);
      p.setStroke(Color.BLACK);
      b.setGraphic(p);
      b.setOnMousePressed(new EventHandler<MouseEvent>() {

        @Override
        public void handle(MouseEvent event) {
View Full Code Here

TOP

Related Classes of javafx.scene.shape.Polygon

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.