private string getTree(LinkStyle linkStyle)
        {
            switch (linkStyle)
            {
            case LinkStyle.lsDirectMode:
            case LinkStyle.lsAutoRouteMode:
            case LinkStyle.lsCustomMode:
                return(string.Empty);

            case LinkStyle.lsTreeVerticalTree:
                return("V");

            case LinkStyle.lsTreeHorizontalTree:
                return("H");

            case LinkStyle.lsLateralHorizontalTree:
                return("LH");

            case LinkStyle.lsLateralVerticalTree:
                return("LC");

            case LinkStyle.lsOrthogonalSquareTree:
                return("OS");

            case LinkStyle.lsOrthogonalRoundedTree:
                return("OR");

            default:
                return("OR");
            }
        }
Example #2
0
 /// <summary>
 /// 初始化HtmlPager对象
 /// </summary>
 /// <param name="dataPage"></param>
 public HtmlPager(DataPage dataPage)
 {
     this.dataPage = dataPage;
     this.linkSize = 10;
     this.lstyle   = LinkStyle.Custom;
     this.bstyle   = ButtonStyle.Href;
 }
Example #3
0
        public WaypointLink AddLink(Waypoint destination, LinkStyle stlye, string script)
        {
            WaypointLink result = new WaypointLink(this, destination, stlye, script);

            Links.Add(destination.Id, result);
            return(result);
        }
Example #4
0
 public LinkStyle LinkStyle()
 {
     if (linkStyle == null)
     {
         linkStyle = new LinkStyle();
     }
     return(linkStyle);
 }
Example #5
0
 public LinkStroke(LinkStroke linkStroke, StylusPointCollection pts) : base(pts)
 {
     guid       = Guid.NewGuid();
     name       = linkStroke.name;
     from       = new AnchorPoint(linkStroke.from);
     to         = new AnchorPoint(linkStroke.to);
     strokeType = linkStroke.strokeType;
     linkType   = linkStroke.linkType;
     style      = new LinkStyle(linkStroke.style);
     path       = new List <Coordinates>();
     path.AddRange(linkStroke.path);
     addStylusPointsToLink();
 }
Example #6
0
        public LinkDrawing(ILinkableDrawing source, ILinkableDrawing destination,
			float lineWidth, float selectedLineWidth, LinkStyle linkStyle)
        {
            this.color = Color.Black;
            this.lineWidth = lineWidth;
            this.selectedLineWidth = selectedLineWidth;
            this.linkStyle = linkStyle;
            this.sourcePoint = new CardinalLinkPoint(this);
            this.destinationPoint = new CardinalLinkPoint(this);
            this.sourceDrawing = source;
            this.destinationDrawing = destination;
            this.direction = new LinkDirection(CardinalDirection.None, CardinalDirection.None);
        }
Example #7
0
        public LinkStroke(Point pointFrom, string formId, int anchor, LinkTypes linkType, StylusPointCollection stylusPointCollection) : base(stylusPointCollection)
        {
            guid          = Guid.NewGuid();
            name          = "Link";
            this.linkType = (int)linkType;

            from = new AnchorPoint(formId, anchor, "");
            to   = new AnchorPoint();
            to.SetDefaults();
            strokeType = (int)StrokeTypes.LINK;
            style      = new LinkStyle();
            style.SetDefaults();
            path = new List <Coordinates>();
            path.Add(new Coordinates(pointFrom));
        }
Example #8
0
        public WaypointLink(Waypoint source, Waypoint destination, LinkStyle style)
        {
            Source      = source;
            Destination = destination;
            Style       = style;

            if (style == LinkStyle.Walk)
            {
                Distance = source.Coordinates.Distance(destination.Coordinates);
            }
            else
            {
                Distance = 1200;
            }
        }
        public void setStyle(LinkStyle linkStyle)
        {
            string lineStyleString = this.wrappedDiagramLink.Style;
            string mode            = getMode(linkStyle);
            string tree            = getTree(linkStyle);

            //set the Mode
            lineStyleString = KeyValuePairsHelper.setValueForKey("Mode", mode, lineStyleString);
            //set the TREE
            if (string.IsNullOrEmpty(tree))
            {
                lineStyleString = KeyValuePairsHelper.RemoveKey("TREE", lineStyleString);
            }
            else
            {
                lineStyleString = KeyValuePairsHelper.setValueForKey("TREE", tree, lineStyleString);
            }
            this.wrappedDiagramLink.Style = lineStyleString;
        }
Example #10
0
        public LinkStroke(StylusPointCollection pts) : base(pts)
        {
            guid = Guid.NewGuid();
            name = "Link";
            from = new AnchorPoint();
            from.SetDefaults();
            to = new AnchorPoint();
            to.SetDefaults();
            strokeType = (int)StrokeTypes.LINK;
            linkType   = (int)LinkTypes.TWO_WAY_ASSOCIATION;
            style      = new LinkStyle();
            style.SetDefaults();
            path = new List <Coordinates>();

            DrawingAttributes.Width  = getThickness();
            DrawingAttributes.Height = getThickness();

            StylusPoint firstPoint = pts[0];
            StylusPoint lastPoint  = pts[pts.Count - 1];

            // garder uniquement le premier point
            while (StylusPoints.Count > 1)
            {
                StylusPoints.RemoveAt(1);
            }
            path.Add(new Coordinates(StylusPoints[0].ToPoint()));

            if (!lastPoint.Equals(firstPoint))
            {
                StylusPoints.Add(new StylusPoint(lastPoint.X, lastPoint.Y));
                path.Add(new Coordinates(lastPoint.X, lastPoint.Y));
            }
            else
            {
                StylusPoints.Add(new StylusPoint(firstPoint.X + 100, lastPoint.Y + 100));
                path.Add(new Coordinates(StylusPoints[1].X, StylusPoints[1].Y));
            }

            addStylusPointsToLink();
        }
        private string getMode(LinkStyle linkStyle)
        {
            switch (linkStyle)
            {
            case LinkStyle.lsDirectMode:
                return("1");

            case LinkStyle.lsAutoRouteMode:
                return("2");

            case LinkStyle.lsCustomMode:
            case LinkStyle.lsTreeVerticalTree:
            case LinkStyle.lsTreeHorizontalTree:
            case LinkStyle.lsLateralHorizontalTree:
            case LinkStyle.lsLateralVerticalTree:
            case LinkStyle.lsOrthogonalSquareTree:
            case LinkStyle.lsOrthogonalRoundedTree:
                return("3");

            default:
                return("3");
            }
        }
Example #12
0
 /// <summary>
 /// 初始化HtmlPager对象
 /// </summary>
 /// <param name="dataPage"></param>
 public HtmlPager(DataPage dataPage)
 {
     this.dataPage = dataPage;
     this.linkSize = 10;
     this.lstyle = LinkStyle.Custom;
     this.bstyle = ButtonStyle.Href;
 }
Example #13
0
 public WaypointLink(Waypoint source, Waypoint destination, LinkStyle style, string script) : this(source, destination, style)
 {
     Script = script;
 }
Example #14
0
        public LinkDrawing(ILink link, float lineWidth, float selectedLineWidth, LinkStyle linkStyle)
            : this((ILinkableDrawing)link.Source.Drawing,
				(ILinkableDrawing)link.Destination.Drawing, 
				lineWidth, selectedLineWidth, linkStyle)
        {
        }
Example #15
0
 public LinkStyle(LinkStyle style)
 {
     color     = style.color;
     thickness = style.thickness;
     type      = style.type;
 }
Example #16
0
 public Link(string text, string url, LinkStyle style)
 {
     Text = text;
     Url = url;
     Style = style;
 }
Example #17
0
 public LinkDrawing CreateLink(ILink link, int lineWidth, int selectedLineWidth, LinkStyle linkStyle)
 {
     LinkDrawing linkDrawing = new LinkDrawing(link, lineWidth, selectedLineWidth, linkStyle);
     return linkDrawing;
 }
 public SamDiagrams.Drawers.Links.LinkDrawing CreateLink(SamDiagrams.Model.ILink link, int lineWidth, int selectedLineWidth, LinkStyle streightLines)
 {
     throw new NotImplementedException();
 }