ShowGraph.hs revision 3f69b6948966979163bdfe8331c38833d5d90ecd
0N/A{- |
553N/AModule : $Header$
0N/ACopyright : (c) Uni Bremen 2002-2005
0N/ALicense : similar to LGPL, see HetCATS/LICENSE.txt or LIZENZ.txt
0N/A
0N/AMaintainer : Christian.Maeder@dfki.de
0N/AStability : provisional
0N/APortability : non-portable (Logic)
0N/A
0N/Adisplay the final graph
0N/A
0N/A-}
0N/A
0N/Amodule GUI.ShowGraph
0N/A (showGraph)
0N/Awhere
0N/A
0N/Aimport Driver.Options
553N/A
553N/Aimport Syntax.AS_Library(LIB_NAME)
553N/A
0N/Aimport Static.DevGraph
0N/A
0N/Aimport GUI.GraphDisplay
0N/Aimport GUI.GraphTypes
0N/Aimport GUI.ShowLibGraph
import InfoBus
import Events
import Destructible
import DialogWin (useHTk)
showGraph :: FilePath -> HetcatsOpts ->
Maybe (LIB_NAME, -- filename
LibEnv -- DGraphs for imported modules
) -> IO ()
showGraph file opts env = case env of
Just (ln, le) ->
showGraphAux file opts ln le -- "development graph"
Nothing -> putIfVerbose opts 1 $ "Error: Basic Analysis is neccessary "
++ "to display graphs in a graphical window"
showGraphAux :: FilePath -> HetcatsOpts -> LIB_NAME -> LibEnv -> IO ()
showGraphAux file opts ln le = do
putIfVerbose opts 2 $ "Trying to display "++file++" in a graphical window"
putIfVerbose opts 3 "Initializing Converter"
(gInfo,wishInst) <- initializeConverter
useHTk -- All messages are displayed in TK dialog windows
-- from this point on
gInfo' <- setGInfo gInfo ln le opts
graph <- showLibGraph gInfo'
mShowGraph gInfo' ln
sync(destroyed graph)
destroy wishInst
InfoBus.shutdown