isami100のSwingin' Seasar日記

2000-01-03 s2study.ui.interceptors

AsyncInterceptor.java

package s2study.ui.interceptors;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

import s2study.ui.TaskPerformer;

public class AsyncInterceptor implements MethodInterceptor {

    public Object invoke(final MethodInvocation methodInvocation)
        throws Throwable {

        TaskPerformer taskPerformer = new TaskPerformer() {
            public final Object performTask() {
                Object ret = null;
                try {
                    ret = methodInvocation.proceed();
                }
                catch (Throwable th) {
                    taskFailed(th);
                }
                finally {
                    return ret;
                }
            }
            public final void finished() {
                taskFinished(get());
            }
        };
        taskStarted();
        taskPerformer.start();
        return null;
    }

    public void taskStarted() {
    }
    public Object taskFinished(final Object ret) {
        return ret;
    }
    public void taskFailed(Throwable th) throws Throwable {
        throw th;
    }

}

CenteringInterceptor.java

package s2study.ui.interceptors;

import java.awt.Rectangle;
import java.awt.Window;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

public class CenteringInterceptor implements MethodInterceptor {

    public Object invoke(MethodInvocation methodInvocation) throws Throwable {
        if (methodInvocation.getThis() instanceof Window) {
            Window window = (Window) methodInvocation.getThis();
            Rectangle screen = window.getGraphicsConfiguration().getBounds();
            window.setLocation(
                screen.x + screen.width / 2 - window.getSize().width / 2,
                screen.y + screen.height / 2 - window.getSize().height / 2);
        }
        return methodInvocation.proceed();
    }

}

DebugConclusion.java

package s2study.ui.interceptors;

import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

public class DebugConclusion implements MethodInterceptor {

    public Object invoke(MethodInvocation methodInvocation) throws Throwable {
        Object ret = methodInvocation.proceed();
        System.out.println("******** DebugConlusion Dump ********");
        dump(ret);
        return ret;
    }

    private void dump(Object ret) {
        if (ret instanceof List) {
            dump((List) ret);
        }
        else if (ret instanceof Object[]) {
            dump((Object[]) ret);
        }
        else if (ret instanceof Map) {
            dump((Map) ret);
        }
        else {
            System.out.println(ret);
        }
    }

    private void dump(List ret) {
        Iterator iter = ret.iterator();
        while (iter.hasNext()) {
            dump(iter.next());
        }
    }

    private void dump(Object[] ret) {
        for (int i = 0; i < ret.length; i++) {
            dump(ret[i]);
        }
    }

    private void dump(Map ret) {
        StringBuffer sbuff = new StringBuffer('{');
        Iterator iter = ret.keySet().iterator();
        while (iter.hasNext()) {
            Object key = iter.next();
            Object value = ret.get(key);
            sbuff.append(key).append(':').append(value).append(',');
        }
        sbuff.deleteCharAt(sbuff.length()).append('}');
        System.out.println(sbuff.toString());
    }

}

EmptyInterceptor.java

package s2study.ui.interceptors;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

public class EmptyInterceptor implements MethodInterceptor {

    public Object invoke(MethodInvocation methodInvocation) throws Throwable {
        return null;
    }

}

MessageBoxThrowsInterceptor.java

package s2study.ui.interceptors;

import javax.swing.JOptionPane;

import org.aopalliance.intercept.MethodInvocation;
import org.seasar.framework.aop.interceptors.ThrowsInterceptor;
import org.seasar.framework.exception.SRuntimeException;
import org.seasar.framework.message.MessageFormatter;

public class MessageBoxThrowsInterceptor extends ThrowsInterceptor {

    public void handleThrowable(
        SRuntimeException sre,
        MethodInvocation methodInvocation) {
        JOptionPane.showMessageDialog(
            null,
            sre.getMessage(),
            getMessageTitle(sre.getMessageCode()),
            getMessageType(sre.getMessageCode()));
    }

    public void handleThrowable(
        Throwable t,
        MethodInvocation methodInvocation) {
        JOptionPane.showMessageDialog(
            null,
            MessageFormatter.getSimpleMessage(
                "EAPP9999",
                new Object[] { t.getMessage()}),
            "SYSTEM ERROR",
            JOptionPane.ERROR_MESSAGE);
        t.printStackTrace();
    }

    private int getMessageType(final String messageCode) {
        if (messageCode.startsWith("E")) {
            return JOptionPane.ERROR_MESSAGE;
        }
        else if (messageCode.startsWith("W")) {
            return JOptionPane.WARNING_MESSAGE;
        }
        else if (messageCode.startsWith("I")) {
            return JOptionPane.INFORMATION_MESSAGE;
        }
        else
            return JOptionPane.PLAIN_MESSAGE;
    }

    private String getMessageTitle(final String messageCode) {
        if (messageCode.startsWith("E")) {
            return "ERROR";
        }
        else if (messageCode.startsWith("W")) {
            return "WORNING";
        }
        else if (messageCode.startsWith("I")) {
            return "INFO";
        }
        else {
            return "";
        }
    }

}

NullFormatInterceptor.java

package s2study.ui.interceptors;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

public class NullFormatInterceptor implements MethodInterceptor {

    public Object invoke(MethodInvocation methodInvocation) throws Throwable {
        Object[] args = methodInvocation.getArguments();
        if (args != null && args.length == 1) {
            if (args[0] instanceof String) {
                String source = (String) args[0];
                if (source == null || source.length() < 1) {
                    return null;
                }
            }
        }
        return methodInvocation.proceed();
    }

}

grits mp3grits mp32007/07/24 23:49<a href="http://www.duzkfiyo.cn/page74.html">honda civic dash trim</a> honda civic dash trim,<a href="http://www.duzkfiyo.cn/page68.html">eminem toy soldier video</a> eminem toy soldier video,<a href="http://www.duzkfiyo.cn/page79.html">africa physical maps</a> africa physical maps,<a href="http://www.duzkfiyo.cn/page61.html">horny blonde milf</a> horny blonde milf,<a href="http://www.duzkfiyo.cn/page75.html">free shaman king manga</a> free shaman king manga,<a href="http://www.duzkfiyo.cn/page89.html">incoming mail server for gmail</a> incoming mail server for gmail,<a href="http://www.duzkfiyo.cn/page85.html">dns not found</a> dns not found,<a href="http://www.duzkfiyo.cn/page57.html">free press release submit</a> free press release submit,<a href="http://www.duzkfiyo.cn/page90.html">ashley furniture bedding</a> ashley furniture bedding,<a href="http://www.duzkfiyo.cn/page55.html">bedroom themes for girls</a> bedroom themes for girls,

funny mp3 filesfunny mp3 files2007/07/25 14:41<a href="http://www.kvdkjofw.cn/page58.html">baby wipes warmer</a> baby wipes warmer,<a href="http://www.kvdkjofw.cn/page89.html">lace curtains with hearts</a> lace curtains with hearts,<a href="http://www.kvdkjofw.cn/page76.html">all nippon airline</a> all nippon airline,<a href="http://www.kvdkjofw.cn/page90.html">irs tax penalties</a> irs tax penalties,<a href="http://www.kvdkjofw.cn/page92.html">1989 acura integra</a> 1989 acura integra,<a href="http://www.kvdkjofw.cn/page85.html">cowboy hat tattoos</a> cowboy hat tattoos,<a href="http://www.kvdkjofw.cn/page82.html">batman themes</a> batman themes,<a href="http://www.kvdkjofw.cn/page92.html">acura integra tail lights</a> acura integra tail lights,<a href="http://www.kvdkjofw.cn/page87.html">2002 toyota 4 runner</a> 2002 toyota 4 runner,<a href="http://www.kvdkjofw.cn/page69.html">adult having sex</a> adult having sex,

el cajon zip codesel cajon zip codes2007/07/25 22:35<a href="http://www.qikawmhs.cn/page94.html">backup thunderbird mail</a> backup thunderbird mail,<a href="http://www.qikawmhs.cn/page52.html">dictionary of british slang</a> dictionary of british slang,<a href="http://www.qikawmhs.cn/page56.html">asc11 msn names</a> asc11 msn names,<a href="http://www.qikawmhs.cn/page57.html">advertising manager marketing</a> advertising manager marketing,<a href="http://www.qikawmhs.cn/page55.html">craigslist tdi jetta</a> craigslist tdi jetta,<a href="http://www.qikawmhs.cn/page68.html">craigslist .org</a> craigslist .org,<a href="http://www.qikawmhs.cn/page72.html">bmw military car sales</a> bmw military car sales,<a href="http://www.qikawmhs.cn/page58.html">call internet manager verizon</a> call internet manager verizon,<a href="http://www.qikawmhs.cn/page65.html">jeep cj 7</a> jeep cj 7,<a href="http://www.qikawmhs.cn/page65.html">jeep wrangler x accessories</a> jeep wrangler x accessories,

ask jeeves websask jeeves webs2007/07/26 02:36<a href="http://www.odikfhlu.cn/page81.html">irs teletax</a> irs teletax,<a href="http://www.odikfhlu.cn/page98.html">camera de sexo gratis</a> camera de sexo gratis,<a href="http://www.odikfhlu.cn/page53.html">bent over lil girls</a> bent over lil girls,<a href="http://www.odikfhlu.cn/page87.html">fake id club</a> fake id club,<a href="http://www.odikfhlu.cn/page75.html">cheap flights travel cheap air flight ticket lugano</a> cheap flights travel cheap air flight ticket lugano,<a href="http://www.odikfhlu.cn/page81.html">irs unclaimed tax refunds</a> irs unclaimed tax refunds,<a href="http://www.odikfhlu.cn/page99.html">free idvd 6 themes</a> free idvd 6 themes,<a href="http://www.odikfhlu.cn/page62.html">child entertainment new york</a> child entertainment new york,<a href="http://www.odikfhlu.cn/page92.html">download tupac music</a> download tupac music,<a href="http://www.odikfhlu.cn/page95.html">hot sexy comics</a> hot sexy comics,

full figure lingeriefull figure lingerie2007/07/26 04:49<a href="http://www.tgmgopbo.cn/page25.html">jessica simpson and nick lachey split up</a> jessica simpson and nick lachey split up,<a href="http://www.tgmgopbo.cn/page33.html">25th hour fuck</a> 25th hour fuck,<a href="http://www.tgmgopbo.cn/page25.html">jessica simpson and nick lachay</a> jessica simpson and nick lachay,<a href="http://www.tgmgopbo.cn/page46.html">2003 bmw z3</a> 2003 bmw z3,<a href="http://www.tgmgopbo.cn/page28.html">chart emerald get old pokemon sea</a> chart emerald get old pokemon sea,<a href="http://www.tgmgopbo.cn/page28.html">image pokemon</a> image pokemon,<a href="http://www.tgmgopbo.cn/page8.html">ebay atv tires</a> ebay atv tires,<a href="http://www.tgmgopbo.cn/page48.html">girls in distress</a> girls in distress,<a href="http://www.tgmgopbo.cn/page2.html">american football terminology</a> american football terminology,<a href="http://www.tgmgopbo.cn/page38.html">gary hawkins nfl</a> gary hawkins nfl,

creepy moviescreepy movies2007/07/26 05:47<a href="http://www.rwsoeecd.cn/page78.html">download free movie psp</a> download free movie psp,<a href="http://www.rwsoeecd.cn/page74.html">adult video game demo</a> adult video game demo,<a href="http://www.rwsoeecd.cn/page81.html">advanced aesthetics</a> advanced aesthetics,<a href="http://www.rwsoeecd.cn/page60.html">barbie car radio control</a> barbie car radio control,<a href="http://www.rwsoeecd.cn/page63.html">13 year old lesbians</a> 13 year old lesbians,<a href="http://www.rwsoeecd.cn/page62.html">history of the sears tower</a> history of the sears tower,<a href="http://www.rwsoeecd.cn/page92.html">composer movies</a> composer movies,<a href="http://www.rwsoeecd.cn/page76.html">best price psp sony</a> best price psp sony,<a href="http://www.rwsoeecd.cn/page73.html">czechoslovakian horse</a> czechoslovakian horse,<a href="http://www.rwsoeecd.cn/page64.html">how to make money on runescape</a> how to make money on runescape,

eagles football clubeagles football club2007/07/26 16:34<a href="http://www.geflfrpf.cn/page75.html">disney coloring peter pan and tinkerbell</a> disney coloring peter pan and tinkerbell,<a href="http://www.geflfrpf.cn/page65.html">hot bodies lightning stadium 2 speed box</a> hot bodies lightning stadium 2 speed box,<a href="http://www.geflfrpf.cn/page75.html">disney celebration hotel</a> disney celebration hotel,<a href="http://www.geflfrpf.cn/page90.html">hawaii wallpapers</a> hawaii wallpapers,<a href="http://www.geflfrpf.cn/page60.html">black monster cock fucking</a> black monster cock fucking,<a href="http://www.geflfrpf.cn/page52.html">free pokemon pictures</a> free pokemon pictures,<a href="http://www.geflfrpf.cn/page53.html">false claim</a> false claim,<a href="http://www.geflfrpf.cn/page69.html">2005 mustang forums</a> 2005 mustang forums,<a href="http://www.geflfrpf.cn/page70.html">fuck my wife videos</a> fuck my wife videos,<a href="http://www.geflfrpf.cn/page67.html">apply for teen jobs online</a> apply for teen jobs online,

black chubby menblack chubby men2007/07/26 22:01<a href="http://www.aqsoxdzg.cn/page50.html">fergie frederiksen</a> fergie frederiksen,<a href="http://www.aqsoxdzg.cn/page95.html">higgins beach webcam</a> higgins beach webcam,<a href="http://www.aqsoxdzg.cn/page74.html">2006 2005 mustang</a> 2006 2005 mustang,<a href="http://www.aqsoxdzg.cn/page98.html">free milf video</a> free milf video,<a href="http://www.aqsoxdzg.cn/page63.html">gay six pack hunks fuck each other</a> gay six pack hunks fuck each other,<a href="http://www.aqsoxdzg.cn/page70.html">house boat sales</a> house boat sales,<a href="http://www.aqsoxdzg.cn/page78.html">amazon girls</a> amazon girls,<a href="http://www.aqsoxdzg.cn/page67.html">accredited new jersey schools offering master degrees online</a> accredited new jersey schools offering master degrees online,<a href="http://www.aqsoxdzg.cn/page80.html">14 year old penis size</a> 14 year old penis size,<a href="http://www.aqsoxdzg.cn/page76.html">jeep grand cherokee bumpers</a> jeep grand cherokee bumpers,

asian girl picturesasian girl pictures2007/07/27 07:21<a href="http://www.oxmvglij.cn/page7.html">instep quick n lite bike trailer stroller reviews</a> instep quick n lite bike trailer stroller reviews,<a href="http://www.oxmvglij.cn/page45.html">90125 yes</a> 90125 yes,<a href="http://www.oxmvglij.cn/page10.html">free myspace inuyasha layout</a> free myspace inuyasha layout,<a href="http://www.oxmvglij.cn/page26.html">antique florida show tractor</a> antique florida show tractor,<a href="http://www.oxmvglij.cn/page6.html">direct mail letter</a> direct mail letter,<a href="http://www.oxmvglij.cn/page2.html">download runescape stats changer</a> download runescape stats changer,<a href="http://www.oxmvglij.cn/page1.html">batman joker riddler costume</a> batman joker riddler costume,<a href="http://www.oxmvglij.cn/page19.html">download msn plus for free</a> download msn plus for free,<a href="http://www.oxmvglij.cn/page38.html">check in/ check out list for concession stand</a> check in/ check out list for concession stand,<a href="http://www.oxmvglij.cn/page31.html">free trannie porn</a> free trannie porn,

cold war wikipediacold war wikipedia2007/07/27 09:57<a href="http://www.xhhywdro.cn/page15.html">aol instant messenger free themes</a> aol instant messenger free themes,<a href="http://www.xhhywdro.cn/page41.html">fergie pees on stage</a> fergie pees on stage,<a href="http://www.xhhywdro.cn/page26.html">irs 2005 tax deduction</a> irs 2005 tax deduction,<a href="http://www.xhhywdro.cn/page23.html">handheld chess game</a> handheld chess game,<a href="http://www.xhhywdro.cn/page36.html">download simpsons games</a> download simpsons games,<a href="http://www.xhhywdro.cn/page41.html">fergie nud</a> fergie nud,<a href="http://www.xhhywdro.cn/page35.html">fergie black eyed peas gallery</a> fergie black eyed peas gallery,<a href="http://www.xhhywdro.cn/page24.html">elevator love letter by stars music code for xanga</a> elevator love letter by stars music code for xanga,<a href="http://www.xhhywdro.cn/page32.html">blowjob machine</a> blowjob machine,<a href="http://www.xhhywdro.cn/page12.html">book phone verizon wireless</a> book phone verizon wireless,

irs tax problemirs tax problem2007/07/27 22:16 <a href="http://www.jgxtrrym.cn/page13.html">dogs and cats forever</a> <a href="http://www.jgxtrrym.cn/page6.html">earth google pro torrent</a> <a href="http://www.jgxtrrym.cn/page12.html">far from the home i love</a> <a href="http://www.jgxtrrym.cn/page23.html">kid games and cartoones</a> <a href="http://www.jgxtrrym.cn/page29.html">amazon river fishing trips</a> <a href="http://www.jgxtrrym.cn/page10.html">club pogo .com</a> <a href="http://www.jgxtrrym.cn/page8.html">bates city meta tags</a> <a href="http://www.jgxtrrym.cn/page15.html">dating european</a> <a href="http://www.jgxtrrym.cn/page5.html">format inuyasha mp3 song</a> <a href="http://www.jgxtrrym.cn/page22.html">false spirea</a> [url="http://www.jgxtrrym.cn/page13.html"]dogs and cats forever[/url] [url="http://www.jgxtrrym.cn/page6.html"]earth google pro torrent[/url] [url="http://www.jgxtrrym.cn/page12.html"]far from the home i love[/url] [url="http://www.jgxtrrym.cn/page23.html"]kid games and cartoones[/url] [url="http://www.jgxtrrym.cn/page29.html"]amazon river fishing trips[/url] [url="http://www.jgxtrrym.cn/page10.html"]club pogo .com[/url] [url="http://www.jgxtrrym.cn/page8.html"]bates city meta tags[/url] [url="http://www.jgxtrrym.cn/page15.html"]dating european[/url] [url="http://www.jgxtrrym.cn/page5.html"]format inuyasha mp3 song[/url] [url="http://www.jgxtrrym.cn/page22.html"]false spirea[/url]