Esempio n. 1
0
        public wStrokes(wGraphic SetGraphic, StrokeTypes SetStrokeType)
        {
            Graphic    = SetGraphic;
            StrokeType = SetStrokeType;

            switch (SetStrokeType)
            {
            default:
                SetDefault();
                break;

            case StrokeTypes.Transparent:
                SetTransparent();
                break;

            case StrokeTypes.OffWhiteSolid:
                SetOffWhite();
                break;

            case StrokeTypes.VeryLightGraySolid:
                SetVeryLightGray();
                break;

            case StrokeTypes.LineChart:
                SetLineChart();
                break;
            }
        }
Esempio n. 2
0
 public Stroke(Stroke stroke) : base()
 {
     this.type       = stroke.type;
     this.color      = new Color(stroke.color);
     this.weight     = stroke.weight;
     this.pattern    = stroke.pattern;
     this.dashoffset = stroke.dashoffset;
     this.cap        = stroke.cap;
     this.corner     = stroke.corner;
     this.miterLimit = stroke.miterLimit;
 }
        private static ShapeStroke createShapeStroke(dynamic shape)
        {
            StylusPointCollection points = new StylusPointCollection {
                new StylusPoint((double)shape.shapeStyle.coordinates.x / 2.1, (double)shape.shapeStyle.coordinates.y / 2.1)
            };

            shape.shapeStyle.height        = (double)shape.shapeStyle.height / 2.1;
            shape.shapeStyle.width         = (double)shape.shapeStyle.width / 2.1;
            shape.shapeStyle.coordinates.x = (double)shape.shapeStyle.coordinates.x / 2.1;
            shape.shapeStyle.coordinates.y = (double)shape.shapeStyle.coordinates.y / 2.1;

            ShapeStroke shapeStroke;
            StrokeTypes type = (StrokeTypes)shape.type;

            switch (type)
            {
            case StrokeTypes.CLASS_SHAPE:
                shapeStroke = new ClassStroke(shape.ToObject <ClassShape>(), points);
                break;

            case StrokeTypes.ARTIFACT:
                shapeStroke = new ArtifactStroke(shape.ToObject <BasicShape>(), points);
                break;

            case StrokeTypes.ACTIVITY:
                shapeStroke = new ActivityStroke(shape.ToObject <BasicShape>(), points);
                break;

            case StrokeTypes.ROLE:
                shapeStroke = new ActorStroke(shape.ToObject <BasicShape>(), points);
                break;

            case StrokeTypes.COMMENT:
                shapeStroke = new CommentStroke(shape.ToObject <BasicShape>(), points);
                break;

            case StrokeTypes.PHASE:
                shapeStroke = new PhaseStroke(shape.ToObject <BasicShape>(), points);
                break;

            case StrokeTypes.FLOATINGTEXT:
                shapeStroke = new FloatingTextStroke(shape.ToObject <BasicShape>(), points);
                break;

            default:
                shapeStroke = new ClassStroke(shape.ToObject <ClassShape>(), points);
                break;
            }
            shapeStroke.guid = Guid.Parse((string)shape.id);

            return(shapeStroke);
        }
        private static ShapeStroke ShapeStrokeFromShape(BasicShape shape)
        {
            StrokeTypes type = (StrokeTypes)shape.type;
            ShapeStroke shapeStroke;

            StylusPointCollection points = new StylusPointCollection();
            StylusPoint           point  = new StylusPoint(shape.shapeStyle.coordinates.x, shape.shapeStyle.coordinates.y);

            points.Add(point);

            switch (type)
            {
            case StrokeTypes.CLASS_SHAPE:
                shapeStroke = new ClassStroke((ClassShape)shape, points);
                break;

            case StrokeTypes.ARTIFACT:
                shapeStroke = new ArtifactStroke(shape, points);
                break;

            case StrokeTypes.ACTIVITY:
                shapeStroke = new ActivityStroke(shape, points);
                break;

            case StrokeTypes.ROLE:
                shapeStroke = new ActorStroke(shape, points);
                break;

            case StrokeTypes.COMMENT:
                shapeStroke = new CommentStroke(shape, points);
                break;

            case StrokeTypes.PHASE:
                shapeStroke = new PhaseStroke(shape, points);
                break;

            case StrokeTypes.FLOATINGTEXT:
                shapeStroke = new FloatingTextStroke(shape, points);
                break;

            default:
                shapeStroke = new ActorStroke(shape, points);
                break;
            }

            return(shapeStroke);
        }
        private static LinkStroke LinkStrokeFromLink(Link link)
        {
            StrokeTypes type = (StrokeTypes)link.type;

            for (int i = 0; i < link.path.Count; i++)
            {
                link.path[i].x /= 2.1;
                link.path[i].y /= 2.1;
            }

            link.from = link.from.GetForLourd();
            link.to   = link.to.GetForLourd();

            return(new LinkStroke(link, new StylusPointCollection {
                new StylusPoint(0, 0)
            }));
        }
Esempio n. 6
0
 protected Stroke(StrokeTypes type) : base()
 {
     this.type = type;
 }