Skip to content

Commit

Permalink
fix typo in "Working" messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrueden committed Oct 23, 2024
1 parent 4aea22f commit bf34f34
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main/java/ai/nets/samj/gui/SAMModelPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -486,27 +486,28 @@ private static String formatHTML(String html) {
* @return the message to be print in the html panel
*/
private String manageEmptyMessage(String html) {
String working = "Working, this might take several minutes";
if (html.trim().isEmpty() && waitingIter == 0) {
html = LocalDateTime.now().format(DATE_FORMAT).toString() + " -- Working, this migh take several minutes .";
html = LocalDateTime.now().format(DATE_FORMAT).toString() + " -- " + working + " .";
waitingIter += 1;
} else if (html.trim().isEmpty() && waitingIter % 3 == 1) {
html = LocalDateTime.now().format(DATE_FORMAT).toString() + " -- Working, this migh take several minutes . .";
html = LocalDateTime.now().format(DATE_FORMAT).toString() + " -- " + working + " . .";
int len = html.length() - (" .").length() + System.lineSeparator().length();
SwingUtilities.invokeLater(() -> {
HTMLDocument doc = (HTMLDocument) info.getDocument();
try {doc.remove(doc.getLength() - len, len);} catch (BadLocationException e) {}
});
waitingIter += 1;
} else if (html.trim().isEmpty() && waitingIter % 3 == 2) {
html = LocalDateTime.now().format(DATE_FORMAT).toString() + " -- Working, this migh take several minutes . . .";
html = LocalDateTime.now().format(DATE_FORMAT).toString() + " -- " + working + " . . .";
int len = html.length() - (" .").length() + System.lineSeparator().length();
SwingUtilities.invokeLater(() -> {
HTMLDocument doc = (HTMLDocument) info.getDocument();
try {doc.remove(doc.getLength() - len, len);} catch (BadLocationException e) {}
});
waitingIter += 1;
} else if (html.trim().isEmpty() && waitingIter % 3 == 0) {
html = LocalDateTime.now().format(DATE_FORMAT).toString() + " -- Working, this migh take several minutes .";
html = LocalDateTime.now().format(DATE_FORMAT).toString() + " -- " + working + " .";
int len = html.length() + (" . .").length() + System.lineSeparator().length();
SwingUtilities.invokeLater(() -> {
HTMLDocument doc = (HTMLDocument) info.getDocument();
Expand Down

0 comments on commit bf34f34

Please sign in to comment.