Skip to content
Snippets Groups Projects
Commit 205b7f4b authored by Lukas Friedrichsen's avatar Lukas Friedrichsen
Browse files

minor changes

parent 35f93c8e
Branches
No related tags found
No related merge requests found
Showing
with 21 additions and 29 deletions
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
<classpathentry kind="src" path="src"/> <classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.fx.ide.jdt.core.JAVAFX_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.fx.ide.jdt.core.JAVAFX_CONTAINER"/>
<classpathentry kind="lib" path="D:/Users/Philipp/gitlab/VInf/Praktikum/VINF_MaerklinProject/controlsfx-8.40.12.jar"/> <classpathentry kind="lib" path="/home/lukas/VInf/Praktikum/VINF_MaerklinGUI/controlsfx-8.40.12.jar"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>
/common/
/gui/ /gui/
/server/
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
...@@ -48,8 +48,6 @@ public class MainApp extends Application { ...@@ -48,8 +48,6 @@ public class MainApp extends Application {
private InputStream in; private InputStream in;
private OutputStream out; private OutputStream out;
private Properties properties;
private Boolean connectionEstablished = false; private Boolean connectionEstablished = false;
/** /**
...@@ -64,7 +62,11 @@ public class MainApp extends Application { ...@@ -64,7 +62,11 @@ public class MainApp extends Application {
engines.add(new Engine("Reichsbahn", 0x4007)); engines.add(new Engine("Reichsbahn", 0x4007));
// Add the already known switches // yes, lazy, i know // Add the already known switches // yes, lazy, i know
for (int i=4;i<=15;i++){ switches.add(new Switch("Weiche "+i, 0x3000+(i-1))); } for (int i=4;i<=15;i++){
if (i != 11){
switches.add(new Switch("Weiche "+i, 0x3000+(i-1)));
}
}
turntable = new Switch("Drehteller", Properties.TURNTABLE_ID); turntable = new Switch("Drehteller", Properties.TURNTABLE_ID);
...@@ -90,7 +92,7 @@ public class MainApp extends Application { ...@@ -90,7 +92,7 @@ public class MainApp extends Application {
@Override @Override
public void start(Stage primaryStage) { public void start(Stage primaryStage) {
this.primaryStage = primaryStage; this.primaryStage = primaryStage;
this.primaryStage.setTitle("Mrklin Control Client"); this.primaryStage.setTitle("Mrklin Control Client");
initRootLayout(); initRootLayout();
initTabs(); initTabs();
...@@ -122,11 +124,11 @@ public class MainApp extends Application { ...@@ -122,11 +124,11 @@ public class MainApp extends Application {
*/ */
public void initTabs() { public void initTabs() {
try { try {
FXMLLoader loader = new FXMLLoader(); FXMLLoader engineLoader = new FXMLLoader();
loader.setLocation(MainApp.class.getResource("view/Engine.fxml")); engineLoader.setLocation(MainApp.class.getResource("view/Engine.fxml"));
enginePane = loader.load(); enginePane = engineLoader.load();
engineController = loader.getController(); // only works if loader.load() has been called already engineController = engineLoader.getController(); // only works if loader.load() has been called already
engineController.setMainApp(this); engineController.setMainApp(this);
FXMLLoader switchListLoader = new FXMLLoader(); FXMLLoader switchListLoader = new FXMLLoader();
...@@ -282,6 +284,7 @@ public class MainApp extends Application { ...@@ -282,6 +284,7 @@ public class MainApp extends Application {
out.write(datagram); out.write(datagram);
client.close(); client.close();
connectionEstablished = false; connectionEstablished = false;
setStatus("Verbindung abgebrochen!");
} catch (Exception e) { } catch (Exception e) {
setStatus("Error at: establishConnection (shutting down connection"); setStatus("Error at: establishConnection (shutting down connection");
......
package gui.model; package gui.model;
import java.net.InetAddress;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import javafx.beans.property.IntegerProperty; import common.Properties;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.StringProperty;
import javafx.beans.property.ObjectProperty; import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.SimpleObjectProperty; import javafx.beans.property.SimpleObjectProperty;
...@@ -25,7 +19,7 @@ public class Settings { ...@@ -25,7 +19,7 @@ public class Settings {
* Default constructor. * Default constructor.
*/ */
public Settings() { public Settings() {
this.server = new SimpleObjectProperty<InetSocketAddress> (new InetSocketAddress("localhost", 12345)); this.server = new SimpleObjectProperty<InetSocketAddress> (new InetSocketAddress("localhost", Properties.PORT));
} }
......
...@@ -2,8 +2,6 @@ package gui.view; ...@@ -2,8 +2,6 @@ package gui.view;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.scene.control.TabPane; import javafx.scene.control.TabPane;
import javafx.scene.layout.BackgroundFill;
import javafx.scene.paint.Color;
import org.controlsfx.control.StatusBar; import org.controlsfx.control.StatusBar;
......
...@@ -24,7 +24,6 @@ public class SwitchControl extends HBox{ ...@@ -24,7 +24,6 @@ public class SwitchControl extends HBox{
private Switch sw; private Switch sw;
/** /**
* The constructor.
* The constructor is called before the initialize() method. * The constructor is called before the initialize() method.
*/ */
public SwitchControl(Switch sw) { public SwitchControl(Switch sw) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment