* I'm releasing this code into the Public Domain. Enjoy. *
@@ -51,932 +47,898 @@ ** 2012-05-10 Redwarp -- Parameterized (me gusta) *
- * + * * @author Robert Harder * @author rharder@users.sf.net * @version 1.0.1 */ public class FileDrop
- * public class MyClass implements FileDrop.Listener
- * ...
- * public void filesDropped( java.io.File[] files )
- * {
- * ...
- * } // end filesDropped
- * ...
- *
- *
- * @since 1.1
- */
- public static interface Listener
+ * public class MyClass implements FileDrop.Listener
+ * ...
+ * public void filesDropped( java.io.File[] files )
+ * {
+ * ...
+ * } // end filesDropped
+ * ...
+ *
+ *
+ * @since 1.1
+ */
+ public static interface Listener- * I'm releasing this code into the Public Domain. Enjoy. - *
- * - * @author Robert Harder - * @author rob@iharder.net - * @version 1.2 - */ - public static class Event extends java.util.EventObject { - - private static final long serialVersionUID = 6145536635297645995L; - - private java.io.File[] files; - - /** - * Constructs an {@link Event} with the array of files that were dropped - * and the {@link FileDrop} that initiated the event. - * - * @param files - * The array of files that were dropped - * @source The event source - * @since 1.1 - */ - public Event(java.io.File[] files, Object source) { - super(source); - this.files = files; - } // end constructor - - /** - * Returns an array of files that were dropped on a registered drop - * target. - * - * @return array of files that were dropped - * @since 1.1 - */ - public java.io.File[] getFiles() { - return this.files; - } // end getFiles - - } // end inner class Event + /** + * This is the event that is passed to the + * {@link FileDropListener#filesDropped filesDropped(...)} method in your + * {@link FileDropListener} when files are dropped onto a registered drop + * target. + * + *+ * I'm releasing this code into the Public Domain. Enjoy. + *
+ * + * @author Robert Harder + * @author rob@iharder.net + * @version 1.2 + */ + public static class Event extends java.util.EventObject { + + private static final long serialVersionUID = 6145536635297645995L; + + private java.io.File[] files; + + /** + * Constructs an {@link Event} with the array of files that were dropped + * and the {@link FileDrop} that initiated the event. + * + * @param files The array of files that were dropped + * @source The event source + * @since 1.1 + */ + public Event(java.io.File[] files, Object source) { + super(source); + this.files = files; + } // end constructor + + /** + * Returns an array of files that were dropped on a registered drop + * target. + * + * @return array of files that were dropped + * @since 1.1 + */ + public java.io.File[] getFiles() { + return this.files; + } // end getFiles + + } // end inner class Event /* ******** I N N E R C L A S S ******** */ - /** - * At last an easy way to encapsulate your custom objects for dragging and - * dropping in your Java programs! When you need to create a - * {@link java.awt.datatransfer.Transferable} object, use this class to wrap - * your object. For example: - * - *
- *
- * ...
- * MyCoolClass myObj = new MyCoolClass();
- * Transferable xfer = new TransferableObject( myObj );
- * ...
- *
- *
- *
- * Or if you need to know when the data was actually dropped, like when
- * you're moving data out of a list, say, you can use the
- * {@link TransferableObject.Fetcher} inner class to return your object Just
- * in Time. For example:
- *
- *
- *
- * ...
- * final MyCoolClass myObj = new MyCoolClass();
- *
- * TransferableObject.Fetcher fetcher = new TransferableObject.Fetcher()
- * { public Object getObject(){ return myObj; }
- * }; // end fetcher
- *
- * Transferable xfer = new TransferableObject( fetcher );
- * ...
- *
- *
- *
- * The {@link java.awt.datatransfer.DataFlavor} associated with
- * {@link TransferableObject} has the representation class
- * net.iharder.dnd.TransferableObject.class and MIME type
- * application/x-net.iharder.dnd.TransferableObject. This data
- * flavor is accessible via the static {@link #DATA_FLAVOR} property.
- *
- *
- * - * I'm releasing this code into the Public Domain. Enjoy. - *
- * - * @author Robert Harder - * @author rob@iharder.net - * @version 1.2 - */ - public static class TransferableObject implements - java.awt.datatransfer.Transferable { - /** - * The MIME type for {@link #DATA_FLAVOR} is - * application/x-net.iharder.dnd.TransferableObject. - * - * @since 1.1 - */ - public final static String MIME_TYPE = "application/x-net.iharder.dnd.TransferableObject"; - - /** - * The default {@link java.awt.datatransfer.DataFlavor} for - * {@link TransferableObject} has the representation class - * net.iharder.dnd.TransferableObject.class and the MIME type - * application/x-net.iharder.dnd.TransferableObject. - * - * @since 1.1 - */ - public final static java.awt.datatransfer.DataFlavor DATA_FLAVOR = new java.awt.datatransfer.DataFlavor( - FileDrop.TransferableObject.class, MIME_TYPE); - - private Fetcher fetcher; - private Object data; - - private java.awt.datatransfer.DataFlavor customFlavor; - - /** - * Creates a new {@link TransferableObject} that wraps data. - * Along with the {@link #DATA_FLAVOR} associated with this class, this - * creates a custom data flavor with a representation class determined - * fromdata.getClass()
and the MIME type
- * application/x-net.iharder.dnd.TransferableObject.
- *
- * @param data
- * The data to transfer
- * @since 1.1
- */
- public TransferableObject(Object data) {
- this.data = data;
- this.customFlavor = new java.awt.datatransfer.DataFlavor(
- data.getClass(), MIME_TYPE);
- } // end constructor
-
- /**
- * Creates a new {@link TransferableObject} that will return the object
- * that is returned by fetcher. No custom data flavor is set
- * other than the default {@link #DATA_FLAVOR}.
- *
- * @see Fetcher
- * @param fetcher
- * The {@link Fetcher} that will return the data object
- * @since 1.1
- */
- public TransferableObject(Fetcher fetcher) {
- this.fetcher = fetcher;
- } // end constructor
-
- /**
- * Creates a new {@link TransferableObject} that will return the object
- * that is returned by fetcher. Along with the
- * {@link #DATA_FLAVOR} associated with this class, this creates a
- * custom data flavor with a representation class dataClass
- * and the MIME type
- * application/x-net.iharder.dnd.TransferableObject.
- *
- * @see Fetcher
- * @param dataClass
- * The {@link java.lang.Class} to use in the custom data
- * flavor
- * @param fetcher
- * The {@link Fetcher} that will return the data object
- * @since 1.1
- */
- @SuppressWarnings("rawtypes")
- public TransferableObject(Class dataClass, Fetcher fetcher) {
- this.fetcher = fetcher;
- this.customFlavor = new java.awt.datatransfer.DataFlavor(dataClass,
- MIME_TYPE);
- } // end constructor
-
- /**
- * Returns the custom {@link java.awt.datatransfer.DataFlavor}
- * associated with the encapsulated object or null if the
- * {@link Fetcher} constructor was used without passing a
- * {@link java.lang.Class}.
- *
- * @return The custom data flavor for the encapsulated object
- * @since 1.1
- */
- public java.awt.datatransfer.DataFlavor getCustomDataFlavor() {
- return this.customFlavor;
- } // end getCustomDataFlavor
+ /**
+ * At last an easy way to encapsulate your custom objects for dragging and
+ * dropping in your Java programs! When you need to create a
+ * {@link java.awt.datatransfer.Transferable} object, use this class to wrap
+ * your object. For example:
+ *
+ *
+ *
+ * ...
+ * MyCoolClass myObj = new MyCoolClass();
+ * Transferable xfer = new TransferableObject( myObj );
+ * ...
+ *
+ *
+ *
+ * Or if you need to know when the data was actually dropped, like when
+ * you're moving data out of a list, say, you can use the
+ * {@link TransferableObject.Fetcher} inner class to return your object Just
+ * in Time. For example:
+ *
+ *
+ *
+ * ...
+ * final MyCoolClass myObj = new MyCoolClass();
+ *
+ * TransferableObject.Fetcher fetcher = new TransferableObject.Fetcher()
+ * { public Object getObject(){ return myObj; }
+ * }; // end fetcher
+ *
+ * Transferable xfer = new TransferableObject( fetcher );
+ * ...
+ *
+ *
+ *
+ * The {@link java.awt.datatransfer.DataFlavor} associated with
+ * {@link TransferableObject} has the representation class
+ * net.iharder.dnd.TransferableObject.class and MIME type
+ * application/x-net.iharder.dnd.TransferableObject. This data
+ * flavor is accessible via the static {@link #DATA_FLAVOR} property.
+ *
+ *
+ * + * I'm releasing this code into the Public Domain. Enjoy. + *
+ * + * @author Robert Harder + * @author rob@iharder.net + * @version 1.2 + */ + public static class TransferableObject implements + java.awt.datatransfer.Transferable { + /** + * The MIME type for {@link #DATA_FLAVOR} is + * application/x-net.iharder.dnd.TransferableObject. + * + * @since 1.1 + */ + public final static String MIME_TYPE = "application/x-net.iharder.dnd.TransferableObject"; + + /** + * The default {@link java.awt.datatransfer.DataFlavor} for + * {@link TransferableObject} has the representation class + * net.iharder.dnd.TransferableObject.class and the MIME type + * application/x-net.iharder.dnd.TransferableObject. + * + * @since 1.1 + */ + public final static java.awt.datatransfer.DataFlavor DATA_FLAVOR = new java.awt.datatransfer.DataFlavor( + FileDrop.TransferableObject.class, MIME_TYPE); + + private Fetcher fetcher; + private Object data; + + private java.awt.datatransfer.DataFlavor customFlavor; + + /** + * Creates a new {@link TransferableObject} that wraps data. + * Along with the {@link #DATA_FLAVOR} associated with this class, this + * creates a custom data flavor with a representation class determined + * fromdata.getClass()
and the MIME type
+ * application/x-net.iharder.dnd.TransferableObject.
+ *
+ * @param data The data to transfer
+ * @since 1.1
+ */
+ public TransferableObject(Object data) {
+ this.data = data;
+ this.customFlavor = new java.awt.datatransfer.DataFlavor(
+ data.getClass(), MIME_TYPE);
+ } // end constructor
+
+ /**
+ * Creates a new {@link TransferableObject} that will return the object
+ * that is returned by fetcher. No custom data flavor is set
+ * other than the default {@link #DATA_FLAVOR}.
+ *
+ * @param fetcher The {@link Fetcher} that will return the data object
+ * @see Fetcher
+ * @since 1.1
+ */
+ public TransferableObject(Fetcher fetcher) {
+ this.fetcher = fetcher;
+ } // end constructor
+
+ /**
+ * Creates a new {@link TransferableObject} that will return the object
+ * that is returned by fetcher. Along with the
+ * {@link #DATA_FLAVOR} associated with this class, this creates a
+ * custom data flavor with a representation class dataClass
+ * and the MIME type
+ * application/x-net.iharder.dnd.TransferableObject.
+ *
+ * @param dataClass The {@link java.lang.Class} to use in the custom data
+ * flavor
+ * @param fetcher The {@link Fetcher} that will return the data object
+ * @see Fetcher
+ * @since 1.1
+ */
+ @SuppressWarnings("rawtypes")
+ public TransferableObject(Class dataClass, Fetcher fetcher) {
+ this.fetcher = fetcher;
+ this.customFlavor = new java.awt.datatransfer.DataFlavor(dataClass,
+ MIME_TYPE);
+ } // end constructor
+
+ /**
+ * Returns the custom {@link java.awt.datatransfer.DataFlavor}
+ * associated with the encapsulated object or null if the
+ * {@link Fetcher} constructor was used without passing a
+ * {@link java.lang.Class}.
+ *
+ * @return The custom data flavor for the encapsulated object
+ * @since 1.1
+ */
+ public java.awt.datatransfer.DataFlavor getCustomDataFlavor() {
+ return this.customFlavor;
+ } // end getCustomDataFlavor
/* ******** T R A N S F E R A B L E M E T H O D S ******** */
- /**
- * Returns a two- or three-element array containing first the custom
- * data flavor, if one was created in the constructors, second the
- * default {@link #DATA_FLAVOR} associated with
- * {@link TransferableObject}, and third the
- * {@link java.awt.datatransfer.DataFlavor.stringFlavor}.
- *
- * @return An array of supported data flavors
- * @since 1.1
- */
- @Override
- public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors() {
- if (this.customFlavor != null) {
- return new java.awt.datatransfer.DataFlavor[] {
- this.customFlavor, DATA_FLAVOR,
- java.awt.datatransfer.DataFlavor.stringFlavor }; // end
- // flavors
- // array
- } else {
- return new java.awt.datatransfer.DataFlavor[] { DATA_FLAVOR,
- java.awt.datatransfer.DataFlavor.stringFlavor }; // end
- // flavors
- // array
- }
- } // end getTransferDataFlavors
-
- /**
- * Returns the data encapsulated in this {@link TransferableObject}. If
- * the {@link Fetcher} constructor was used, then this is when the
- * {@link Fetcher#getObject getObject()} method will be called. If the
- * requested data flavor is not supported, then the
- * {@link Fetcher#getObject getObject()} method will not be called.
- *
- * @param flavor
- * The data flavor for the data to return
- * @return The dropped data
- * @since 1.1
- */
- @Override
- public Object getTransferData(java.awt.datatransfer.DataFlavor flavor)
- throws java.awt.datatransfer.UnsupportedFlavorException,
- java.io.IOException {
- // Native object
- if (flavor.equals(DATA_FLAVOR)) {
- return this.fetcher == null ? this.data : this.fetcher
- .getObject();
- }
-
- // String
- if (flavor.equals(java.awt.datatransfer.DataFlavor.stringFlavor)) {
- return this.fetcher == null ? this.data.toString()
- : this.fetcher.getObject().toString();
- }
-
- // We can't do anything else
- throw new java.awt.datatransfer.UnsupportedFlavorException(flavor);
- } // end getTransferData
-
- /**
- * Returns true if flavor is one of the supported
- * flavors. Flavors are supported using the equals(...)
- * method.
- *
- * @param flavor
- * The data flavor to check
- * @return Whether or not the flavor is supported
- * @since 1.1
- */
- @Override
- public boolean isDataFlavorSupported(
- java.awt.datatransfer.DataFlavor flavor) {
- // Native object
- if (flavor.equals(DATA_FLAVOR)) {
- return true;
- }
-
- // String
- if (flavor.equals(java.awt.datatransfer.DataFlavor.stringFlavor)) {
- return true;
- }
-
- // We can't do anything else
- return false;
- } // end isDataFlavorSupported
+ /**
+ * Returns a two- or three-element array containing first the custom
+ * data flavor, if one was created in the constructors, second the
+ * default {@link #DATA_FLAVOR} associated with
+ * {@link TransferableObject}, and third the
+ * {@link java.awt.datatransfer.DataFlavor.stringFlavor}.
+ *
+ * @return An array of supported data flavors
+ * @since 1.1
+ */
+ @Override
+ public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors() {
+ if (this.customFlavor != null) {
+ return new java.awt.datatransfer.DataFlavor[]{
+ this.customFlavor, DATA_FLAVOR,
+ java.awt.datatransfer.DataFlavor.stringFlavor}; // end
+ // flavors
+ // array
+ } else {
+ return new java.awt.datatransfer.DataFlavor[]{DATA_FLAVOR,
+ java.awt.datatransfer.DataFlavor.stringFlavor}; // end
+ // flavors
+ // array
+ }
+ } // end getTransferDataFlavors
+
+ /**
+ * Returns the data encapsulated in this {@link TransferableObject}. If
+ * the {@link Fetcher} constructor was used, then this is when the
+ * {@link Fetcher#getObject getObject()} method will be called. If the
+ * requested data flavor is not supported, then the
+ * {@link Fetcher#getObject getObject()} method will not be called.
+ *
+ * @param flavor The data flavor for the data to return
+ * @return The dropped data
+ * @since 1.1
+ */
+ @Override
+ public Object getTransferData(java.awt.datatransfer.DataFlavor flavor)
+ throws java.awt.datatransfer.UnsupportedFlavorException,
+ java.io.IOException {
+ // Native object
+ if (flavor.equals(DATA_FLAVOR)) {
+ return this.fetcher == null ? this.data : this.fetcher
+ .getObject();
+ }
+
+ // String
+ if (flavor.equals(java.awt.datatransfer.DataFlavor.stringFlavor)) {
+ return this.fetcher == null ? this.data.toString()
+ : this.fetcher.getObject().toString();
+ }
+
+ // We can't do anything else
+ throw new java.awt.datatransfer.UnsupportedFlavorException(flavor);
+ } // end getTransferData
+
+ /**
+ * Returns true if flavor is one of the supported
+ * flavors. Flavors are supported using the equals(...)
+ * method.
+ *
+ * @param flavor The data flavor to check
+ * @return Whether or not the flavor is supported
+ * @since 1.1
+ */
+ @Override
+ public boolean isDataFlavorSupported(
+ java.awt.datatransfer.DataFlavor flavor) {
+ // Native object
+ if (flavor.equals(DATA_FLAVOR)) {
+ return true;
+ }
+
+ // String
+ if (flavor.equals(java.awt.datatransfer.DataFlavor.stringFlavor)) {
+ return true;
+ }
+
+ // We can't do anything else
+ return false;
+ } // end isDataFlavorSupported
/* ******** I N N E R I N T E R F A C E F E T C H E R ******** */
- /**
- * Instead of passing your data directly to the
- * {@link TransferableObject} constructor, you may want to know exactly
- * when your data was received in case you need to remove it from its
- * source (or do anyting else to it). When the {@link #getTransferData
- * getTransferData(...)} method is called on the
- * {@link TransferableObject}, the {@link Fetcher}'s {@link #getObject
- * getObject()} method will be called.
- *
- * @author Robert Harder
- * @copyright 2001
- * @version 1.1
- * @since 1.1
- */
- public static interface Fetcher {
- /**
- * Return the object being encapsulated in the
- * {@link TransferableObject}.
- *
- * @return The dropped object
- * @since 1.1
- */
- public abstract Object getObject();
- } // end inner interface Fetcher
-
- } // end class TransferableObject
+ /**
+ * Instead of passing your data directly to the
+ * {@link TransferableObject} constructor, you may want to know exactly
+ * when your data was received in case you need to remove it from its
+ * source (or do anyting else to it). When the {@link #getTransferData
+ * getTransferData(...)} method is called on the
+ * {@link TransferableObject}, the {@link Fetcher}'s {@link #getObject
+ * getObject()} method will be called.
+ *
+ * @author Robert Harder
+ * @version 1.1
+ * @copyright 2001
+ * @since 1.1
+ */
+ public static interface Fetcher {
+ /**
+ * Return the object being encapsulated in the
+ * {@link TransferableObject}.
+ *
+ * @return The dropped object
+ * @since 1.1
+ */
+ public abstract Object getObject();
+ } // end inner interface Fetcher
+
+ } // end class TransferableObject
} // end class FileDrop
diff --git a/src/net/redwarp/tool/resizer/FileTools.java b/src/net/redwarp/tool/resizer/FileTools.java
index a7b1738..c613dfb 100644
--- a/src/net/redwarp/tool/resizer/FileTools.java
+++ b/src/net/redwarp/tool/resizer/FileTools.java
@@ -1,6 +1,4 @@
/*
- * Copyright 2012 redwarp
- *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -12,36 +10,32 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Copyright 2013 Redwarp
*/
package net.redwarp.tool.resizer;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
+import java.io.*;
public class FileTools {
- public static void copyfile(File input, File output) {
- try {
- InputStream in = new FileInputStream(input);
- OutputStream out = new FileOutputStream(output);
+ public static void copyfile(File input, File output) {
+ try {
+ InputStream in = new FileInputStream(input);
+ OutputStream out = new FileOutputStream(output);
- byte[] buf = new byte[1024];
- int len;
- while ((len = in.read(buf)) > 0) {
- out.write(buf, 0, len);
- }
- in.close();
- out.close();
- } catch (FileNotFoundException ex) {
- System.out
- .println(ex.getMessage() + " in the specified directory.");
- System.exit(0);
- } catch (IOException e) {
- System.out.println(e.getMessage());
- }
- }
+ byte[] buf = new byte[1024];
+ int len;
+ while ((len = in.read(buf)) > 0) {
+ out.write(buf, 0, len);
+ }
+ in.close();
+ out.close();
+ } catch (FileNotFoundException ex) {
+ System.out
+ .println(ex.getMessage() + " in the specified directory.");
+ System.exit(0);
+ } catch (IOException e) {
+ System.out.println(e.getMessage());
+ }
+ }
}
\ No newline at end of file
diff --git a/src/net/redwarp/tool/resizer/Main.java b/src/net/redwarp/tool/resizer/Main.java
index b8af067..9d947c4 100644
--- a/src/net/redwarp/tool/resizer/Main.java
+++ b/src/net/redwarp/tool/resizer/Main.java
@@ -1,6 +1,4 @@
/*
- * Copyright 2012 redwarp
- *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -12,34 +10,35 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Copyright 2013 Redwarp
*/
package net.redwarp.tool.resizer;
-import javax.swing.UIManager;
-import javax.swing.UnsupportedLookAndFeelException;
-
import net.redwarp.tool.resizer.misc.Localization;
import net.redwarp.tool.resizer.views.MainWindow;
+import javax.swing.*;
+
public class Main {
- public static void main(String[] args) {
- // Apple only stuff
- System.setProperty("apple.laf.useScreenMenuBar", "true");
- System.setProperty("com.apple.mrj.application.apple.menu.about.name",
- Localization.get("app_name"));
+ public static void main(String[] args) {
+ // Apple only stuff
+ System.setProperty("apple.laf.useScreenMenuBar", "true");
+ System.setProperty("com.apple.mrj.application.apple.menu.about.name",
+ Localization.get("app_name"));
- try {
- UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- } catch (InstantiationException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (UnsupportedLookAndFeelException e) {
- e.printStackTrace();
- }
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ } catch (InstantiationException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (UnsupportedLookAndFeelException e) {
+ e.printStackTrace();
+ }
- new MainWindow().setVisible(true);
- }
+ new MainWindow().setVisible(true);
+ }
}
diff --git a/src/net/redwarp/tool/resizer/misc/Localization.java b/src/net/redwarp/tool/resizer/misc/Localization.java
index 82a3a29..cdd6f23 100644
--- a/src/net/redwarp/tool/resizer/misc/Localization.java
+++ b/src/net/redwarp/tool/resizer/misc/Localization.java
@@ -1,6 +1,4 @@
/*
- * Copyright 2012 redwarp
- *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -12,6 +10,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Copyright 2013 Redwarp
*/
package net.redwarp.tool.resizer.misc;
@@ -20,21 +20,21 @@
import java.util.ResourceBundle;
public class Localization {
- private static ResourceBundle bundle = ResourceBundle.getBundle(
- "locale.Strings", Locale.getDefault(), new MyResourceControl());
+ private static ResourceBundle bundle = ResourceBundle.getBundle(
+ "locale.Strings", Locale.getDefault(), new MyResourceControl());
- public static String get(String key) {
- try {
- return bundle.getString(key);
- } catch (MissingResourceException e) {
- return new String(key);
- }
- }
+ public static String get(String key) {
+ try {
+ return bundle.getString(key);
+ } catch (MissingResourceException e) {
+ return new String(key);
+ }
+ }
- private static class MyResourceControl extends ResourceBundle.Control {
- @Override
- public Locale getFallbackLocale(String baseName, Locale locale) {
- return null;
- }
- }
+ private static class MyResourceControl extends ResourceBundle.Control {
+ @Override
+ public Locale getFallbackLocale(String baseName, Locale locale) {
+ return null;
+ }
+ }
}
diff --git a/src/net/redwarp/tool/resizer/misc/Preferences.java b/src/net/redwarp/tool/resizer/misc/Preferences.java
index d4483e3..269e035 100644
--- a/src/net/redwarp/tool/resizer/misc/Preferences.java
+++ b/src/net/redwarp/tool/resizer/misc/Preferences.java
@@ -1,6 +1,4 @@
/*
- * Copyright 2012 redwarp
- *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -12,6 +10,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Copyright 2013 Redwarp
*/
package net.redwarp.tool.resizer.misc;
@@ -19,10 +19,10 @@
import java.util.ResourceBundle;
public class Preferences {
- private static ResourceBundle bundle = ResourceBundle.getBundle(
- "misc.preferences", Locale.FRANCE);
+ private static ResourceBundle bundle = ResourceBundle.getBundle(
+ "misc.preferences", Locale.FRANCE);
- public static String getVersion() {
- return bundle.getString("version");
- }
+ public static String getVersion() {
+ return bundle.getString("version");
+ }
}
diff --git a/src/net/redwarp/tool/resizer/table/Operation.java b/src/net/redwarp/tool/resizer/table/Operation.java
index a5c13a3..e94298d 100644
--- a/src/net/redwarp/tool/resizer/table/Operation.java
+++ b/src/net/redwarp/tool/resizer/table/Operation.java
@@ -1,6 +1,4 @@
/*
- * Copyright 2012 redwarp
- *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -12,40 +10,42 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Copyright 2013 Redwarp
*/
package net.redwarp.tool.resizer.table;
import java.io.File;
public class Operation {
- private volatile OperationStatus status;
- private File file;
- private String message = null;
-
- public Operation(File f) {
- this.file = f;
- this.status = OperationStatus.PENDING;
- }
-
- public OperationStatus getStatus() {
- return this.status;
- }
-
- public File getFile() {
- return this.file;
- }
-
- public void setStatus(OperationStatus status) {
- this.status = status;
- this.message = null;
- }
-
- public void setStatus(OperationStatus status, String message) {
- this.status = status;
- this.message = message;
- }
-
- public String getMessage() {
- return this.message;
- }
+ private volatile OperationStatus status;
+ private File file;
+ private String message = null;
+
+ public Operation(File f) {
+ this.file = f;
+ this.status = OperationStatus.PENDING;
+ }
+
+ public OperationStatus getStatus() {
+ return this.status;
+ }
+
+ public File getFile() {
+ return this.file;
+ }
+
+ public void setStatus(OperationStatus status) {
+ this.status = status;
+ this.message = null;
+ }
+
+ public void setStatus(OperationStatus status, String message) {
+ this.status = status;
+ this.message = message;
+ }
+
+ public String getMessage() {
+ return this.message;
+ }
}
diff --git a/src/net/redwarp/tool/resizer/table/OperationStatus.java b/src/net/redwarp/tool/resizer/table/OperationStatus.java
index 2324be6..0ecc790 100644
--- a/src/net/redwarp/tool/resizer/table/OperationStatus.java
+++ b/src/net/redwarp/tool/resizer/table/OperationStatus.java
@@ -1,6 +1,4 @@
/*
- * Copyright 2012 redwarp
- *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -12,9 +10,11 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Copyright 2013 Redwarp
*/
package net.redwarp.tool.resizer.table;
public enum OperationStatus {
- PENDING, IN_PROGRESS, FINISH, ERROR
+ PENDING, IN_PROGRESS, FINISH, ERROR
}
diff --git a/src/net/redwarp/tool/resizer/table/ResultModel.java b/src/net/redwarp/tool/resizer/table/ResultModel.java
index 91d372c..b99a836 100644
--- a/src/net/redwarp/tool/resizer/table/ResultModel.java
+++ b/src/net/redwarp/tool/resizer/table/ResultModel.java
@@ -1,6 +1,4 @@
/*
- * Copyright 2012 redwarp
- *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -12,79 +10,80 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Copyright 2013 Redwarp
*/
package net.redwarp.tool.resizer.table;
+import net.redwarp.tool.resizer.misc.Localization;
+
+import javax.swing.table.AbstractTableModel;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-import javax.swing.table.AbstractTableModel;
-
-import net.redwarp.tool.resizer.misc.Localization;
-
public class ResultModel extends AbstractTableModel {
- private static final long serialVersionUID = -6799282358729483044L;
- private List