Examples of UndoAction


Examples of ptolemy.kernel.undo.UndoAction

        if (!movedOne) {
            // Do not generate any undo action if no move happened.
            return;
        }

        UndoAction undoAction = new UndoAction() {
            public void execute() {
                try {
                    // Undo has to reverse the order of the do.
                    if ((type == TO_FIRST) || (type == UP)) {
                        // Traverse the list in forward order.
                        Iterator targetIterator = targets.iterator();

                        for (int i = 0; i < targets.size(); i++) {
                            NamedObj target = (NamedObj) targetIterator.next();
                            target.moveToIndex(priorIndexes[i]);
                        }
                    } else {
                        // Traverse the list in reverse order.
                        ListIterator targetIterator = targets
                                .listIterator(targets.size());

                        for (int i = targets.size() - 1; i >= 0; i--) {
                            NamedObj target = (NamedObj) targetIterator
                                    .previous();
                            target.moveToIndex(priorIndexes[i]);
                        }
                    }
                } catch (IllegalActionException e) {
                    // This should only be thrown if the target
                    // has no container, which in theory is not
                    // possible.
                    throw new InternalErrorException(e);
                }

                // Create redo action.
                UndoAction redoAction = new UndoAction() {
                    public void execute() {
                        move(targets, type, context);
                    }
                };
View Full Code Here

Examples of slash.navigation.gui.undo.UndoAction

        JMenu mergeMenu = (JMenu) findMenuComponent(menu, "merge-positionlist");
        new MergePositionListMenu(mergeMenu, getPositionsView(), getFormatAndRoutesModel());

        ClipboardInteractor clipboardInteractor = new ClipboardInteractor();
        clipboardInteractor.watchClipboard();
        actionManager.register("undo", new UndoAction());
        actionManager.register("redo", new RedoAction());
        actionManager.register("copy", new CopyAction(getPositionsView(), getPositionsModel(), clipboardInteractor));
        actionManager.register("cut", new CutAction(getPositionsView(), getPositionsModel(), clipboardInteractor));
        actionManager.register("delete", new DeleteAction(getPositionsView(), getPositionsModel()));
        actionManager.register("new-position", new AddPositionAction(getPositionsView(), getPositionsModel(), getPositionsSelectionModel()));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.