Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2007, 2008 Anyware Technologies All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: Anyware Technologies - initial API and implementation $Id: EReferenceEditPart.java,v 1.9 2009/02/02 08:39:05 jlescot Exp $ /
 
 
 package org.eclipse.emf.ecoretools.diagram.edit.parts;
 
 import  org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
 import  org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
 import  org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
 import  org.eclipse.gmf.runtime.notation.Anchor;
 import  org.eclipse.gmf.runtime.notation.NotationPackage;
 import  org.eclipse.gmf.runtime.notation.RelativeBendpoints;
 import  org.eclipse.gmf.runtime.notation.View;

Generated:
 
 public class EReferenceEditPart extends ConnectionNodeEditPart {
 
 	private boolean selectable = true;
 
 	protected void handleNotificationEvent(Notification notification) {
 		if (notification.getNotifier() instanceof EReference) {
 			switch (notification.getFeatureID(EReference.class)) {
 				break;
 				break;
 			}
 		}
 		if (NotationPackage.Literals.ROUTING_STYLE__ROUTING.equals(notification.getFeature()) || notification.getNotifier() instanceof RelativeBendpoints
 				|| notification.getNotifier() instanceof Anchor) {
 		}
 		super.handleNotificationEvent(notification);
 	}
 
 	protected void trackLinkedReference() {
 		EObject semanticElement = resolveSemanticElement();
 		if (false == semanticElement instanceof EReference) {
 			return;
 		}
 		if (((EReferencesemanticElement).getEOpposite() != null) {
 			EReferenceUtils.trackReferences(this);
 		}
 	}

Refresh reference decoration and visibility
 
 	protected void refreshLinkedReference() {
 		EObject semanticElement = resolveSemanticElement();
 		if (false == semanticElement instanceof EReference) {
 			return;
 		}
 		if (((EReferencesemanticElement).getEOpposite() != null) {
 		} else {
 		}
 	}

Generated:
 
 	public static final int VISUAL_ID = 3002;

Generated:
 
 	public EReferenceEditPart(View view) {
 		super(view);
	}

Generated:
	protected void createDefaultEditPolicies() {
		super.createDefaultEditPolicies();
		installEditPolicy(EditPolicyRoles.SEMANTIC_ROLEnew EReferenceItemSemanticEditPolicy());
	}

Generated:
	protected boolean addFixedChild(EditPart childEditPart) {
		return false;
	}

Generated:
	protected void addChildVisual(EditPart childEditPartint index) {
		if (addFixedChild(childEditPart)) {
			return;
		}
		super.addChildVisual(childEditPart, -1);
	}

Generated:
	protected boolean removeFixedChild(EditPart childEditPart) {
		return false;
	}

Generated:
	protected void removeChildVisual(EditPart childEditPart) {
		if (removeFixedChild(childEditPart)) {
			return;
		}
		super.removeChildVisual(childEditPart);
	}

Creates figure for this edit part. Body of this method does not depend on settings in generation model so you may safely remove generated tag and modify it.

Generated:
		return new SolidLineWDstArrow();
	}

Generated:
	}

Generated:
	public class SolidLineWDstArrow extends PolylineConnectionEx {
		private boolean hideLine;

Returns:
the hideLine
		public boolean isHideLine() {
			return ;
		}

Parameters:
hideLine the hideLine to set
		public void setHideLine(boolean hideLine) {
			this. = hideLine;
			synchronized (EReferenceEditPart.this) {
				if (hideLine) {
else {
				}
			}
		}

Generated:
NOT
		public SolidLineWDstArrow() {
			setTargetDecoration(createTargetDecoration());
		}
		public void displayTargetDecoration(boolean display) {
			if (display == true) {
				setTargetDecoration(createTargetDecoration());
else {
				if (getTargetDecoration() != null) {
					setTargetDecoration(null);
				}
			}
		}
		public void displaySourceDecoration(boolean display) {
			if (display == true) {
				setSourceDecoration(createSourceDecoration());
else {
				if (getSourceDecoration() != null) {
					setSourceDecoration(null);
				}
			}
		}

Generated:
			PointList pl = new PointList();
			pl.addPoint(getMapMode().DPtoLP(-1), getMapMode().DPtoLP(1));
			pl.addPoint(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0));
			pl.addPoint(getMapMode().DPtoLP(-1), getMapMode().DPtoLP(-1));
			df.setScale(getMapMode().DPtoLP(7), getMapMode().DPtoLP(3));
			return df;
		}
			PointList pl = new PointList();
			pl.addPoint(getMapMode().DPtoLP(-1), getMapMode().DPtoLP(1));
			pl.addPoint(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0));
			pl.addPoint(getMapMode().DPtoLP(-1), getMapMode().DPtoLP(-1));
			pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(0));
			pl.addPoint(getMapMode().DPtoLP(-1), getMapMode().DPtoLP(1));
			df.setScale(getMapMode().DPtoLP(7), getMapMode().DPtoLP(3));
			return df;
		}

		public void paintFigure(Graphics graphics) {
			if () {
				return;
			}
			super.paintFigure(graphics);
		}
	}

See also:
org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart#refreshVisuals()
	protected void refreshVisuals() {
		super.refreshVisuals();
	}

Update the source decoration depending on the containment property of the EReference
	protected void refreshSourceDecoration() {
		EObject semanticElement = resolveSemanticElement();
		if (semanticElement instanceof EReference) {
		}
	}

See also:
org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart#isSelectable()
	public boolean isSelectable() {
		return ;
	}

Parameters:
selectable the selectable to set
	public void setSelectable(boolean selectable) {
		this. = selectable;
	}
New to GrepCode? Check out our FAQ X