Some minor clean-up before release.

- Removing some deprecated stuff
- Moving unused classes to sandbox
This commit is contained in:
Harald Kuhr 2009-10-20 21:10:20 +02:00
parent b5a5d9b79f
commit ac68a31c36
15 changed files with 726 additions and 715 deletions

View File

@ -878,7 +878,7 @@ public final class FileUtil {
File folder = resolve(pFolder);
if (!(/*folder.exists() &&*/folder.isDirectory() && folder.canRead())) {
// NOTE: exists is implictly called by isDirectory
// NOTE: exists is implicitly called by isDirectory
throw new FileNotFoundException("\"" + pFolder + "\" is not a directory or is not readable.");
}

View File

@ -156,8 +156,8 @@ public class FilenameMaskFilter implements FilenameFilter {
* This method implements the {@code java.io.FilenameFilter} interface.
*
* @param pDir the directory in which the file was found.
* @param pName the pName of the file.
* @return {@code true} if the pName should be included in the file
* @param pName the name of the file.
* @return {@code true} if the file {@code pName} should be included in the file
* list; {@code false} otherwise.
*/
public boolean accept(File pDir, String pName) {

View File

@ -53,7 +53,7 @@ public class StringArrayReader extends StringReader {
/**
* Create a new string array reader.
*
* @param pStrings <tt>String</tt>s providing the character stream.
* @param pStrings {@code String}s providing the character stream.
*/
public StringArrayReader(final String[] pStrings) {
super("");

View File

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.twelvemonkeys.imageio</groupId>
<artifactId>twelvemonkeys-imageio-jmagick</artifactId>
<version>2.2-SNAPSHOT</version>
<version>2.2</version>
<name>TwelveMonkeys ImageIO JMagick Plugin</name>
<description>
<![CDATA[
@ -17,7 +17,7 @@
<parent>
<artifactId>twelvemonkeys-imageio</artifactId>
<groupId>com.twelvemonkeys</groupId>
<version>2.2-SNAPSHOT</version>
<version>2.2</version>
</parent>
<dependencies>

View File

@ -28,10 +28,13 @@
package com.twelvemonkeys.imageio.plugins.pict;
import com.twelvemonkeys.image.ConvolveTester;
import com.twelvemonkeys.image.BufferedImageIcon;
import com.twelvemonkeys.image.ImageUtil;
import javax.swing.*;
import java.awt.image.BufferedImage;
import java.awt.*;
import java.lang.reflect.InvocationTargetException;
/**
* QDTest
@ -125,6 +128,34 @@ public class QDTest {
context.closePicture();
}
ConvolveTester.showIt(image, "QuickDraw Test");
showIt(image, "QuickDraw Test");
}
public static void showIt(final BufferedImage pImage, final String pTitle) {
try {
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
JFrame frame = new JFrame(pTitle);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setLocationByPlatform(true);
JPanel pane = new JPanel(new BorderLayout());
GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
BufferedImageIcon icon = new BufferedImageIcon(ImageUtil.accelerate(pImage, gc));
JScrollPane scroll = new JScrollPane(new JLabel(icon));
scroll.setBorder(null);
pane.add(scroll);
frame.setContentPane(pane);
frame.pack();
frame.setVisible(true);
}
});
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
catch (InvocationTargetException e) {
throw new RuntimeException(e);
}
}
}

View File

@ -29,7 +29,6 @@
package com.twelvemonkeys.servlet;
import com.twelvemonkeys.lang.StringUtil;
import com.twelvemonkeys.util.DebugUtil;
import com.twelvemonkeys.util.convert.ConversionException;
import com.twelvemonkeys.util.convert.Converter;
@ -45,6 +44,7 @@ import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Date;
import java.util.Enumeration;
import java.util.List;
import java.util.Map;
@ -154,7 +154,7 @@ public final class ServletUtil {
// public static T getParameter<T>(ServletRequest pReq, String pName,
// String pFormat, T pDefault) {
static Object getParameter(ServletRequest pReq, String pName, Class pType, String pFormat, Object pDefault) {
static <T> T getParameter(ServletRequest pReq, String pName, Class<T> pType, String pFormat, T pDefault) {
// Test if pDefault is either null or instance of pType
if (pDefault != null && !pType.isInstance(pDefault)) {
throw new IllegalArgumentException("default value not instance of " + pType + ": " + pDefault.getClass());
@ -166,7 +166,7 @@ public final class ServletUtil {
return pDefault;
}
try {
return Converter.getInstance().toObject(str, pType, pFormat);
return pType.cast(Converter.getInstance().toObject(str, pType, pFormat));
}
catch (ConversionException ce) {
return pDefault;
@ -949,14 +949,14 @@ public final class ServletUtil {
// recieved the request
buffer.append(indentation);
buffer.append("Last accessed time: ");
buffer.append(DebugUtil.getTimestamp(pHttpSession.getLastAccessedTime()));
buffer.append(new Date(pHttpSession.getLastAccessedTime()));
buffer.append("\n");
// Returns the time when this session was created, measured in
// milliseconds since midnight January 1, 1970 GMT
buffer.append(indentation);
buffer.append("Creation time: ");
buffer.append(DebugUtil.getTimestamp(pHttpSession.getCreationTime()));
buffer.append(new Date(pHttpSession.getCreationTime()));
buffer.append("\n");
// Returns true if the client does not yet know about the session