Package org.enhydra.shark.xpdl.elements

Examples of org.enhydra.shark.xpdl.elements.Transitions


    protected boolean checkTransitionId(Transition newEl)
    {
        int idCnt = 0;
        WorkflowProcess proc = XMLUtil.getWorkflowProcess(newEl);
        String newId = newEl.getId();
        Transitions trans = proc.getTransitions();
        idCnt += XMLUtil.cntIds(trans, newId);
        ActivitySets actSets = proc.getActivitySets();
        for(int y = 0; y < actSets.size(); y++)
        {
            ActivitySet actSet = (ActivitySet)actSets.get(y);
View Full Code Here


                    GraphActivityInterface s = ((GraphPortInterface) firstPort.getCell()).getActivity();
                    GraphActivityInterface t = ((GraphPortInterface) pPort.getCell()).getActivity();
                    XMLElement sxpdl = s.getPropertyObject();
                    XMLElement txpdl = t.getPropertyObject();
                    if (sxpdl instanceof Activity && txpdl instanceof Activity) {
                        Transitions tras = (Transitions) getGraph().getXPDLObject().get("Transitions");
                        String fromId = ((Activity) sxpdl).getId();
                        String toId = ((Activity) txpdl).getId();
                        Transition tra = JaWEManager.getInstance().getXPDLObjectFactory().createXPDLObject(tras, subType, false);
                        tra.setFrom(fromId);
                        tra.setTo(toId);
                        if (fromId.equals(toId)) {
                            GraphUtilities.setStyle(tra, GraphEAConstants.EA_JAWE_GRAPH_TRANSITION_STYLE_VALUE_NO_ROUTING_BEZIER);
                        } else {
                            GraphUtilities.setStyle(tra, getGraphController().getGraphSettings().getDefaultTransitionStyle());
                        }
                        GraphUtilities.setBreakpoints(tra, points);
                        points.clear();
                        graphController.setUpdateInProgress(true);
                        JaWEManager.getInstance().getJaWEController().startUndouableChange();
                        tras.add(tra);
                        getGraphManager().insertTransition(tra);
                        List toSelect = new ArrayList();
                        toSelect.add(tra);
                        JaWEManager.getInstance().getJaWEController().endUndouableChange(toSelect);
                        getGraph().selectTransition(tra, false);
                        graphController.setUpdateInProgress(false);
                    } else if (sxpdl instanceof ExtendedAttribute && txpdl instanceof Activity) {
                        connectStartOrEndBubble((ExtendedAttribute) sxpdl, ((Activity) txpdl).getId());
                    } else if (txpdl instanceof ExtendedAttribute && sxpdl instanceof Activity) {
                        connectStartOrEndBubble((ExtendedAttribute) txpdl, ((Activity) sxpdl).getId());
                    }
                    return true;
                }
                // circular
            } else {
                if (validateConnection(pPort, pPort, null) && points.size() > 0) { // CUSTOM: only allow circular if there is another point

                    Point realP = (Point) getGraph().fromScreen(new Point(start));
                    List breakpoints = new ArrayList();
                    if (points.size() == 0) {
                        int rp50x1 = realP.x - 50;
                        int rp50x2 = realP.x + 50;
                        if (rp50x1 < 0) {
                            rp50x2 = rp50x2 - rp50x1;
                            rp50x1 = 0;
                        }
                        int rp50y = realP.y - 50;
                        if (rp50y < 0) {
                            rp50y = realP.y + 50;
                        }

                        breakpoints.add(new Point(Math.abs(rp50x1), Math.abs(rp50y)));
                        breakpoints.add(new Point(Math.abs(rp50x2), Math.abs(rp50y)));
                    } else {
                        breakpoints.addAll(points);
                        points.clear();
                    }

                    Activity act = (Activity) ((GraphPortInterface) firstPort.getCell()).getActivity().getPropertyObject();

                    Transitions tras = (Transitions) getGraph().getXPDLObject().get("Transitions");
                    Transition tra = JaWEManager.getInstance().getXPDLObjectFactory().createXPDLObject(tras, subType, false);
                    tra.setFrom(act.getId());
                    tra.setTo(act.getId());
                    GraphUtilities.setStyle(tra, GraphEAConstants.EA_JAWE_GRAPH_TRANSITION_STYLE_VALUE_NO_ROUTING_BEZIER);
                    GraphUtilities.setBreakpoints(tra, breakpoints);
                    getGraphController().setUpdateInProgress(true);
                    JaWEManager.getInstance().getJaWEController().startUndouableChange();
                    tras.add(tra);
                    getGraphManager().insertTransition(tra);
                    List toSelect = new ArrayList();
                    toSelect.add(tra);
                    JaWEManager.getInstance().getJaWEController().endUndouableChange(toSelect);
                    getGraph().selectTransition(tra, false);
View Full Code Here

    }

   public boolean checkTransitionId (Transition newEl,String newId) {
      WorkflowProcess proc = XMLUtil.getWorkflowProcess(newEl);

      Transitions trans = proc.getTransitions();
      List elsWithId=getElementsForId(trans, newId);
      ActivitySets actSets = proc.getActivitySets();
      for(int y = 0; y < actSets.size(); y++) {
         ActivitySet actSet = (ActivitySet)actSets.get(y);
         trans = actSet.getTransitions();
View Full Code Here

TOP

Related Classes of org.enhydra.shark.xpdl.elements.Transitions

Copyright © 2018 www.massapicom. 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.