1 package jimm.datavision.gui.cmd; 2 import jimm.datavision.field.Rectangle; 3 import jimm.datavision.gui.FieldWidget; 4 import jimm.util.I18N; 5 6 12 public class FieldStretchCommand extends CommandAdapter { 13 14 protected FieldWidget fw; 15 protected Rectangle origBounds; 16 protected Rectangle newBounds; 17 18 public FieldStretchCommand(FieldWidget fw, Rectangle origBounds) { 19 super(I18N.get("FieldStretchCommand.name")); 20 21 this.fw = fw; 22 this.origBounds = origBounds; 23 } 24 25 public void perform() { 26 newBounds = new Rectangle(fw.getField().getBounds()); } 29 30 public void undo() { 31 fw.getField().getBounds().setBounds(origBounds); 32 } 33 34 public void redo() { 35 fw.getField().getBounds().setBounds(newBounds); 36 } 37 38 } 39 | Popular Tags |