Package org.jbpm.ui.common.model

Examples of org.jbpm.ui.common.model.Transition


        }
    }
   
    @Override
    protected void refreshVisuals() {
        Transition transition = getModel();
        if (transition.getSource() instanceof TaskState && !PluginConstants.TIMER_TRANSITION_NAME.equals(transition.getName())) {
            String label;
            if (((TaskState) transition.getSource()).hasMultipleOutputTransitions()) {
                label = transition.getName();
            } else {
                label = "";
            }
            getFigure().setLabelText(label);
        }
        if (transition.getSource() instanceof ActionNode){
            String label;
            if (transition.getSource().getLeavingTransitions().size() > 1) {
                label = transition.getName();
            } else {
                label = "";
            }
            getFigure().setLabelText(label);
        }
View Full Code Here


        }
        return (T) element;
    }
   
    private void parseTransition(Node node, GraphElement parent) {
        Transition transition = create(node, parent);
        String targetName = getAttribute(node, TO_ATTR);
        TRANSITION_TARGETS.put(transition, targetName);
    }
View Full Code Here

    }

    @Override
    protected Command getReconnectTargetCommand(ReconnectRequest request) {
        Node node = getNode();
        Transition transition = getTransition(request);
        if (!node.canReconnectArrivingTransition(transition, transition.getSource())
                || !transition.getSource().canReconnectLeavingTransition(transition, node)) {
            return null;
        }
        TransitionReconnectCommand cmd = new TransitionReconnectCommand();
        cmd.setTransition(transition);
        cmd.setTarget(node);
View Full Code Here

    }

    @Override
    protected Command getReconnectSourceCommand(ReconnectRequest request) {
        Node node = getNode();
        Transition transition = getTransition(request);
        if (!node.canReconnectLeavingTransition(transition, transition.getTarget())
                || !transition.getTarget().canReconnectArrivingTransition(transition, node)) {
            return null;
        }
        TransitionReconnectCommand cmd = new TransitionReconnectCommand();
        cmd.setTransition(transition);
        cmd.setSource(node);
View Full Code Here

                List<Transition> transitions = node.getChildren(Transition.class);
                for (Transition transition : transitions) {
                    Node source = targetNodeList.get(transition.getSource().getName());
                    Node target = targetNodeList.get(transition.getTarget().getName());
                    if (source != null && target != null) {
                        Transition tr = (Transition) trFactory.getNewObject(source);
                        tr.setName(transition.getName());
                        tr.setTarget(target);
                        for (Bendpoint bp : transition.getBendpoints()) {
                            tr.getBendpoints().add(new Bendpoint(bp.getX(), bp.getY()));
                        }
                        source.addLeavingTransition(tr);

                        for (org.jbpm.ui.common.model.Action action : transition.getActions()) {
                            AddActionHandlerAction copyAction = new AddActionHandlerAction(tr, action);
View Full Code Here

        return (TransitionFigure) super.getFigure();
    }

    @Override
    protected IFigure createFigure() {
        Transition transition = getModel();
        final TransitionFigure figure = transition.getTypeDefinition().createFigure(getModel().getProcessDefinition());
        figure.setRoutingConstraint(constructFigureBendpointList());
        if (transition.getSource() instanceof Decision) {
            figure.setLabelText(transition.getName());
        }
        if (transition.getSource() instanceof ITimed && transition.getName().equals(PluginConstants.TIMER_TRANSITION_NAME)) {
          ITimed state = (ITimed) transition.getSource();
            figure.setLabelText(state.getDuration().toString());
        }
      boolean exclusive = getModel().getSource().isExclusive() && getModel().getSource().getLeavingTransitions().size() > 1;
        figure.setExclusive(exclusive);
      if (getModel().getSource() instanceof Decision) {
            Decision decision = (Decision) getModel().getSource();
            IDecisionProvider provider = CustomizationRegistry.getProvider(decision);
            if (transition.getName().equals(provider.getDefaultTransitionName(decision))) {
                figure.setDefaultFlow(true);
            }
      }
        figure.addRoutingListener(new RoutingListener() {
            public void invalidate(Connection connection) {
View Full Code Here

    public void propertyChange(PropertyChangeEvent evt) {
        String messageId = evt.getPropertyName();
        if (TRANSITION_BENDPOINTS_CHANGED.equals(messageId)) {
            refreshVisuals();
        } else if (PROPERTY_NAME.equals(messageId) && evt.getSource() instanceof Transition) {
            Transition transition = getModel();
            if (transition.getSource() instanceof Decision) {
                getFigure().setLabelText(transition.getName());
                refreshVisuals();
                // update decision configuration
                Decision decision = (Decision) transition.getSource();
                IDecisionProvider provider = CustomizationRegistry.getProvider(decision);
                provider.transitionRenamed(decision, (String) evt.getOldValue(), (String) evt.getNewValue());
            }
            if (transition.getSource() instanceof ITimed) {
                ITimed state = (ITimed) transition.getSource();
                String labelText = state.timerExist() ? state.getDuration().toString() : "";
                getFigure().setLabelText(labelText);
                refreshVisuals();
            }
        } else if (PROPERTY_TIMER_DURATION.equals(messageId)) {
            Transition transition = getModel();
            if (transition.getName().equals(PluginConstants.TIMER_TRANSITION_NAME)) {
              ITimed state = (ITimed) transition.getSource();
                getFigure().setLabelText(state.getDuration().toString());
                refreshVisuals();
            }
        } else if (NODE_CHILDS_CHANGED.equals(messageId)) {
            refreshChildren();
View Full Code Here

        }
        return (T) element;
    }

    private void parseTransition(Node node, GraphElement parent) {
        Transition transition = create(node, parent);
        String targetName = getAttribute(node, TO_ATTR);
        TRANSION_TARGETS.put(transition, targetName);
    }
View Full Code Here

TOP

Related Classes of org.jbpm.ui.common.model.Transition

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.