Package edu.cmu.cs.stage3.util

Examples of edu.cmu.cs.stage3.util.HowMuch


  }

  protected void fireWorldUnLoaded(edu.cmu.cs.stage3.alice.core.World world) {
    AuthoringToolStateChangedEvent ev = new AuthoringToolStateChangedEvent(AuthoringToolStateChangedEvent.AUTHORING_STATE, AuthoringToolStateChangedEvent.AUTHORING_STATE, world);
    for (java.util.Iterator iter = stateListeners.iterator(); iter.hasNext();) {
      AuthoringToolStateListener listener = (AuthoringToolStateListener) iter.next();
      try {
        listener.worldUnLoaded(ev);
      } catch (Throwable t) {
        AuthoringTool.showErrorDialog("Error in listener responding to world unloaded.", t);
      }
    }
  }
View Full Code Here


  }

  protected void fireWorldStarted(int previousState, int currentState, edu.cmu.cs.stage3.alice.core.World world) {
    AuthoringToolStateChangedEvent ev = new AuthoringToolStateChangedEvent(previousState, currentState, world);
    for (java.util.Iterator iter = stateListeners.iterator(); iter.hasNext();) {
      AuthoringToolStateListener listener = (AuthoringToolStateListener) iter.next();
      try {
        listener.worldStarted(ev);
      } catch (Throwable t) {
        AuthoringTool.showErrorDialog("Error in listener responding to world started.", t);
      }
    }
  }
View Full Code Here

  }

  protected void fireWorldStopped(int previousState, int currentState, edu.cmu.cs.stage3.alice.core.World world) {
    AuthoringToolStateChangedEvent ev = new AuthoringToolStateChangedEvent(previousState, currentState, world);
    for (java.util.Iterator iter = stateListeners.iterator(); iter.hasNext();) {
      AuthoringToolStateListener listener = (AuthoringToolStateListener) iter.next();
      try {
        listener.worldStopped(ev);
      } catch (Throwable t) {
        AuthoringTool.showErrorDialog("Error in listener responding to world stopped.", t);
      }
    }
  }
View Full Code Here

  }

  protected void fireWorldPaused(int previousState, int currentState, edu.cmu.cs.stage3.alice.core.World world) {
    AuthoringToolStateChangedEvent ev = new AuthoringToolStateChangedEvent(previousState, currentState, world);
    for (java.util.Iterator iter = stateListeners.iterator(); iter.hasNext();) {
      AuthoringToolStateListener listener = (AuthoringToolStateListener) iter.next();
      try {
        listener.worldPaused(ev);
      } catch (Throwable t) {
        AuthoringTool.showErrorDialog("Error in listener responding to world paused.", t);
      }
    }
  }
View Full Code Here

  }

  protected void fireWorldSaved(edu.cmu.cs.stage3.alice.core.World world) {
    AuthoringToolStateChangedEvent ev = new AuthoringToolStateChangedEvent(AuthoringToolStateChangedEvent.AUTHORING_STATE, AuthoringToolStateChangedEvent.AUTHORING_STATE, world);
    for (java.util.Iterator iter = stateListeners.iterator(); iter.hasNext();) {
      AuthoringToolStateListener listener = (AuthoringToolStateListener) iter.next();
      try {
        listener.worldSaved(ev);
      } catch (Throwable t) {
        AuthoringTool.showErrorDialog("Error in listener responding to world saved.", t);
      }
    }
  }
View Full Code Here

public abstract class ArrayNumberQuestion extends edu.cmu.cs.stage3.alice.core.question.NumberQuestion {
  public final ArrayProperty array = new ArrayProperty( this, "array", null );
  //protected abstract double getValue( Array array );
  protected abstract int getValue( Array array );
  public Object getValue() {
    Array arrayValue = array.getArrayValue();
    if( arrayValue!=null ) {
            return new Integer( getValue( arrayValue ) );
    } else {
      return null;
    }
View Full Code Here

  protected abstract Object getValue( Array array );
    public Class getValueClass() {
        return array.getArrayValue().valueClass.getClassValue();
    }
  public Object getValue() {
    Array arrayValue = array.getArrayValue();
    if( arrayValue!=null ) {
            return getValue( arrayValue );
    } else {
      return null;
    }
View Full Code Here

  public final UserDefinedQuestionProperty userDefinedQuestion = new UserDefinedQuestionProperty( this, "userDefinedQuestion", null );
  public final ElementArrayProperty requiredActualParameters = new ElementArrayProperty( this, "requiredActualParameters", null, Variable[].class );
  public final ElementArrayProperty keywordActualParameters = new ElementArrayProperty( this, "keywordActualParameters", null, Variable[].class );
    public Object getValue() {
        UserDefinedQuestion userDefinedQuestionValue = userDefinedQuestion.getUserDefinedQuestionValue();
        Behavior currentBehavior = null;
        World world = getWorld();
        if( world != null ) {
            Sandbox sandbox = world.getCurrentSandbox();
            if( sandbox!=null ) {
                currentBehavior = sandbox.getCurrentBehavior();
            } else {
                //System.err.println( "current sandbox is null" );
            }
        } else {
            //System.err.println( "world is null" );
        }
    if( currentBehavior != null ) {
      currentBehavior.pushStack(
        (Variable[])CallToUserDefinedQuestion.this.requiredActualParameters.getArrayValue(),
        (Variable[])CallToUserDefinedQuestion.this.keywordActualParameters.getArrayValue(),
        (Variable[])userDefinedQuestionValue.requiredFormalParameters.getArrayValue(),
        (Variable[])userDefinedQuestionValue.keywordFormalParameters.getArrayValue(),
        (Variable[])userDefinedQuestionValue.localVariables.getArrayValue(),
        true
      );
      Object returnValue = userDefinedQuestionValue.getValue();
      currentBehavior.popStack();
      return returnValue;
    } else {
      return null;
    }
    }
View Full Code Here

          light = pointLight;
        }
        model = light;
        sgLight.setBonus( model );
      } else if( sgCamera != null ) {
        Camera camera = null;
        if( sgCamera instanceof edu.cmu.cs.stage3.alice.scenegraph.SymmetricPerspectiveCamera ) {
          SymmetricPerspectiveCamera symmetricPerspectiveCamera = new SymmetricPerspectiveCamera();
          camera = symmetricPerspectiveCamera;
        } else if( sgCamera instanceof edu.cmu.cs.stage3.alice.scenegraph.PerspectiveCamera ) {
          PerspectiveCamera perspectiveCamera = new PerspectiveCamera();
View Full Code Here

  }
  public class RuntimeMoveAnimation extends RuntimeDirectionAmountTransformAnimation {
    private javax.vecmath.Vector3d m_vector;
    private javax.vecmath.Vector3d m_vectorPrev;
    protected javax.vecmath.Vector3d getVector() {
      Direction directionValue = MoveAnimation.this.direction.getDirectionValue();
      double amountValue = MoveAnimation.this.amount.doubleValue();
      if( directionValue!=null && !Double.isNaN( amountValue ) ) {
        javax.vecmath.Vector3d v = edu.cmu.cs.stage3.math.MathUtilities.multiply( directionValue.getMoveAxis(), amountValue );
        if( MoveAnimation.this.isScaledBySize.booleanValue() ) {
          javax.vecmath.Vector3d subjectSize = m_subject.getSize();
          v.x *= subjectSize.x;
          v.y *= subjectSize.y;
          v.z *= subjectSize.z;
View Full Code Here

TOP

Related Classes of edu.cmu.cs.stage3.util.HowMuch

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.