Examples of Circle


Examples of engine.geometry.Circle

        } else if (shape instanceof Rectangle) {
            Rectangle rectangle = (Rectangle) shape;
            rectangle.setX(rectangle.getX() + x);
            rectangle.setY(rectangle.getY() + y);
        } else if (shape instanceof Circle) {
            Circle circle = (Circle) shape;
            circle.setX(circle.getX() + x);
            circle.setY(circle.getY() + y);
        } else if (shape instanceof Polygon) {
            Polygon polygon = (Polygon) shape;
            final int size = polygon.getSize();
            for (int i = 0; i < size; i++) {
                polygon.setVertex(i, polygon.getX(i) + x, polygon.getY(i) + y);
View Full Code Here

Examples of fr.cyann.reactdemo.ui.Circle

    tab1React = TimeReact.every(10).edge(MouseReact.onButton1()).subscribe(new Procedure1<Integer>() {

      @Override
      public void invoke(Integer value) {
        // create circle
        final Circle circle = new Circle(5);
        particule.addShape(circle);

        // determine random velocity and angle constant in time
        double velAngle = Math.random() * Math.PI * 2;
        double velSpeed = Math.random() * 10;
        final double velX = Math.cos(velAngle) * velSpeed;
        final double velY = Math.sin(velAngle) * velSpeed;

        final int mx = mouseX.getValue();
        final int my = mouseY.getValue();

        // create reactive counter every 25 fps
        final Var<Integer> counter = TimeReact.framePerSecond(25).fold(0, new Function2<Integer, Integer, Integer>() {

          @Override
          public Integer invoke(Integer arg1, Integer arg2) {
            return arg1 + 1;
          }
        }).map(new Function1<Integer, Integer>() {

          @Override
          public Integer invoke(Integer arg1) {
            return arg1.intValue();
          }
        }).toVar(0);

        // creation reactive operation between counter and constants to calculate x coordonate
        final Var<Integer> x = counter.map(new Function1<Integer, Integer>() {

          @Override
          public Integer invoke(Integer value) {
            return mx + (int) (velX * value);
          }
        });

        // creation reactive operation between counter and constants to calculate y coordonate
        final Var<Integer> y = counter.map(new Function1<Integer, Integer>() {

          @Override
          public Integer invoke(Integer value) {
            return my + (int) (velY * value);
          }
        });

        // creation reactive operation between counter and constants to calculate circle size
        Signal<Integer> size = counter.map(new Function1<Integer, Integer>() {

          @Override
          public Integer invoke(Integer value) {
            double factor = Math.sin((double) value / 10 - Math.PI / 4);
            return 50 + (int) (50 * factor);
          }
        });

        size.disposeWhen(new Predicate1<Integer>() {

          @Override
          public boolean invoke(Integer value) {
            if (value == 1) {
              particule.removeShape(circle);
              x.dispose();
              y.dispose();
              return true;
            }
            return false;
          }
        });

        // set reacts to component
        circle.setX(x);
        circle.setY(y);
        circle.setSize(size);
      }
    });

  }
View Full Code Here

Examples of gwt.g2d.client.math.Circle

  @Override
  public void initialize() {
    add(new Label("This demo does not work under IE."));
    Surface originalCanvas = new Surface(300, 300);
    Circle smallCircle = new Circle(150, 150, 140);
    Circle bigCircle = new Circle(150, 150, 150);
    Shape smallCircleShape = new ShapeBuilder().drawCircle(smallCircle).build();
    Shape bigCircleShape = new ShapeBuilder().drawCircle(bigCircle).build();
    Gradient radialGradient = new RadialGradient(new Circle(150, 150, 0), smallCircle)
        .addColorStop(0, KnownColor.RED)
        .addColorStop(1, KnownColor.GREEN);
    originalCanvas.setFillStyle(KnownColor.BLACK)
        .fillShape(bigCircleShape)
        .setFillStyle(radialGradient)
View Full Code Here

Examples of javafx.scene.shape.Circle

    }
    VBox circleBox;
    Digit digit;
    char c;
    int d;
    Circle circle;
    for (int i=0; i<value.length(); i++) {
      c = value.charAt(i);
      if (remCnt != 0) {
        if (c == '.') {
          circleBox = new VBox();
          circleBox.setCache(true);
          circleBox.setCacheHint(CacheHint.SPEED);
          circleBox.setStyle("-fx-alignment: BOTTOM_LEFT;");
          circle = new Circle(0, 0, 6 * getScale(), onColor);
          circle.setCache(true);
          circle.setSmooth(false);
          circleBox.getChildren().add(circle);
          getChildren().add(circleBox);
        } else {
          d = c == '-' ? Digit.NEGATIVE_SIGN_DIGIT : Integer.valueOf(String.valueOf(c));
          digit = new Digit(getScale(), d, onColor, offColor);
View Full Code Here

Examples of javafx.scene.shape.Circle

      return null;
    }
   
    protected Group createButtonGraphic(final double scale) {
    final Group btnGrp = new Group();
      final Circle circle = new Circle(106.0 * scale, 74.0 * scale, 25.0 * scale);
      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);
 
View Full Code Here

Examples of javafx.scene.shape.Circle

      // rotate value text so that it is never upside down
      final double angle = -getGeometericStartAngle();
      if (Math.abs(angle) > 90d && Math.abs(angle) < 270d) {
        val.setRotate(180d);
      }
      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
View Full Code Here

Examples of javafx.scene.shape.Circle

    if (isCircular()) {
      return null;
    }
    final StackPane valContainer = new StackPane();
    final double rimRadius = outerRadius - innerRadius;
    final Circle dialCutout = new Circle(centerX, centerY, innerRadius);
    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,
View Full Code Here

Examples of javafx.scene.shape.Circle

      final ObjectProperty<Paint> centerGaugeFillProperty,
      final ObjectProperty<Paint> rimStrokeFillProperty,
      final ObjectProperty<Color> backgroundEffectFillProperty) {
    final Effect effect = createBackgroundEffect(backgroundEffectFillProperty);
    if (isCircular()) {
      final Circle ccg = new Circle(centerX, centerY, radius);
      ccg.setCache(true);
      ccg.setCacheHint(CacheHint.QUALITY);
      ccg.setEffect(effect);
      addRimStroke(ccg, rimStrokeFillProperty);
      Bindings.bindBidirectional(ccg.fillProperty(), centerGaugeFillProperty);
      return ccg;
    } else {
      final Arc acg = new Arc(centerX, centerY, radius, radius,
          angleStart, angleLength);
      acg.setType(ArcType.ROUND);
      acg.setCache(true);
      acg.setCacheHint(CacheHint.QUALITY);
      final Shape acf = new Circle(centerX, centerY, dialCenterBackgroundRadius);
      acf.setCache(true);
      final Shape cg = Shape.union(acg, acf);
      cg.setCache(true);
      cg.setEffect(effect);
      addRimStroke(cg, rimStrokeFillProperty);
      Bindings.bindBidirectional(cg.fillProperty(), centerGaugeFillProperty);
View Full Code Here

Examples of javafx.scene.shape.Circle

     * Creates the bolt that hold the indicator in place
     *
     * @return the indicator bolt
     */
    protected Shape createIndicatorBolt() {
    final Shape indicatorBolt = new Circle(centerX, centerY, dialCenterOuterRadius);
//      createSproket(centerX, centerY, 24, dialCenterOuterRadius / 1.1d,
//        dialCenterOuterRadius, angleStart, dialCenterFillProperty);
    indicatorBolt.setCache(true);
    indicatorBolt.setCacheHint(CacheHint.SPEED);
    Bindings.bindBidirectional(indicatorBolt.fillProperty(), dialCenterFillProperty);
    Bindings.bindBidirectional(indicatorBolt.opacityProperty(), dialCenterOpacityProperty);
    return indicatorBolt;
    }
View Full Code Here

Examples of lifesbest23.common.math.Circle

            for(Color[] l:toolColors)
              for(int i = 0; i < y; i++)
                l[i] = clearColor;
           
            //create Circle
            Circle c = new Circle(startX, startY,
                (int)Point.distance(startX, startY,
                    xt, yt));
            //
            Point[] ps = c.getPoints();
            for(Point p:ps)
              if(p.x >= 0 && p.x < x && p.y >= 0 && p.y < y)
                toolColors[p.x][p.y] = clickColors[buttonPressed + clickCount - 1];
           
            repaint();
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.