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);
}
}
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);
}
}
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);
}
}
}
}
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;
}
Aggregations