org.jfxonverter.app.JFXConverterApp
. Note that is is only available in the IDE (the associated code is not distributed in the jfxConverter.jar
library).
public Node getContent()
method. A context
object is available giving access to the following methods: getScriptFile()
: the script filegetPath(String)
: the absolute path of a file specified by a path relative to the script filegetCSS(String)
: the CSS path of a file specified by a path relative to the script file, usable to add a StyleSheet to a Node parentimport javafx.scene.*; import javafx.scene.layout.*; import javafx.scene.shape.*; import javafx.scene.paint.*; public Node getContent() { Pane pane = new Pane(); Rectangle rect = new Rectangle(0, 0, 200, 200); rect.setFill(Color.YELLOW); rect.setStyle("-fx-fill: green; -fx-rotate: 45;"); Line line = new Line(0, 0, 200, 200); line.setStroke(Color.RED); pane.getChildren().add(rect); pane.getChildren().add(line); return pane; }
import javafx.scene.*; import javafx.scene.layout.*; import javafx.scene.shape.*; import javafx.scene.paint.*; public Node getContent() { Pane pane = new Pane(); String path = context.getCSS("pane.css"); pane.getStylesheets().add(path); pane.getStyleClass().add("paneStyle"); return pane; }
Copyright 2016-2018 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence