Clean up code
This commit is contained in:
parent
522c3a49b6
commit
5fcf3e9850
@ -1284,34 +1284,24 @@ public class BasicFrame extends JFrame {
|
|||||||
//// Handle the document
|
//// Handle the document
|
||||||
OpenRocketDocument doc = null;
|
OpenRocketDocument doc = null;
|
||||||
try {
|
try {
|
||||||
|
|
||||||
doc = worker.get();
|
doc = worker.get();
|
||||||
|
|
||||||
} catch (ExecutionException e) {
|
} catch (ExecutionException e) {
|
||||||
|
|
||||||
Throwable cause = e.getCause();
|
Throwable cause = e.getCause();
|
||||||
|
|
||||||
if (cause instanceof FileNotFoundException) {
|
if (cause instanceof FileNotFoundException) {
|
||||||
|
|
||||||
log.warn("File not found", cause);
|
log.warn("File not found", cause);
|
||||||
JOptionPane.showMessageDialog(parent,
|
JOptionPane.showMessageDialog(parent,
|
||||||
"File not found: " + displayName,
|
"File not found: " + displayName,
|
||||||
"Error opening file", JOptionPane.ERROR_MESSAGE);
|
"Error opening file", JOptionPane.ERROR_MESSAGE);
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
} else if (cause instanceof RocketLoadException) {
|
} else if (cause instanceof RocketLoadException) {
|
||||||
|
|
||||||
log.warn("Error loading the file", cause);
|
log.warn("Error loading the file", cause);
|
||||||
JOptionPane.showMessageDialog(parent,
|
JOptionPane.showMessageDialog(parent,
|
||||||
"Unable to open file '" + displayName + "': "
|
"Unable to open file '" + displayName + "': "
|
||||||
+ cause.getMessage(),
|
+ cause.getMessage(),
|
||||||
"Error opening file", JOptionPane.ERROR_MESSAGE);
|
"Error opening file", JOptionPane.ERROR_MESSAGE);
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
throw new BugException("Unknown error when opening file", e);
|
throw new BugException("Unknown error when opening file", e);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
@ -1322,7 +1312,6 @@ public class BasicFrame extends JFrame {
|
|||||||
throw new BugException("Document loader returned null");
|
throw new BugException("Document loader returned null");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//// Show warnings
|
//// Show warnings
|
||||||
WarningSet warnings = worker.getRocketLoader().getWarnings();
|
WarningSet warnings = worker.getRocketLoader().getWarnings();
|
||||||
if (!warnings.isEmpty()) {
|
if (!warnings.isEmpty()) {
|
||||||
|
@ -107,7 +107,7 @@ public final class ExampleDesignFileAction extends JMenu {
|
|||||||
/**
|
/**
|
||||||
* When a user clicks on one of the recently used design files, open it.
|
* When a user clicks on one of the recently used design files, open it.
|
||||||
*
|
*
|
||||||
* @param file the design file name (absolute path)
|
* @param example the design file name (absolute path)
|
||||||
*
|
*
|
||||||
* @return the action to open a design file
|
* @return the action to open a design file
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user