diff options
| author | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-05-12 18:16:39 +0200 |
|---|---|---|
| committer | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-05-12 18:16:39 +0200 |
| commit | f74cd282da1f14bc3d2d768b2f68b8f6d6429e68 (patch) | |
| tree | bbf000cdcf263670076fee407a48a6389112bad7 | |
| download | UpnFx-f74cd282da1f14bc3d2d768b2f68b8f6d6429e68.tar.gz UpnFx-f74cd282da1f14bc3d2d768b2f68b8f6d6429e68.zip | |
Initial commit
| -rw-r--r-- | .classpath | 7 | ||||
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | .project | 23 | ||||
| -rw-r--r-- | build.fxbuild | 8 | ||||
| -rw-r--r-- | src/de/fhswf/in/inf/UpnFx/MainApp.java | 50 | ||||
| -rw-r--r-- | src/de/fhswf/in/inf/UpnFx/view/MainView.fxml | 61 | ||||
| -rw-r--r-- | src/de/fhswf/in/inf/UpnFx/view/MainViewController.java | 28 |
7 files changed, 178 insertions, 0 deletions
diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..ac4a647 --- /dev/null +++ b/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="con" path="org.eclipse.fx.ide.jdt.core.JAVAFX_CONTAINER"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ae3c172 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/.project b/.project new file mode 100644 index 0000000..b820669 --- /dev/null +++ b/.project @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>UpnFx</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.xtext.ui.shared.xtextBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.xtext.ui.shared.xtextNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/build.fxbuild b/build.fxbuild new file mode 100644 index 0000000..acdfe3a --- /dev/null +++ b/build.fxbuild @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="ASCII"?> +<anttasks:AntTask xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:anttasks="http://org.eclipse.fx.ide.jdt/1.0" buildDirectory="${project}/build"> + <deploy> + <application name="UpnFx"/> + <info/> + </deploy> + <signjar/> +</anttasks:AntTask> diff --git a/src/de/fhswf/in/inf/UpnFx/MainApp.java b/src/de/fhswf/in/inf/UpnFx/MainApp.java new file mode 100644 index 0000000..5d5e049 --- /dev/null +++ b/src/de/fhswf/in/inf/UpnFx/MainApp.java @@ -0,0 +1,50 @@ +package de.fhswf.in.inf.UpnFx; + +import javafx.application.Application; +import javafx.fxml.FXMLLoader; +import javafx.scene.Scene; +import javafx.scene.layout.AnchorPane; +import javafx.stage.Stage; + +/** + * This is the starting point for the application. + * + * @author Stefan Suhren + * @version 1.0 + */ +public class MainApp extends Application +{ + /* + * (non-Javadoc) + * + * @see javafx.application.Application#start(javafx.stage.Stage) + */ + @Override + public void start(Stage primaryStage) + { + try + { + AnchorPane apane = FXMLLoader.load(MainApp.class + .getResource("view/MainView.fxml")); + Scene scene = new Scene(apane); + primaryStage.setScene(scene); + primaryStage.setTitle("UpnFx"); + primaryStage.show(); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + + /** + * The main function. + * + * @param args + * The command line arguments + */ + public static void main(String[] args) + { + launch(args); + } +} diff --git a/src/de/fhswf/in/inf/UpnFx/view/MainView.fxml b/src/de/fhswf/in/inf/UpnFx/view/MainView.fxml new file mode 100644 index 0000000..449cc4e --- /dev/null +++ b/src/de/fhswf/in/inf/UpnFx/view/MainView.fxml @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<?import javafx.scene.control.*?> +<?import java.lang.*?> +<?import javafx.scene.layout.*?> +<?import javafx.scene.layout.GridPane?> + +<AnchorPane xmlns="http://javafx.com/javafx/8.0.45" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.fhswf.in.inf.UpnFx.view.MainViewController"> + <children> + <GridPane AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> + <children> + <TextField fx:id="txtField" alignment="CENTER_RIGHT" GridPane.columnSpan="4" GridPane.halignment="CENTER" /> + <Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="LN" GridPane.halignment="CENTER" GridPane.rowIndex="1" /> + <Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="SIN" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="1" /> + <Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="COS" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="1" /> + <Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="TAN" GridPane.columnIndex="3" GridPane.halignment="CENTER" GridPane.rowIndex="1" /> + <Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="+/-" GridPane.halignment="CENTER" GridPane.rowIndex="2" /> + <Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="1/X" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="2" /> + <Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="Y^X" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="2" /> + <Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="SQR" GridPane.columnIndex="3" GridPane.halignment="CENTER" GridPane.rowIndex="2" /> + <Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="LstX" GridPane.halignment="CENTER" GridPane.rowIndex="3" /> + <Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="X<>Y" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="3" /> + <Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="CLR" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="3" /> + <Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="CLX" GridPane.columnIndex="3" GridPane.halignment="CENTER" GridPane.rowIndex="3" /> + <Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" onAction="#numberHandle" text="7" GridPane.halignment="CENTER" GridPane.rowIndex="4" /> + <Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" onAction="#numberHandle" text="8" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="4" /> + <Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" onAction="#numberHandle" text="9" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="4" /> + <Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="/" GridPane.columnIndex="3" GridPane.halignment="CENTER" GridPane.rowIndex="4" /> + <Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" onAction="#numberHandle" text="4" GridPane.halignment="CENTER" GridPane.rowIndex="5" /> + <Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" onAction="#numberHandle" text="5" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="5" /> + <Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" onAction="#numberHandle" text="6" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="5" /> + <Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="*" GridPane.columnIndex="3" GridPane.halignment="CENTER" GridPane.rowIndex="5" /> + <Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" onAction="#numberHandle" text="1" GridPane.halignment="CENTER" GridPane.rowIndex="6" /> + <Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" onAction="#numberHandle" text="2" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="6" /> + <Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" onAction="#numberHandle" text="3" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="6" /> + <Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="-" GridPane.columnIndex="3" GridPane.halignment="CENTER" GridPane.rowIndex="6" /> + <Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" onAction="#numberHandle" text="0" GridPane.halignment="CENTER" GridPane.rowIndex="7" /> + <Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" onAction="#numberHandle" text="," GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="7" /> + <Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="ENT" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="7" /> + <Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="+" GridPane.columnIndex="3" GridPane.halignment="CENTER" GridPane.rowIndex="7" /> + </children> + <rowConstraints> + <RowConstraints vgrow="ALWAYS" /> + <RowConstraints vgrow="ALWAYS" /> + <RowConstraints vgrow="ALWAYS" /> + <RowConstraints vgrow="ALWAYS" /> + <RowConstraints vgrow="ALWAYS" /> + <RowConstraints vgrow="ALWAYS" /> + <RowConstraints vgrow="ALWAYS" /> + <RowConstraints vgrow="ALWAYS" /> + <RowConstraints vgrow="ALWAYS" /> + </rowConstraints> + <columnConstraints> + <ColumnConstraints hgrow="ALWAYS" /> + <ColumnConstraints hgrow="ALWAYS" /> + <ColumnConstraints hgrow="ALWAYS" /> + <ColumnConstraints hgrow="ALWAYS" /> + </columnConstraints> + </GridPane> + </children> +</AnchorPane> diff --git a/src/de/fhswf/in/inf/UpnFx/view/MainViewController.java b/src/de/fhswf/in/inf/UpnFx/view/MainViewController.java new file mode 100644 index 0000000..6e0b7e4 --- /dev/null +++ b/src/de/fhswf/in/inf/UpnFx/view/MainViewController.java @@ -0,0 +1,28 @@ +/** + * + */ +package de.fhswf.in.inf.UpnFx.view; + +import javafx.event.ActionEvent; +import javafx.fxml.FXML; +import javafx.scene.control.Button; +import javafx.scene.control.TextField; + +/** + * The controller for the MainView.fxml. + * + * @author Stefan Suhren + * @version 1.0 + */ +public class MainViewController +{ + @FXML + private TextField txtField; + + @FXML + private void numberHandle(ActionEvent event) + { + txtField.appendText(((Button) event.getSource()).getText()); + } + +} |
