content: package oscfg.diagram.edit.parts;
  
  import org.eclipse.draw2d.Connection;
  import org.eclipse.draw2d.PolylineDecoration;
  import org.eclipse.draw2d.RotatableDecoration;
  import org.eclipse.gef.EditPart;
  import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
  import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
  import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
  import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
  import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
  import org.eclipse.gmf.runtime.notation.View;
  import org.eclipse.swt.graphics.Color;
  
  import oscfg.diagram.edit.policies.BaseTaskEnterExitMutexItemSemanticEditPolicy;
  
  /**
   * @generated
   */
  public class BaseTaskEnterExitMutexEditPart extends ConnectionNodeEditPart
  		implements ITreeBranchEditPart {
  
  	/**
  	 * @generated
  	 */
  	public static final int VISUAL_ID = 4003;
  
  	/**
  	 * @generated
  	 */
  	public BaseTaskEnterExitMutexEditPart(View view) {
  		super(view);
  	}
  
  	/**
  	 * @generated
  	 */
  	protected void createDefaultEditPolicies() {
  		super.createDefaultEditPolicies();
  		installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE,
  				new BaseTaskEnterExitMutexItemSemanticEditPolicy());
  	}
  
  	/**
  	 * @generated
  	 */
  	protected boolean addFixedChild(EditPart childEditPart) {
  		if (childEditPart instanceof WrappingLabel3EditPart) {
  			((WrappingLabel3EditPart) childEditPart).setLabel(getPrimaryShape()
  					.getFigureEnterExitMutexLabel());
  			return true;
  		}
  		return false;
  	}
  
  	/**
  	 * @generated
  	 */
  	protected void addChildVisual(EditPart childEditPart, int index) {
  		if (addFixedChild(childEditPart)) {
  			return;
  		}
  		super.addChildVisual(childEditPart, index);
  	}
  
  	/**
  	 * @generated
  	 */
  	protected boolean removeFixedChild(EditPart childEditPart) {
  		if (childEditPart instanceof WrappingLabel3EditPart) {
  			return true;
  		}
  		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 <i>generated</i> tag and modify it.
  	 * 
  	 * @generated
  	 */
  
  	protected Connection createConnectionFigure() {
  		return new EnterExitMutexFigure();
  	}
  
  	/**
  	 * @generated
  	 */
  	public EnterExitMutexFigure getPrimaryShape() {
  		return (EnterExitMutexFigure) getFigure();
  	}
  
  	/**
  	 * @generated
  	 */
  	public class EnterExitMutexFigure extends PolylineConnectionEx {
  
  		/**
  		 * @generated
  		 */
  		private WrappingLabel fFigureEnterExitMutexLabel;
  
  		/**
  		 * @generated
  		 */
  		public EnterExitMutexFigure() {
  			this.setLineWidth(2);
  			this.setForegroundColor(THIS_FORE);
  
  			createContents();
  			setTargetDecoration(createTargetDecoration());
  		}
  
  		/**
  		 * @generated
  		 */
  		private void createContents() {
  
  			fFigureEnterExitMutexLabel = new WrappingLabel();
  			fFigureEnterExitMutexLabel.setText("Critical Section");
  
  			this.add(fFigureEnterExitMutexLabel);
  
  		}
  
  		/**
  		 * @generated
  		 */
  		private RotatableDecoration createTargetDecoration() {
  			PolylineDecoration df = new PolylineDecoration();
  			df.setLineWidth(2);
  			return df;
  		}
  
  		/**
  		 * @generated
  		 */
  		public WrappingLabel getFigureEnterExitMutexLabel() {
  			return fFigureEnterExitMutexLabel;
  		}
  
  	}
  
  	/**
  	 * @generated
  	 */
  	static final Color THIS_FORE = new Color(null, 236, 96, 96);
  
  }
  