/// <summary>
 /// Initializes a new instance of the <see cref="DiagramAssociationConnector"/> class.
 /// </summary>
 /// <param name="startConnector">The start connector.</param>
 /// <param name="endConnector">The end connector.</param>
 /// <remarks>
 /// Consturctor that specifies the two nodes that are connected.
 /// </remarks>
 internal DiagramAssociationConnector(DiagramConnectorNode startConnector, DiagramConnectorNode endConnector)
   : base(startConnector, endConnector)
 {
   BrushConverter bc = new BrushConverter();
   Brush brush = bc.ConvertFromString("#B0764F") as Brush;
   this.ResourcePen = new Pen(brush != null ? brush : Brushes.Sienna, 1);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DiagramInheritanceConnector"/> class.
 /// </summary>
 /// <param name="startConnector">The start connector.</param>
 /// <param name="endConnector">The end connector.</param>
 /// <remarks>
 /// Consturctor that specifies the two nodes that are connected.
 /// </remarks>
 internal DiagramInheritanceConnector(DiagramConnectorNode startConnector, DiagramConnectorNode endConnector)
   : base(startConnector, endConnector)
 {
   BrushConverter bc = new BrushConverter();
   Brush brush = bc.ConvertFromString("#716F64") as Brush;
   this.ResourcePen = new Pen(brush != null ? brush : Brushes.DimGray, 1);
 }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DiagramCallConnector"/> class.
 /// </summary>
 /// <param name="startConnector">The start connector.</param>
 /// <param name="endConnector">The end connector.</param>
 /// <remarks>
 /// Consturctor that specifies the two nodes that are connected.
 /// </remarks>
 public DiagramCallConnector(DiagramConnectorNode startConnector, DiagramConnectorNode endConnector)
   : base(startConnector, endConnector)
 {
   this.ResourcePen = new Pen(Brushes.Black, 1);
 }
예제 #4
0
    /// <summary>
    /// Creates the model descendant row.
    /// </summary>
    /// <returns>The newly created DiagramRow.</returns>
    internal DiagramRow CreateClassModelDescendantRow()
    {
      // TODO: Find proper algorithm to layout the shapes...
      // The object info nodes are contained in one groups, 
      DiagramGroup descendantGroup = new DiagramGroup();
      DiagramGroup baselessGroup = new DiagramGroup();

      // Set up the row.
      DiagramRow descendantRow = new DiagramRow();

      foreach (ExtendedObjectInfo objectInfo in this.DiagramModel)
      {
        // find descendants from primaryRow.PrimaryGroup.Nodes
        if (objectInfo.BaseType != null && this.objectInfoLookup.ContainsKey(objectInfo.BaseType) && !this.objectInfoLookup.ContainsKey(objectInfo))
        {
          if (!this.objectInfoLookup.ContainsKey(objectInfo))
          {
            DiagramNode node = CreateNode(objectInfo);
            descendantGroup.Add(node);
            DiagramConnectorNode startConnector = new DiagramConnectorNode(node, descendantGroup, descendantRow);
            this.objectInfoLookup.Add(node.ObjectInfo, startConnector);

            DiagramConnectorNode endConnector = this.objectInfoLookup[objectInfo.BaseType];

            // create inheritance connector
            this.connections.Add(new DiagramInheritanceConnector(startConnector, endConnector));

            // create association connector
            this.connections.Add(new DiagramAssociationConnector(startConnector, endConnector));
          }
        }
        else if (objectInfo.BaseType != null && !this.objectInfoLookup.ContainsKey(objectInfo))
        {
          if (!this.objectInfoLookup.ContainsKey(objectInfo))
          {
            DiagramNode node = CreateNode(objectInfo);
            descendantGroup.Add(node);
            this.objectInfoLookup.Add(node.ObjectInfo, new DiagramConnectorNode(node, descendantGroup, descendantRow));
          }
        }

        // add four more nodes (if available) to baselessGroup
      }

      descendantRow.Add(descendantGroup);
      descendantRow.Add(baselessGroup);

      return descendantRow;
    }
예제 #5
0
    /// <summary>
    /// Creates the message row.
    /// </summary>
    /// <param name="messageInfo">The message info.</param>
    /// <returns>A new message row.</returns>
    internal DiagramRow CreateSequenceMessageRow(MessageInfo messageInfo)
    {
      DiagramGroup group = new DiagramGroup();

      // Set up the row.
      DiagramRow row = new DiagramRow();
      DiagramConnectorNode sourceConnector = null;
      DiagramConnectorNode targetConnector = null;

      foreach (DiagramConnectorNode connectorNode in this.ObjectInfoLookup.Values)
      {
        DiagramNode node = CreateNode(messageInfo);
        if (messageInfo != null &&
          (connectorNode.Node.ObjectInfo == messageInfo.Source || connectorNode.Node.ObjectInfo == messageInfo.Target))
        {
          node.ObjectInfo = connectorNode.Node.ObjectInfo;
          if (connectorNode.Node.ObjectInfo == messageInfo.Source && sourceConnector == null)
          {
            sourceConnector = new DiagramConnectorNode(node, group, row);
          }
          else
          {
            targetConnector = new DiagramConnectorNode(node, group, row);
          }
        }

        group.Add(node);
      }

      if (targetConnector == null)
      {
        targetConnector = sourceConnector;
      }

      if (sourceConnector != null)
      {
        // add the message connection between the two nodes
        this.connections.Add(new DiagramCallConnector(sourceConnector, targetConnector));
      }

      row.Add(group);

      return row;
    }
예제 #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DiagramConnector"/> class.
 /// </summary>
 /// <param name="startConnector">The start connector.</param>
 /// <param name="endConnector">The end connector.</param>
 /// <remarks>
 /// Consturctor that specifies the two nodes that are connected.
 /// </remarks>
 protected DiagramConnector(DiagramConnectorNode startConnector, DiagramConnectorNode endConnector)
 {
   this.start = startConnector;
   this.end = endConnector;
 }