Fri Oct 14 16:55:53 WEST 2005 Malcolm.Wallace@cs.york.ac.uk
* add ability to revert the analysis
{
hunk ./src/Analysis.hs 17
+-- There is also a method for reverting the analysis (which may not be
+-- possible for all kinds of analysis, I suppose).
hunk ./src/Analysis.hs 25
+ revert :: (g, IntMap (Node n), IntMap (Edge e)) ->
+ (g, IntMap (Node n), IntMap (Edge e))
hunk ./src/Analysis.hs 42
+ }
+
+revertAnalysis :: Analysis g n e => State g n e -> IO ()
+revertAnalysis state =
+ do{ pDoc <- getDocument state
+ ; doc <- PD.getDocument pDoc
+ ; let network = getNetwork doc
+ g = getGlobalInfo network
+ n = networkNodes network
+ e = networkEdges network
+ (g',n',e') = revert (g,n,e)
+ network' = setNodeAssocs (assocs n')
+ $ setEdgeAssocs (assocs e')
+ $ setGlobalInfo g'
+ $ network
+ ; PD.updateDocument "revert analysis" (setNetwork network') pDoc
hunk ./src/FPTC/Analysis.hs 23
+ revert (g, nodemap, edgemap) = (g, nodemap, edgemap')
+ where edgemap' = IntMap.map (\e-> e { edgeInfo = blank }) edgemap
hunk ./src/NetworkUI.hs 179
+ ; menuItem editMenu
+ [ text := "Revert analysis"
+ , on command := safetyNet theFrame $ do
+ { revertAnalysis state; repaintAll state }
+ ]
}