1 package jimm.datavision.gui.cmd; 2 import jimm.datavision.gui.SectionWidget; 3 import jimm.util.I18N; 4 5 11 public class SectionResizeCommand extends CommandAdapter { 12 13 protected SectionWidget sw; 14 protected int oldSectionHeight; 15 protected int sectionHeightDelta; 16 17 public SectionResizeCommand(SectionWidget sw) 18 { 19 super(I18N.get("SectionResizeCommand.name")); 20 this.sw = sw; 21 oldSectionHeight = sw.getHeight(); 22 } 23 24 public void perform() { 25 sectionHeightDelta = sw.getHeight() - oldSectionHeight; 26 } 27 28 public void undo() { 29 sw.growBy(-sectionHeightDelta); 30 } 31 32 public void redo() { 33 sw.growBy(sectionHeightDelta); 34 } 35 36 } 37 | Popular Tags |