protected void AddBaseNodeBindings(GoXmlBindingTransformer bt)
 {
     bt.AddBinding("Id");
     bt.AddBinding("Name");
     AddWithLayoutInfoBindings(bt);
     bt.AddBinding("Description");
 }
Esempio n. 2
0
 private static void AddBrushBindings(GoXmlBindingTransformer t, string xmlprefix, string objprefix)
 {
     t.AddBinding(xmlprefix + "color", objprefix + ".BrushColor");
     t.AddBinding(xmlprefix + "midcolor", objprefix + ".BrushMidColor");
     t.AddBinding(xmlprefix + "forecolor", objprefix + ".BrushForeColor");
     t.AddBinding(xmlprefix + "midfraction", objprefix + ".BrushMidFraction");
     t.AddBinding(xmlprefix + "brushstyle", objprefix + ".BrushStyle");
 }
 protected void AddWithLayoutInfoBindings(GoXmlBindingTransformer bt)
 {
     AddWithLocationBindings(bt);
     bt.AddBinding("Hidden");
     bt.AddBinding("IsVisible");
     bt.AddBinding("LocationFixed");
     bt.AddBinding("UserFlags");
 }
 protected void AddContainerBaseNodeBindings(GoXmlBindingTransformer bt)
 {
     bt.HandlesChildren                  = true;
     bt.HandlesChildAttributes           = true;
     bt.HandlesSubGraphCollapsedChildren = true;
     AddBaseNodeBindings(bt);
     bt.AddBinding("IsLogical");
     bt.AddBinding("IsExpanded");
     bt.AddBinding("IsExpandedByDefault");
 }
Esempio n. 5
0
 private static void AddFontBindings(GoXmlBindingTransformer t, string xmlprefix, string objprefix)
 {
     t.AddBinding(xmlprefix + "familyname", objprefix + ".FamilyName");
     t.AddBinding(xmlprefix + "fontsize", objprefix + ".FontSize");
     t.AddBinding(xmlprefix + "alignment", objprefix + ".Alignment");
     t.AddBinding(xmlprefix + "bold", objprefix + ".Bold");
     t.AddBinding(xmlprefix + "italic", objprefix + ".Italic");
     t.AddBinding(xmlprefix + "multiline", objprefix + ".Multiline");
     t.AddBinding(xmlprefix + "strikethru", objprefix + ".StrikeThrough");
     t.AddBinding(xmlprefix + "underline", objprefix + ".Underline");
     t.AddBinding(xmlprefix + "textcolor", objprefix + ".TextColor");
 }
Esempio n. 6
0
        // TODO: adapt the XML elements and attributes to match your classes and their properties
        private static void InitReaderWriter(GoXmlReaderWriterBase rw)
        {
            GoXmlBindingTransformer.DefaultTracingEnabled = true;  // for debugging, check your Output window (trace listener)
            GoXmlBindingTransformer t;

            t = new GoXmlBindingTransformer("statechart", new StateChartDocument());
            t.AddBinding("version", "Version", GoXmlBindingFlags.RethrowsExceptions);  // let exception from Version setter propagate out
            t.AddBinding("name", "Name");
            t.AddBinding("path", "Path");
            rw.AddTransformer(t);

            t = new GoXmlBindingTransformer("comment", NewComment());
            t.IdAttributeUsedForSharedObjects = true; // each GoComment gets a unique ID
            t.AddBinding("label", "Text");
            t.AddBinding("center", "Center");         // last property, since it depends on content/alignment
            AddBrushBindings(t, "", "Shape");
            AddPenBindings(t, "pen", "Shape");
            AddFontBindings(t, "label", "Label");
            rw.AddTransformer(t);

            t = new GoXmlBindingTransformer("state", NewNode());
            t.IdAttributeUsedForSharedObjects = true; // each GraphNode gets a unique ID
            t.HandlesNamedPorts = true;               // generate attributes for each of the named ports, specifying their IDs
            t.AddBinding("label", "Text");
            t.AddBinding("loc", "Location");
            AddBrushBindings(t, "", "Shape");
            AddPenBindings(t, "pen", "Shape");
            AddFontBindings(t, "label", "Label");
            //t.AddBinding("userFlags", "UserFlags");
            rw.AddTransformer(t);



            t = new GoXmlBindingTransformer("transition", new AnimatedLink());
            t.AddBinding("from", "FromPort");
            t.AddBinding("to", "ToPort");
            t.AddBinding("curviness", "Curviness");
            t.AddBinding("brush", "RealLink.BrushColor");
            t.AddBinding("adjusted", "RealLink.AdjustingStyle");
            t.AddBinding("points", "RealLink.Points");
            t.AddBinding("label", "Text");
            //t.AddBinding("userFlags", "UserFlags");
            AddPenBindings(t, "pen", "RealLink");
            AddFontBindings(t, "label", "MidLabel");
            rw.AddTransformer(t);
        }
Esempio n. 7
0
        // TODO: adapt the XML elements and attributes to match your classes and their properties
        private static void InitReaderWriter(GoXmlReaderWriterBase rw)
        {
            GoXmlBindingTransformer.DefaultTracingEnabled = true;  // for debugging, check your Output window (trace listener)
            GoXmlBindingTransformer t;

            t = new GoXmlBindingTransformer("flowchart", new GraphDoc());
            t.AddBinding("version", "Version", GoXmlBindingFlags.RethrowsExceptions);  // let exception from Version setter propagate out
            t.AddBinding("name", "Name");
            t.AddBinding("nextnodepos", "InternalNextNodePos");
            rw.AddTransformer(t);

            t = new GoXmlBindingTransformer("node", new GraphNode());
            t.IdAttributeUsedForSharedObjects = true; // each GraphNode gets a unique ID
            t.HandlesNamedPorts = true;               // generate attributes for each of the named ports, specifying their IDs
            t.AddBinding("kind", "Kind");
            t.AddBinding("text", "Text");
            t.AddBinding("pos", "Position");
            rw.AddTransformer(t);

            t = new GoXmlBindingTransformer("title", new Title());
            rw.AddTransformer(t);

            t = new GoXmlBindingTransformer("comment", new GoComment());
            t.IdAttributeUsedForSharedObjects = true;  // each GoComment and Title gets a unique ID
            t.AddBinding("text", "Text");
            t.AddBinding("familyname", "Label.FamilyName");
            t.AddBinding("fontsize", "Label.FontSize");
            t.AddBinding("alignment", "Label.Alignment");
            t.AddBinding("bold", "Label.Bold");
            t.AddBinding("italic", "Label.Italic");
            t.AddBinding("strikethrough", "Label.StrikeThrough");
            t.AddBinding("underline", "Label.Underline");
            t.AddBinding("multiline", "Label.Multiline");
            t.AddBinding("wrapping", "Label.Wrapping");
            t.AddBinding("wrappingwidth", "Label.WrappingWidth");
            t.AddBinding("editable", "Label.Editable");
            t.AddBinding("loc", "Location");  // last property, since it depends on content/alignment
            rw.AddTransformer(t);

            t = new GoXmlBindingTransformer("link", new GraphLink());
            t.AddBinding("from", "FromPort");
            t.AddBinding("to", "ToPort");
            //t.AddBinding("LabelType", "FromOrTo");
            t.AddBinding("label", "Text");
            rw.AddTransformer(t);
        }
        private void addExpandableElementBaseNodeBindingFor <T>(T node)
        {
            var bt = new GoXmlBindingTransformer(node);

            bt.AddBinding("IsExpanded");
            AddElementBaseNodeBindings(bt);
            Transformers.Add(bt);
        }
        public FormDiagram(List <string[]> pre_data, List <KeyValuePair <int, float> > time_sequence)
        {
            InitializeComponent();

            this.Text = Application.ProductName + " - Precedence Diagram";

            rawData     = pre_data;
            indexNumber = time_sequence.Count;

            nodes = new GoBasicNode[indexNumber];
            links = new GoLink[rawData.Count];

            timeSeq = time_sequence;
            createDiagram(rawData);

            #region Graph Data Test

            #region Adding Transformer

            GoBasicNode             node = new GoBasicNode();
            GoXmlBindingTransformer x    = new GoXmlBindingTransformer("node", node);
            x.IdAttributeUsedForSharedObjects = true;
            x.TreeStructured      = true;
            x.TreeLinkPrototype   = new GoLink();
            x.TreeLinksToChildren = true;
            x.AddBinding("label", "Text");
            x.AddBinding("parent", "TreeParentNode");

            #endregion

            GoXmlWriter w = new GoXmlWriter();
            w.AddTransformer(x);
            w.Objects = goViewDiagram.Document;
            using (StreamWriter writer = new StreamWriter("output.xml"))
            {
                w.Generate(writer);
            }
            #endregion
        }
Esempio n. 10
0
        private static void InitReaderWriterA(GoXmlReaderWriterBase rw)
        {
            GoXmlBindingTransformer tr = new GoXmlBindingTransformer("node", new GraphNode(GraphNodeKind.End));

            // indicate that the XML consists of nested elements
            tr.TreeStructured = true;
            // provide the prototype link for connecting the nodes
            tr.TreeLinkPrototype = new GoLink();
            // indicate the direction of the link (from parent to child)
            tr.TreeLinksToChildren = true;
            //tr.AddBinding("label", "Text");

            //tr.AddBinding("kind", "Kind");
            tr.AddBinding("text", "Text");

            rw.AddTransformer(tr);
        }
Esempio n. 11
0
 private static void AddPenBindings(GoXmlBindingTransformer t, string xmlprefix, string objprefix)
 {
     t.AddBinding(xmlprefix + "color", objprefix + ".PenColor");
     t.AddBinding(xmlprefix + "width", objprefix + ".PenWidth");
     t.AddBinding(xmlprefix + "dashstyle", objprefix + ".Pen.DashStyle");
 }
 protected void AddReactionNodeBindings(GoXmlBindingTransformer bt)
 {
     AddElementBaseNodeBindings(bt);
     bt.AddBinding("DisplayEductsRight");
 }
 protected void AddNeighborhoodNodeBindings(GoXmlBindingTransformer bt)
 {
     AddElementBaseNodeBindings(bt);
     bt.AddBinding("FirstNeighbor");
     bt.AddBinding("SecondNeighbor");
 }
 public void AddElementBaseNodeBindings(GoXmlBindingTransformer bt)
 {
     AddBaseNodeBindings(bt);
     bt.AddBinding("NodeSize");
     // NodeBaseSize must not be serialized, because is determined in Constructor / copy
 }
 protected void AddWithLocationBindings(GoXmlBindingTransformer bt)
 {
     bt.AddBinding("Location");
     bt.AddBinding("Size");
     // Center must not be serialized, because is determined by Location and Size
 }