예제 #1
0
파일: DotBuilder.cs 프로젝트: danaxa/Pencil
 static string Encode(RankDirection dir)
 {
     switch(dir)
     {
         case RankDirection.LeftRight: return "LR";
         default: return "TB";
     }
 }
예제 #2
0
 internal AutomaticLayout(RankDirection rankDirection, int rankSeparation, int nodeSeparation,
                          int edgeSeparation, bool vertices)
 {
     RankDirection  = rankDirection;
     RankSeparation = rankSeparation;
     NodeSeparation = nodeSeparation;
     EdgeSeparation = edgeSeparation;
     Vertices       = vertices;
 }
예제 #3
0
        public static GraphAttribute RankDirection(RankDirection rankDir)
        {
            if (!rankDir.IsValid())
            {
                throw new ArgumentException($"The { nameof(RankDirection) } provided must be a valid enum.", nameof(rankDir));
            }

            var rankDirStr = rankDir.AsString();

            return(new GraphAttribute("rankdir", rankDirStr));
        }
예제 #4
0
 /// <summary>
 /// Enables the automatic layout for this view, with the specified settings.
 /// </summary>
 /// <param name="rankDirection">the rank direction</param>
 /// <param name="rankSeparation">the separation between ranks (in pixels, a positive integer)</param>
 /// <param name="nodeSeparation">the separation between nodes within the same rank (in pixels, a positive integer)</param>
 /// <param name="edgeSeparation">the separation between edges (in pixels, a positive integer)</param>
 /// <param name="vertices">whether vertices should be created during automatic layout</param>
 public void EnableAutomaticLayout(RankDirection rankDirection, int rankSeparation, int nodeSeparation, int edgeSeparation, bool vertices)
 {
     AutomaticLayout = new AutomaticLayout(rankDirection, rankSeparation, nodeSeparation, edgeSeparation, vertices);
 }