Package edu.cmu.cs.stage3.alice.core

Examples of edu.cmu.cs.stage3.alice.core.Transformable


        // look

        subject.getTransformableValue().turnRightNow(Direction.FORWARD,turning.x);


        Transformable t = new Transformable();
        t.setPositionRightNow(subject.getTransformableValue().getPosition());
        t.setOrientationRightNow(subject.getTransformableValue().vehicle.getReferenceFrameValue().getOrientationAsQuaternion());

        subject.getTransformableValue().turnRightNow(Direction.RIGHT,turning.y,t);

        turning.x = 0;
        turning.y = 0;
View Full Code Here


public abstract class SizeAlongDimensionQuestion extends Question {
  public final TransformableProperty subject = new TransformableProperty( this, "subject", null );
  protected abstract Dimension getDimension();
  public Object getValue() {
    Transformable subjectValue = subject.getTransformableValue();
    if( subjectValue!=null ) {
      return new Double( subjectValue.getSizeAlongDimension( getDimension() ) );
    } else {
      return null;
    }
  }
View Full Code Here

public abstract class SubjectQuestion extends Question {
  public final TransformableProperty subject = new TransformableProperty( this, "subject", null );
  protected abstract Object getValue( Transformable subjectValue );
  public Object getValue() {
    Transformable subjectValue = subject.getTransformableValue();
    return getValue( subjectValue );
  }
View Full Code Here

  }
  public void mousePressed( java.awt.event.MouseEvent mouseEvent ) {
    updateDetails( mouseEvent );
    if( isEnabled.booleanValue() ) {
      if( checkModifierMask( mouseEvent ) ) {
        Transformable onWhatValue = onWhat.getTransformableValue();
        boolean success;
        if( onWhatValue!=null ) {
          edu.cmu.cs.stage3.alice.scenegraph.renderer.PickInfo pickInfo = RenderTarget.pick( mouseEvent );
          if( pickInfo.getCount()>0 ) {
            Model model = (Model)( pickInfo.getVisualAt( 0 ).getBonus() );
            success = onWhatValue == model || onWhatValue.isAncestorOf( model );
          } else {
            success = false;
          }
        } else {
          success = true;
View Full Code Here

  public final TransformableProperty toWhom = new TransformableProperty( this, "toWhom", null );
  public class RuntimeSendMessage extends RuntimeResponse {
    public void prologue( double t ) {
      super.prologue( t );
      String messageValue = SendMessage.this.message.getStringValue();
      Transformable fromWhoValue = SendMessage.this.fromWho.getTransformableValue();
      Transformable toWhomValue = SendMessage.this.toWhom.getTransformableValue();
      World world = getWorld();
      if( world!=null ) {
        world.sendMessage( SendMessage.this, messageValue, fromWhoValue, toWhomValue, System.currentTimeMillis() );
      }
    }
View Full Code Here

    keyChar.valueClass.set( Character.class );
    details.add( keyChar );
  }
  private void updateDetails( java.awt.event.KeyEvent keyEvent ) {
    for( int i=0; i<details.size(); i++ ) {
      Variable detail = (Variable)details.get( i );
      if( detail.name.getStringValue().equals( "keyChar" ) ) {
        detail.value.set( new Character( keyEvent.getKeyChar() ) );
      }
    }
  }
View Full Code Here

    }
  }
  public void manufactureDetails() {
    super.manufactureDetails();

    Variable x = new Variable();
    x.name.set( "x" );
    x.setParent( this );
    x.valueClass.set( Number.class );
    details.add( x );

    Variable y = new Variable();
    y.name.set( "y" );
    y.setParent( this );
    y.valueClass.set( Number.class );
    details.add( y );

    manufactureAnyNecessaryDetails();
  }
View Full Code Here

  public Object getValue() {
    Transformable ownerValue = owner.getTransformableValue();
    String nameValue = variableName.getStringValue();
        if( ownerValue != null ) {
            for( int i=0; i<ownerValue.variables.size(); i++ ) {
                Variable variableI = (Variable)ownerValue.variables.get( i );
                if( variableI != null ) {
                    String nameI = variableI.name.getStringValue();
                    if( nameI != null ) {
                        if( ignoreCase.booleanValue() ) {
                            if( nameI.equalsIgnoreCase( nameValue ) ) {
                                return variableI.getValue();
                            }
                        } else {
                            if( nameI.equals( nameValue ) ) {
                                return variableI.getValue();
                            }
                        }
                    }
                }
            }
View Full Code Here

    details.add( toWhom );
  }

  private void updateDetails( edu.cmu.cs.stage3.alice.core.event.MessageEvent messageEvent ) {
    for( int i=0; i<details.size(); i++ ) {
      Variable detail = (Variable)details.get( i );
      if( detail.name.getStringValue().equals( "message" ) ) {
        detail.value.set( messageEvent.getMessage() );
      } else if( detail.name.getStringValue().equals( "fromWho" ) ) {
        detail.value.set( messageEvent.getFromWho() );
      } else if( detail.name.getStringValue().equals( "toWhom" ) ) {
View Full Code Here

    details.add( code );
  }

  private void updateDetails( java.awt.event.KeyEvent keyEvent ) {
    for( int i=0; i<details.size(); i++ ) {
      Variable detail = (Variable)details.get( i );
      if( detail.name.getStringValue().equals( "keyChar" ) ) {
        detail.value.set( new Character( keyEvent.getKeyChar() ) );
      } else if( detail.name.getStringValue().equals( "code" ) ) {
        detail.value.set( new Integer( keyEvent.getKeyCode() ) );
      }
View Full Code Here

TOP

Related Classes of edu.cmu.cs.stage3.alice.core.Transformable

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.