/** * 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; }
/** * 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; } }
@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); } }
@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); } } }
@Override public void setWrapContentHeight(final boolean wrapHeight) { super.setWrapContentHeight(wrapHeight); invalidateChildrenPosition(); }
@Override public void setWrapContentWidth(final boolean wrapWidth) { super.setWrapContentWidth(wrapWidth); invalidateChildrenPosition(); }
@Override protected void onRemovedChild(final DisplayObject child) { super.onRemovedChild(child); invalidateChildrenPosition(); }