Esempio n. 1
0
 public Graph()
 {
     m_roots = new ArrayList();
       m_leafs = new ArrayList();
       m_parent = null;
       m_type = Factory.ObjectType.Graph;
 }
 public override object visit(Graph graph)
 {
     foreach (GraphNode node in graph.Roots)
       {
     node.getVisited(this);
       }
       return null;
 }
 public CppCompiler(Settings sett, Graph graph)
 {
     //
     // Required for Windows Form Designer support
     //
     InitializeComponent();
       m_settings = sett;
       m_graph = graph;
 }
Esempio n. 4
0
 public GraphNode()
 {
     m_location = new Point(0,0);
       m_size = new Point(0,0);
       m_succs = new ArrayList();
       m_preds = new ArrayList();
       m_properties = new ArrayList();
       m_type = Factory.ObjectType.GraphNode;
       m_name = "Node";
       m_lower_graph = null;
 }
 public CppSqlGenerationVisitor(Settings sett, Graph rooms)
 {
     m_settings = sett;
       m_graph = rooms;
       //System.Diagnostics.Process proc = new System.Diagnostics.Process();
       //proc.StartInfo.FileName = "sqlite.exe";
       m_conn = new SQLiteConnection("Data Source=adventure.hac;Version=3;New=True;Compress=True");
       m_conn.Open();
       m_cmd = m_conn.CreateCommand();
       m_propid = -1;
       m_statpropid = -1;
       m_respid = 0;
 }
Esempio n. 6
0
        public GraphForm()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

              m_graph = new Graph();
              m_left_down = false;
              m_node_func = new ArrayList();

              this.MouseDown +=new MouseEventHandler(GraphForm_MouseDown);
              this.MouseUp +=new MouseEventHandler(GraphForm_MouseUp);
              this.MouseMove +=new MouseEventHandler(GraphForm_MouseMove);
              this.Paint += new PaintEventHandler(GraphForm_Paint);
        }
Esempio n. 7
0
 public GraphNode(BinaryReader reader)
     : this()
 {
     m_location.X = reader.ReadInt32();
       m_location.Y = reader.ReadInt32();
       m_size.X = reader.ReadInt32();
       m_size.Y = reader.ReadInt32();
       m_name = reader.ReadString();
       m_type = Factory.ObjectType.GraphNode;
       int count = reader.ReadInt32();
       for (int i = 0; i < count; ++i){
     m_properties.Add(new ObjProperty(reader));
       }
       bool subgraph = reader.ReadBoolean();
       if (subgraph){
     //load subgraph
     //attention: currently, the parent member cannot be restored.
     //It is re-set when needed by the GraphFrom
     m_lower_graph = (Graph)Factory.makeObject(reader);
       }
 }
 public abstract object visit(Graph graph);
 public override object visit(Graph graph)
 {
     return null;
 }
Esempio n. 10
0
 private void graph_level_Click(object sender, System.EventArgs e)
 {
     if (m_graph.Parent != null){
     m_graph = m_graph.Parent;
     string tmp = graph_level.Text.Substring(6);
     int level = Convert.ToInt32(tmp);
     graph_level.Text = "level "+Convert.ToString(level-1);
     Invalidate();
       }
 }
Esempio n. 11
0
 private void GraphForm_MouseDown(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Right)
       {
     if (m_selection == null)
       return;
     //connect request
     Monitor.Enter(m_graph);
     GraphNodeSelectionVisitor gnsv = new GraphNodeSelectionVisitor(new Point(e.X,e.Y));
     GraphNode target = (GraphNode)m_graph.getVisited(gnsv);
     if (target != null)
     {
       //it was clicked on a node
       m_graph.connect(m_selection, target);
     }
     else{
       m_selection = null;
     }
     Monitor.Exit(m_graph);
       }
       else if (e.Button == MouseButtons.Left)
       {
     GraphNodeSelectionVisitor gnsv = new GraphNodeSelectionVisitor(new Point(e.X,e.Y));
     m_selection = (GraphNode)m_graph.getVisited(gnsv);
     if (m_selection != null)
     {
       //it was clicked on a node
       if (e.Clicks > 1)
       {
     //double click
     if (m_selection.LowerGraph == null)
     {
       m_selection.LowerGraph = m_gen_graph();
     }
     m_selection.LowerGraph.Parent = m_graph;
     m_graph = m_selection.LowerGraph;
     string tmp = graph_level.Text.Substring(6);
     int level = Convert.ToInt32(tmp);
     graph_level.Text = "level "+Convert.ToString(level+1);
     //m_selection.Name = "dc";
       }
       m_left_down = true;
     }
     else
     {
       m_click = new Point(e.X, e.Y);
       NodeMenu.Show(this, m_click);
     }
       }
       Invalidate();
 }