use of javafx.fxml.FXMLLoader in project swift by luastar.
the class MybatisGenApp method initRootLayout.
public void initRootLayout() {
try {
FXMLLoader loader = new FXMLLoader();
loader.setLocation(getClass().getResource("/views/mybatis_gen.fxml"));
rootLayout = loader.load();
// Show the scene containing the root layout.
Scene scene = new Scene(rootLayout);
primaryStage.setScene(scene);
primaryStage.show();
} catch (IOException e) {
e.printStackTrace();
}
}
use of javafx.fxml.FXMLLoader in project Gargoyle by callakrsos.
the class FilePropertiesComposite method init.
void init() {
FXMLLoader loader = new FXMLLoader();
loader.setLocation(FilePropertiesComposite.class.getResource("FilePropertiesCompositeView.fxml"));
loader.setRoot(this);
loader.setController(this);
try {
loader.load();
} catch (IOException e) {
e.printStackTrace();
}
}
use of javafx.fxml.FXMLLoader in project Gargoyle by callakrsos.
the class FXMLPreviewLoader method start.
/**
* @inheritDoc
*/
@Override
public void start(Stage primaryStage) throws Exception {
BorderPane borderPane = new BorderPane();
FXMLLoader loader = new FXMLLoader() {
};
// InputStream resourceAsStream =
// FXMLPreviewLoader.class.getResourceAsStream("lang_ko.properties");
//
// loader.setResources(new PropertyResourceBundle(new
// InputStreamReader(resourceAsStream, "UTF-8")) {
// /*
// * @inheritDoc
// */
// @Override
// public boolean containsKey(String key) {
// return true;
// }
//
// /*
// * @inheritDoc
// */
// @Override
// public Object handleGetObject(String key) {
// if (key == null) {
// return "";
// }
//
// Object result = null;
//
// try {
// result = super.handleGetObject(key);
// } catch (Exception e) {
// ;
// }
//
// return (result == null) ? key : result;
// }
// });
// loader.setLocation(/*FXMLPreviewLoader.class.getResource("ColumnExam3.fxml")*/url);
loader.setBuilderFactory(new BuilderFactory() {
@Override
public Builder<?> getBuilder(Class<?> param) {
return new JavaFXBuilderFactory().getBuilder(param);
}
});
loader.setControllerFactory(new Callback<Class<?>, Object>() {
@Override
public Object call(Class<?> param) {
return null;
}
});
FileInputStream inputStream = new FileInputStream(file);
InputStream is = null;
try {
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();
ByteArrayOutputStream out = new ByteArrayOutputStream();
FXMLSaxHandler handler = new FXMLSaxHandler(out);
sp.parse(inputStream, handler);
String string = out.toString("UTF-8");
string = ValueUtil.regexReplaceMatchs("<!\\[CDATA\\[[?<a-zA-Z. *?>]+]]>", string, str -> {
return ValueUtil.regexMatch("<\\?import [a-zA-Z.*?]+>", str);
});
System.out.println(string);
byte[] bytes = string.getBytes();
is = new ByteArrayInputStream(bytes);
} catch (Exception e) {
e.printStackTrace();
}
// FileInputStream inputStream = new FileInputStream(file);
borderPane.setCenter(loader.load(is));
Scene scene = new Scene(borderPane);
primaryStage.setScene(scene);
primaryStage.show();
}
use of javafx.fxml.FXMLLoader in project Gargoyle by callakrsos.
the class FileCompareExam method start.
@Override
public void start(Stage primaryStage) throws Exception {
FXMLLoader loader = new FXMLLoader();
loader.setLocation(DiffAppController.class.getResource("FileBaseDiffApp.fxml"));
BorderPane load = loader.load();
FileBaseDiffAppController controller = loader.getController();
URL resource1 = FileCompareExam.class.getResource("Test1");
URL resource2 = FileCompareExam.class.getResource("Test2");
File ordinalFile = new File(resource1.toURI());
controller.setDiffFile(ordinalFile, new File(resource2.toURI()));
Scene scene = new Scene(load);
primaryStage.setScene(scene);
primaryStage.show();
}
use of javafx.fxml.FXMLLoader in project Gargoyle by callakrsos.
the class ColumnExample3 method start.
@Override
public void start(Stage primaryStage) throws IOException {
FXMLLoader loader = new FXMLLoader();
loader.setLocation(getClass().getResource("ColumnExam3.fxml"));
primaryStage.setTitle("Column Resize Test");
primaryStage.setScene(new Scene(new BorderPane(loader.load()), 1100, 700));
primaryStage.sizeToScene();
primaryStage.show();
}
Aggregations