예제 #1
0
 /**
  * Add the parent group's menu items
  *
  * @param items menu items
  * @return the items
  */
 protected List addGroupMenuItems(List items) {
   if (displayGroup != null) {
     items.add(GuiUtils.MENU_SEPARATOR);
     items.add(
         GuiUtils.makeMenu(
             "Parent " + displayGroup.toString(),
             displayGroup.getPopupMenuItems(new ArrayList())));
   }
   return items;
 }
예제 #2
0
 /**
  * Remove me
  *
  * @return was removed
  */
 public boolean removeDisplayComponent() {
   if (GuiUtils.askYesNo("Remove Display", "Are you sure you want to remove: " + toString())) {
     DisplayGroup displayGroup = getDisplayGroup();
     if (displayGroup != null) {
       displayGroup.removeDisplayComponent(this);
     }
     getDisplayControl().removeDisplayComponent(this);
     return true;
   } else {
     return false;
   }
 }
예제 #3
0
  @Override
  public void setXMLAttributes(final XmlPullParser xmlParser, final UIManager manager) {
    super.setXMLAttributes(xmlParser, manager);

    final String align = xmlParser.getAttributeValue(null, ATT_ALIGN);
    if (align != null) {
      setAlignment(UIConfig.getAlignment(align));
    }

    final String repeating = xmlParser.getAttributeValue(null, ATT_REPEATING);
    if (repeating != null) {
      setRepeating(Boolean.valueOf(repeating));
    }

    final String boundsCheck = xmlParser.getAttributeValue(null, ATT_BOUNDS_CHECK_ENABLED);
    if (boundsCheck != null) {
      setBoundsCheckEnabled(Boolean.valueOf(boundsCheck));
    }

    final String autoSleepChildren = xmlParser.getAttributeValue(null, ATT_AUTO_SLEEP_CHILDREN);
    if (autoSleepChildren != null) {
      setAutoSleepChildren(Boolean.valueOf(autoSleepChildren));
    }

    final String minCellSize = xmlParser.getAttributeValue(null, ATT_MIN_CELL_SIZE);
    if (minCellSize != null) {
      setMinCellSize(Float.valueOf(minCellSize) * manager.getConfig().screen_scale);
    }
  }
예제 #4
0
  @Override
  public void updateChildren(final int deltaTime) {
    super.updateChildren(deltaTime);

    // adjust the positions when necessary
    if (mChildrenPositionInvalidated) {
      positionChildren();
      mChildrenPositionInvalidated = false;

      // only apply constraints when size or parent changed
      if (mUIConstraint != null && (mInvalidateFlags & (SIZE | PARENT)) != 0) {
        mUIConstraint.apply(this, mParent);
      }
    }
  }
예제 #5
0
  @Override
  public void setWrapContentHeight(final boolean wrapHeight) {
    super.setWrapContentHeight(wrapHeight);

    invalidateChildrenPosition();
  }
예제 #6
0
  @Override
  public void setWrapContentWidth(final boolean wrapWidth) {
    super.setWrapContentWidth(wrapWidth);

    invalidateChildrenPosition();
  }
예제 #7
0
  @Override
  protected void onRemovedChild(final DisplayObject child) {
    super.onRemovedChild(child);

    invalidateChildrenPosition();
  }