-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from Domeml94/1.0.0
1.0.0
- Loading branch information
Showing
196 changed files
with
7,736 additions
and
3,035 deletions.
There are no files selected for viewing
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
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
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,125 @@ | ||
package de.dominikemmel.reflowlab; | ||
|
||
import java.awt.Color; | ||
import java.io.IOException; | ||
import java.io.PipedInputStream; | ||
import java.io.PipedOutputStream; | ||
import java.io.PrintStream; | ||
|
||
import de.dominikemmel.reflowlab.controller.maincontrol.ConsoleOverviewController; | ||
import de.dominikemmel.reflowlab.controller.maincontrol.ReaderThread; | ||
import javafx.application.Application; | ||
import javafx.application.Platform; | ||
import javafx.event.EventHandler; | ||
import javafx.fxml.FXMLLoader; | ||
import javafx.scene.Parent; | ||
import javafx.scene.Scene; | ||
import javafx.scene.control.TextArea; | ||
import javafx.scene.image.Image; | ||
import javafx.stage.Stage; | ||
import javafx.stage.StageStyle; | ||
import javafx.stage.WindowEvent; | ||
|
||
|
||
|
||
public class MainApp extends Application { | ||
|
||
private final PipedInputStream pipeIn = new PipedInputStream(); | ||
private final PipedInputStream pipeIn2 = new PipedInputStream(); | ||
Thread errorThrower; | ||
private Thread reader; | ||
private Thread reader2; | ||
boolean quit; | ||
private TextArea txtArea; | ||
|
||
@Override | ||
public void start(Stage primaryStage) throws IOException { | ||
|
||
Updates.updateDB(); | ||
|
||
Parent root = FXMLLoader.load(getClass().getResource("/de/dominikemmel/reflowlab/controller/maincontrol/fxml/main.fxml")); | ||
|
||
Scene scene = new Scene(root); | ||
scene.getStylesheets().add(getClass().getResource("/de/dominikemmel/reflowlab/style/reflowlabStyle1.css").toExternalForm()); | ||
primaryStage.initStyle(StageStyle.DECORATED); | ||
|
||
primaryStage.setScene(scene); | ||
primaryStage.show(); | ||
primaryStage.setTitle("ReFlowLab"); | ||
// primaryStage.getIcons().add(new Image("/.../.png")); | ||
|
||
primaryStage.getIcons().add(new Image(getClass().getResourceAsStream("/de/dominikemmel/reflowlab/img/logo_simple/1x/logo_simple1x.png"))); | ||
// MainController.dbTest(); | ||
|
||
// Database.createConnection("activeMaterial"); | ||
// Database.createConnection("solvent"); | ||
// Database.createConnection("electrolyte"); | ||
// Database.createConnection("costAnalysis"); | ||
// Database.createConnection("reference"); | ||
|
||
|
||
txtArea = ConsoleOverviewController.staticTxtArea; | ||
|
||
//Thread execution for reading output stream | ||
executeReaderThreads(); | ||
|
||
//Thread closing on stag close event | ||
primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>() { | ||
@Override | ||
public void handle(WindowEvent e) { | ||
|
||
closeThread(); | ||
Platform.exit(); | ||
System.exit(0); | ||
} | ||
}); | ||
|
||
|
||
} | ||
|
||
//method to handle thread closing on stage closing | ||
synchronized void closeThread() { | ||
System.out.println("Message: Stage is closed."); | ||
this.quit = true; | ||
notifyAll(); | ||
try { this.reader.join(1000L); this.pipeIn.close(); } catch (Exception e) { | ||
}try { this.reader2.join(1000L); this.pipeIn2.close(); } catch (Exception e) { | ||
}System.exit(0); | ||
} | ||
|
||
/** | ||
* @param args the command line arguments | ||
*/ | ||
|
||
public static void main(String[] args) throws Exception { | ||
|
||
launch(args); | ||
} | ||
|
||
public void executeReaderThreads() { | ||
try { | ||
PipedOutputStream pout = new PipedOutputStream(this.pipeIn); | ||
System.setOut(new PrintStream(pout, true)); | ||
} | ||
catch (IOException io) { | ||
|
||
} | ||
catch (SecurityException se) { | ||
|
||
} | ||
|
||
try { | ||
PipedOutputStream pout2 = new PipedOutputStream(this.pipeIn2); | ||
System.setErr(new PrintStream(pout2, true)); | ||
} | ||
catch (IOException io) { | ||
|
||
} | ||
catch (SecurityException se) { | ||
|
||
} | ||
|
||
ReaderThread obj = new ReaderThread(pipeIn, pipeIn2, errorThrower, reader, reader2, quit, txtArea); | ||
|
||
|
||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package de.dominikemmel.reflowlab; | ||
|
||
import java.sql.Connection; | ||
import java.sql.SQLException; | ||
import java.sql.Statement; | ||
|
||
public class Updates { | ||
|
||
public static void updateDB() { | ||
|
||
|
||
} | ||
|
||
} |
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
Oops, something went wrong.