javafx.scene.layout.VBox Java Examples

The following examples show how to use javafx.scene.layout.VBox. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source Project: mars-sim   Author: mars-sim   File: MarsNode.java    License: GNU General Public License v3.0 6 votes vote down vote up
public void createGreenhouses(TitledPane tp, Settlement settlement) {
 	VBox v = new VBox();
    v.setSpacing(10);
    v.setPadding(new Insets(0, 20, 10, 20));

 	List<Building> buildings = settlement.getBuildingManager().getACopyOfBuildings();

	Iterator<Building> iter1 = buildings.iterator();
	while (iter1.hasNext()) {
		Building building = iter1.next();
    	if (building.hasFunction(FunctionType.FARMING)) {
//        	try {
        		Farming farm = (Farming) building.getFunction(FunctionType.FARMING);
            	Button b = createGreenhouseDialog(farm);
            	v.getChildren().add(b);
//        	}
//        	catch (BuildingException e) {}
        }
	}


    tp.setContent(v);//"1 2 3 4 5..."));
    tp.setExpanded(true);

 }
 
Example #2
Source Project: FXTutorials   Author: AlmasB   File: DialogsApp.java    License: MIT License 6 votes vote down vote up
private Parent createContent() {
    VBox box = new VBox();
    box.setPrefSize(800, 600);
    Button btn1 = new Button("Open JavaFX dialog");
    btn1.setOnAction(e -> {
        Alert alert = new Alert(Alert.AlertType.INFORMATION);
        alert.setHeaderText("Header");
        alert.setContentText("Content");
        alert.show();
    });

    Button btn2 = new Button("Open Custom dialog");
    btn2.setOnAction(e -> {
        CustomDialog dialog = new CustomDialog("Header", "Content");
        dialog.openDialog();
    });

    box.getChildren().addAll(btn1, btn2);

    return box;
}
 
Example #3
Source Project: SONDY   Author: AdrienGuille   File: EventDetectionUI.java    License: GNU General Public License v3.0 6 votes vote down vote up
public final void availabeMethodsUI(){
    initializeAvailableMethodList();
    methodDescriptionLabel = new Label("Selected method description");
    methodDescriptionLabel.setId("smalltext");
    UIUtils.setSize(methodDescriptionLabel,Main.columnWidthLEFT,24);
    VBox methodsLEFT = new VBox();
    methodsLEFT.getChildren().addAll(methodList,new Rectangle(0,3),methodDescriptionLabel);
    // Right part
    applyButton = createApplyMethodButton();
    UIUtils.setSize(applyButton, Main.columnWidthRIGHT, 24);
    parameterTable = new TableView<>();
    UIUtils.setSize(parameterTable, Main.columnWidthRIGHT, 64);
    initializeParameterTable();
    VBox methodsRIGHT = new VBox();
    methodsRIGHT.getChildren().addAll(parameterTable,new Rectangle(0,3),applyButton);
    // Both parts
    HBox methodsBOTH = new HBox(5);
    methodsBOTH.getChildren().addAll(methodsLEFT,methodsRIGHT);
    grid.add(methodsBOTH,0,2);
}
 
Example #4
Source Project: phoebus   Author: ControlSystemStudio   File: ErrLogInstance.java    License: Eclipse Public License 1.0 6 votes vote down vote up
public ErrLogInstance(final AppDescriptor app) throws Exception
{
    this.app = app;

    line_view = new LineView();

    errlog = new ErrLog(out -> line_view.addLine(out,  false),
                        err -> line_view.addLine(err, true));

    final VBox layout = new VBox(line_view.getControl());
    VBox.setVgrow(line_view.getControl(), Priority.ALWAYS);
    layout.setPadding(new Insets(5.0));
    tab = new DockItem(this, layout);
    tab.addCloseCheck(() ->
    {
        errlog.close();
        INSTANCE = null;
        return true;
    });
    DockPane.getActiveDockPane().addTab(tab);
}
 
Example #5
Source Project: FXTutorials   Author: AlmasB   File: RPGApp.java    License: MIT License 6 votes vote down vote up
private Parent createContent() {
    VBox root = new VBox(10);
    root.setPrefSize(800, 600);
    root.setPadding(new Insets(15));

    Button btnAttack = new Button("ATTACK");
    btnAttack.setOnAction(e -> makeMove(Action.ATTACK));

    Button btnCharge = new Button("CHARGE");
    btnCharge.setOnAction(e -> makeMove(Action.CHARGE));

    Button btnBlock = new Button("BLOCK");
    btnBlock.setOnAction(e -> makeMove(Action.BLOCK));

    output.setPrefHeight(450);
    output.setFont(Font.font(26));

    updateInfo();

    root.getChildren().addAll(btnAttack, btnCharge, btnBlock, output);

    return root;
}
 
Example #6
Source Project: jmonkeybuilder   Author: JavaSaBr   File: ExternalFileEditorDialog.java    License: Apache License 2.0 6 votes vote down vote up
@Override
@FxThread
protected void createContent(@NotNull final VBox root) {

    resourceTree = new ResourceTree(this::processOpen, false);
    resourceTree.prefHeightProperty().bind(heightProperty());
    resourceTree.prefWidthProperty().bind(widthProperty());
    resourceTree.setActionTester(type -> false);
    resourceTree.setLazyMode(true);
    resourceTree.setShowRoot(false);
    resourceTree.getSelectionModel()
            .selectedItemProperty()
            .addListener((observable, oldValue, newValue) -> processSelected(newValue));

    FXUtils.addToPane(resourceTree, root);
    FXUtils.addClassTo(root, CssClasses.OPEN_EXTERNAL_FOLDER_EDITOR_DIALOG);
}
 
Example #7
Source Project: gluon-samples   Author: gluonhq   File: BasicView.java    License: BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
public BasicView() {
    
    Label label = new Label("Gluon - AWS Mobile Hub");

    Label signIn = new Label("Accesing signed view...");
    signIn.setGraphic(new Icon(MaterialDesignIcon.VPN_LOCK));
    
    VBox controls = new VBox(15.0, label, signIn);
    controls.setAlignment(Pos.CENTER);
    
    setCenter(controls);
    
    setOnShowing(e -> {
        if (! AWSService.getInstance().isSignedIn()) {
            getApplication().switchView(AwsMobileHub.SIGNED_OUT_VIEW);
        }
    });
}
 
Example #8
Source Project: chart-fx   Author: GSI-CS-CO   File: EditAxis.java    License: Apache License 2.0 6 votes vote down vote up
private Pane getAutoRangeCheckBoxes(final Axis axis) {
    final Pane boxMax = new VBox();
    VBox.setVgrow(boxMax, Priority.ALWAYS);

    final CheckBox autoRanging = new CheckBox("auto ranging");
    HBox.setHgrow(autoRanging, Priority.ALWAYS);
    VBox.setVgrow(autoRanging, Priority.ALWAYS);
    autoRanging.setMaxWidth(Double.MAX_VALUE);
    autoRanging.setSelected(axis.isAutoRanging());
    autoRanging.selectedProperty().bindBidirectional(axis.autoRangingProperty());
    boxMax.getChildren().add(autoRanging);

    final CheckBox autoGrow = new CheckBox("auto grow");
    HBox.setHgrow(autoGrow, Priority.ALWAYS);
    VBox.setVgrow(autoGrow, Priority.ALWAYS);
    autoGrow.setMaxWidth(Double.MAX_VALUE);
    autoGrow.setSelected(axis.isAutoGrowRanging());
    autoGrow.selectedProperty().bindBidirectional(axis.autoGrowRangingProperty());
    boxMax.getChildren().add(autoGrow);

    return boxMax;
}
 
Example #9
Source Project: oim-fx   Author: oimchat   File: ScreenShotFrameShowFrame.java    License: MIT License 6 votes vote down vote up
private void init() {
	this.setCenter(rootPane);
	this.setTitle("组件测试");
	this.setWidth(380);
	this.setHeight(600);
	this.setRadius(10);

	VBox topBox = new VBox();
	topBox.setPrefHeight(50);
	rootPane.setTop(topBox);
	rootPane.setCenter(componentBox);

	Button b=new Button("截屏");
	componentBox.getChildren().add(b);
	
	b.setOnAction(a->{
		ss.setVisible(true);
	});
}
 
Example #10
Source Project: phoenicis   Author: PhoenicisOrg   File: ContainerEngineToolsPanelSkin.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void initialise() {
    final Text title = new Text(tr("Engine tools"));
    title.getStyleClass().add("title");

    final FlowPane toolButtonContainer = createToolButtonContainer();

    final VBox toolsPane = new VBox(title, toolButtonContainer);
    toolsPane.getStyleClass().addAll("containerConfigurationPane");

    final ScrollPane scrollPane = new ScrollPane(toolsPane);
    scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    scrollPane.setFitToWidth(true);

    getChildren().addAll(scrollPane);
}
 
Example #11
Source Project: PDF4Teachers   Author: ClementGre   File: AboutWindow.java    License: Apache License 2.0 6 votes vote down vote up
public AboutWindow(){

        VBox root = new VBox();
        Scene scene = new Scene(root, 400, 640);

        initOwner(Main.window);
        initModality(Modality.WINDOW_MODAL);
        getIcons().add(new Image(getClass().getResource("/logo.png")+""));
        setTitle(TR.tr("PDF4Teachers - À Propos"));
        setResizable(false);
        setScene(scene);
        setOnCloseRequest(e -> close());
        StyleManager.putStyle(root, Style.DEFAULT);

        setupUi(root);

        show();
    }
 
Example #12
Source Project: arma-dialog-creator   Author: kayler-renslow   File: ADCProjectInitWindow.java    License: MIT License 6 votes vote down vote up
public NewProjectTab() {
	tfProjectName.setPrefWidth(200d);
	tfProjectName.setPromptText("untitled");
	tfProjectDescription.setPrefRowCount(6);

	final VBox root = getTabVbox(10);

	final Label lblCreateNewProject = new Label(bundle.getString("new_project_title"));
	VBox.setMargin(lblCreateNewProject, new Insets(0, 0, 10, 0));
	final Label lblProjectName = new Label(bundle.getString("project_name"), tfProjectName);
	lblProjectName.setContentDisplay(ContentDisplay.RIGHT);
	final HBox hboxProjectDescription = new HBox(5, new Label(bundle.getString("new_project_description")), tfProjectDescription);

	root.getChildren().addAll(lblCreateNewProject, lblProjectName, hboxProjectDescription);

	tabNew.setContent(root);
}
 
Example #13
Source Project: chart-fx   Author: GSI-CS-CO   File: DataSetMeasurementsTests.java    License: Apache License 2.0 6 votes vote down vote up
@Start
public void start(Stage stage) {
    final XYChart chart = new XYChart();
    chart.getDatasets().add(new SineFunction("sine1", 1000));
    chart.getDatasets().add(new SineFunction("sine2", 1000));

    plugin = new ParameterMeasurements();

    for (MeasurementType type : MeasurementType.values()) {
        assertThrows(IllegalArgumentException.class, () -> new DataSetMeasurements(null, type).initialize());
        assertDoesNotThrow(() -> new DataSetMeasurements(plugin, type));
    }

    field = new DataSetMeasurements(plugin, MeasurementType.FFT_DB_RANGED);
    field.setDataSet(chart.getAllDatasets().get(0));
    assertTrue(field.getMeasType().isVerticalMeasurement());

    chart.getPlugins().add(plugin);
    final VBox root = new VBox(chart);

    stage.setScene(new Scene(root, 100, 100));
    stage.show();
}
 
Example #14
Source Project: oim-fx   Author: oimchat   File: IconButtonFrameTest.java    License: MIT License 6 votes vote down vote up
@Override
  public void start(Stage primaryStage) {
  	stage.show();
  	
  	stage.setCenter(rootPane);
  	stage.setTitle("组件测试");
  	stage.setWidth(380);
  	stage.setHeight(600);
  	stage.setRadius(10);

VBox topBox = new VBox();
topBox.setPrefHeight(50);
rootPane.setTop(topBox);

rootPane.setCenter(componentBox);

Image image = ImageBox.getImageClassPath("/images/head/101_100.gif");
IconButton themeIconButton = new IconButton(image);
themeIconButton.setPrefSize(130, 130);
Platform.runLater(new Runnable() {
	@Override
	public void run() {
		componentBox.getChildren().add(themeIconButton);
	}
});
  }
 
Example #15
Source Project: sis   Author: apache   File: ResourceView.java    License: Apache License 2.0 6 votes vote down vote up
private void addFeaturePanel(String filePath) {
    try {
        DataStore ds = DataStores.open(filePath);
        setContent(new FeatureTable(ds, 18));
        root.getChildren().addAll(temp);
        temp.clear();
    } catch (DataStoreException e) {
        final Alert alert = new Alert(Alert.AlertType.ERROR);
        alert.setTitle("An error has occurred");
        Label lab = new Label(e.getMessage());
        lab.setWrapText(true);
        lab.setMaxWidth(650);
        VBox vb = new VBox();
        vb.getChildren().add(lab);
        alert.getDialogPane().setContent(vb);
        alert.show();
    }
}
 
Example #16
Source Project: helloiot   Author: adrianromero   File: ControlIntensity.java    License: GNU General Public License v3.0 6 votes vote down vote up
@Override
public Node constructContent() {
    VBox vboxroot = new VBox();
    vboxroot.setSpacing(10.0);
    
    action = new Button();
    action.setContentDisplay(ContentDisplay.TOP);
    action.setFocusTraversable(false);
    action.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
    action.setMnemonicParsing(false);
    action.getStyleClass().add("buttonbase");
    VBox.setVgrow(action, Priority.SOMETIMES);
    action.setOnAction(this::onAction);
    
    slider = new Slider();
    slider.setFocusTraversable(false);
    slider.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
    slider.setPrefWidth(20.0);
    
    vboxroot.getChildren().addAll(action, slider);
    
    initialize();
    return vboxroot;
}
 
Example #17
Source Project: Library-Assistant   Author: afsalashyana   File: MainController.java    License: Apache License 2.0 6 votes vote down vote up
private void initDrawer() {
    try {
        FXMLLoader loader = new FXMLLoader(getClass().getResource("/library/assistant/ui/main/toolbar/toolbar.fxml"));
        VBox toolbar = loader.load();
        drawer.setSidePane(toolbar);
        ToolbarController controller = loader.getController();
        controller.setBookReturnCallback(this);
    } catch (IOException ex) {
        Logger.getLogger(MainController.class.getName()).log(Level.SEVERE, null, ex);
    }
    HamburgerSlideCloseTransition task = new HamburgerSlideCloseTransition(hamburger);
    task.setRate(-1);
    hamburger.addEventHandler(MouseEvent.MOUSE_CLICKED, (Event event) -> {
        drawer.toggle();
    });
    drawer.setOnDrawerOpening((event) -> {
        task.setRate(task.getRate() * -1);
        task.play();
        drawer.toFront();
    });
    drawer.setOnDrawerClosed((event) -> {
        drawer.toBack();
        task.setRate(task.getRate() * -1);
        task.play();
    });
}
 
Example #18
Source Project: SONDY   Author: AdrienGuille   File: InfluenceAnalysisUI.java    License: GNU General Public License v3.0 6 votes vote down vote up
public final void availabeMethodsUI(){
    initializeAvailableMethodList();
    methodDescriptionLabel = new Label("Selected method description");
    methodDescriptionLabel.setId("smalltext");
    UIUtils.setSize(methodDescriptionLabel,Main.columnWidthLEFT,24);
    VBox methodsLEFT = new VBox();
    methodsLEFT.getChildren().addAll(methodList,new Rectangle(0,3),methodDescriptionLabel);
    // Right part
    applyButton = createApplyMethodButton();
    UIUtils.setSize(applyButton, Main.columnWidthRIGHT, 24);
    parameterTable = new TableView<>();
    UIUtils.setSize(parameterTable, Main.columnWidthRIGHT, 64);
    initializeParameterTable();
    VBox methodsRIGHT = new VBox();
    methodsRIGHT.getChildren().addAll(parameterTable,new Rectangle(0,3),applyButton);
    // Both parts
    HBox methodsBOTH = new HBox(5);
    methodsBOTH.getChildren().addAll(methodsLEFT,methodsRIGHT);
    grid.add(methodsBOTH,0,2);
}
 
Example #19
Source Project: xframium-java   Author: xframium   File: GuiFactory.java    License: GNU General Public License v3.0 5 votes vote down vote up
public RadioButton getRadioButton(String text, VBox vbox, ToggleGroup group)
{
  RadioButton button = new RadioButton(text);
  vbox.getChildren().add(button);
  button.setToggleGroup(group);
  button.setDisable(true);
  return button;
}
 
Example #20
Source Project: PreferencesFX   Author: dlsc-software-consulting-gmbh   File: SimpleRadioButtonControl.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void initializeParts() {
  super.initializeParts();

  node = new VBox();
  node.getStyleClass().add("simple-radio-control");

  toggleGroup = new ToggleGroup();

  createRadioButtons();
}
 
Example #21
Source Project: bisq   Author: bisq-network   File: FormBuilder.java    License: GNU Affero General Public License v3.0 5 votes vote down vote up
public static Tuple3<Label, TextField, VBox> addTopLabelReadOnlyTextField(GridPane gridPane,
                                                                          int rowIndex,
                                                                          int columnIndex,
                                                                          String title,
                                                                          String value,
                                                                          double top) {
    Tuple3<Label, TextField, VBox> tuple = addTopLabelTextField(gridPane, rowIndex, title, value, top - 15);
    GridPane.setColumnIndex(tuple.third, columnIndex);
    return tuple;
}
 
Example #22
Source Project: bisq   Author: bisq-network   File: DisputeSummaryWindow.java    License: GNU Affero General Public License v3.0 5 votes vote down vote up
private void addSummaryNotes() {
    summaryNotesTextArea = new BisqTextArea();
    summaryNotesTextArea.setPromptText(Res.get("disputeSummaryWindow.addSummaryNotes"));
    summaryNotesTextArea.setWrapText(true);

    Tuple2<Label, VBox> topLabelWithVBox = addTopLabelWithVBox(gridPane, ++rowIndex,
            Res.get("disputeSummaryWindow.summaryNotes"), summaryNotesTextArea, 0);
    GridPane.setColumnSpan(topLabelWithVBox.second, 2);

    summaryNotesTextArea.setPrefHeight(50);
    summaryNotesTextArea.textProperty().bindBidirectional(disputeResult.summaryNotesProperty());
}
 
Example #23
Source Project: marathonv5   Author: jalian-systems   File: CheckListView.java    License: Apache License 2.0 5 votes vote down vote up
private void initVerticalButtonBar() {
    verticalButtonBar = new VBox();
    Button upButton = FXUIUtils.createButton("up", "Move selection up", true, "Up");
    upButton.setMaxWidth(Double.MAX_VALUE);
    upButton.setOnAction((e) -> {
        checkListFormNode.moveUpSelected();
        if (checkListFormNode.isDirty()) {
            fireContentChanged();
        }
    });

    Button deleteButton = FXUIUtils.createButton("remove", "Delete selection", true, "Remove");
    deleteButton.setOnAction((e) -> {
        checkListFormNode.deleteSelected();
        if (checkListFormNode.isDirty()) {
            fireContentChanged();
        }
    });

    Button downButton = FXUIUtils.createButton("down", "Move selection down", true, "Down");
    downButton.setOnAction((e) -> {
        checkListFormNode.moveDownSelected();
        if (checkListFormNode.isDirty()) {
            fireContentChanged();
        }
    });
    downButton.setMaxWidth(Double.MAX_VALUE);

    verticalButtonBar.getChildren().addAll(upButton, deleteButton, downButton);
}
 
Example #24
Source Project: erlyberly   Author: andytill   File: ErlyBerly.java    License: GNU General Public License v3.0 5 votes vote down vote up
/**
 * All I know is pane.
 */
public static Pane wrapInPane(Node node) {
    if(node instanceof Pane)
        return (Pane) node;
    VBox.setVgrow(node, Priority.ALWAYS);
    VBox vBox = new VBox(node);
    return vBox;
}
 
Example #25
Source Project: Intro-to-Java-Programming   Author: jsquared21   File: Exercise_15_04.java    License: MIT License 5 votes vote down vote up
@Override // Override the start method in the Application class
public void start(Stage primaryStage) {
	// Create UI
	HBox hBox1 = new HBox(5);
	HBox hBox2 = new HBox(5);
	VBox vBox = new VBox(15);
	hBox1.getChildren().addAll(new Label("Number1: "), tfNumber1,
		new Label("Number2: "), tfNumber2, new Label("Result: "), tfResult);
	hBox2.getChildren().addAll(btAdd, btSubtract, btMultiply, btDivide);
	vBox.getChildren().addAll(hBox1, hBox2);

	// Set UI properties
	hBox1.setAlignment(Pos.CENTER);
	hBox2.setAlignment(Pos.CENTER);
	tfNumber1.setPrefColumnCount(4);
	tfNumber2.setPrefColumnCount(4);
	tfResult.setPrefColumnCount(4);
	tfResult.setEditable(false);
	vBox.setPadding(new Insets(2, 5, 0, 0));

	// Process events
	btAdd.setOnAction(e -> add());
	btSubtract.setOnAction(e -> subtract());
	btMultiply.setOnAction(e -> multiply());
	btDivide.setOnAction(e -> divide());

	// Create a scene and place it in the stage
	Scene scene = new Scene(vBox);
	primaryStage.setTitle("Exercise_15_04"); // Set the stage title
	primaryStage.setScene(scene); // Place the scene in the stage
	primaryStage.show(); // Display the stage
}
 
Example #26
Source Project: MyBox   Author: Mararsh   File: EpidemicReportsChartController.java    License: Apache License 2.0 5 votes vote down vote up
protected LabeledHorizontalBarChart addHorizontalBarChart() {
    chartBox.getChildren().clear();
    LabeledHorizontalBarChart barChart
            = LabeledHorizontalBarChart.create(categoryAxisCheck.isSelected(), chartCoordinate)
                    .setIntValue(false)
                    .setLabelType(labelType)
                    .setTextSize(textSize);
    barChart.setAlternativeRowFillVisible(false);
    barChart.setAlternativeColumnFillVisible(false);
    barChart.setBarGap(0.0);
    barChart.setCategoryGap(0.0);
    barChart.setAnimated(false);
    barChart.getXAxis().setAnimated(false);
    barChart.getYAxis().setAnimated(false);
    barChart.setVerticalGridLinesVisible(vlinesCheck.isSelected());
    barChart.setHorizontalGridLinesVisible(hlinesCheck.isSelected());
    barChart.getXAxis().setTickLabelRotation(90);
    barChart.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
    VBox.setVgrow(barChart, Priority.ALWAYS);
    HBox.setHgrow(barChart, Priority.ALWAYS);
    if (legendSide == null) {
        barChart.setLegendVisible(false);
    } else {
        barChart.setLegendVisible(true);
        barChart.setLegendSide(legendSide);
    }
    chartBox.getChildren().add(barChart);
    return barChart;
}
 
Example #27
Source Project: jmonkeybuilder   Author: JavaSaBr   File: ConfirmDialog.java    License: Apache License 2.0 5 votes vote down vote up
@Override
@FxThread
protected void createContent(@NotNull final VBox root) {
    super.createContent(root);

    questionLabel = new Label();
    questionLabel.minWidthProperty().bind(widthProperty().multiply(0.9));

    FXUtils.addToPane(questionLabel, root);
    FXUtils.addClassTo(root, CssClasses.CONFIRM_DIALOG);
}
 
Example #28
Source Project: marathonv5   Author: jalian-systems   File: TextFiledScrollSample.java    License: Apache License 2.0 5 votes vote down vote up
public TextFiledScrollSample() {
    VBox root = new VBox();
    ObservableList<Node> children = root.getChildren();
    for (int i = 0; i < 20; i++) {
        Label label = new Label("TextFiled " + i);
        children.add(label);
        TextField e = new TextField();
        children.add(e);
        children.add(new Button("Click Me"));
    }
    getChildren().add(root);
}
 
Example #29
Source Project: mars-sim   Author: mars-sim   File: Story.java    License: GNU General Public License v3.0 5 votes vote down vote up
/** @return the content of the address, with a signature and portrait attached. */
private Pane getContent() {
  final VBox content = new VBox();
  content.getStyleClass().add("address");

  //int rand = RandomUtil.getRandomInt(1);

  final Label address = new Label(START1+START2+MID1+MID2+MID3+MID4);

  address.setWrapText(true);
  ScrollPane addressScroll = makeScrollable(address);

  final ImageView signature = new ImageView(); signature.setId("signature");
  final ImageView lincolnImage = new ImageView(); lincolnImage.setId("portrait");
  VBox.setVgrow(addressScroll, Priority.ALWAYS);

  final Region spring = new Region();
  HBox.setHgrow(spring, Priority.ALWAYS);
  
  //final Node alignedSignature = HBoxBuilder.create().children(spring, signature).build();
  final HBox alignedSignature = new HBox(spring, signature);
  
  Label date = new Label(DATE);
  date.setAlignment(Pos.BOTTOM_RIGHT);

  content.getChildren().addAll(
      lincolnImage,
      addressScroll,
      alignedSignature,
      date
  );

  return content;
}
 
Example #30
Source Project: pikatimer   Author: PikaTimer   File: FXMLResultOutputController.java    License: GNU General Public License v3.0 5 votes vote down vote up
public void removeRaceReport(ActionEvent fxevent){
    System.out.println("FXMLREsultOutputController baseGridPane is a " +  baseGridPane.getParent().getClass().getName());

    boolean remove = ((VBox) baseGridPane.getParent()).getChildren().remove(baseGridPane);
    if (thisRaceReport != null && thisRaceReport.getRace() != null) {
        thisRaceReport.getRace().removeRaceReport(thisRaceReport);
        resultsDAO.removeRaceReport(thisRaceReport);
    } else {
        System.out.println("Either thisRaceReport is null or thisRaceReport.getRace() is null!");
    }
   
}