Math2mat

/home/ythoma/docs/math2mat/svn/wp1/framework/m2mGUI/src/m2m/frontend/dynamicview/editPart/InternPointConnectionPart.java

Go to the documentation of this file.
00001 
00017 package m2m.frontend.dynamicview.editPart;
00018 
00019 import java.beans.PropertyChangeEvent;
00020 import java.util.Vector;
00021 
00022 import m2m.frontend.dynamicview.figure.InternPointConnectionFigure;
00023 import m2m.frontend.dynamicview.model.InternPointConnection;
00024 import m2m.frontend.dynamicview.model.Node;
00025 
00026 import org.eclipse.draw2d.IFigure;
00027 
00028 
00029 public class InternPointConnectionPart extends AbstractEditPart 
00030 {
00035     @Override
00036     protected IFigure createFigure() 
00037     {
00038         IFigure figure = new InternPointConnectionFigure();
00039         ((InternPointConnectionFigure) figure).addMouseMotionListener(this);
00040         ((InternPointConnectionFigure) figure).addMouseListener(this);
00041         return figure;
00042     }
00043     
00044 
00048     protected void refreshVisuals()
00049     { 
00050         /* Get the figure and the model */
00051         InternPointConnectionFigure figure = (InternPointConnectionFigure)getFigure();
00052         InternPointConnection model = (InternPointConnection)getModel();
00053        
00054         /* Update the figure with the model */
00055         figure.setLayout(model.getLayout());
00056         figure.setVisible(model.getVisible());
00057     }
00058 
00059     
00064     public Vector<Node> getModelChildren()
00065     {
00066         return ((InternPointConnection)getModel()).getChildrenArray();
00067     }
00068     
00069     
00074         @Override
00075         public void propertyChange(PropertyChangeEvent evt) 
00076         {
00077                  if (evt.getPropertyName().equals(Node.LAYOUT)) 
00078                          refreshVisuals();
00079                  else if(evt.getPropertyName().equals(Node.VISIBLE_COMPONENT))
00080                          refreshVisuals();
00081         }
00082         
00083         
00084     @Override
00085     protected void createEditPolicies() {
00086                 // TODO Auto-generated method stub
00087     }
00088 }
 All Classes Namespaces Files Functions Variables Enumerations