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

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


  public abstract class RuntimeRotateAtSpeed extends RuntimeDirectionSpeedTransformResponse {
    private javax.vecmath.Vector3d m_axis;
    protected abstract javax.vecmath.Vector3d getAxis( edu.cmu.cs.stage3.alice.core.Direction direction );
    public void prologue( double t ) {
      super.prologue( t );
      Direction directionValue = RotateAtSpeed.this.direction.getDirectionValue();
      m_axis = getAxis( directionValue );
      if( m_axis == null ) {
        StringBuffer sb = new StringBuffer( "direction value must not be " );
        if( directionValue != null ) {
          sb.append( directionValue.getRepr() );
        } else {
          sb.append( "null" );
        }
        sb.append( '.' );
        throw new edu.cmu.cs.stage3.alice.core.SimulationPropertyException( sb.toString(), null, RotateAtSpeed.this.direction );
View Full Code Here


public class ChildNamed extends Question {
  public final ElementProperty parent = new ElementProperty( this, "parent", null );
  public final StringProperty name = new StringProperty( this, "name", "" );
  public final BooleanProperty ignoreCase = new BooleanProperty( this, "ignoreCase", Boolean.TRUE );
  public Object getValue() {
    Element parentValue = parent.getElementValue();
    String nameValue = name.getStringValue();
    if( ignoreCase.booleanValue() ) {
      return parentValue.getChildNamed( nameValue );
    } else {
      return parentValue.getChildNamedIgnoreCase( nameValue );
    }
  }
View Full Code Here

        Element[] src = getElementArrayValue();
        Element[] dst = (Element[])java.lang.reflect.Array.newInstance( getComponentType(), src.length );
        System.arraycopy( src, 0, dst, 0, dst.length );
        java.util.Arrays.sort( dst, new java.util.Comparator() {
            public int compare( Object o1, Object o2 ) {
                Element e1 = (Element)o1;
                Element e2 = (Element)o2;
                String n1 = e1.name.getStringValue();
                String n2 = e2.name.getStringValue();
                if( n1 != null ) {
                    if( n2 != null ) {
                        if( ignoreCase ) {
View Full Code Here

  }
  private Model ascend( Model part ) {
    if( part.doEventsStopAscending() ) {
      return part;
    }
    Element parent = part.getParent();
    if( parent instanceof Model ) {
      return ascend( (Model)parent );
    } else {
      return part;
    }
View Full Code Here

  private void updateOverrideValueClasses() {
    Class elementOverrideValueClass = null;
    Class valueOverrideValueClass = null;
    String propertyNameValue = propertyName.getStringValue();
    if( propertyNameValue!=null ) {
      Element elementValue = element.getElementValue();
      if( elementValue!=null ) {
        edu.cmu.cs.stage3.alice.core.Property property = elementValue.getPropertyNamed( propertyNameValue );
        if( property != null ) {
          elementOverrideValueClass = property.getDeclaredClass();
          valueOverrideValueClass = property.getValueClass();
        } else {
          if( elementValue instanceof Expression ) {
View Full Code Here

  public final StringProperty propertyName = new StringProperty( this, "propertyName", null );
  private void updateOverrideValueClass() {
    Class elementOverrideValueClass = null;
    String propertyNameValue = propertyName.getStringValue();
    if( propertyNameValue!=null ) {
      Element elementValue = element.getElementValue();
      if( elementValue!=null ) {
        Property property = elementValue.getPropertyNamed( propertyNameValue );
        if( property != null ) {
          elementOverrideValueClass = property.getDeclaredClass();
        } else {
          if( elementValue instanceof Expression ) {
            Class cls = ((Expression)elementValue).getValueClass();
View Full Code Here

  }
  private Property getPropertyValue() {
    if( element.getOverrideValueClass() == null ) {
      updateOverrideValueClass();
    }
    Element elementValue = element.getElementValue();
    String propertyNameValue = propertyName.getStringValue();
    if( elementValue != null && propertyNameValue != null ) {
      return elementValue.getPropertyNamed( propertyNameValue );
//      Property property = elementValue.getPropertyNamed( propertyNameValue );
//      if( property == null ) {
//        if( elementValue instanceof Expression ) {
//          Expression expression = (Expression)elementValue;
//          if( Element.class.isAssignableFrom( expression.getValueClass() ) ) {
View Full Code Here

  private void updateOverrideValueClasses() {
    Class elementOverrideValueClass = null;
    Class valueOverrideValueClass = null;
    String propertyNameValue = propertyName.getStringValue();
    if( propertyNameValue!=null ) {
      Element elementValue = element.getElementValue();
      if( elementValue!=null ) {
        Property property = elementValue.getPropertyNamed( propertyNameValue );
        if( property != null ) {
          elementOverrideValueClass = property.getDeclaredClass();
          valueOverrideValueClass = property.getValueClass();
        } else {
          if( elementValue instanceof Expression ) {
View Full Code Here

    manufactureAnyNecessaryDetails();
  }
  private void updateDetails( java.awt.event.MouseEvent mouseEvent ) {
    for( int i=0; i<details.size(); i++ ) {
      Expression detail = (Expression)details.get( i );
      if( detail.name.getStringValue().equals( "x" ) ) {
        ((Variable)detail).value.set( new Double( mouseEvent.getX() ) );
      } else if( detail.name.getStringValue().equals( "y" ) ) {
        ((Variable)detail).value.set( new Double( mouseEvent.getY() ) );
      } else if( detail.name.getStringValue().equals( "what" ) ) {
View Full Code Here

    if( aValue != null ) {
      if( aValue.equals( bValue ) ) {
                return true;
            } else {
                if( aValue instanceof Expression ) {
                    Expression aExpression = (Expression)aValue;
                    Object aValue2 = aExpression.getValue();
                    if( bValue instanceof Expression ) {
                        Expression bExpression = (Expression)bValue;
                        Object bValue2 = bExpression.getValue();
                        if( aExpression.equals( bExpression.getValue() ) ) {
                            return true;
                        } else {
                            if( aValue2 != null ) {
                                if( aValue2.equals( bExpression ) ) {
                                    return true;
                                } else {
                                    return aValue2.equals( bValue2 );
                                }
                            } else {
                                return bValue2==null;
                            }
                        }
                    } else {
                        if( aValue2 != null ) {
                            return aValue2.equals( bValue );
                        } else {
                            return bValue == null;
                        }
                    }
                } else {
                    if( bValue instanceof Expression ) {
                        Expression bExpression = (Expression)bValue;
                        Object bValue2 = bExpression.getValue();
                        if( aValue.equals( bExpression ) ) {
                            return true;
                        } else {
                            return aValue.equals( bValue2 );
                        }
                    } else {
                        return false;
                    }
                }
            }
    } else {
            if( bValue instanceof Expression ) {
                Expression bExpression = (Expression)bValue;
                Object bValue2 = bExpression.getValue();
                return bValue2 == null;
            } else {
                return bValue == null;
            }
    }
View Full Code Here

TOP

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

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.