private void addRelatedItem(JournalPageNode journalPageNode, RelatedItem item, RelatedItemNode lowestRelatedItemNode)
        {
            var relatedItemNode = DiagramModel.GetNode <RelatedItemNode>(item.Id);

            if (relatedItemNode == null)
            {
                relatedItemNode = DiagramModel.CreateNode <RelatedItemNode>(item.Id, journalPageNode.GetNextRelatedItemLocation(lowestRelatedItemNode), DiagramModel);
            }
            relatedItemNode.SetColorFrom(DiagramOptions.DiagramColors);
            linkRelatedNodes(journalPageNode, relatedItemNode);
            relatedItemNode.UpdateAttributesFromItem(item);
            relatedItemNode.ToolTipText = _toolTipCreator.GetToolTipFor(item);
        }
 private void redrawLinks(JournalPageNode childNode, JournalPageNode parentNode)
 {
     DiagramModel.BeginUpdate();
     try
     {
         childNode.ClearParentLinks();
         addLink(childNode, parentNode);
     }
     finally
     {
         DiagramModel.EndUpdate();
     }
 }
        private void addLink(JournalPageNode parentNode, JournalPageNode childNode)
        {
            var link = new JournalPageLink();

            link.Initialize(childNode, parentNode);
        }
 private void drawLinks(JournalPageNode childNode, JournalPageNode parentNode)
 {
     this.DoWithinLatch(() => { redrawLinks(childNode, parentNode); });
 }
 /// <summary>
 /// Returns a point which is to the immediate left of the <paramref name="lastInsertedNode"/>
 /// </summary>
 public PointF NextInsertLocationRelativeTo(JournalPageNode lastInsertedNode)
 {
     // Some magic constants here. 7 and 3 are derived by trial and error
     return(new PointF(lastInsertedNode.Center.X - 7 + 2 * lastInsertedNode.Width, lastInsertedNode.Center.Y - 3));
 }