1 package prefuse.action.animate; 2 3 import prefuse.action.ItemAction; 4 import prefuse.visual.VisualItem; 5 6 7 13 public class LocationAnimator extends ItemAction { 14 15 18 public LocationAnimator() { 19 super(); 20 } 21 22 26 public LocationAnimator(String group) { 27 super(group); 28 } 29 30 33 public void process(VisualItem item, double frac) { 34 double sx = item.getStartX(); 35 double sy = item.getStartY(); 36 item.setX(sx + frac*(item.getEndX()-sx)); 37 item.setY(sy + frac*(item.getEndY()-sy)); 38 } 39 40 } | Popular Tags |