Copy constructors
Greg Brown
greg.x.brown at oracle.com
Mon Sep 10 10:57:19 PDT 2012
> The FXML loader only takes a URL. If you have a resource that you may load multiple times, how efficient is it? I have used a XSLT to convert SVG into FXML so I can get scalable icons in my application. There are two concern:
>
> 1) If I choose to convert from SVG to FXML at runtime I need to make a temporary file for the FXML loader as it doesn't take a DOM or a String as a source.
Why not just apply your transform at compile time such that only FXML is processed at runtime, rather than both SVG and FXML?
> 2) The exact same component hierarchy is being parsed over and over (these icons may appear many many times in the GUI) - It might make sense for there to be an intermediate form that new copies of the FXML node hierarchy could be created from.
A new flag was added to FXMLLoader for 8.0 to address this exact case. When this flag is set to true, information about the loaded FXML document is cached across calls to load() so that subsequent calls do not take as long to execute.
More information about the openjfx-dev
mailing list