예제 #1
0
 public void ExportDomainProperty(DomainProperty domprop)
 {
     var name = new StringBuilder (domprop.Name);
     if (name.Length > 30) {
         var midspace = domprop.Name.IndexOf (' ', (domprop.Name.Length / 2) - 1);
         name.Replace (" ", @"\n", midspace, 1);
     }
     writer.WriteLine (@"""{0}"" [shape=trapezium,label=""{1}"",style=filled,fillcolor=""{2}"",fontname=""HelveticaNeue"",fontsize=9,margin=""-.2,0""];",
                       domprop.Identifier, name, "#e8fdcb");
 }
예제 #2
0
 public static MvcHtmlString GetLink(this HtmlHelper helper, DomainProperty domprop)
 {
     return helper.ActionLink (domprop.FriendlyName, "GoalModel");
 }
예제 #3
0
 private static void AddElementsFor(this IList<string> alphabet, DomainProperty domprop)
 {
     alphabet.AddElementsFor (domprop.FormalSpec);
 }
예제 #4
0
 public void Add(DomainProperty domProp)
 {
     this.DomainPropertyIdentifiers.Add (domProp.Identifier);
 }
예제 #5
0
 public void Remove(DomainProperty domProp)
 {
     this.DomainPropertyIdentifiers.Remove (domProp.Identifier);
 }
예제 #6
0
 public void Add(DomainProperty agent)
 {
     DomainProperties.Add (agent);
 }
예제 #7
0
        public static IEncodedString GetPartialDomPropDiagram(DomainProperty domprop)
        {
            var view = new PartialModelView ();
            view.Add (domprop);

            foreach (var r in domprop.GoalRefinements ()) {
                view.Add (r);
                view.Add (r.ParentGoal ());
                foreach (var gg in r.SubGoals ()) {
                    view.Add (gg);
                }
                foreach (var gg in r.DomainProperties ()) {
                    view.Add (gg);
                }
                foreach (var gg in r.DomainHypotheses ()) {
                    view.Add (gg);
                }
            }

            foreach (var r in domprop.ObstacleRefinements ()) {
                view.Add (r);
                view.Add (r.ParentObstacle ());
                foreach (var gg in r.SubObstacles ()) {
                    view.Add (gg);
                }
            }

            var stream1 = new MemoryStream();
            var ser = new DataContractJsonSerializer(typeof(PartialModelView));
            ser.WriteObject(stream1, view);
            stream1.Position = 0;
            StreamReader sr = new StreamReader(stream1);
            return new RawString (sr.ReadToEnd());
        }
 protected void Render(DomainProperty domProp)
 {
     AddHomeShape (domProp.Identifier, domProp.FriendlyName,
         1, 0.895214, 1, 0.72515);
 }