// Copyright (c) 1995, 1996 Regents of the University of California. // All rights reserved. // // This software was developed by the Arcadia project // at the University of California, Irvine. // // Redistribution and use in source and binary forms are permitted // provided that the above copyright notice and this paragraph are // duplicated in all such forms and that any documentation, // advertising materials, and other materials related to such // distribution and use acknowledge that the software was developed // by the University of California, Irvine. The name of the // University may not be used to endorse or promote products derived // from this software without specific prior written permission. // THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED // WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. // File: ActionReorder.java // Classes: ActionReorder // Original Author: Jason Robbins package uci.graphedit; /** * Action to change the back-to-front ordering of DiagramElement's. * @see LayerDiagram#reorder */ public class ActionReorder extends Action { /** parameters for specifying the desired reordering */ public static final int SEND_TO_BACK = 1; public static final int BRING_TO_FRONT = 2; public static final int SEND_BACKWARD = 3; public static final int BRING_FORWARD = 4; private int function; /** Construct a new ActionReorder with the given reordering constrant (see above) */ public ActionReorder(int f,Document d) { super(d); function = f; } public String name() { return "Reorder Objects"; } public void doIt() { Layer v = _document.view(); Selection sel = _document.selection(); sel.startTrans(); sel.reorder(function, v); sel.endTrans(); _document.repairDamage(); } public void undoIt() { } } /* end class ActionReorder */