| @@ -2,6 +2,7 @@ package de.uniluebeck.mi.projmi6.controller; | |||||
| import de.uniluebeck.mi.projmi6.db.DBHandler; | import de.uniluebeck.mi.projmi6.db.DBHandler; | ||||
| import de.uniluebeck.mi.projmi6.model.*; | import de.uniluebeck.mi.projmi6.model.*; | ||||
| import de.uniluebeck.mi.projmi6.view.MessageIcon; | |||||
| import javafx.beans.binding.Bindings; | import javafx.beans.binding.Bindings; | ||||
| import javafx.beans.property.ReadOnlyObjectProperty; | import javafx.beans.property.ReadOnlyObjectProperty; | ||||
| import javafx.beans.property.SimpleObjectProperty; | import javafx.beans.property.SimpleObjectProperty; | ||||
| @@ -30,6 +31,8 @@ public class MainController { | |||||
| private StationsHistorieController stationsHistorieController; | private StationsHistorieController stationsHistorieController; | ||||
| private UntersuchungenController untersuchungenController; | private UntersuchungenController untersuchungenController; | ||||
| private LogController logController; | private LogController logController; | ||||
| private MessageController messageController; | |||||
| private int parallelTaskCount = 0; | private int parallelTaskCount = 0; | ||||
| @@ -73,8 +76,10 @@ public class MainController { | |||||
| return untersuchungenController; | return untersuchungenController; | ||||
| } else if (clazz.equals(StationsHistorieController.class)) { | } else if (clazz.equals(StationsHistorieController.class)) { | ||||
| return stationsHistorieController; | return stationsHistorieController; | ||||
| } else if (clazz.equals(LogController.class)){ | |||||
| } else if (clazz.equals(LogController.class)) { | |||||
| return logController; | return logController; | ||||
| }else if(clazz.equals(MessageController.class)){ | |||||
| return messageController; | |||||
| } else { | } else { | ||||
| System.err.println("Keine Controller-Klasse des Typs " + clazz + " gefunden!!!"); | System.err.println("Keine Controller-Klasse des Typs " + clazz + " gefunden!!!"); | ||||
| return null; | return null; | ||||
| @@ -90,6 +95,7 @@ public class MainController { | |||||
| untersuchungenController = new UntersuchungenController(this); | untersuchungenController = new UntersuchungenController(this); | ||||
| stationsHistorieController = new StationsHistorieController(this); | stationsHistorieController = new StationsHistorieController(this); | ||||
| logController = new LogController(this); | logController = new LogController(this); | ||||
| messageController = new MessageController(this); | |||||
| } | } | ||||
| @@ -250,7 +256,6 @@ public class MainController { | |||||
| } | } | ||||
| private Task<Void> loadCaseData = null; | private Task<Void> loadCaseData = null; | ||||
| @@ -296,7 +301,6 @@ public class MainController { | |||||
| protected void succeeded() { | protected void succeeded() { | ||||
| super.succeeded(); | super.succeeded(); | ||||
| if (isCancelled()) { | if (isCancelled()) { | ||||
| System.out.println("Task wurde gecancelt"); | |||||
| return; | return; | ||||
| } | } | ||||
| ObservableList<Diagnose> diagnoses = FXCollections.observableArrayList(diagnoseList); | ObservableList<Diagnose> diagnoses = FXCollections.observableArrayList(diagnoseList); | ||||
| @@ -0,0 +1,44 @@ | |||||
| package de.uniluebeck.mi.projmi6.controller; | |||||
| import de.uniluebeck.mi.projmi6.model.Fall; | |||||
| import de.uniluebeck.mi.projmi6.model.HL7Message; | |||||
| import de.uniluebeck.mi.projmi6.model.Patient; | |||||
| import de.uniluebeck.mi.projmi6.view.MessageIcon; | |||||
| import javafx.collections.ObservableList; | |||||
| import javafx.fxml.FXML; | |||||
| /** | |||||
| * Created by Johannes on 21/11/2015. | |||||
| */ | |||||
| public class MessageController { | |||||
| final MainController mainController; | |||||
| @FXML | |||||
| private MessageIcon messageIcon; | |||||
| public MessageController(MainController mainController){ | |||||
| this.mainController = mainController; | |||||
| } | |||||
| @FXML | |||||
| private void initialize(){ | |||||
| } | |||||
| @FXML | |||||
| private void onMessageIconClicked(){ | |||||
| } | |||||
| public void addMessage(HL7Message message){ | |||||
| } | |||||
| } | |||||
| @@ -8,7 +8,7 @@ import java.sql.SQLException; | |||||
| * MySQL Connection Factory. | * MySQL Connection Factory. | ||||
| */ | */ | ||||
| public class MySqlConnectionFactory { | public class MySqlConnectionFactory { | ||||
| public static final String URL = "jdbc:mysql://141.83.20.84:3306/pmiw15g06_v01"; | |||||
| public static final String URL = "jdbc:mysql://localhost:3306/pmiw15g06_v01"; | |||||
| public static final String USER = "pmiw15g06"; | public static final String USER = "pmiw15g06"; | ||||
| public static final String PASS = "AX3yQSYJSH43PrSz"; | public static final String PASS = "AX3yQSYJSH43PrSz"; | ||||
| public static final String DRIVER = "com.mysql.jdbc.Driver"; | public static final String DRIVER = "com.mysql.jdbc.Driver"; | ||||
| @@ -0,0 +1,65 @@ | |||||
| package de.uniluebeck.mi.projmi6.model; | |||||
| import java.time.LocalDateTime; | |||||
| /** | |||||
| * Created by Johannes on 21/11/2015. | |||||
| */ | |||||
| public class HL7Message { | |||||
| private LocalDateTime dateTime; | |||||
| private String messageContent; | |||||
| private boolean failed; | |||||
| private Patient patient; | |||||
| private int fallId; | |||||
| public HL7Message(Patient patient, int fallId, LocalDateTime dateTime, String messageContent, boolean failed) { | |||||
| this.patient = patient; | |||||
| this.fallId = fallId; | |||||
| this.dateTime = dateTime; | |||||
| this.messageContent = messageContent; | |||||
| this.failed = failed; | |||||
| } | |||||
| public LocalDateTime getDateTime() { | |||||
| return dateTime; | |||||
| } | |||||
| public void setDateTime(LocalDateTime dateTime) { | |||||
| this.dateTime = dateTime; | |||||
| } | |||||
| public String getMessageContent() { | |||||
| return messageContent; | |||||
| } | |||||
| public void setMessageContent(String messageContent) { | |||||
| this.messageContent = messageContent; | |||||
| } | |||||
| public boolean isFailed() { | |||||
| return failed; | |||||
| } | |||||
| public void setFailed(boolean failed) { | |||||
| this.failed = failed; | |||||
| } | |||||
| public Patient getPatient() { | |||||
| return patient; | |||||
| } | |||||
| public void setPatient(Patient patient) { | |||||
| this.patient = patient; | |||||
| } | |||||
| public int getFallId() { | |||||
| return fallId; | |||||
| } | |||||
| public void setFallId(int fallId) { | |||||
| this.fallId = fallId; | |||||
| } | |||||
| } | |||||
| @@ -1,11 +1,18 @@ | |||||
| package de.uniluebeck.mi.projmi6.view; | package de.uniluebeck.mi.projmi6.view; | ||||
| import javafx.animation.FadeTransition; | |||||
| import javafx.animation.Timeline; | |||||
| import javafx.animation.Transition; | |||||
| import javafx.beans.binding.Bindings; | |||||
| import javafx.beans.property.SimpleIntegerProperty; | import javafx.beans.property.SimpleIntegerProperty; | ||||
| import javafx.geometry.Pos; | |||||
| import javafx.scene.control.Button; | import javafx.scene.control.Button; | ||||
| import javafx.scene.control.Label; | import javafx.scene.control.Label; | ||||
| import javafx.scene.image.Image; | import javafx.scene.image.Image; | ||||
| import javafx.scene.image.ImageView; | import javafx.scene.image.ImageView; | ||||
| import javafx.scene.layout.StackPane; | import javafx.scene.layout.StackPane; | ||||
| import javafx.scene.paint.Color; | |||||
| import javafx.util.Duration; | |||||
| /** | /** | ||||
| * Created by Johannes on 21/11/2015. | * Created by Johannes on 21/11/2015. | ||||
| @@ -18,16 +25,57 @@ public class MessageIcon extends Button { | |||||
| private final SimpleIntegerProperty messageCount = new SimpleIntegerProperty(this, "messageCount", 0); | private final SimpleIntegerProperty messageCount = new SimpleIntegerProperty(this, "messageCount", 0); | ||||
| FadeTransition transition; | |||||
| public MessageIcon(){ | public MessageIcon(){ | ||||
| imageView = new ImageView(new Image("")); | |||||
| imageView = new ImageView(new Image("message.png")); | |||||
| imageView.setFitHeight(30); | |||||
| imageView.setFitWidth(30); | |||||
| /* imageView.opacityProperty().bind(Bindings.createDoubleBinding( | |||||
| ()->messageCount.get()>0? 1.0 : 0.5, messageCount));*/ | |||||
| messageCountLabel = new Label(); | messageCountLabel = new Label(); | ||||
| messageCountLabel.textProperty().bind(messageCount.asString()); | |||||
| StackPane.setAlignment(messageCountLabel, Pos.BOTTOM_RIGHT); | |||||
| messageCountLabel.setTextFill(Color.BLACK); | |||||
| this.disableProperty().bind(messageCount.lessThanOrEqualTo(0)); | |||||
| StackPane graphic = new StackPane(imageView, messageCountLabel); | StackPane graphic = new StackPane(imageView, messageCountLabel); | ||||
| this.setGraphic(graphic); | this.setGraphic(graphic); | ||||
| initTransition(); | |||||
| } | |||||
| private void initTransition(){ | |||||
| transition = new FadeTransition(Duration.millis(500), imageView); | |||||
| transition.setFromValue(0.5); | |||||
| transition.setToValue(1.0); | |||||
| transition.setCycleCount(Timeline.INDEFINITE); | |||||
| transition.setAutoReverse(true); | |||||
| messageCount.addListener((observable, oldValue, newValue) -> { | |||||
| if(messageCount.get()>0){ | |||||
| transition.play(); | |||||
| }else{ | |||||
| transition.stop(); | |||||
| } | |||||
| }); | |||||
| } | |||||
| public int getMessageCount() { | |||||
| return messageCount.get(); | |||||
| } | } | ||||
| public SimpleIntegerProperty messageCountProperty() { | |||||
| return messageCount; | |||||
| } | |||||
| public void setMessageCount(int messageCount) { | |||||
| this.messageCount.set(messageCount); | |||||
| } | |||||
| @@ -5,8 +5,10 @@ | |||||
| <?import java.lang.*?> | <?import java.lang.*?> | ||||
| <?import javafx.scene.control.*?> | <?import javafx.scene.control.*?> | ||||
| <?import javafx.scene.layout.*?> | <?import javafx.scene.layout.*?> | ||||
| <?import de.uniluebeck.mi.projmi6.view.* ?> | |||||
| <?import java.net.URL?> | <?import java.net.URL?> | ||||
| <?import de.uniluebeck.mi.projmi6.view.MessageIcon?> | |||||
| <VBox fx:controller="de.uniluebeck.mi.projmi6.controller.MainController" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"> | <VBox fx:controller="de.uniluebeck.mi.projmi6.controller.MainController" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"> | ||||
| <children> | <children> | ||||
| <TabPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" side="LEFT" tabClosingPolicy="UNAVAILABLE" VBox.vgrow="ALWAYS"> | <TabPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" side="LEFT" tabClosingPolicy="UNAVAILABLE" VBox.vgrow="ALWAYS"> | ||||
| @@ -82,6 +84,7 @@ | |||||
| <ChoiceBox fx:id="cmbUserChoose" prefWidth="150.0" /> | <ChoiceBox fx:id="cmbUserChoose" prefWidth="150.0" /> | ||||
| <Pane HBox.hgrow="ALWAYS" /> | <Pane HBox.hgrow="ALWAYS" /> | ||||
| <ProgressIndicator fx:id="progressIndicator" visible="false" pickOnBounds="false" prefHeight="35.0" prefWidth="35.0" /> | <ProgressIndicator fx:id="progressIndicator" visible="false" pickOnBounds="false" prefHeight="35.0" prefWidth="35.0" /> | ||||
| <fx:include source="message.fxml" /> | |||||
| </items> | </items> | ||||
| </ToolBar> | </ToolBar> | ||||
| </children> | </children> | ||||
| @@ -0,0 +1,13 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | |||||
| <?import javafx.geometry.*?> | |||||
| <?import javafx.scene.text.*?> | |||||
| <?import java.lang.*?> | |||||
| <?import javafx.scene.control.*?> | |||||
| <?import javafx.scene.layout.*?> | |||||
| <?import de.uniluebeck.mi.projmi6.view.* ?> | |||||
| <MessageIcon fx:id="messageIcon" fx:controller="de.uniluebeck.mi.projmi6.controller.MessageController" | |||||
| onAction="#onMessageIconClicked" | |||||
| xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"/> | |||||