Package javafx.scene.shape

Examples of javafx.scene.shape.Rectangle


  private static final Color MY_WHEAT= Color.WHEAT.deriveColor(0.0, 1.0, 0.5, 1.0);
 
  public Fuselage() {

    Rectangle back= new Rectangle(4, 4);
    back.setTranslateX(-2);
    back.setTranslateY(-2);
    back.setTranslateZ(40);
    back.setFill(Color.YELLOW);
   
    Rectangle front= new Rectangle(4, 4);
    front.setTranslateX(-2);
    front.setTranslateY(-2);
    front.setTranslateZ(-40);
    front.setFill(Color.YELLOW);
   
    Rectangle top= new Rectangle(4, 80);
    top.setTranslateX(-2);
    top.setTranslateY(-38);
    top.setRotationAxis(Rotate.X_AXIS);
    top.setRotate(90);
    top.setFill(MY_WHEAT);
   
    Rectangle bottom= new Rectangle(4, 80);
    bottom.setTranslateX(-2);
    bottom.setTranslateY(-42);
    bottom.setRotationAxis(Rotate.X_AXIS);
    bottom.setRotate(90);
    bottom.setFill(MY_WHEAT);
   
    Rectangle left= new Rectangle(80, 4);
    left.setTranslateX(-42);
    left.setTranslateY(-2);
    left.setRotationAxis(Rotate.Y_AXIS);
    left.setRotate(90);
    left.setFill(Color.WHEAT);
   
    Rectangle right= new Rectangle(80, 4);
    right.setTranslateX(-38);
    right.setTranslateY(-2);
    right.setRotationAxis(Rotate.Y_AXIS);
    right.setRotate(90);
    right.setFill(Color.WHEAT);
   
    getChildren().addAll(back, front, bottom, top, left, right);
  }
View Full Code Here


  private static final Color MY_WHEAT= Color.WHEAT.deriveColor(0.0, 1.0, 0.5, 1.0);
  private static final Color MY_GREEN= Color.GREEN.deriveColor(0.0, 1.0, 0.5, 1.0);
 
  public Tail() {

    Rectangle elevator= new Rectangle(30, 8);
    elevator.setTranslateX(-15);   
    elevator.setFill(MY_WHEAT);
   
    Rectangle rudder= new Rectangle(15, 8);
    rudder.setTranslateX(-7.5);
    rudder.setTranslateZ(7.5);
    rudder.setRotationAxis(Rotate.Y_AXIS);
    rudder.setRotate(-90);
    rudder.setFill(MY_GREEN);
   
    getChildren().addAll(elevator, rudder);
  }
View Full Code Here

public class Wings extends Group {
 
  public Wings(Color color) {

    Rectangle right= new Rectangle(50, 20);
    right.setRotationAxis(Rotate.Y_AXIS);
    right.setRotate(10);
    right.setFill(color);
   
    Rectangle left= new Rectangle(50, 20);
    left.setTranslateX(-50);
    left.setRotationAxis(Rotate.Y_AXIS);
    left.setRotate(-10);
    left.setFill(color);
   
    getChildren().addAll(left, right);
  }
View Full Code Here

                    popover.setColor(getColor());
                    popover.show(ColorPicker.this);
                }
            }
        });
        Rectangle colorRect = RectangleBuilder.create()
                .width(16).height(16)
                .build();
        colorRect.fillProperty().bind(new ObjectBinding<Paint>() {
            { bind(color); }
            @Override protected Paint computeValue() {
                return getColor();
            }
        });
        colorRect.setEffect(new DropShadow(3, 0, 1, Color.rgb(0, 0, 0, 0.8)));
        setGraphic(colorRect);
    }
View Full Code Here

      setOnMousePressed( (mouseEvent) -> {
        // // record a delta distance for the drag and drop operation.
        // dragDelta.x = stage.getX() - mouseEvent.getScreenX();
        // dragDelta.y = stage.getY() - mouseEvent.getScreenY();
        DurationDragger.this.setCursor(Cursor.V_RESIZE);
        resizeRectangle = new Rectangle(
            NodeUtil.snapXY(DurationDragger.this.appointmentPane.getLayoutX()),
            NodeUtil.snapXY(DurationDragger.this.appointmentPane.getLayoutY()),
            NodeUtil.snapWH(DurationDragger.this.appointmentPane.getLayoutX(), DurationDragger.this.appointmentPane.getWidth()),
            NodeUtil.snapWH(DurationDragger.this.appointmentPane.getLayoutY(), DurationDragger.this.appointmentPane.getHeight()));
        resizeRectangle.getStyleClass().add("GhostRectangle");
View Full Code Here

        // place the rectangle
        AbstractAppointmentPane.this.setCursor(Cursor.MOVE);
        double lX = NodeUtil.screenX(AbstractAppointmentPane.this) - NodeUtil.screenX(dragPane);
        double lY = NodeUtil.screenY(AbstractAppointmentPane.this) - NodeUtil.screenY(dragPane);
        dragRectangle = new Rectangle(NodeUtil.snapXY(lX), NodeUtil.snapXY(lY), NodeUtil.snapWH(lX, AbstractAppointmentPane.this.getWidth()), NodeUtil.snapWH(lY, (AbstractAppointmentPane.this.appointment.isWholeDay() ? titleCalendarHeightProperty.get() : AbstractAppointmentPane.this.getHeight())) );
        dragRectangle.getStyleClass().add("GhostRectangle");
        dragPane.getChildren().add(dragRectangle);
       
        // remember
        startX = mouseEvent.getScreenX();
View Full Code Here

      // set label
      calendarText = new Text("?");
      calendarText.getStyleClass().add("Calendar");
      calendarText.setX( padding ); // align left
      calendarText.setY( calendarText.prefHeight(0) );
      Rectangle lClip = new Rectangle(0,0,0,0);
      lClip.widthProperty().bind(widthProperty().subtract(padding));
      lClip.heightProperty().bind(heightProperty());
      calendarText.setClip(lClip);
      getChildren().add(calendarText);
      // react to changes in the calendar by updating the label
      dayPane.calendarObjectProperty.addListener( (observable) -> {
        String lLabel = DayHeaderPane.this.dayPane.calendarObjectProperty.get() == null ? "" : dayOfWeekDateFormat.format(DayHeaderPane.this.dayPane.calendarObjectProperty.get().getTime()) + " " + dateFormat.format(DayHeaderPane.this.dayPane.calendarObjectProperty.get().getTime());
View Full Code Here

      // add a text node
      Text lSummaryText = new Text(appointment.getSummary());
      lSummaryText.getStyleClass().add("AppointmentLabel");
      lSummaryText.setX( padding );
      lSummaryText.setY( textHeightProperty.get() );
      Rectangle lClip = new Rectangle(0,0,0,0);
      lClip.widthProperty().bind(widthProperty().subtract(padding));
      lClip.heightProperty().bind(heightProperty());
      lSummaryText.setClip(lClip);
      getChildren().add(lSummaryText);     
     
      // add the menu header
      getChildren().add(menuIcon);
View Full Code Here

        }
       
        // show the rectangle
        DayPane.this.setCursor(Cursor.V_RESIZE);
        double lY = mouseEvent.getScreenY() - NodeUtil.screenY(DayPane.this);
        resizeRectangle = new Rectangle(0, lY, dayWidthProperty.get(), 10);
        resizeRectangle.getStyleClass().add("GhostRectangle");
        DayPane.this.getChildren().add(resizeRectangle);
       
        // this event should not be processed by the appointment area
        mouseEvent.consume();
View Full Code Here

      Text lTimeText = new Text(startAsString + "-" + endAsString);
      {
        lTimeText.getStyleClass().add("AppointmentTimeLabel");
        lTimeText.setX( padding );
        lTimeText.setY(lTimeText.prefHeight(0));
        Rectangle lClip = new Rectangle(0,0,0,0);
        lClip.widthProperty().bind(widthProperty().subtract(padding));
        lClip.heightProperty().bind(heightProperty());
        lTimeText.setClip(lClip);
        getChildren().add(lTimeText);
      }
      // add summary
      Text lSummaryText = new Text(appointment.getSummary());
      {
        lSummaryText.getStyleClass().add("AppointmentLabel");
        lSummaryText.setX( padding );
        lSummaryText.setY( lTimeText.getY() + textHeightProperty.get());
        lSummaryText.wrappingWidthProperty().bind(widthProperty().subtract(padding));
        Rectangle lClip = new Rectangle(0,0,0,0);
        lClip.widthProperty().bind(widthProperty());
        lClip.heightProperty().bind(heightProperty().subtract(padding));
        lSummaryText.setClip(lClip);
        getChildren().add(lSummaryText);     
      }
    }
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.