package jas2.swingstudio;
import java.lang.reflect.*;
import java.awt.*;
import java.awt.event.*;
import jas2.util.*;
public class JASCommandProcessor extends CommandProcessor
{
protected void invokeCommand(SimpleTarget t)
{
Cursor oldCursor = JavaAnalysisStudio.getApp().getFrame().getCursor();
try
{
JavaAnalysisStudio.getApp().getFrame().setCursor(new Cursor(Cursor.WAIT_CURSOR));
t.doCommand();
}
catch (CommandInvocationException e)
{
Throwable target = e.getTargetException();
if (target instanceof JASException)
{
JASException x = (JASException) target;
JavaAnalysisStudio.getApp().error(x.getMessage(),x.getNestedException());
}
else
{
JavaAnalysisStudio.getApp().error("Unexpected exception during command processing",target);
}
}
finally
{
JavaAnalysisStudio.getApp().getFrame().setCursor(oldCursor);
}
}
protected void invoke(Method method,Object[] args)
throws IllegalAccessException, InvocationTargetException
{
method.invoke(this,args);
}
}
Ads help maintain this website.