mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-08-04 12:05:29 -04:00
Some minor clean-up before release.
- Removing some deprecated stuff - Moving unused classes to sandbox
This commit is contained in:
parent
b5a5d9b79f
commit
ac68a31c36
@ -878,7 +878,7 @@ public final class FileUtil {
|
|||||||
|
|
||||||
File folder = resolve(pFolder);
|
File folder = resolve(pFolder);
|
||||||
if (!(/*folder.exists() &&*/folder.isDirectory() && folder.canRead())) {
|
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.");
|
throw new FileNotFoundException("\"" + pFolder + "\" is not a directory or is not readable.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,8 +156,8 @@ public class FilenameMaskFilter implements FilenameFilter {
|
|||||||
* This method implements the {@code java.io.FilenameFilter} interface.
|
* This method implements the {@code java.io.FilenameFilter} interface.
|
||||||
*
|
*
|
||||||
* @param pDir the directory in which the file was found.
|
* @param pDir the directory in which the file was found.
|
||||||
* @param pName the pName of the file.
|
* @param pName the name of the file.
|
||||||
* @return {@code true} if the pName should be included in the file
|
* @return {@code true} if the file {@code pName} should be included in the file
|
||||||
* list; {@code false} otherwise.
|
* list; {@code false} otherwise.
|
||||||
*/
|
*/
|
||||||
public boolean accept(File pDir, String pName) {
|
public boolean accept(File pDir, String pName) {
|
||||||
|
@ -53,7 +53,7 @@ public class StringArrayReader extends StringReader {
|
|||||||
/**
|
/**
|
||||||
* Create a new string array reader.
|
* 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) {
|
public StringArrayReader(final String[] pStrings) {
|
||||||
super("");
|
super("");
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -5,7 +5,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||||
<artifactId>twelvemonkeys-imageio-jmagick</artifactId>
|
<artifactId>twelvemonkeys-imageio-jmagick</artifactId>
|
||||||
<version>2.2-SNAPSHOT</version>
|
<version>2.2</version>
|
||||||
<name>TwelveMonkeys ImageIO JMagick Plugin</name>
|
<name>TwelveMonkeys ImageIO JMagick Plugin</name>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
@ -17,7 +17,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>twelvemonkeys-imageio</artifactId>
|
<artifactId>twelvemonkeys-imageio</artifactId>
|
||||||
<groupId>com.twelvemonkeys</groupId>
|
<groupId>com.twelvemonkeys</groupId>
|
||||||
<version>2.2-SNAPSHOT</version>
|
<version>2.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
35
twelvemonkeys-imageio/pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/QDTest.java
Executable file → Normal file
35
twelvemonkeys-imageio/pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/QDTest.java
Executable file → Normal file
@ -28,10 +28,13 @@
|
|||||||
|
|
||||||
package com.twelvemonkeys.imageio.plugins.pict;
|
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.image.BufferedImage;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* QDTest
|
* QDTest
|
||||||
@ -125,6 +128,34 @@ public class QDTest {
|
|||||||
context.closePicture();
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,6 @@
|
|||||||
package com.twelvemonkeys.servlet;
|
package com.twelvemonkeys.servlet;
|
||||||
|
|
||||||
import com.twelvemonkeys.lang.StringUtil;
|
import com.twelvemonkeys.lang.StringUtil;
|
||||||
import com.twelvemonkeys.util.DebugUtil;
|
|
||||||
import com.twelvemonkeys.util.convert.ConversionException;
|
import com.twelvemonkeys.util.convert.ConversionException;
|
||||||
import com.twelvemonkeys.util.convert.Converter;
|
import com.twelvemonkeys.util.convert.Converter;
|
||||||
|
|
||||||
@ -45,6 +44,7 @@ import java.lang.reflect.Method;
|
|||||||
import java.lang.reflect.Proxy;
|
import java.lang.reflect.Proxy;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -154,7 +154,7 @@ public final class ServletUtil {
|
|||||||
|
|
||||||
// public static T getParameter<T>(ServletRequest pReq, String pName,
|
// public static T getParameter<T>(ServletRequest pReq, String pName,
|
||||||
// String pFormat, T pDefault) {
|
// 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
|
// Test if pDefault is either null or instance of pType
|
||||||
if (pDefault != null && !pType.isInstance(pDefault)) {
|
if (pDefault != null && !pType.isInstance(pDefault)) {
|
||||||
throw new IllegalArgumentException("default value not instance of " + pType + ": " + pDefault.getClass());
|
throw new IllegalArgumentException("default value not instance of " + pType + ": " + pDefault.getClass());
|
||||||
@ -166,7 +166,7 @@ public final class ServletUtil {
|
|||||||
return pDefault;
|
return pDefault;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
return Converter.getInstance().toObject(str, pType, pFormat);
|
return pType.cast(Converter.getInstance().toObject(str, pType, pFormat));
|
||||||
}
|
}
|
||||||
catch (ConversionException ce) {
|
catch (ConversionException ce) {
|
||||||
return pDefault;
|
return pDefault;
|
||||||
@ -949,14 +949,14 @@ public final class ServletUtil {
|
|||||||
// recieved the request
|
// recieved the request
|
||||||
buffer.append(indentation);
|
buffer.append(indentation);
|
||||||
buffer.append("Last accessed time: ");
|
buffer.append("Last accessed time: ");
|
||||||
buffer.append(DebugUtil.getTimestamp(pHttpSession.getLastAccessedTime()));
|
buffer.append(new Date(pHttpSession.getLastAccessedTime()));
|
||||||
buffer.append("\n");
|
buffer.append("\n");
|
||||||
|
|
||||||
// Returns the time when this session was created, measured in
|
// Returns the time when this session was created, measured in
|
||||||
// milliseconds since midnight January 1, 1970 GMT
|
// milliseconds since midnight January 1, 1970 GMT
|
||||||
buffer.append(indentation);
|
buffer.append(indentation);
|
||||||
buffer.append("Creation time: ");
|
buffer.append("Creation time: ");
|
||||||
buffer.append(DebugUtil.getTimestamp(pHttpSession.getCreationTime()));
|
buffer.append(new Date(pHttpSession.getCreationTime()));
|
||||||
buffer.append("\n");
|
buffer.append("\n");
|
||||||
|
|
||||||
// Returns true if the client does not yet know about the session
|
// Returns true if the client does not yet know about the session
|
||||||
|
Loading…
x
Reference in New Issue
Block a user