Changeset 1225

Show
Ignore:
Timestamp:
02/20/10 16:13:37 (5 months ago)
Author:
gregor
Message:
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Moonlight/src/eu/moonlight3d/ml3d/modelling/objects/DeleteObjectsCommand.java

    r1216 r1225  
    3636import eu.moonlight3d.ml3d.backend.threedim.og.Node; 
    3737import eu.moonlight3d.ml3d.backend.threedim.og.Slot; 
     38import eu.moonlight3d.ml3d.ui.command.CommandBase; 
    3839 
    39 public class DeleteObjectsCommand implements Command { 
     40public class DeleteObjectsCommand extends CommandBase implements Command { 
    4041        private String previousOGNodeName; 
    4142        private String previousSlotName; 
     
    8990        public void redo() { 
    9091        try { 
     92                saveOldSelection(); 
     93                 
    9194            State state=State.getInstance(); 
    9295             
     
    115118                OperatorGraphHelper.removeAndBridge(deleteObjectsNodeName); 
    116119            } 
     120            restoreOldSelection(); 
    117121            ogManager.update(); 
    118122                } catch (Exception e) { 
  • trunk/Moonlight/src/eu/moonlight3d/ml3d/modelling/objects/DuplicateObjectsCommand.java

    r1216 r1225  
    3737import eu.moonlight3d.ml3d.backend.threedim.og.Node; 
    3838import eu.moonlight3d.ml3d.backend.threedim.og.Slot; 
     39import eu.moonlight3d.ml3d.ui.command.CommandBase; 
    3940 
    40 public class DuplicateObjectsCommand implements Command { 
     41public class DuplicateObjectsCommand extends CommandBase implements Command { 
    4142        private int numCopies; 
    4243        private boolean copyChildren; 
     
    9495        public void redo() { 
    9596        try { 
     97                saveOldSelection(); 
     98                 
    9699            State state=State.getInstance(); 
    97100             
     
    126129                OperatorGraphHelper.removeAndBridge(duplicateObjectsNodeName); 
    127130            } 
     131            restoreOldSelection(); 
    128132            ogManager.update(); 
    129133                } catch (Exception e) { 
  • trunk/Moonlight/src/eu/moonlight3d/ml3d/modelling/objects/GroupObjectsCommand.java

    r1216 r1225  
    3838import eu.moonlight3d.ml3d.backend.threedim.og.Slot; 
    3939import eu.moonlight3d.ml3d.modelling.basic.OGOutputMerger; 
     40import eu.moonlight3d.ml3d.ui.command.CommandBase; 
    4041 
    41 public class GroupObjectsCommand implements Command { 
     42public class GroupObjectsCommand extends CommandBase implements Command { 
    4243        private ArrayList<String> inputPaths; 
    4344        private List<String> mergeNodeNames; 
     
    8586        public void redo() { 
    8687        try { 
     88                saveOldSelection(); 
     89                 
    8790            State state=State.getInstance(); 
    8891             
     
    145148                } 
    146149            } 
     150            restoreOldSelection(); 
    147151            ogManager.update(); 
    148152                } catch (Exception e) { 
  • trunk/Moonlight/src/eu/moonlight3d/ml3d/modelling/objects/MoveObjectCommand.java

    r1218 r1225  
    3535import eu.moonlight3d.ml3d.backend.threedim.og.Manager; 
    3636import eu.moonlight3d.ml3d.backend.threedim.og.Node; 
     37import eu.moonlight3d.ml3d.ui.command.CommandBase; 
    3738 
    38 public class MoveObjectCommand implements Command { 
     39public class MoveObjectCommand extends CommandBase implements Command { 
    3940        private String selectionName; 
    4041        private Vector3D oldDisplacement; 
     
    8283        public void redo() { 
    8384                try { 
     85                        saveOldSelection(); 
     86                         
    8487                Manager ogManager=((Document) State.getInstance().getDocumentManager().getMainDocument()).getOGManager(); 
    8588                Selection selection = ((Document) State.getInstance().getDocumentManager().getMainDocument()).getSelectionManager().getSelection("viewSelection"); 
     
    125128                                currentOperation.getProperty("displacement").setValue(new Vector3DValue(oldDisplacement));                               
    126129                        } 
     130                        restoreOldSelection(); 
    127131                        ogManager.update(); 
    128132                } catch(Exception e) { 
  • trunk/Moonlight/src/eu/moonlight3d/ml3d/modelling/objects/RotateObjectCommand.java

    r1218 r1225  
    3636import eu.moonlight3d.ml3d.backend.threedim.og.Manager; 
    3737import eu.moonlight3d.ml3d.backend.threedim.og.Node; 
     38import eu.moonlight3d.ml3d.ui.command.CommandBase; 
    3839 
    39 public class RotateObjectCommand implements Command { 
     40public class RotateObjectCommand extends CommandBase implements Command { 
    4041        private String selectionName; 
    4142        private Vector3D oldPivot; 
     
    9495        public void redo() { 
    9596                try { 
     97                        saveOldSelection(); 
     98                         
    9699                Manager ogManager=((Document) State.getInstance().getDocumentManager().getMainDocument()).getOGManager(); 
    97100                Selection selection = ((Document) State.getInstance().getDocumentManager().getMainDocument()).getSelectionManager().getSelection("viewSelection"); 
     
    142145                                currentOperation.getProperty("angle").setValue(new FloatValue(oldAngle)); 
    143146                        } 
     147                        restoreOldSelection(); 
    144148                        ogManager.update(); 
    145149                } catch(Exception e) { 
  • trunk/Moonlight/src/eu/moonlight3d/ml3d/modelling/objects/ScaleObjectCommand.java

    r1218 r1225  
    3535import eu.moonlight3d.ml3d.backend.threedim.og.Manager; 
    3636import eu.moonlight3d.ml3d.backend.threedim.og.Node; 
     37import eu.moonlight3d.ml3d.ui.command.CommandBase; 
    3738 
    38 public class ScaleObjectCommand implements Command { 
     39public class ScaleObjectCommand extends CommandBase implements Command { 
    3940        private String selectionName; 
    4041        private Vector3D oldPivot; 
     
    8889        public void redo() { 
    8990                try { 
     91                        saveOldSelection(); 
     92                         
    9093                Manager ogManager=((Document) State.getInstance().getDocumentManager().getMainDocument()).getOGManager(); 
    9194                Selection selection = ((Document) State.getInstance().getDocumentManager().getMainDocument()).getSelectionManager().getSelection("viewSelection"); 
     
    130133                                        OperatorGraphHelper.removeAndBridge(scaleObjectNodeName); 
    131134                                } 
    132                                 ogManager.removeNode(currentOperation); 
    133135                        } else { 
    134136                                currentOperation.getProperty("pivot").setValue(new Vector3DValue(oldPivot)); 
     
    149151                        currentOperation.getProperty("pivot").setValue(new Vector3DValue(newPivot)); 
    150152                        currentOperation.getProperty("scale").setValue(new Vector3DValue(newScale)); 
     153                        restoreOldSelection(); 
    151154                        ogManager.update(); 
    152155                } catch(Exception e) { 
  • trunk/Moonlight/src/eu/moonlight3d/ml3d/modelling/objects/UngroupObjectsCommand.java

    r1216 r1225  
    3535import eu.moonlight3d.ml3d.backend.threedim.og.Node; 
    3636import eu.moonlight3d.ml3d.backend.threedim.og.Slot; 
     37import eu.moonlight3d.ml3d.ui.command.CommandBase; 
    3738 
    38 public class UngroupObjectsCommand implements Command { 
     39public class UngroupObjectsCommand extends CommandBase implements Command { 
    3940        private boolean keepTransformation; 
    4041        private String previousOGNodeName; 
     
    8586        public void redo() { 
    8687        try { 
     88                saveOldSelection(); 
     89                 
    8790            State state=State.getInstance(); 
    8891             
     
    116119                OperatorGraphHelper.removeAndBridge(ungroupObjectsNodeName); 
    117120            } 
     121            restoreOldSelection(); 
    118122                        ogManager.update(); 
    119123                } catch (Exception e) {