Math2mat

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

Go to the documentation of this file.
00001 
00018 package m2m.frontend.dynamicview.editPart;
00019 
00020 import java.beans.PropertyChangeEvent;
00021 import java.util.Vector;
00022 
00023 import m2m.frontend.dynamicview.editpolicies.EditLayoutPolicy;
00024 import m2m.frontend.dynamicview.figure.PointConnectionFigure;
00025 import m2m.frontend.dynamicview.model.Node;
00026 import m2m.frontend.dynamicview.model.PointConnection;
00027 
00028 import org.eclipse.draw2d.IFigure;
00029 import org.eclipse.gef.EditPolicy;
00030 
00031 
00032 public class PointConnectionPart extends AbstractEditPart 
00033 {       
00038     @Override
00039     protected IFigure createFigure() 
00040     {
00041         IFigure figure = new PointConnectionFigure();
00042         ((PointConnectionFigure) figure).addMouseMotionListener(this);
00043         ((PointConnectionFigure) figure).addMouseListener(this);
00044         return figure;
00045     }
00046 
00047     
00051     @Override
00052     protected void createEditPolicies() 
00053     {
00054         installEditPolicy(EditPolicy.LAYOUT_ROLE, new EditLayoutPolicy()); 
00055     }
00056     
00057     
00061     protected void refreshVisuals()
00062     { 
00063         /* Get the figure and the model */
00064         PointConnectionFigure figure = (PointConnectionFigure)getFigure();
00065         PointConnection model = (PointConnection)getModel();
00066        
00067         /* Update the figure with the model */
00068         figure.setBackgroundColor(model.getColorConditionSelected());
00069         figure.setLayout(model.getLayout());
00070         figure.setVisible(model.getVisible());
00071     }
00072 
00073     
00079 
00089 
 All Classes Namespaces Files Functions Variables Enumerations