示例#1
0
 public static org.lgna.project.ast.NamedUserType
     getNamedUserTypeFromPersonResourceInstanceCreation(
         org.lgna.project.ast.InstanceCreation instanceCreation) {
   org.lgna.project.ast.JavaType bipedType =
       org.lgna.project.ast.JavaType.getInstance(org.lgna.story.SBiped.class);
   org.lgna.project.ast.AbstractType<?, ?, ?>[] argumentTypes =
       getArgumentTypes(bipedType, instanceCreation.getType());
   return getNamedUserTypeFor(bipedType, argumentTypes, 0, null);
 }
 public static SetOpacityMethodInvocationFillIn getInstance(
     org.alice.ide.instancefactory.InstanceFactory instanceFactory,
     Class<?> cls,
     String methodName,
     Class<?>... parameterClses) {
   return getInstance(
       instanceFactory,
       org.lgna.project.ast.JavaType.getInstance(cls),
       methodName,
       parameterClses);
 }
 @Override
 protected void migrate(
     org.lgna.project.ast.MethodInvocation methodInvocation,
     org.lgna.project.Project projectIfApplicable) {
   org.lgna.project.ast.AbstractMethod method = methodInvocation.method.getValue();
   if (method instanceof org.lgna.project.ast.JavaMethod) {
     org.lgna.project.ast.JavaMethod javaMethod = (org.lgna.project.ast.JavaMethod) method;
     if (javaMethod.getDeclaringType()
         == org.lgna.project.ast.JavaType.getInstance(org.lgna.story.SScene.class)) {
       String methodName = javaMethod.getName();
       if (methodName.equals("addMouseClickOnScreenListener")) {
         for (org.lgna.project.ast.AbstractArgument argument : methodInvocation.keyedArguments) {
           if (DEBUG_MODE) {
             edu.cmu.cs.dennisc.java.util.logging.Logger.errln(
                 "ALERT: migration removing", argument);
           }
         }
         methodInvocation.keyedArguments.clear();
         methodInvocation.method.setValue(
             org.lgna.story.ast.EventListenerMethodUtilities
                 .ADD_MOUSE_CLICK_ON_SCREEN_LISTENER_METHOD);
       } else if (methodName.equals("addMouseClickOnObjectListener")) {
         for (org.lgna.project.ast.AbstractArgument argument : methodInvocation.keyedArguments) {
           if (DEBUG_MODE) {
             edu.cmu.cs.dennisc.java.util.logging.Logger.errln(
                 "ALERT: migration removing", argument);
           }
         }
         methodInvocation.keyedArguments.clear();
         methodInvocation.method.setValue(
             org.lgna.story.ast.EventListenerMethodUtilities
                 .ADD_MOUSE_CLICK_ON_OBJECT_LISTENER_METHOD);
       }
     }
   }
 }