Esempio n. 1
0
  private GLListProperty(GLStateType type, List<IGLProperty> props) {
    mList = props;
    mType = type;

    for (IGLProperty p : mList) {
      p.setParent(this);
    }
  }
Esempio n. 2
0
  @Override
  public GLListProperty clone() {
    List<IGLProperty> props = new ArrayList<IGLProperty>(mList.size());

    for (IGLProperty p : mList) {
      props.add(p.clone());
    }

    return new GLListProperty(getType(), props);
  }
Esempio n. 3
0
 @Override
 public void prettyPrint(StatePrettyPrinter pp) {
   pp.prettyPrint(mType, null);
   pp.incrementIndentLevel();
   for (int i = 0; i < mList.size(); i++) {
     pp.prettyPrint(String.format(Locale.US, "Index %d:", i));
     IGLProperty p = mList.get(i);
     p.prettyPrint(pp);
   }
   pp.decrementIndentLevel();
 }
Esempio n. 4
0
  /**
   * Construct a list of properties of given size from the provided template.
   *
   * @param template property that will be cloned and used as members of the list
   * @param size size of the list
   */
  public GLListProperty(GLStateType type, IGLProperty template, int size) {
    mType = type;
    mTemplate = template;

    mList = new ArrayList<IGLProperty>(size);
    for (int i = 0; i < size; i++) {
      IGLProperty p = template.clone();
      mList.add(p);

      p.setParent(this);
    }
  }
Esempio n. 5
0
  @Override
  public String toString() {
    StringBuffer sb = new StringBuffer();
    sb.append("GLListProperty ["); // $NON-NLS-1$

    int i = 0;
    for (IGLProperty p : mList) {
      sb.append(i);
      sb.append(':');
      sb.append(p.toString());
      sb.append(", "); // $NON-NLS-1$
      i++;
    }

    sb.append("]");
    return sb.toString();
  }
Esempio n. 6
0
 public void set(int index, IGLProperty property) {
   ensureCapacity(index + 1);
   mList.set(index, property);
   property.setParent(this);
 }
Esempio n. 7
0
 public boolean add(IGLProperty property) {
   property.setParent(this);
   return mList.add(property);
 }