Created
March 28, 2015 11:00
-
-
Save RuZman/0e20597a67daff8aba25 to your computer and use it in GitHub Desktop.
DataFX Demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<?import javafx.scene.text.*?> | |
<?import javafx.geometry.*?> | |
<?import java.lang.*?> | |
<?import javafx.scene.layout.*?> | |
<?import javafx.scene.control.*?> | |
<?import javafx.scene.*?> | |
<VBox prefHeight="500.0" prefWidth="700.0" xmlns:fx="http://javafx.com/fxml"> | |
<MenuBar> | |
<Menu text="Menü"> | |
<Menu text="Projekt"> | |
<MenuItem onAction="#anlegenProjekt" text="Projekt anlegen" /> | |
</Menu> | |
<Menu text="Service"> | |
<MenuItem onAction="#anlegenService" text="Service anlegen" /> | |
</Menu> | |
<SeparatorMenuItem /> | |
<MenuItem onAction="#beendeProgramm" text="Beenden" /> | |
</Menu> | |
</MenuBar> | |
<Pane fx:id="programmInhalt" /> | |
</VBox> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package de.ruzman.datafxdemo; | |
import io.datafx.controller.flow.Flow; | |
import io.datafx.controller.flow.FlowException; | |
import javafx.application.Application; | |
import javafx.stage.Stage; | |
public class Main extends Application { | |
@Override | |
public void start(Stage stage) throws FlowException { | |
new Flow(MainController.class).startInStage(stage); | |
} | |
public static void main(String[] args) { | |
launch(args); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package de.ruzman.datafxdemo; | |
import io.datafx.controller.FXMLController; | |
import io.datafx.controller.flow.Flow; | |
import io.datafx.controller.flow.FlowException; | |
import io.datafx.controller.flow.FlowHandler; | |
import javafx.application.Platform; | |
import javafx.event.ActionEvent; | |
import javafx.fxml.FXML; | |
import javafx.scene.layout.Pane; | |
import javax.annotation.PostConstruct; | |
@FXMLController("fxml/main.fxml") | |
public class MainController { | |
@FXML private Pane programmInhalt; | |
private FlowHandler innerFlow; | |
@PostConstruct | |
public void init() throws FlowException { | |
innerFlow = new Flow(MenuProjektAnlegenController.class).createHandler(); | |
programmInhalt.getChildren().add(innerFlow.start()); | |
} | |
@FXML | |
private void anlegenProjekt(ActionEvent actionEvent) throws Exception { | |
innerFlow.navigateTo(MenuProjektAnlegenController.class); | |
} | |
@FXML | |
private void anlegenService(ActionEvent actionEvent) throws Exception { | |
innerFlow.navigateTo(MenuServiceAnlegenController.class); | |
} | |
@FXML | |
private void beendeProgramm(ActionEvent actionEvent) { | |
Platform.exit(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package de.ruzman.datafxdemo; | |
import io.datafx.controller.injection.scopes.ApplicationScoped; | |
@ApplicationScoped | |
public class Model { | |
private int testwert = 22; | |
private String version = "1.0.0"; | |
public int getTestwert() { | |
return testwert; | |
} | |
public String getVersion() { | |
return version; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment