示例#1
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]
        }
示例#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]
        }