Search in sources :

Example 6 with RcvrOutOfMemoryException

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

the class DesignEditorController method copyFrames.

protected void copyFrames(Frame[] frames) {
    try {
        // Passing the set of frames as part of purpose allows us
        // to copy only those transitions that link those frames.
        ObjectSaver s = CogToolClipboard.startClipboardSave(CogToolClipboard.CopyFrames, frames, CogToolClipboard.SAVE_TO_CLIPBOARD);
        for (Frame frame : frames) {
            s.saveObject(frame);
        }
        s.finish();
    } catch (IOException e) {
        throw new RcvrClipboardException(e);
    } catch (IllegalStateException e) {
        throw new RcvrClipboardException(e);
    } catch (OutOfMemoryError error) {
        throw new RcvrOutOfMemoryException("Copying Frames", error);
    }
}
Also used : ObjectSaver(edu.cmu.cs.hcii.cogtool.util.ObjectSaver) RcvrIllegalStateException(edu.cmu.cs.hcii.cogtool.util.RcvrIllegalStateException) Frame(edu.cmu.cs.hcii.cogtool.model.Frame) RcvrOutOfMemoryException(edu.cmu.cs.hcii.cogtool.util.RcvrOutOfMemoryException) RcvrClipboardException(edu.cmu.cs.hcii.cogtool.util.RcvrClipboardException) RcvrIOException(edu.cmu.cs.hcii.cogtool.util.RcvrIOException) IOException(java.io.IOException)

Aggregations

RcvrClipboardException (edu.cmu.cs.hcii.cogtool.util.RcvrClipboardException)6 RcvrOutOfMemoryException (edu.cmu.cs.hcii.cogtool.util.RcvrOutOfMemoryException)6 IOException (java.io.IOException)6 ObjectSaver (edu.cmu.cs.hcii.cogtool.util.ObjectSaver)5 RcvrIOException (edu.cmu.cs.hcii.cogtool.util.RcvrIOException)5 IListenerAction (edu.cmu.cs.hcii.cogtool.util.IListenerAction)4 AUndertaking (edu.cmu.cs.hcii.cogtool.model.AUndertaking)2 Design (edu.cmu.cs.hcii.cogtool.model.Design)2 ITaskDesign (edu.cmu.cs.hcii.cogtool.model.Project.ITaskDesign)2 DesignSelectionState (edu.cmu.cs.hcii.cogtool.ui.DesignSelectionState)2 TaskSelectionState (edu.cmu.cs.hcii.cogtool.ui.TaskSelectionState)2 CogToolClipboard (edu.cmu.cs.hcii.cogtool.CogToolClipboard)1 ChildWidget (edu.cmu.cs.hcii.cogtool.model.ChildWidget)1 Frame (edu.cmu.cs.hcii.cogtool.model.Frame)1 FrameElement (edu.cmu.cs.hcii.cogtool.model.FrameElement)1 RcvrIllegalStateException (edu.cmu.cs.hcii.cogtool.util.RcvrIllegalStateException)1