/// <inheritdoc/>
        internal override void UpdateIcon(INode node)
        {
            if (dataIcon == null)
            {
                UpdateDataIcon();
            }
            if (collectionIcon == null)
            {
                UpdateCollectionIcon();
            }

            var icons = new List <IIcon> {
                dataIcon
            };

            if (Collection)
            {
                icons.Add(collectionIcon);
            }
            if (typeIcon != null)
            {
                icons.Add(typeIcon);
            }
            if (icons.Count > 1)
            {
                Icon = IconFactory.CreateCombinedIcon(icons);
            }
            else
            {
                Icon = dataIcon;
            }
        }
 internal override void UpdateIcon(INode node)
 {
     if (gatewayIcon == null)
     {
         UpdateGatewayIcon();
     }
     Icon = typeIcon != null?IconFactory.CreateCombinedIcon(new[] { gatewayIcon, typeIcon }) : gatewayIcon;
 }
 private void UpdateTopInitiatingMessageIcon()
 {
     topInitiatingMessageIcon = IconFactory.CreateCombinedIcon(new[] {
         IconFactory.CreatePlacedIcon(messageLineIcon, ExteriorLabelModel.North, new SizeD(MessageDistance, MessageDistance)),
         IconFactory.CreatePlacedIcon(initiatingMessageIcon, BpmnConstants.ChoreographyTopMessagePlacement,
                                      BpmnConstants.MessageSize)
     });
 }
 private void UpdateBottomResponseMessageIcon()
 {
     bottomResponseMessageIcon = IconFactory.CreateCombinedIcon(new[] {
         IconFactory.CreatePlacedIcon(messageLineIcon, ExteriorLabelModel.South,
                                      new SizeD(MessageDistance, MessageDistance)),
         IconFactory.CreatePlacedIcon(responseMessageIcon, BpmnConstants.ChoreographyBottomMessagePlacement,
                                      BpmnConstants.MessageSize)
     });
 }
Exemple #5
0
 /// <inheritdoc/>
 internal override void UpdateIcon(INode node)
 {
     if (eventIcon == null)
     {
         CreateEventIcon();
     }
     if (typeIcon != null)
     {
         Icon = IconFactory.CreateCombinedIcon(new List <IIcon>(new[] { eventIcon, typeIcon }));
     }
     else
     {
         Icon = eventIcon;
     }
 }
Exemple #6
0
        private void UpdateIcon()
        {
            var typeIcon   = IconFactory.CreateConversation(type, Background, Outline);
            var markerIcon = IconFactory.CreateConversationMarker(type, IconColor);

            if (markerIcon != null)
            {
                markerIcon = IconFactory.CreatePlacedIcon(markerIcon, BpmnConstants.ConversationMarkerPlacement,
                                                          BpmnConstants.MarkerSize);
                typeIcon = IconFactory.CreateCombinedIcon(new List <IIcon>(new[] { typeIcon, markerIcon }));
            }

            Icon = IconFactory.CreatePlacedIcon(typeIcon, BpmnConstants.ConversationPlacement,
                                                BpmnConstants.ConversationSize);
        }
        private IIcon CreateParticipantIcon(Participant participant, bool top, bool isFirst)
        {
            var isInitializing = isFirst && (top ^ !InitiatingAtTop);

            var radius = BpmnConstants.ChoreographyCornerRadius;
            var icon   = IconFactory.CreateChoreographyParticipant(
                Outline, isInitializing ? InitiatingColor : ResponseColor,
                top && isFirst ? radius : 0,
                !top && isFirst ? radius : 0);

            if (participant.MultiInstance)
            {
                if (multiInstanceIcon == null)
                {
                    UpdateMultiInstanceIcon();
                }
                icon = IconFactory.CreateCombinedIcon(new List <IIcon>(new[] { icon, multiInstanceIcon }));
            }
            return(icon);
        }
        private IIcon CreateTaskBandIcon(INode node)
        {
            if (taskBandBackgroundIcon == null)
            {
                UpdateTaskBandIcon();
            }
            IIcon subStateIcon = null;

            if (SubState != SubState.None)
            {
                subStateIcon = SubState == SubState.Dynamic ? IconFactory.CreateDynamicSubState(node, IconColor) : IconFactory.CreateStaticSubState(SubState, IconColor);
            }

            IIcon markerIcon = null;

            if (loopIcon != null && subStateIcon != null)
            {
                markerIcon = IconFactory.CreateLineUpIcon(new List <IIcon>(new [] { loopIcon, subStateIcon }),
                                                          BpmnConstants.MarkerSize, 5);
            }
            else if (loopIcon != null)
            {
                markerIcon = loopIcon;
            }
            else if (subStateIcon != null)
            {
                markerIcon = subStateIcon;
            }
            if (markerIcon != null)
            {
                var placedMarkers = IconFactory.CreatePlacedIcon(markerIcon, BpmnConstants.ChoreographyMarkerPlacement,
                                                                 BpmnConstants.MarkerSize);
                return(IconFactory.CreateCombinedIcon(new List <IIcon>(new[] { taskBandBackgroundIcon, placedMarkers })));
            }
            else
            {
                return(taskBandBackgroundIcon);
            }
        }
        internal IIcon CreateIcon(INode node)
        {
            var minimumWidth = 10.0;

            var icons = new List <IIcon>();

            if (activityIcon != null)
            {
                icons.Add(activityIcon);
            }
            if (taskIcon != null)
            {
                icons.Add(taskIcon);
            }

            var lineUpIcons = new List <IIcon>();

            if (loopIcon != null)
            {
                minimumWidth += BpmnConstants.MarkerSize.Width + 5;
                lineUpIcons.Add(loopIcon);
            }
            if (AdHoc)
            {
                minimumWidth += BpmnConstants.MarkerSize.Width + 5;
                lineUpIcons.Add(adHocIcon);
            }
            if (Compensation)
            {
                minimumWidth += BpmnConstants.MarkerSize.Width + 5;
                lineUpIcons.Add(compensationIcon);
            }
            if (SubState != SubState.None)
            {
                minimumWidth += BpmnConstants.MarkerSize.Width + 5;
                if (SubState == SubState.Dynamic)
                {
                    lineUpIcons.Add(IconFactory.CreateDynamicSubState(node, IconColor));
                }
                else
                {
                    lineUpIcons.Add(IconFactory.CreateStaticSubState(SubState, IconColor));
                }
            }
            if (lineUpIcons.Count > 0)
            {
                IIcon lineUpIcon = IconFactory.CreateLineUpIcon(lineUpIcons, BpmnConstants.MarkerSize, 5);
                icons.Add(IconFactory.CreatePlacedIcon(lineUpIcon, BpmnConstants.TaskMarkerPlacement, BpmnConstants.MarkerSize));
            }

            MinimumSize = new SizeD(Math.Max(minimumWidth, 40), 40);
            if (icons.Count > 1)
            {
                return(IconFactory.CreateCombinedIcon(icons));
            }
            else if (icons.Count == 1)
            {
                return(icons[0]);
            }
            else
            {
                return(null);
            }
        }