From 27bf571d6413c3cc6a5d664b5bddd38d21d7b1cd Mon Sep 17 00:00:00 2001 From: EVE Date: Mon, 13 Mar 2017 16:42:21 -0400 Subject: Formatting --- .../bjc/utils/gui/awt/ExtensionFileFilter.java | 10 ++-- .../java/bjc/utils/gui/awt/SimpleFileDialog.java | 53 +++++++++------------- 2 files changed, 26 insertions(+), 37 deletions(-) (limited to 'BJC-Utils2/src/main/java/bjc/utils/gui/awt') diff --git a/BJC-Utils2/src/main/java/bjc/utils/gui/awt/ExtensionFileFilter.java b/BJC-Utils2/src/main/java/bjc/utils/gui/awt/ExtensionFileFilter.java index a375a98..0990f4f 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/gui/awt/ExtensionFileFilter.java +++ b/BJC-Utils2/src/main/java/bjc/utils/gui/awt/ExtensionFileFilter.java @@ -22,11 +22,10 @@ public class ExtensionFileFilter implements FilenameFilter { private IList extensions; /** - * Create a new filter only showing files with the specified - * extensions. + * Create a new filter only showing files with the specified extensions. * * @param exts - * The extensions to show in this filter. + * The extensions to show in this filter. */ public ExtensionFileFilter(List exts) { if (exts == null) { @@ -37,11 +36,10 @@ public class ExtensionFileFilter implements FilenameFilter { } /** - * Create a new filter only showing files with the specified - * extensions. + * Create a new filter only showing files with the specified extensions. * * @param exts - * The extensions to show in this filter. + * The extensions to show in this filter. */ public ExtensionFileFilter(String... exts) { extensions = new FunctionalList<>(exts); diff --git a/BJC-Utils2/src/main/java/bjc/utils/gui/awt/SimpleFileDialog.java b/BJC-Utils2/src/main/java/bjc/utils/gui/awt/SimpleFileDialog.java index 280c5d8..041a9a2 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/gui/awt/SimpleFileDialog.java +++ b/BJC-Utils2/src/main/java/bjc/utils/gui/awt/SimpleFileDialog.java @@ -20,9 +20,9 @@ public class SimpleFileDialog { * Prompt the user to pick a file to open * * @param parent - * The parent of the file picker + * The parent of the file picker * @param title - * The title of the file picker + * The title of the file picker * @return The file the user picked */ public static File getOpenFile(Frame parent, String title) { @@ -33,23 +33,21 @@ public class SimpleFileDialog { * Prompt the user to pick a file to open * * @param parent - * The parent of the file picker + * The parent of the file picker * @param title - * The title of the file picker + * The title of the file picker * @param extensions - * The extensions to accept as valid + * The extensions to accept as valid * @return The file the user picked */ - public static File getOpenFile(Frame parent, String title, - String... extensions) { + public static File getOpenFile(Frame parent, String title, String... extensions) { if (parent == null) { throw new NullPointerException("Parent must not be null"); } else if (title == null) { throw new NullPointerException("Title must not be null"); } - FileDialog chooser = new FileDialog(parent, title, - FileDialog.LOAD); + FileDialog chooser = new FileDialog(parent, title, FileDialog.LOAD); if (extensions != null) { FilenameFilter filter = new ExtensionFileFilter(extensions); @@ -59,8 +57,7 @@ public class SimpleFileDialog { chooser.setVisible(true); while (chooser.getFile() == null) { - SimpleDialogs.showError(parent, "File I/O Error", - "Please choose a file to open."); + SimpleDialogs.showError(parent, "File I/O Error", "Please choose a file to open."); chooser.setVisible(true); } @@ -71,23 +68,21 @@ public class SimpleFileDialog { * Prompt the user to pick a file to open * * @param parent - * The parent of the file picker + * The parent of the file picker * @param title - * The title of the file picker + * The title of the file picker * @param extensions - * The extensions to accept as valid + * The extensions to accept as valid * @return The file the user picked */ - public static File[] getOpenFiles(Frame parent, String title, - String... extensions) { + public static File[] getOpenFiles(Frame parent, String title, String... extensions) { if (parent == null) { throw new NullPointerException("Parent must not be null"); } else if (title == null) { throw new NullPointerException("Title must not be null"); } - FileDialog chooser = new FileDialog(parent, title, - FileDialog.LOAD); + FileDialog chooser = new FileDialog(parent, title, FileDialog.LOAD); if (extensions != null) { FilenameFilter filter = new ExtensionFileFilter(extensions); @@ -98,8 +93,7 @@ public class SimpleFileDialog { chooser.setVisible(true); while (chooser.getFile() == null) { - SimpleDialogs.showError(parent, "File I/O Error", - "Please choose a file to open."); + SimpleDialogs.showError(parent, "File I/O Error", "Please choose a file to open."); chooser.setVisible(true); } @@ -110,9 +104,9 @@ public class SimpleFileDialog { * Prompt the user to pick a file to save * * @param parent - * The parent of the file picker + * The parent of the file picker * @param title - * The title of the file picker + * The title of the file picker * @return The file the user picked */ public static File getSaveFile(Frame parent, String title) { @@ -123,23 +117,21 @@ public class SimpleFileDialog { * Prompt the user to pick a file to save * * @param parent - * The parent of the file picker + * The parent of the file picker * @param title - * The title of the file picker + * The title of the file picker * @param extensions - * The extensions to accept as valid + * The extensions to accept as valid * @return The file the user picked */ - public static File getSaveFile(Frame parent, String title, - String... extensions) { + public static File getSaveFile(Frame parent, String title, String... extensions) { if (parent == null) { throw new NullPointerException("Parent must not be null"); } else if (title == null) { throw new NullPointerException("Title must not be null"); } - FileDialog chooser = new FileDialog(parent, title, - FileDialog.SAVE); + FileDialog chooser = new FileDialog(parent, title, FileDialog.SAVE); if (extensions != null) { FilenameFilter filter = new ExtensionFileFilter(extensions); @@ -149,8 +141,7 @@ public class SimpleFileDialog { chooser.setVisible(true); while (chooser.getFile() == null) { - SimpleDialogs.showError(parent, "File I/O Error", - "Please choose a file to save to."); + SimpleDialogs.showError(parent, "File I/O Error", "Please choose a file to save to."); chooser.setVisible(true); } -- cgit v1.2.3