Skip to content

Commit

Permalink
add screenshots
Browse files Browse the repository at this point in the history
  • Loading branch information
constantin-p committed May 14, 2018
1 parent c9605f2 commit 97b91dc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
12 changes: 12 additions & 0 deletions src/main/java/dcccontroller/ErrorManager.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package dcccontroller;

import javax.swing.*;

public class ErrorManager {

static public void showErrorMessage(String title, String msg) {
SwingUtilities.invokeLater(() -> {
JOptionPane.showMessageDialog(null, msg, title, JOptionPane.ERROR_MESSAGE);
});
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package dcccontroller.configuration;


import dcccontroller.ErrorManager;
import dcccontroller.configuration.csv.CSVFileHandler;
import dcccontroller.model.CPFunctionItem;
import dcccontroller.util.Change;
Expand Down Expand Up @@ -151,9 +152,7 @@ private HashMap<String, String> mapRowValues(String line) {
}

private void showErrorMessage(Exception e) {
SwingUtilities.invokeLater(() -> {
JOptionPane.showMessageDialog(null, "Could not open file \n" + e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
});
ErrorManager.showErrorMessage("Configuration Error", "Could not open file \n" + e.getMessage());
}

private String createConfigName(File file) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package dcccontroller.serial;

import com.fazecast.jSerialComm.SerialPort;
import dcccontroller.ErrorManager;
import dcccontroller.util.Change;

import java.io.InputStream;
Expand Down Expand Up @@ -121,7 +122,7 @@ private void sendMessage(String message) {
}
listenForMessages(3);
} else {
System.out.println("Port busy!");
ErrorManager.showErrorMessage("Connection Error", "Port busy!");
}
}

Expand Down

0 comments on commit 97b91dc

Please sign in to comment.