From ec3452f282f7f9f17e078467a4a9a8588028d6b9 Mon Sep 17 00:00:00 2001 From: Ben Culkin Date: Tue, 27 Sep 2022 19:13:09 -0400 Subject: Minor changes --- .../main/java/bjc/firmal/DirectoryExpected.java | 18 ++++++++++++ .../main/java/bjc/firmal/FirmalBrowserPanel.java | 33 +++------------------- firmal/src/main/java/module-info.java | 13 +++++++++ 3 files changed, 35 insertions(+), 29 deletions(-) create mode 100644 firmal/src/main/java/bjc/firmal/DirectoryExpected.java create mode 100644 firmal/src/main/java/module-info.java (limited to 'firmal/src/main/java') diff --git a/firmal/src/main/java/bjc/firmal/DirectoryExpected.java b/firmal/src/main/java/bjc/firmal/DirectoryExpected.java new file mode 100644 index 0000000..ebd6da9 --- /dev/null +++ b/firmal/src/main/java/bjc/firmal/DirectoryExpected.java @@ -0,0 +1,18 @@ +package bjc.firmal; + +/** + * Exception thrown when we got a directory when should've gotten a non directory. + * @author Ben Culkin + * + */ +public class DirectoryExpected extends RuntimeException { + private static final long serialVersionUID = 6614868098505684922L; + + /** + * Create a new exception. + * @param pth The path to the directory. + */ + public DirectoryExpected(String pth) { + super(String.format("Non-directory '%s' passed where a directory was expected", pth)); + } +} \ No newline at end of file diff --git a/firmal/src/main/java/bjc/firmal/FirmalBrowserPanel.java b/firmal/src/main/java/bjc/firmal/FirmalBrowserPanel.java index 4eef8e6..3120a2d 100644 --- a/firmal/src/main/java/bjc/firmal/FirmalBrowserPanel.java +++ b/firmal/src/main/java/bjc/firmal/FirmalBrowserPanel.java @@ -24,23 +24,6 @@ import bjc.utils.gui.layout.VLayout; * */ public class FirmalBrowserPanel extends JPanel { - /** - * Exception thrown when we got a directory when should've gotten a non directory. - * @author Ben Culkin - * - */ - public class DirectoryExpected extends RuntimeException { - private static final long serialVersionUID = 6614868098505684922L; - - /** - * Create a new exception. - * @param pth The path to the directory. - */ - public DirectoryExpected(String pth) { - super(String.format("Non-directory '%s' passed where a directory was expected", pth)); - } - } - private static final long serialVersionUID = 9078988253392361649L; private JEditorPane contentPane; @@ -79,25 +62,17 @@ public class FirmalBrowserPanel extends JPanel { navButtonPanel.setLayout(new GridLayout(2, 2)); SimpleKeyedButton firstButton = new SimpleKeyedButton("<< First"); - firstButton.setGlobalDefaultKeystroke("firstFile", "control shift P", (aev) -> { - moveFirst(); - }); + firstButton.setGlobalDefaultKeystroke("firstFile", "control shift P", (aev) -> moveFirst()); firstButton.setMnemonic(KeyEvent.VK_F); SimpleKeyedButton prevButton = new SimpleKeyedButton("< Previous"); - prevButton.setGlobalDefaultKeystroke("prevFile", "control P", (ev) -> { - movePrevious(); - }); + prevButton.setGlobalDefaultKeystroke("prevFile", "control P", (ev) -> movePrevious()); SimpleKeyedButton lastButton = new SimpleKeyedButton("Last >>"); - lastButton.setGlobalDefaultKeystroke("lastFile", "control shift N", (ev) -> { - moveLast(); - }); + lastButton.setGlobalDefaultKeystroke("lastFile", "control shift N", (ev) -> moveLast()); SimpleKeyedButton nextButton = new SimpleKeyedButton("Next >"); - nextButton.setGlobalDefaultKeystroke("nextFile", "control N", (ev) -> { - moveNext(); - }); + nextButton.setGlobalDefaultKeystroke("nextFile", "control N", (ev) -> moveNext()); navButtonPanel.add(firstButton); navButtonPanel.add(lastButton); diff --git a/firmal/src/main/java/module-info.java b/firmal/src/main/java/module-info.java new file mode 100644 index 0000000..80dd7c4 --- /dev/null +++ b/firmal/src/main/java/module-info.java @@ -0,0 +1,13 @@ +/** + * A browsing utility for images and other files. + * + * @author bjcul + * + */ +module firmal { + exports bjc.firmal; + + requires bjc.utils; + requires esodata; + requires transitive java.desktop; +} \ No newline at end of file -- cgit v1.2.3