Search in sources :

Example 6 with MenuItem

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);
                }
            }
        }
    }
}
Also used : MenuItem(edu.cmu.cs.hcii.cogtool.model.MenuItem) IWidget(edu.cmu.cs.hcii.cogtool.model.IWidget)

Example 7 with MenuItem

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);
}
Also used : MenuItem(edu.cmu.cs.hcii.cogtool.model.MenuItem) AParentWidget(edu.cmu.cs.hcii.cogtool.model.AParentWidget)

Example 8 with MenuItem

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);
                }
            }
        }
    }
}
Also used : MenuItem(edu.cmu.cs.hcii.cogtool.model.MenuItem) IWidget(edu.cmu.cs.hcii.cogtool.model.IWidget)

Aggregations

MenuItem (edu.cmu.cs.hcii.cogtool.model.MenuItem)8 IWidget (edu.cmu.cs.hcii.cogtool.model.IWidget)5 AParentWidget (edu.cmu.cs.hcii.cogtool.model.AParentWidget)4 SimpleWidgetGroup (edu.cmu.cs.hcii.cogtool.model.SimpleWidgetGroup)3 TraversableWidget (edu.cmu.cs.hcii.cogtool.model.TraversableWidget)3 ChildWidget (edu.cmu.cs.hcii.cogtool.model.ChildWidget)2 ListItem (edu.cmu.cs.hcii.cogtool.model.ListItem)2 MenuHeader (edu.cmu.cs.hcii.cogtool.model.MenuHeader)2 PullDownItem (edu.cmu.cs.hcii.cogtool.model.PullDownItem)2 FrameEditorUI (edu.cmu.cs.hcii.cogtool.ui.FrameEditorUI)2 CompoundUndoableEdit (edu.cmu.cs.hcii.cogtool.util.CompoundUndoableEdit)2 AMenuWidget (edu.cmu.cs.hcii.cogtool.model.AMenuWidget)1 CheckBox (edu.cmu.cs.hcii.cogtool.model.CheckBox)1 ContextMenu (edu.cmu.cs.hcii.cogtool.model.ContextMenu)1 DoubleRectangle (edu.cmu.cs.hcii.cogtool.model.DoubleRectangle)1 GridButton (edu.cmu.cs.hcii.cogtool.model.GridButton)1 GridButtonGroup (edu.cmu.cs.hcii.cogtool.model.GridButtonGroup)1 PullDownHeader (edu.cmu.cs.hcii.cogtool.model.PullDownHeader)1 RadioButton (edu.cmu.cs.hcii.cogtool.model.RadioButton)1 Widget (edu.cmu.cs.hcii.cogtool.model.Widget)1