Package javafx.scene.shape

Examples of javafx.scene.shape.Rectangle


    final VBox vbox = new VBox();
    final HBox hbox = new HBox(2);
    final int bands = UISession.getMediaPlayer().getAudioSpectrumNumBands() - 20;
    final Rectangle[] rects = new Rectangle[bands];
    for (int i = 0; i < rects.length; i++) {
      rects[i] = new Rectangle();
      rects[i].getTransforms().add(new Rotate(180, 0, 0)); //
      rects[i].setFill(Color.GRAY);
      rects[i].setArcHeight(screenHeight);
      hbox.getChildren().add(rects[i]);
View Full Code Here


      }
    });
    final double rimThickness = outerRadius - innerRadius;
    Shape border;
    if (isCircular()) {
      final Rectangle rec = new Rectangle(outerRadius, height);
      rec.setArcHeight(5d);
      rec.setArcWidth(5d);
      rec.setTranslateY(5d);
      border = rec;
      val.setTranslateY(rec.getHeight() / 2d);
      valContainer.setTranslateX(centerX - rec.getWidth() / 2d);
      valContainer.setTranslateY(centerY + rec.getHeight());
    } else {
      // create the background border for the tick mark value
      final double width = outerRadius - rimThickness;
      final double offsetY = centerY + rimThickness;
      // TODO : replace square root with proper angle offset
View Full Code Here

   * @param tickMarkFillProperty the fill property to bind for the tick mark
   * @return the tick mark
   */
    protected Shape createTickMark(final double x, final double y, final double width,
        final double height, final double angle, final ObjectProperty<Paint> tickMarkFillProperty) {
      final Rectangle tm = new Rectangle(x, y, width, height);
      tm.setSmooth(false);
      tm.setCache(true);
      tm.setCacheHint(CacheHint.QUALITY);
      Bindings.bindBidirectional(tm.fillProperty(), tickMarkFillProperty);
    tm.getTransforms().addAll(new Rotate(angle, centerX, centerY));
    return tm;
    }
View Full Code Here

        final double width, final double height, final double pointDistance,
        final double gaugeCenterX, final double gaugeCenterY,
        final ObjectProperty<Paint> indicatorFillProperty) {
      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)
View Full Code Here

        offLabel.setStyle("-fx-text-fill: #333333; -fx-font-size: 12pt; -fx-font-weight: bold;");
        HBox.setMargin(onLabel, TEXT_INSETS);
        HBox.setMargin(offLabel, TEXT_INSETS);
    textView.getChildren().addAll(onLabel, offLabel);
   
      mainRec = new Rectangle();
      mainRec.setSmooth(false);
      mainRec.setCache(true);
      mainRec.setCacheHint(CacheHint.SPEED);
      mainRec.setStroke(Color.BLACK);
      mainRec.setStrokeWidth(REC_STROKE_WIDTH);
      mainRec.setX(0);
      mainRec.setY(0);
      mainRec.setHeight(0);
      mainRec.setArcWidth(REC_ARC);
      mainRec.setArcHeight(REC_ARC);
     
      middleRec = new Rectangle();
      middleRec.setSmooth(false);
      middleRec.setCache(true);
      middleRec.setCacheHint(CacheHint.SPEED);
      middleRec.setStroke(Color.BLACK);
      middleRec.setStrokeWidth(REC_STROKE_WIDTH);
View Full Code Here

            windowBtns.getChildren().addAll(minButton, maxButton, closeButton);

            toolBar.getItems().addAll(titleLabel, spacer, windowBtns);
            root.setTop(toolBar);

            resizeCorner = new Rectangle(10, 10);
            resizeCorner.getStyleClass().add("window-resize-corner");

            // add window resizing
            EventHandler<MouseEvent> resizeHandler = new EventHandler<MouseEvent>() {
                private double width;
View Full Code Here

  }

  @Override
  public Node createVisualRepresentation() {
    Pane pane = new Pane();
    final Rectangle workflowRectangle = new Rectangle(WIDTH+20, EventAnimationBase.EVENT_HEIGHT+15);
    workflowRectangle.setFill(WORKFLOW_COLOR);
    workflowRectangle.setArcHeight(25);
    workflowRectangle.setArcWidth(25);
    final Text classText = new Text(workflowClass);
    classText.setFontSmoothingType(FontSmoothingType.LCD);
    classText.xProperty().bind(workflowRectangle.xProperty().add(workflowRectangle.getWidth()/2).subtract(classText.getBoundsInLocal().getWidth()/2));
    classText.yProperty().bind(workflowRectangle.yProperty().subtract(16));
    final Text instanceIdText = new Text(id);
    instanceIdText.setFont(Font.font(Font.getDefault().getName(),10));
    instanceIdText.setFontSmoothingType(FontSmoothingType.LCD);
    instanceIdText.xProperty().bind(workflowRectangle.xProperty().add(workflowRectangle.getWidth()/2).subtract(classText.getBoundsInLocal().getWidth()/2));
    instanceIdText.yProperty().bind(workflowRectangle.yProperty().subtract(3));
    pane.getChildren().add(workflowRectangle);
    pane.getChildren().add(classText);
    pane.getChildren().add(instanceIdText);
    return pane;
  }
View Full Code Here

  Color color;

  @Override
  public Node createVisualRepresentation() {
    Pane pane = new Pane();
    final Rectangle rectangle = new Rectangle(EVENT_WIDTH,EVENT_HEIGHT);
    rectangle.setFill(color);
    rectangle.setArcHeight(20);
    rectangle.setArcWidth(20);
    final Text text = new Text(getDisplayText());
    text.setFontSmoothingType(FontSmoothingType.LCD);
    text.translateXProperty().bind(rectangle.translateXProperty());
    text.translateYProperty().bind(rectangle.translateYProperty().add(rectangle.getHeight()/2).add(text.getBoundsInLocal().getHeight()/4));
    pane.getChildren().add(rectangle);
    pane.getChildren().add(text);
    return pane;
  }
View Full Code Here

 
  private Node createLegendEntry(String text, Color color){
    HBox hbox = new HBox();
    hbox.setAlignment(Pos.CENTER_LEFT);
    hbox.setSpacing(3);
    hbox.getChildren().add(new Rectangle(15,15,color));
    hbox.getChildren().add(new Label(text));
    VBox.setMargin(hbox, new Insets(1.5,3,1.5,3));
    return hbox;
  }
View Full Code Here

  }

  @Override
  public Node createVisualRepresentation() {
    Pane pane = new Pane();
    final Rectangle adapterRectangle = new Rectangle(ADAPTER_WIDTH,ADAPTER_HEIGHT);
    adapterRectangle.setFill(ADAPTER_COLOR);
    adapterRectangle.setArcHeight(25);
    adapterRectangle.setArcWidth(25);
    final Text adapterText = new Text(id);
    adapterText.setFontSmoothingType(FontSmoothingType.LCD);
    adapterText.xProperty().bind(adapterRectangle.xProperty().add(adapterRectangle.getWidth()/2).subtract(adapterText.getBoundsInLocal().getWidth()/2));
    adapterText.yProperty().bind(adapterRectangle.yProperty().subtract(5));
    pane.getChildren().add(adapterRectangle);
    pane.getChildren().add(adapterText);
    return pane;
  }
View Full Code Here

TOP

Related Classes of javafx.scene.shape.Rectangle

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.