1 11 12 package org.eclipse.jface.dialogs; 13 14 import org.eclipse.swt.graphics.Point; 15 import org.eclipse.swt.graphics.Rectangle; 16 import org.eclipse.swt.widgets.Control; 17 18 26 27 28 public class ControlAnimator { 29 30 protected Control control; 31 32 38 public ControlAnimator(Control control) { 39 this.control = control; 40 } 41 42 50 public void setVisible(boolean visible){ 51 if (!(control.isVisible() ^ visible)) 55 return; 56 control.setVisible(visible); 57 Rectangle parentBounds = control.getParent().getBounds(); 58 int bottom = parentBounds.height; 59 final int endY = visible ? bottom - control.getBounds().height 60 : bottom; 61 Point loc = control.getLocation(); 62 control.setLocation(loc.x,endY); 63 } 64 65 } 66 | Popular Tags |