Search in sources :

Example 21 with AListenerAction

use of edu.cmu.cs.hcii.cogtool.util.AListenerAction in project cogtool by cogtool.

the class DesignEditorController method createNewFrameAction.

protected IListenerAction createNewFrameAction() {
    return new AListenerAction() {

        public boolean performAction(Object prms) {
            // Find an unoccupied starting position by cascading.
            DoublePoint origin = new DoublePoint(10.0, 10.0);
            DesignUtil.findDistinctOrigin(design, origin, 16.0, 16.0);
            Frame frame = createNewFrame(origin.x, origin.y);
            ui.initiateFrameRename(frame);
            return true;
        }
    };
}
Also used : Frame(edu.cmu.cs.hcii.cogtool.model.Frame) AListenerAction(edu.cmu.cs.hcii.cogtool.util.AListenerAction) DoublePoint(edu.cmu.cs.hcii.cogtool.model.DoublePoint)

Aggregations

AListenerAction (edu.cmu.cs.hcii.cogtool.util.AListenerAction)21 DoublePoint (edu.cmu.cs.hcii.cogtool.model.DoublePoint)7 IListenerAction (edu.cmu.cs.hcii.cogtool.util.IListenerAction)6 Frame (edu.cmu.cs.hcii.cogtool.model.Frame)4 CompoundUndoableEdit (edu.cmu.cs.hcii.cogtool.util.CompoundUndoableEdit)4 IOException (java.io.IOException)4 AUndoableEdit (edu.cmu.cs.hcii.cogtool.util.AUndoableEdit)3 RcvrClipboardException (edu.cmu.cs.hcii.cogtool.util.RcvrClipboardException)3 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)3 SAXException (org.xml.sax.SAXException)3 AUndertaking (edu.cmu.cs.hcii.cogtool.model.AUndertaking)2 ChildWidget (edu.cmu.cs.hcii.cogtool.model.ChildWidget)2 IWidget (edu.cmu.cs.hcii.cogtool.model.IWidget)2 ITaskDesign (edu.cmu.cs.hcii.cogtool.model.Project.ITaskDesign)2 SkinType (edu.cmu.cs.hcii.cogtool.model.SkinType)2 DesignEditorUI (edu.cmu.cs.hcii.cogtool.ui.DesignEditorUI)2 FrameEditorUI (edu.cmu.cs.hcii.cogtool.ui.FrameEditorUI)2 ProjectSelectionState (edu.cmu.cs.hcii.cogtool.ui.ProjectSelectionState)2 UI (edu.cmu.cs.hcii.cogtool.ui.UI)2 ZoomableUI (edu.cmu.cs.hcii.cogtool.ui.ZoomableUI)2