Exemple #1
0
        internal override IReadOnlyCollection <IMxElement> ToMxElements()
        {
            var topLevelCell = MxCellBuilder.StartBuilding(0).Build();
            var secondCell   = MxCellBuilder.StartBuilding(1).WithParent(0).Build();
            var headingCell  = MxCellBuilder.StartBuilding(2)
                               .WithValue(HeadingText)
                               .WithStyle("swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=none;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;")
                               .WithParent(1)
                               .WithVertex(1)
                               .WithGeometry(
                MxGeometryBuilder.StartBuilding(140, 52)
                .WithY(_position.Y)
                .WithX(_position.X))
                               .Build();

            var propertyCells = new List <MxCell>();

            for (var i = 0; i < Properties.Count; i++)
            {
                var yAxis = _position.Y + ((i + 1) * 26);

                var cell = MxCellBuilder.StartBuilding(i + 3)
                           .WithValue(Properties.ElementAt(i))
                           .WithStyle("text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;")
                           .WithParent(2)
                           .WithVertex(1)
                           .WithGeometry(
                    new MxGeometryBuilder(140, 26)
                    .WithX(230)
                    .WithY(yAxis))
                           .Build();

                propertyCells.Add(cell);
            }

            var result = new List <IMxElement>()
            {
                topLevelCell,
                secondCell,
                headingCell
            }.Concat(propertyCells).ToList();

            return(result);
        }
Exemple #2
0
        internal override IReadOnlyCollection <IMxElement> ToMxElements()
        {
            var topLevelCell = MxCellBuilder.StartBuilding(0).Build();
            var secondCell   = MxCellBuilder.StartBuilding(1).WithParent(0).Build();

            var descriptionCell = MxCellBuilder
                                  .StartBuilding(2)
                                  .WithValue("&lt;&lt;Annotation&gt;&gt;<br /><b>Component<b>")
                                  .WithStyle("html=1;")
                                  .WithVertex(1)
                                  .WithParent(1)
                                  .WithGeometry(new MxGeometryBuilder(180, 90)
                                                .WithX(210)
                                                .WithY(210))
                                  .Build();

            var componentShapeCell = MxCellBuilder
                                     .StartBuilding(3)
                                     .WithValue(string.Empty)
                                     .WithStyle("shape=component;jettyWidth=8;jettyHeight=4;")
                                     .WithVertex(1)
                                     .WithParent(2)
                                     .WithGeometry(new MxGeometryBuilder(20, 20)
                                                   .WithRelativeCellId(1)
                                                   .WithX(1)
                                                   .WithPoint(new MxPoint(-27, 7)))
                                     .Build();

            var result = new List <IMxElement>()
            {
                topLevelCell,
                secondCell,
                descriptionCell,
                componentShapeCell
            };

            return(result);
        }