The Meta-Environment API
00001 #ifndef __GRAPH_UTILS__ 00002 #define __GRAPH_UTILS__ 00003 00004 #include <graph-namespace.h> 00005 #include <layoutgraph.idef> 00006 #include <graph-converter.idef> 00007 #include <graph-painter.idef> 00008 00009 process GraphCleanup(GraphType: str, GraphId: term, Sid: session-id) is 00010 GP-AddCloseListener(GraphType, GraphId) 00011 . rec-note(gp-panel-closed(GraphType, GraphId)) 00012 . snd-msg(em-delete-session(Sid)) 00013 00014 process RenderGraph(GraphType: str, GraphId: term, Shared: bool, 00015 Closable: bool, Graph: term?) is 00016 let 00017 Sid: session-id, 00018 PanelId: term, 00019 Id: int 00020 in 00021 AddJob("Rendering") 00022 . 00023 if equal(Shared, false) then 00024 snd-msg(em-create-session) 00025 . rec-msg(em-session(Sid?)) 00026 . PanelId := Sid 00027 . create(GraphCleanup(GraphType, GraphId, Sid), Id?) 00028 else 00029 PanelId := GraphId 00030 fi 00031 . snd-msg(gp-create-panel(GraphType, PanelId, Shared, Closable)) 00032 . rec-msg(gp-panel-created(GraphType, PanelId)) 00033 . snd-msg(gp-render-graph(GraphType, PanelId, Graph)) 00034 . rec-msg(gp-rendered-graph(GraphType, PanelId, Graph?)) 00035 . snd-msg(gl-layout-graph(Graph)) 00036 . rec-msg(gl-graph(Graph?)) 00037 . snd-msg(gp-display-graph(GraphType, PanelId, Graph)) 00038 . JobDone("Rendering") 00039 endlet 00040 00041 /** 00042 * Merges a changed attribute with an already displayed graph. 00043 * 00044 * \param GraphType type of the graph 00045 * \param GraphId unique graph identification 00046 * \param NodeId the node id of the node having a changed attribute 00047 * \param Key key of the changed attribute 00048 * \param Value new value of the changed attribute 00049 */ 00050 process UpdateGraphAttribute(GraphType: str, GraphId: term, NodeId: term, Key: term, Value: term) is 00051 snd-msg(gp-update-graph(GraphType, GraphId, NodeId, Key, Value)) 00052 00053 process ShowTree(Tree: term, ShowLayout: bool, ShowLeafs: bool, 00054 SharingOn: bool) is 00055 let 00056 Graph: term 00057 in 00058 snd-msg(gc-tree-to-graph(Tree, ShowLayout, ShowLeafs, SharingOn)) 00059 . rec-msg(gc-graph(Graph?)) 00060 . TODO("Change the way GraphType and GraphId are used\n") 00061 . RenderGraph("parsetree","0",false,true,Graph?) 00062 endlet 00063 00064 00065 #endif /*__GRAPH_UTILS__*/