Search in sources :

Example 31 with Pane

use of javafx.scene.layout.Pane in project jgnash by ccavanaugh.

the class InvestmentSlipManager method buildAdjustShareTab.

private SlipControllerContainer buildAdjustShareTab(final String name, final TransactionType transactionType) {
    try {
        final FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("AdjustSharesSlip.fxml"), resources);
        final Pane pane = fxmlLoader.load();
        final AdjustSharesSlipController slipController = fxmlLoader.getController();
        slipController.setTransactionType(transactionType);
        slipController.accountProperty().bind(accountProperty());
        return new SlipControllerContainer(name, slipController, pane);
    } catch (final IOException e) {
        throw new RuntimeException(e);
    }
}
Also used : IOException(java.io.IOException) FXMLLoader(javafx.fxml.FXMLLoader) StackPane(javafx.scene.layout.StackPane) Pane(javafx.scene.layout.Pane)

Example 32 with Pane

use of javafx.scene.layout.Pane in project jgnash by ccavanaugh.

the class InvestmentSlipManager method buildSellShareTab.

private SlipControllerContainer buildSellShareTab(final String name) {
    try {
        final FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("SellShareSlip.fxml"), resources);
        final Pane pane = fxmlLoader.load();
        final SellShareSlipController slipController = fxmlLoader.getController();
        slipController.accountProperty().bind(accountProperty());
        return new SlipControllerContainer(name, slipController, pane);
    } catch (final IOException e) {
        throw new RuntimeException(e);
    }
}
Also used : IOException(java.io.IOException) FXMLLoader(javafx.fxml.FXMLLoader) StackPane(javafx.scene.layout.StackPane) Pane(javafx.scene.layout.Pane)

Example 33 with Pane

use of javafx.scene.layout.Pane in project jgnash by ccavanaugh.

the class DoughnutChart method installContent.

private void installContent() {
    if (!getData().isEmpty()) {
        final Node node = getData().get(0).getNode();
        if (node.getParent() instanceof Pane) {
            final Pane parent = (Pane) node.getParent();
            // The content needs to be reordered after data has changed
            if (parent.getChildren().contains(hole)) {
                parent.getChildren().remove(hole);
                parent.getChildren().remove(titleText);
                parent.getChildren().remove(subTitleText);
            }
            if (!parent.getChildren().contains(hole)) {
                parent.getChildren().add(hole);
                parent.getChildren().add(titleText);
                parent.getChildren().add(subTitleText);
            }
        }
    }
}
Also used : Node(javafx.scene.Node) Pane(javafx.scene.layout.Pane)

Example 34 with Pane

use of javafx.scene.layout.Pane in project jgnash by ccavanaugh.

the class ChartUtilities method takeSnapshot.

private static WritableImage takeSnapshot(final Pane pane) {
    Map<Chart, Boolean> animationMap = new HashMap<>();
    // Need to disable chart animations for printing
    pane.getChildren().stream().filter(node -> node instanceof Chart).forEach(node -> {
        animationMap.put((Chart) node, ((Chart) node).getAnimated());
        ((Chart) node).setAnimated(false);
    });
    final SnapshotParameters snapshotParameters = new SnapshotParameters();
    snapshotParameters.setTransform(new Scale(SNAPSHOT_SCALE_FACTOR, SNAPSHOT_SCALE_FACTOR));
    final WritableImage image = pane.snapshot(snapshotParameters, null);
    // Restore animation
    for (Map.Entry<Chart, Boolean> entry : animationMap.entrySet()) {
        entry.getKey().setAnimated(entry.getValue());
    }
    return image;
}
Also used : StaticUIMethods(jgnash.uifx.StaticUIMethods) MainView(jgnash.uifx.views.main.MainView) ResourceUtils(jgnash.util.ResourceUtils) WritableImage(javafx.scene.image.WritableImage) IOException(java.io.IOException) HashMap(java.util.HashMap) SnapshotParameters(javafx.scene.SnapshotParameters) Chart(javafx.scene.chart.Chart) File(java.io.File) JavaFXUtils(jgnash.uifx.util.JavaFXUtils) FileChooser(javafx.stage.FileChooser) Clipboard(javafx.scene.input.Clipboard) Locale(java.util.Locale) ImageView(javafx.scene.image.ImageView) FileUtils(jgnash.util.FileUtils) Map(java.util.Map) ImageIO(javax.imageio.ImageIO) SwingFXUtils(javafx.embed.swing.SwingFXUtils) Scale(javafx.scene.transform.Scale) ClipboardContent(javafx.scene.input.ClipboardContent) Pane(javafx.scene.layout.Pane) WritableImage(javafx.scene.image.WritableImage) SnapshotParameters(javafx.scene.SnapshotParameters) HashMap(java.util.HashMap) Scale(javafx.scene.transform.Scale) HashMap(java.util.HashMap) Map(java.util.Map) Chart(javafx.scene.chart.Chart)

Aggregations

Pane (javafx.scene.layout.Pane)34 StackPane (javafx.scene.layout.StackPane)13 IOException (java.io.IOException)12 FXMLLoader (javafx.fxml.FXMLLoader)12 Node (javafx.scene.Node)7 BorderPane (javafx.scene.layout.BorderPane)6 Scene (javafx.scene.Scene)5 Label (javafx.scene.control.Label)5 ArrayList (java.util.ArrayList)4 AnchorPane (javafx.scene.layout.AnchorPane)4 Stage (javafx.stage.Stage)4 HashMap (java.util.HashMap)3 List (java.util.List)3 FXML (javafx.fxml.FXML)3 ScrollPane (javafx.scene.control.ScrollPane)3 UserThread (io.bitsquare.common.UserThread)2 Insets (javafx.geometry.Insets)2 Parent (javafx.scene.Parent)2 Button (javafx.scene.control.Button)2 TabPane (javafx.scene.control.TabPane)2