package CDModeler.buttons; import gui.CellAnimateIf; import gui.Constants; import java.awt.Dimension; import org.eclipse.jface.action.IAction; import org.eclipse.jface.viewers.ISelection; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.IWorkbenchWindowActionDelegate; /** * * This class will execute the CDModeler Cell Dev Animation program. * @author Jing Cao * @see IWorkbenchWindowActionDelegate * @version 1.0 */ public class CellDevAnimationAction implements IWorkbenchWindowActionDelegate{ //constructor public CellDevAnimationAction() { } /** * Called when the action is executed * @see IWorkbenchWindowActionDelegate#run */ public void run(IAction action) { try { CellAnimateIf cellAnimate = (CellAnimateIf)Class.forName(Constants.getInstance().getString("cellAnimate", "gui.animate.cellanimate.CellAnimate")).newInstance(); cellAnimate.setSize(new Dimension(600,800)); cellAnimate.setLocationRelativeTo(null); cellAnimate.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } /** * Called when objects in the editor are selected or deselected. * @see IWorkbenchWindowActionDelegate#selectionChanged */ public void selectionChanged(IAction action, ISelection selection) { } /** * Called when the action is discarded. * @see IWorkbenchWindowActionDelegate#dispose */ public void dispose() { } /** * Called when the action is created. * @see IWorkbenchWindowActionDelegate#init */ public void init(IWorkbenchWindow window) { } }