Beispiel #1
0
        public void DrawCloser(GoTextNode originalNode, GoTextNode currentNode, GoLayer layer, float modifier, List <GoTextNode> visited = null)
        {
            if (visited == null)
            {
                visited = new List <GoTextNode>()
                {
                    currentNode
                };
            }

            foreach (GoTextNode backNode in currentNode.LeftPort.Links.Cast <GoLink>().Where(x => x.Layer == layer).Select(x => x.FromNode))
            {
                if (visited.Contains(backNode))
                {
                    continue;
                }
                visited.Add(backNode);
                float xLoc = backNode.Location.X;
                float yLoc = (originalNode.Location.Y + backNode.Location.Y) / modifier;
                backNode.Location = new PointF(xLoc, yLoc);
                if (modifier <= 1)
                {
                    modifier -= 0.1f;
                }
                DrawCloser(originalNode, backNode, layer, modifier, visited);
            }
        }
Beispiel #2
0
        public Lifeline(Color color, Color textColor)
        {
            Resizable = false;

            header = new GoTextNode();
            header.Selectable = false;
            header.TopPort = null; // don't need these ports
            header.LeftPort = null;
            header.RightPort = null;
            header.BottomPort = null;
            header.Text = "name : class";
            header.Label.TextColor = textColor;
            header.Label.Alignment = MiddleTop;
            header.Label.Wrapping = true;
            header.Label.WrappingWidth = 100;
            header.Label.Editable = false;
            header.Label.BackgroundColor = color;
            header.Shape.BrushColor = color;
            header.Shape.Pen = new Pen(textColor, 2);

            header.Position = new PointF(10, 10);
            Add(header); // will be this[0]

            GoStroke line = new GoStroke();
            line.Selectable = false;
            Pen pen = new Pen(textColor, 2);
            pen.DashStyle = DashStyle.Dash;
            line.Pen = pen;
            line.AddPoint(new PointF());
            line.AddPoint(new PointF());
            Add(line); // will be this[1]

            LifelinePort port = new LifelinePort();
            Add(port); // will be this[2]
        }
Beispiel #3
0
        public Lifeline()
        {
            this.Resizable = false;

            GoTextNode header = new GoTextNode();

            header.Selectable          = false;
            header.TopPort             = null; // don't need these ports
            header.LeftPort            = null;
            header.RightPort           = null;
            header.BottomPort          = null;
            header.Text                = "name : class";
            header.Label.Alignment     = MiddleTop;
            header.Label.Wrapping      = true;
            header.Label.WrappingWidth = 100;
            header.Label.Editable      = true;
            header.Shape.BrushColor    = Color.LightGreen;
            header.Position            = new PointF(10, 10);
            Add(header); // will be this[0]

            GoStroke line = new GoStroke();

            line.Selectable = false;
            Pen pen = new Pen(Color.Black, 1);

            pen.DashStyle = DashStyle.Dash;
            line.Pen      = pen;
            line.AddPoint(new PointF());
            line.AddPoint(new PointF());
            Add(line); // will be this[1]

            LifelinePort port = new LifelinePort();

            Add(port); // will be this[2]
        }
Beispiel #4
0
        public GoLink MakeRelationship(GoTextNode a, GoTextNode b)
        {
            var l = new GoLink();

            l.Orthogonal = true;
            l.Style      = GoStrokeStyle.RoundedLine;
            l.Brush      = null;
            l.FromPort   = a.BottomPort;
            l.ToPort     = b.TopPort;
            return(l);
        }