Search in sources :

Example 1 with Association

use of edu.cmu.cs.hcii.cogtool.model.Association in project cogtool by cogtool.

the class FrameEditorMouseState method dynamicResizeGroup.

protected void dynamicResizeGroup(Association<?> group, double ratioX, double ratioY, double newLeft, double newTop, boolean childrenToo) {
    Iterator<? extends FrameElement> groupElts = group.iterator();
    while (groupElts.hasNext()) {
        FrameElement elt = groupElts.next();
        if (elt instanceof IWidget) {
            IWidget w = (IWidget) elt;
            GraphicalWidget<?> gw = ui.frameUI.getWidgetFigure(w);
            dynamicResizeWidget(w, gw, ratioX, ratioY, newLeft, newTop);
            if (childrenToo && (w instanceof AParentWidget)) {
                AParentWidget pw = (AParentWidget) w;
                SimpleWidgetGroup children = pw.getChildren();
                if (children != null) {
                    dynamicResizeGroup(children, ratioX, ratioY, newLeft, newTop, childrenToo);
                }
            }
        } else if (elt instanceof Association<?>) {
            dynamicResizeGroup((Association<?>) elt, ratioX, ratioY, newLeft, newTop, childrenToo);
        }
    }
}
Also used : SimpleWidgetGroup(edu.cmu.cs.hcii.cogtool.model.SimpleWidgetGroup) Association(edu.cmu.cs.hcii.cogtool.model.Association) FrameElement(edu.cmu.cs.hcii.cogtool.model.FrameElement) AParentWidget(edu.cmu.cs.hcii.cogtool.model.AParentWidget) IWidget(edu.cmu.cs.hcii.cogtool.model.IWidget)

Aggregations

AParentWidget (edu.cmu.cs.hcii.cogtool.model.AParentWidget)1 Association (edu.cmu.cs.hcii.cogtool.model.Association)1 FrameElement (edu.cmu.cs.hcii.cogtool.model.FrameElement)1 IWidget (edu.cmu.cs.hcii.cogtool.model.IWidget)1 SimpleWidgetGroup (edu.cmu.cs.hcii.cogtool.model.SimpleWidgetGroup)1