Examples of ModelHandler


Examples of org.eclipse.bpmn2.modeler.core.ModelHandler

  public void addBendpoint(IAddBendpointContext context) {
    super.addBendpoint(context);
    try {
      FreeFormConnection connection = context.getConnection();
      BaseElement element = (BaseElement) BusinessObjectUtil.getFirstElementOfType(connection, BaseElement.class);
      ModelHandler modelHandler = ModelHandlerLocator.getModelHandler(getDiagram().eResource());

      Point p = DcFactory.eINSTANCE.createPoint();
      p.setX(context.getX());
      p.setY(context.getY());

      BPMNEdge edge = (BPMNEdge) modelHandler.findDIElement(getDiagram(), element);
      int index = context.getBendpointIndex() + 1;
      edge.getWaypoint().add(index, p);
      if (index == 1) {
        AnchorUtil.reConnect((BPMNShape) edge.getSourceElement(), getDiagram());
      } else if (index == connection.getBendpoints().size()) {
View Full Code Here

Examples of org.eclipse.bpmn2.modeler.core.ModelHandler

  @Override
  public Object[] create(ICreateContext context) {
    Lane lane = null;
    try {
      ModelHandler mh = ModelHandlerLocator.getModelHandler(getDiagram().eResource());
      Object o = getBusinessObjectForPictogramElement(context.getTargetContainer());
      if (FeatureSupport.isTargetLane(context)) {
        Lane targetLane = (Lane) o;
        lane = mh.createLane(targetLane);
      } else {
        lane = mh.createLane(o);
      }
      lane.setName("Lane nr " + index++);
    } catch (IOException e) {
      Activator.logError(e);
    }
View Full Code Here

Examples of org.eclipse.bpmn2.modeler.core.ModelHandler

  public boolean moveBendpoint(IMoveBendpointContext context) {
    boolean moved = super.moveBendpoint(context);
    try {
      FreeFormConnection connection = context.getConnection();
      BaseElement element = (BaseElement) BusinessObjectUtil.getFirstElementOfType(connection, BaseElement.class);
      ModelHandler modelHandler = ModelHandlerLocator.getModelHandler(getDiagram().eResource());
      BPMNEdge edge = (BPMNEdge) modelHandler.findDIElement(getDiagram(), element);
      int index = context.getBendpointIndex() + 1;
      Point p = edge.getWaypoint().get(index);
      p.setX(context.getX());
      p.setY(context.getY());
      if (index == 1) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.