Math2mat
|
00001 00017 package m2m.frontend.dynamicview.editPart; 00018 00019 import m2m.frontend.dynamicview.figure.FunctionFigure; 00020 import m2m.frontend.dynamicview.model.GraphicLoop; 00021 00022 import org.eclipse.draw2d.ActionListener; 00023 import org.eclipse.draw2d.IFigure; 00024 00025 00026 public class LoopPart extends FunctionPart implements ActionListener 00027 { 00032 @Override 00033 protected IFigure createFigure() 00034 { 00035 IFigure figure = new FunctionFigure(); 00036 ((FunctionFigure) figure).getBtnMinimize().addActionListener(this); 00037 ((FunctionFigure) figure).addMouseMotionListener(this); 00038 ((FunctionFigure) figure).addMouseListener(this); 00039 return figure; 00040 } 00041 00042 00046 protected void refreshVisuals() 00047 { 00048 /* Get the figure and the model */ 00049 FunctionFigure figure = (FunctionFigure)getFigure(); 00050 GraphicLoop model = (GraphicLoop)getModel(); 00051 00052 /* Update the figure with the model */ 00053 figure.setName(model.getName()); 00054 figure.setLayout(model.getLayout()); 00055 figure.setVisible(model.getVisible()); 00056 } 00057 }