Package javafx.scene.shape

Examples of javafx.scene.shape.Circle


    relocate(Constants.NODE_RADIUS,
        (input.getIndex() * (2 * Constants.NODE_RADIUS + Constants.SPACING)) + Constants.NODE_RADIUS);
   
    updateText();

    Circle outputSocket = new Circle(Constants.NODE_RADIUS, 0, Constants.SOCKET_RADIUS, Paint.valueOf("white"));
    outputSocket.setId(String.valueOf(0));
    outputSocket.setStroke(Paint.valueOf("black"));

    getChildren().addAll(mainCircle, text, outputSocket);
   
    /*
     * Mouse event handlers on whole gene
View Full Code Here


    // set the line ends correctly
    updateLines();
    updateText();

    Circle socket = new Circle(-Constants.NODE_RADIUS, 0, Constants.SOCKET_RADIUS, Paint.valueOf("white"));
    socket.setId(String.valueOf(0));
    socket.setStroke(Paint.valueOf("black"));

    final Label connectionLabel = new Label("S");
    connectionLabel.setStyle("-fx-background-color:rgb(255, 255, 255); -fx-border-color:rgba(0, 0, 0, 0.5); ");
    connectionLabel.relocate(socket.getCenterX() + 5, socket.getCenterY() - 10);
    connectionLabel.setVisible(false);

    /*
     * Mouse event handlers on sockets
     *
     */
    socket.addEventFilter(MouseEvent.DRAG_DETECTED, new EventHandler<MouseEvent>() {
      @Override
      public void handle(MouseEvent event) {
        // the mouse has been dragged out of the socket, this means a full drag is in progress
        startFullDrag();
      }
    });

    socket.addEventFilter(MouseEvent.MOUSE_ENTERED, new EventHandler<MouseEvent>() {
      @Override
      public void handle(MouseEvent event) {
        // user is hovering over connection socket
        connectionLabel.setVisible(true);
      }
    });

    socket.addEventFilter(MouseEvent.MOUSE_EXITED, new EventHandler<MouseEvent>() {
      @Override
      public void handle(MouseEvent event) {
        // user exits the connection socket
        connectionLabel.setVisible(false);
      }
    });

    socket.addEventFilter(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {
      @Override
      public void handle(MouseEvent event) {
        // mouse was pressed on the socket
        setState(GUIGeneState.SOURCE);
      }
    });

    socket.addEventFilter(MouseEvent.MOUSE_DRAGGED, new EventHandler<MouseEvent>() {
      @Override
      public void handle(MouseEvent event) {
        if (!parent.isTarget()) {
          sourceLine.setEndX(event.getX() + ((Circle) event.getSource()).getParent().getLayoutX());
          sourceLine.setEndY(event.getY() + ((Circle) event.getSource()).getParent().getLayoutY());
        }
       
      }
    })

    socket.addEventFilter(MouseEvent.MOUSE_RELEASED, new EventHandler<MouseEvent>() {
      @Override
      public void handle(MouseEvent event) {
        if (event.isStillSincePress()) {
          // mouse was released before dragging out of the socket
          updateLines();
View Full Code Here

    final Label connectionNumber = new Label();
    connectionNumber.setStyle("-fx-background-color:rgb(255, 255, 255); -fx-border-color:rgba(0, 0, 0, 0.5); ");
    connectionNumber.setVisible(false);

    Circle output = new Circle(Constants.NODE_RADIUS, 0, Constants.SOCKET_RADIUS, Paint.valueOf("white"));
    output.setStroke(Paint.valueOf("black"));

    updateText();

    Circle[] sockets = new Circle[resources.arity()];
    double angle, xPos, yPos;
    for (int l = 0; l < sockets.length; l++) {
      angle = (((l + 1) / ((double) (resources.arity() + 1))) * Constants.THETA) - (Constants.THETA / 2);
      xPos = -Math.cos(angle) * Constants.NODE_RADIUS;
      yPos = Math.sin(angle) * Constants.NODE_RADIUS;

      sockets[l] = new Circle(xPos, yPos, Constants.SOCKET_RADIUS, Paint.valueOf("white"));
      sockets[l].setId(String.valueOf(l));
      sockets[l].setStroke(Paint.valueOf("black"));

      final Circle s = sockets[l];
      final int index = l;

      /*
       * Mouse event handlers on sockets
       *
       */
      s.addEventFilter(MouseEvent.DRAG_DETECTED, new EventHandler<MouseEvent>() {
        @Override
        public void handle(MouseEvent event) {
          // the mouse has been dragged out of the socket, this means a full drag is in progress
          startFullDrag();
        }
      });

      s.addEventFilter(MouseEvent.MOUSE_ENTERED, new EventHandler<MouseEvent>() {
        @Override
        public void handle(MouseEvent event) {
          // user is hovering over connection socket
          connectionNumber.setText("C: " + s.getId());
          connectionNumber.relocate(s.getCenterX() + 5, s.getCenterY() - 10);
          connectionNumber.setVisible(true);
        }
      });

      s.addEventFilter(MouseEvent.MOUSE_EXITED, new EventHandler<MouseEvent>() {
        @Override
        public void handle(MouseEvent event) {
          // user exits the connection socket
          connectionNumber.setVisible(false);
        }
      });

      s.addEventFilter(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {
        @Override
        public void handle(MouseEvent event) {
          // mouse was pressed on the socket
          setState(GUIGeneState.SOURCE);
          connectionIndex = index;
        }
      });

      s.addEventFilter(MouseEvent.MOUSE_DRAGGED, new EventHandler<MouseEvent>() {
        @Override
        public void handle(MouseEvent event) {
          if (!parent.isTarget()) {
            lines[connectionIndex].setEndX(event.getX() + ((Circle) event.getSource()).getParent().getLayoutX());
            lines[connectionIndex].setEndY(event.getY() + ((Circle) event.getSource()).getParent().getLayoutY());
          }
        }
      })

      s.addEventFilter(MouseEvent.MOUSE_RELEASED, new EventHandler<MouseEvent>() {
        @Override
        public void handle(MouseEvent event) {         
          if (event.isStillSincePress()) {
            // mouse was released before dragging out of the socket
            updateLine(index);
View Full Code Here

    private void setDots(){
        dots = new Pane();
        dotMap = new HashMap<>(getSkinnable().ledWidthProperty().intValue() * getSkinnable().ledHeightProperty().intValue());
        for (int i = 0; i < getSkinnable().ledHeightProperty().intValue(); i++) {
            for (int j = 0; j < getSkinnable().ledWidthProperty().intValue(); j++) {
                Circle circ = new Circle(radio,COLOR_OFF);
                dotMap.put(new Integer(j + i * getSkinnable().ledWidthProperty().intValue()), circ);
                dots.getChildren().add(circ);
            }
        }     
        dots.setCache(true);
View Full Code Here

            }
            radio=(width-2d*(0.0841121495*size+5d))/(3d*getSkinnable().ledWidthProperty().doubleValue()+1);
            double gapH = (height-2d*(0.0841121495*size+5d)-2d*radio*getSkinnable().ledHeightProperty().doubleValue())/(getSkinnable().ledHeightProperty().doubleValue()+1);
            for (int i = 0; i < getSkinnable().ledHeightProperty().intValue(); i++) {
                for (int j = 0; j < getSkinnable().ledWidthProperty().intValue(); j++) {
                    Circle c=(Circle)dots.getChildren().get(i*getSkinnable().ledWidthProperty().intValue()+j);
                    c.setTranslateX(0.0841121495 * size + 5d + 2d*radio + j * 3d * radio);
                    c.setTranslateY(0.0841121495 * size + 5d + gapH + radio + i * (gapH + 2d * radio));
                    c.setRadius(radio);
                }
            }
           
            mainForeground.setPrefSize(width-2d*(0.0841121495 * size + 2d), height-2d*(0.0841121495 * size + 2d));
            mainForeground.setTranslateX(0.0841121495 * size + 2d);
View Full Code Here

    param = new SnapshotParameters();
    param.setDepthBuffer(true);
    param.setTransform(scale);

    final StackPane mainContent = new StackPane();
    final Circle frame = new Circle();
    frame.getStyleClass().add("magnifier-frame");
    frame.radiusProperty().bind(localRadius.add(frameWidthProperty));
   
    final Circle cClip = new Circle();
    cClip.radiusProperty().bind(localRadius);
    cClip.translateXProperty().bind(localRadius);
    cClip.translateYProperty().bind(localRadius);

    viewer = new Viewer(localRadius, localRadius);
    viewer.setClip(cClip);

    final Line vL = new Line();
View Full Code Here

        /*####################################
         *PositionCursor Set
         #################################### */

        final Circle c = new Circle(2, Color.RED);
        final Text cursorText = new Text("None");
        cursorText.setFill(Color.YELLOW);
        cursorText.setFont(Font.font("Arial", 6));


View Full Code Here

    }

    private void initGraphics() {                       
        innerShadow = new InnerShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.65), PREFERRED_HEIGHT * 0.1, 0, 0, 0);
        Color color = gradientLookup.getColorAt(getSkinnable().getValue() / (getSkinnable().getMaxValue() - getSkinnable().getMinValue()));
        background = new Circle(0.5 * PREFERRED_WIDTH, 0.5 * PREFERRED_HEIGHT, 0.5 * PREFERRED_WIDTH);
        background.setFill(new LinearGradient(0, 0, 0, PREFERRED_HEIGHT,
                                              false, CycleMethod.NO_CYCLE,
                                              new Stop(0, color.deriveColor(0, 1, 0.8, 1)),
                                              new Stop(1, color.deriveColor(0, 1, 0.6, 1))));
        background.setEffect(innerShadow);
View Full Code Here

        HBox.setHgrow(label, Priority.ALWAYS);

        Label x1 = new Label(AwesomeIcon.TIMES_CIRCLE.toString());
        x1.getStyleClass().add("awesome");
        x1.getStyleClass().add("windows-x");
        Circle circle = new Circle(10);
        circle.setFill(Color.WHITE);
        closeButton = new StackPane(circle, x1);

        HBox titlebar = new HBox(label, closeButton);
        titlebar.getStyleClass().add("titlebar");
        setTop(titlebar);
View Full Code Here

Rectangle rectangleRightFace = rightFace.build();
Rectangle ractangleLeftFace = leftFace.build();
Rectangle rectangleBackFace = backFace.build();

Bloom backFaceBloomEffect = new Bloom();
Circle backCircle = new Circle();
backCircle.setStrokeWidth(10);
backCircle.setRadius(10);
backCircle.setStrokeLineCap(StrokeLineCap.ROUND);
backCircle.setStroke(colors[1]);
backCircle.getStrokeDashArray().addAll(1.0, 20.0);
backCircle.setTranslateX(-0.5 * size);
backCircle.setTranslateY(-0.5 * size);
backCircle.setTranslateZ(-0.5 * size);
backCircle.setEffect(backFaceBloomEffect);

Bloom frontFaceBloomEffect = new Bloom();
Circle frontCircle = new Circle();
frontCircle.setStrokeWidth(10);
frontCircle.setRadius(10);
frontCircle.setStrokeLineCap(StrokeLineCap.ROUND);
frontCircle.setStroke(colors[1]);
frontCircle.getStrokeDashArray().addAll(1.0, 20.0);
frontCircle.setTranslateX(-0.5 * size);
frontCircle.setTranslateY(-0.5 * size);
frontCircle.setTranslateZ(0.5 * size);
frontCircle.setEffect(frontFaceBloomEffect);

pathBackFaceTransition = new PathTransition();
pathBackFaceTransition.setPath(rectangleBackFace);
pathBackFaceTransition.setNode(frontCircle);
pathBackFaceTransition.setDuration(Duration.seconds(4));
View Full Code Here

TOP

Related Classes of javafx.scene.shape.Circle

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.