use of edu.cmu.cs.hcii.cogtool.model.MenuItem in project cogtool by cogtool.
the class DesignEditorCmd method addChildWidgets.
private static void addChildWidgets(Frame frame, SimpleWidgetGroup widgetGroup, DemoStateManager mgr, IUndoableEditSequence editSeq) {
if (widgetGroup != null) {
Iterator<IWidget> children = widgetGroup.iterator();
while (children.hasNext()) {
IWidget child = children.next();
makeWidgetNameUnique(child, frame);
frame.addWidget(child);
if (editSeq != null) {
editSeq.addEdit(addWidgetUndoableEdit(frame, child, mgr));
}
if (child instanceof MenuItem) {
MenuItem item = (MenuItem) child;
if (item.isSubmenu()) {
addChildWidgets(frame, item.getChildren(), mgr, editSeq);
}
}
}
}
}
use of edu.cmu.cs.hcii.cogtool.model.MenuItem in project cogtool by cogtool.
the class GraphicalMenuItem method getParentFigure.
@SuppressWarnings("unchecked")
public GraphicalParentWidget<AMenuWidget, MenuItem> getParentFigure() {
MenuItem menuWidget = getModel();
AParentWidget parent = menuWidget.getParent();
return (GraphicalMenuWidget<AMenuWidget>) figureSpt.getWidgetFigure(parent);
}
use of edu.cmu.cs.hcii.cogtool.model.MenuItem in project cogtool by cogtool.
the class FrameEditorController method addChildWidgets.
private void addChildWidgets(SimpleWidgetGroup widgetGroup, IUndoableEditSequence editSeq) {
if (widgetGroup != null) {
Iterator<IWidget> children = widgetGroup.iterator();
while (children.hasNext()) {
IWidget child = children.next();
makeWidgetNameUnique(child);
editSeq.addEdit(addWidget(child));
if (child instanceof MenuItem) {
MenuItem item = (MenuItem) child;
if (item.isSubmenu()) {
addChildWidgets(item.getChildren(), editSeq);
}
}
}
}
}
Aggregations