Package javafx.scene.layout

Examples of javafx.scene.layout.Pane


  public static final int EVENT_WIDTH = 110;
  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


    super(animationPartBaseParameter);
  }

  @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

    this.workflowClass = workflowClass;
  }

  @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

                new Image(ToolsApp.class.getResourceAsStream("images/derive-color-icon.png"))
            )
        };
       
        //create root node
        root = new Pane() {
            @Override protected void layoutChildren() {
                double w = getWidth();
                double h = getHeight();
                toolBar.resizeRelocate(0,0,TOOLBAR_WIDTH,h);
                currentPane.relocate(TOOLBAR_WIDTH-10,0);
View Full Code Here

    protected void initView() {

        // getRootNode().setFitToWidth(false);
        // getRootNode().setFitToHeight(false);

        this.panel = new Pane();
        this.panel.setPrefSize(600, 500);

        this.panel.getStyleClass().add("editor");

        final Circle c = new Circle(200 + 25, Color.BEIGE);
View Full Code Here

     *
     * @return the header panel
     */
    protected Node getHeaderPanel() {

        final Pane headerPane = PaneBuilder.create()
                .styleClass("header")
                .layoutX(0.0)
                .layoutY(0.0)
                .minWidth(1024)
                .prefWidth(1024)
                .build();
        // sp.getStyleClass().add("header");

        final Label primaryTitle = LabelBuilder.create()
                // .styleClass("slideTitle")
                .font(PrezFonts.SLIDE_TITLE.get())
                .textFill(PrezColors.SLIDE_TITLE.get())
                .text(getModel().getSlide().getTitle().replaceAll("\\\\n", "\n").replaceAll("\\\\t", "\t"))
                .layoutX(40)
                .layoutY(45)
                // .style("-fx-background-color:#CCCB20")
                .build();

        this.secondaryTitle = LabelBuilder.create()
                // .styleClass("slideTitle")
                .font(PrezFonts.SLIDE_SUB_TITLE.get())
                .textFill(PrezColors.SLIDE_TITLE.get())
                // .scaleX(1.5)
                // .scaleY(1.5)
                .layoutX(450)
                .layoutY(14)
                .minWidth(450)
                // .style("-fx-background-color:#E53B20")
                .alignment(Pos.CENTER_RIGHT)
                .textAlignment(TextAlignment.RIGHT)
                .build();

        final ImageView breizhcamp = ImageViewBuilder.create()
                .layoutX(680.0)
                .layoutY(-14.0)
                .scaleX(0.6)
                .scaleY(0.6)
                .image(PrezImages.HEADER_LOGO.get())
                .build();

        final Polyline pl = PolylineBuilder.create()
                .strokeWidth(3)
                .stroke(Color.BLACK)
                .points(684.0, 12.0, 946.0, 12.0, 946.0, 107.0)
                .build();

        this.rectangle = RectangleBuilder.create()
                .layoutX(108.0)
                .layoutY(95.0)
                .width(0.0) // 60.0
                .height(14.0)
                .fill(Color.web("1C9A9A"))
                .build();

        this.circle = CircleBuilder.create()
                .scaleX(0)
                .scaleY(0)
                .layoutX(18 + 54)
                .layoutY(18 + 54)
                .radius(54)
                .fill(Color.web("444442"))
                .build();

        this.pageLabel = LabelBuilder.create()
                .layoutX(970)
                .layoutY(18.0)
                .text(String.valueOf(getModel().getSlide().getPage()))
                .font(PrezFonts.PAGE.get())
                .rotate(90.0)
                .build();

        // final FlowPane fp = FlowPaneBuilder.create()
        // .orientation(Orientation.HORIZONTAL)
        // .alignment(Pos.BASELINE_CENTER)
        // .children(this.secondaryTitle)
        // // .style("-fx-background-color:#CCCCCC")
        // .build();

        headerPane.getChildren().addAll(this.circle, primaryTitle, breizhcamp, this.secondaryTitle, pl, this.rectangle, this.pageLabel);

        // AnchorPane.setLeftAnchor(primaryTitle, 40.0);
        // AnchorPane.setTopAnchor(primaryTitle, 45.0);
        //
        // AnchorPane.setRightAnchor(this.secondaryTitle, 80.0);
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    public void start(final Stage stage) throws Exception {

        final Pane p = new Pane();
        final Scene scene = new Scene(p, 800, 600);

        stage.setScene(scene);

        p.setMaxWidth(800);
        p.setMaxHeight(600);
        // p.getChildren().addAll(
        // RectangleBuilder.create().x(0).y(0).width(100).height(600).fill(Color.AZURE).build(),
        // RectangleBuilder.create().x(100).y(0).width(100).height(600).fill(Color.BEIGE).build(),
        // RectangleBuilder.create().x(200).y(0).width(100).height(600).fill(Color.AZURE).build(),
        // RectangleBuilder.create().x(300).y(0).width(100).height(600).fill(Color.BEIGE).build(),
        // RectangleBuilder.create().x(400).y(0).width(100).height(600).fill(Color.AZURE).build(),
        // RectangleBuilder.create().x(500).y(0).width(100).height(600).fill(Color.BEIGE).build(),
        // RectangleBuilder.create().x(600).y(0).width(100).height(600).fill(Color.AZURE).build(),
        // RectangleBuilder.create().x(700).y(0).width(100).height(600).fill(Color.BEIGE).build()
        // );

        final DropShadow shadow = DropShadowBuilder.create()
                .radius(4)
                .color(Color.GREY)
                .build();

        Image image = null;
        final InputStream imageInputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("Properties.png");
        if (imageInputStream != null) {
            image = new Image(imageInputStream);
        }

        for (int i = 0; i < 40; i++) {
            p.getChildren().add(
                    ImageViewBuilder.create()
                            .image(image)
                            .clip(RectangleBuilder.create()
                                    .x(i * 20)
                                    .y(0)
                                    .width(20)
                                    .height(600)
                                    .build())
                            // RectangleBuilder.create()
                            // .x(i * 40)
                            // .y(0)
                            // .fitWidth(40)
                            // .fitHeight(600)
                            // .width(40)
                            // .height(600)
                            // .fill(Color.AZURE)
                            .effect(shadow)
                            // .strokeDashArray(2.0, 4.0)
                            // .stroke(Color.CHOCOLATE)
                            .build()
                    );
        }
        stage.show();

        final EventHandler<javafx.event.ActionEvent> shadowRemover = new EventHandler<javafx.event.ActionEvent>() {

            @Override
            public void handle(final javafx.event.ActionEvent event) {
                ((TranslateTransition) event.getSource()).getNode().setEffect(null);
            }

        };

        final ParallelTransition st = ParallelTransitionBuilder.create().delay(Duration.seconds(1)).autoReverse(true).cycleCount(10).build();
        int i = 0;
        for (final Node n : p.getChildren()) {

            st.getChildren().add(
                    TranslateTransitionBuilder.create()
                            .delay(Duration.millis(i * 50))
                            .node(n)
View Full Code Here

    weekHeaderPane.prefHeightProperty().bind(headerHeightProperty);
    weekHeaderPane.setTranslateX(1); // correct for the scrollpane
    borderPane.setTop(weekHeaderPane);
   
    // create a transparent pane where dragging an appointment is visualized
    dragPane = new Pane();
    dragPane.prefWidthProperty().bind(getSkinnable().widthProperty()); // the drag pane is the same size as the whole skin
    dragPane.prefHeightProperty().bind(getSkinnable().heightProperty());
    // the borderpane is placed in the drag pane and sized to match
    dragPane.getChildren().add(borderPane);
    borderPane.prefWidthProperty().bind(dragPane.widthProperty());
View Full Code Here

    lAppointmentGroupGridPane.setVgap(2);
    int lCnt = 0;
    for (Agenda.AppointmentGroup lAppointmentGroup : getSkinnable().appointmentGroups())
    {
      // create the appointment group
      final Pane lPane = new Pane();
      lPane.setPrefSize(15, 15);
      lPane.getStyleClass().addAll("AppointmentGroup", lAppointmentGroup.getStyleClass());
      lAppointmentGroupGridPane.add(lPane, lCnt % 10, lCnt / 10 );
      lCnt++;

      // tooltip
      if (lAppointmentGroup.getDescription() != null) {
        Tooltip.install(lPane, new Tooltip(lAppointmentGroup.getDescription()));
      }

      // mouse reactions
      lPane.setOnMouseEntered((mouseEvent) -> {
        if (!mouseEvent.isPrimaryButtonDown())
        {
          mouseEvent.consume();
          lPane.setCursor(Cursor.HAND);
        }
      });
      lPane.setOnMouseExited((mouseEvent) -> {
        if (!mouseEvent.isPrimaryButtonDown())
        {
          mouseEvent.consume();
          lPane.setCursor(Cursor.DEFAULT);
        }
      });
      final Agenda.AppointmentGroup lAppointmentGroupFinal = lAppointmentGroup;
      lPane.setOnMouseClicked((mouseEvent) -> {
        mouseEvent.consume();

        // assign appointment group
        abstractAppointmentPane.appointment.setAppointmentGroup(lAppointmentGroupFinal);
View Full Code Here

public class CircularPaneTest extends JFXtrasGuiTest {

  @Override
  protected Parent getRootNode() {
    // use a pane to force the scene large enough, the circular pane is placed top-left
    Pane lPane = new Pane();
    lPane.setMinSize(600, 600);
    label = new Label();
    label.setLayoutY(lPane.getMinHeight() - 20);
    lPane.getChildren().add(label);   
   
    // add the circularePane (this is what we want to test)
    circularPane = new CircularPane();
    circularPane.setShowDebug(Color.GREEN);
    lPane.getChildren().add(circularPane);   
    circularPane.setStyle("-fx-border-color:black;");
    return lPane;
  }
View Full Code Here

TOP

Related Classes of javafx.scene.layout.Pane

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.