changeset 4487:aae5b3773e63

Added CFG editor from c1visualizer.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Tue, 31 Jan 2012 00:23:10 +0100
parents f3cc08cb211d
children 3bbc6d6d7465
files src/share/tools/IdealGraphVisualizer/ControlFlowEditor/.svn/all-wcprops src/share/tools/IdealGraphVisualizer/ControlFlowEditor/.svn/dir-prop-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/.svn/entries src/share/tools/IdealGraphVisualizer/ControlFlowEditor/.svn/text-base/manifest.mf.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/manifest.mf src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/.svn/all-wcprops src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/.svn/entries src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/.svn/all-wcprops src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/.svn/entries src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/.svn/all-wcprops src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/.svn/entries src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/.svn/all-wcprops src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/.svn/entries src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/.svn/all-wcprops src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/.svn/entries src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/.svn/text-base/Bundle.properties.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/.svn/text-base/CfgEditorContext.java.netbeans-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/.svn/text-base/CfgEditorContext.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/.svn/text-base/layer.xml.netbeans-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/.svn/text-base/layer.xml.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/Bundle.properties src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/CfgEditorContext.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/all-wcprops src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/entries src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/AbstractCfgEditorAction.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/AbstractRouterAction.java.netbeans-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/AbstractRouterAction.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/ColorAction.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/ExportAction.java.netbeans-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/ExportAction.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/HideEdgesAction.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/HierarchicalCompoundLayoutAction.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/HierarchicalNodeLayoutAction.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/ShowAllAction.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/ShowCFGEditorAction.java.netbeans-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/ShowCFGEditorAction.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/ShowEdgesAction.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/SwitchLoopClustersAction.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/UseBezierRouterAction.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/UseDirectLineRouterAction.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/ZoominAction.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/ZoomoutAction.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/AbstractCfgEditorAction.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/AbstractRouterAction.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/ColorAction.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/ExportAction.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/HideEdgesAction.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/HierarchicalCompoundLayoutAction.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/HierarchicalNodeLayoutAction.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/ShowAllAction.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/ShowCFGEditorAction.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/ShowEdgesAction.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/SwitchLoopClustersAction.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/UseBezierRouterAction.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/UseDirectLineRouterAction.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/ZoominAction.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/ZoomoutAction.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/editor/.svn/all-wcprops src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/editor/.svn/entries src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/editor/.svn/text-base/CfgEditorSupport.java.netbeans-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/editor/.svn/text-base/CfgEditorSupport.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/editor/.svn/text-base/CfgEditorTopComponent.java.netbeans-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/editor/.svn/text-base/CfgEditorTopComponent.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/editor/CfgEditorSupport.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/editor/CfgEditorTopComponent.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/.svn/all-wcprops src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/.svn/entries src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/.svn/text-base/CfgEventListener.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/.svn/text-base/CfgScene.java.netbeans-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/.svn/text-base/CfgScene.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/.svn/text-base/EdgeSwitchWidget.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/.svn/text-base/EdgeWidget.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/.svn/text-base/LoopClusterWidget.java.netbeans-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/.svn/text-base/LoopClusterWidget.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/.svn/text-base/NodeWidget.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/.svn/text-base/SelectionWidget.java.netbeans-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/.svn/text-base/SelectionWidget.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/.svn/text-base/SymmetricAnchor.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/CfgEventListener.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/CfgScene.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/EdgeSwitchWidget.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/EdgeWidget.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/LoopClusterWidget.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/NodeWidget.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/SelectionWidget.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/SymmetricAnchor.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/layout/.svn/all-wcprops src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/layout/.svn/entries src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/layout/.svn/text-base/HierarchicalCompoundLayout.java.netbeans-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/layout/.svn/text-base/HierarchicalCompoundLayout.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/layout/.svn/text-base/HierarchicalNodeLayout.java.netbeans-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/layout/.svn/text-base/HierarchicalNodeLayout.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/layout/HierarchicalCompoundLayout.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/layout/HierarchicalNodeLayout.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/all-wcprops src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/entries src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/prop-base/arrangebfs.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/prop-base/arrangehier.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/prop-base/arrangeloop.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/prop-base/autosize.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/prop-base/autosize_selection.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/prop-base/bezierrouter.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/prop-base/cfg.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/prop-base/cfg32.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/prop-base/cluster.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/prop-base/color.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/prop-base/combine.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/prop-base/combine_disabled.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/prop-base/disk.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/prop-base/fanrouter.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/prop-base/hideedges.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/prop-base/hideedges_disabled.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/prop-base/manhattanrouter.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/prop-base/showedges.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/prop-base/showedges_disabled.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/prop-base/split.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/prop-base/split_disabled.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/prop-base/zoomin.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/prop-base/zoomout.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/text-base/Icons.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/text-base/arrangebfs.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/text-base/arrangehier.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/text-base/arrangeloop.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/text-base/autosize.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/text-base/autosize_selection.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/text-base/bezierrouter.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/text-base/cfg.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/text-base/cfg32.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/text-base/cluster.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/text-base/color.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/text-base/combine.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/text-base/combine_disabled.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/text-base/disk.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/text-base/fanrouter.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/text-base/hideedges.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/text-base/hideedges_disabled.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/text-base/manhattanrouter.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/text-base/showedges.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/text-base/showedges_disabled.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/text-base/split.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/text-base/split_disabled.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/text-base/zoomin.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/.svn/text-base/zoomout.gif.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/Icons.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/arrangebfs.gif src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/arrangehier.gif src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/arrangeloop.gif src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/autosize.gif src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/autosize_selection.gif src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/bezierrouter.gif src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/cfg.gif src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/cfg32.gif src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/cluster.gif src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/color.gif src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/combine.gif src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/combine_disabled.gif src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/disk.gif src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/fanrouter.gif src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/hideedges.gif src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/hideedges_disabled.gif src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/manhattanrouter.gif src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/showedges.gif src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/showedges_disabled.gif src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/split.gif src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/split_disabled.gif src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/zoomin.gif src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/icons/zoomout.gif src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/layer.xml src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/model/.svn/all-wcprops src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/model/.svn/entries src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/model/.svn/text-base/CfgEdge.java.netbeans-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/model/.svn/text-base/CfgEdge.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/model/.svn/text-base/CfgEdgeImpl.java.netbeans-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/model/.svn/text-base/CfgEdgeImpl.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/model/.svn/text-base/CfgEnv.java.netbeans-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/model/.svn/text-base/CfgEnv.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/model/.svn/text-base/CfgNode.java.netbeans-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/model/.svn/text-base/CfgNode.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/model/.svn/text-base/CfgNodeImpl.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/model/.svn/text-base/LoopInfo.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/model/CfgEdge.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/model/CfgEdgeImpl.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/model/CfgEnv.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/model/CfgNode.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/model/CfgNodeImpl.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/model/LoopInfo.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/preferences/.svn/all-wcprops src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/preferences/.svn/entries src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/preferences/.svn/text-base/CFGOptionsCategory.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/preferences/.svn/text-base/CFGOptionsPanel.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/preferences/.svn/text-base/CFGOptionsPanelController.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/preferences/.svn/text-base/CfgPreferences.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/preferences/.svn/text-base/CfgPreferencesDefaults.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/preferences/.svn/text-base/ColorChooserButton.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/preferences/.svn/text-base/FlagsEditorPanel.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/preferences/.svn/text-base/FlagsSetting.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/preferences/.svn/text-base/FontChooserDialog.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/preferences/CFGOptionsCategory.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/preferences/CFGOptionsPanel.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/preferences/CFGOptionsPanelController.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/preferences/CfgPreferences.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/preferences/CfgPreferencesDefaults.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/preferences/ColorChooserButton.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/preferences/FlagsEditorPanel.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/preferences/FlagsSetting.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/preferences/FontChooserDialog.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/visual/.svn/all-wcprops src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/visual/.svn/entries src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/visual/.svn/text-base/BezierWidget.java.netbeans-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/visual/.svn/text-base/BezierWidget.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/visual/.svn/text-base/PolylineRouter.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/visual/.svn/text-base/PolylineRouterV2.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/visual/.svn/text-base/SplineConnectionWidget.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/visual/.svn/text-base/WidgetCollisionCollector.java.svn-base src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/visual/BezierWidget.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/visual/PolylineRouter.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/visual/PolylineRouterV2.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/visual/SplineConnectionWidget.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/visual/WidgetCollisionCollector.java src/share/tools/IdealGraphVisualizer/ControlFlowEditor/test/.svn/all-wcprops src/share/tools/IdealGraphVisualizer/ControlFlowEditor/test/.svn/entries src/share/tools/IdealGraphVisualizer/ControlFlowEditor/test/unit/.svn/all-wcprops src/share/tools/IdealGraphVisualizer/ControlFlowEditor/test/unit/.svn/entries src/share/tools/IdealGraphVisualizer/ControlFlowEditor/test/unit/src/.svn/all-wcprops src/share/tools/IdealGraphVisualizer/ControlFlowEditor/test/unit/src/.svn/entries src/share/tools/IdealGraphVisualizer/Coordinator/nbproject/project.xml src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/GraphOpenCookie.java src/share/tools/IdealGraphVisualizer/Data/manifest.mf src/share/tools/IdealGraphVisualizer/Data/nbproject/project.xml src/share/tools/IdealGraphVisualizer/Data/src/at/ssw/visualizer/model/cfg/BasicBlock.java src/share/tools/IdealGraphVisualizer/Data/src/at/ssw/visualizer/modelimpl/cfg/BasicBlockImpl.java src/share/tools/IdealGraphVisualizer/Data/src/at/ssw/visualizer/modelimpl/cfg/ControlFlowGraphImpl.java src/share/tools/IdealGraphVisualizer/Data/src/at/ssw/visualizer/modelimpl/interval/IntervalListImpl.java src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/Bundle.properties src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputBlock.java src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputGraph.java src/share/tools/IdealGraphVisualizer/Draw2DLibrary/.svn/all-wcprops src/share/tools/IdealGraphVisualizer/Draw2DLibrary/.svn/dir-prop-base src/share/tools/IdealGraphVisualizer/Draw2DLibrary/.svn/entries src/share/tools/IdealGraphVisualizer/Draw2DLibrary/.svn/text-base/manifest.mf.svn-base src/share/tools/IdealGraphVisualizer/Draw2DLibrary/manifest.mf src/share/tools/IdealGraphVisualizer/Draw2DLibrary/release/.svn/all-wcprops src/share/tools/IdealGraphVisualizer/Draw2DLibrary/release/.svn/entries src/share/tools/IdealGraphVisualizer/Draw2DLibrary/release/modules/.svn/all-wcprops src/share/tools/IdealGraphVisualizer/Draw2DLibrary/release/modules/.svn/entries src/share/tools/IdealGraphVisualizer/Draw2DLibrary/release/modules/ext/.svn/all-wcprops src/share/tools/IdealGraphVisualizer/Draw2DLibrary/release/modules/ext/.svn/entries src/share/tools/IdealGraphVisualizer/Draw2DLibrary/release/modules/ext/.svn/prop-base/org.eclipse.draw2d_3.1.0.jar.svn-base src/share/tools/IdealGraphVisualizer/Draw2DLibrary/release/modules/ext/.svn/text-base/org.eclipse.draw2d_3.1.0.jar.svn-base src/share/tools/IdealGraphVisualizer/Draw2DLibrary/release/modules/ext/org.eclipse.draw2d_3.1.0.jar src/share/tools/IdealGraphVisualizer/Draw2DLibrary/src/.svn/all-wcprops src/share/tools/IdealGraphVisualizer/Draw2DLibrary/src/.svn/entries src/share/tools/IdealGraphVisualizer/Draw2DLibrary/src/org/.svn/all-wcprops src/share/tools/IdealGraphVisualizer/Draw2DLibrary/src/org/.svn/entries src/share/tools/IdealGraphVisualizer/Draw2DLibrary/src/org/eclipse/.svn/all-wcprops src/share/tools/IdealGraphVisualizer/Draw2DLibrary/src/org/eclipse/.svn/entries src/share/tools/IdealGraphVisualizer/Draw2DLibrary/src/org/eclipse/draw2d/.svn/all-wcprops src/share/tools/IdealGraphVisualizer/Draw2DLibrary/src/org/eclipse/draw2d/.svn/entries src/share/tools/IdealGraphVisualizer/Draw2DLibrary/src/org/eclipse/draw2d/.svn/text-base/Bundle.properties.svn-base src/share/tools/IdealGraphVisualizer/Draw2DLibrary/src/org/eclipse/draw2d/Bundle.properties src/share/tools/IdealGraphVisualizer/nbproject/project.properties
diffstat 261 files changed, 20621 insertions(+), 138 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/.svn/all-wcprops	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,17 @@
+K 25
+svn:wc:ra_dav:version-url
+V 77
+/svn/c1visualizer~svn/!svn/ver/201/trunk/C1Visualizer/Control%20Flow%20Editor
+END
+manifest.mf
+K 25
+svn:wc:ra_dav:version-url
+V 87
+/svn/c1visualizer~svn/!svn/ver/7/trunk/C1Visualizer/Control%20Flow%20Editor/manifest.mf
+END
+build.xml
+K 25
+svn:wc:ra_dav:version-url
+V 87
+/svn/c1visualizer~svn/!svn/ver/186/trunk/C1Visualizer/Control%20Flow%20Editor/build.xml
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/.svn/dir-prop-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,6 @@
+K 10
+svn:ignore
+V 6
+build
+
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/.svn/entries	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,105 @@
+10
+
+dir
+206
+https://svn.java.net/svn/c1visualizer~svn/trunk/C1Visualizer/Control%20Flow%20Editor
+https://svn.java.net/svn/c1visualizer~svn
+
+
+
+2011-06-30T16:41:14.883751Z
+201
+christianw
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+f598ca33-f47e-61e0-e023-f120d32a8e8d
+
+test
+dir
+
+nbproject
+dir
+
+src
+dir
+
+manifest.mf
+file
+
+
+
+
+2012-01-28T15:08:37.661161Z
+7b79e34dd7d10a5f3217846992d92313
+2007-07-07T21:02:50.702037Z
+7
+christianw
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+237
+
+build.xml
+file
+
+
+
+
+2012-01-28T15:08:37.665161Z
+80dff6a001f91e7db91fb56c0277fc5b
+2010-07-16T01:08:34.138866Z
+186
+ChristianW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+497
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/.svn/text-base/manifest.mf.svn-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,6 @@
+Manifest-Version: 1.0
+OpenIDE-Module: at.ssw.visualizer.cfg
+OpenIDE-Module-Layer: at/ssw/visualizer/cfg/layer.xml
+OpenIDE-Module-Localizing-Bundle: at/ssw/visualizer/cfg/Bundle.properties
+OpenIDE-Module-Specification-Version: 1.0
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/manifest.mf	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,6 @@
+Manifest-Version: 1.0
+OpenIDE-Module: at.ssw.visualizer.cfg
+OpenIDE-Module-Layer: at/ssw/visualizer/cfg/layer.xml
+OpenIDE-Module-Localizing-Bundle: at/ssw/visualizer/cfg/Bundle.properties
+OpenIDE-Module-Specification-Version: 1.0
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/.svn/all-wcprops	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 81
+/svn/c1visualizer~svn/!svn/ver/201/trunk/C1Visualizer/Control%20Flow%20Editor/src
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/.svn/entries	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,31 @@
+10
+
+dir
+206
+https://svn.java.net/svn/c1visualizer~svn/trunk/C1Visualizer/Control%20Flow%20Editor/src
+https://svn.java.net/svn/c1visualizer~svn
+
+
+
+2011-06-30T16:41:14.883751Z
+201
+christianw
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+f598ca33-f47e-61e0-e023-f120d32a8e8d
+
+at
+dir
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/.svn/all-wcprops	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 84
+/svn/c1visualizer~svn/!svn/ver/201/trunk/C1Visualizer/Control%20Flow%20Editor/src/at
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/.svn/entries	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,31 @@
+10
+
+dir
+206
+https://svn.java.net/svn/c1visualizer~svn/trunk/C1Visualizer/Control%20Flow%20Editor/src/at
+https://svn.java.net/svn/c1visualizer~svn
+
+
+
+2011-06-30T16:41:14.883751Z
+201
+christianw
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+f598ca33-f47e-61e0-e023-f120d32a8e8d
+
+ssw
+dir
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/.svn/all-wcprops	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 88
+/svn/c1visualizer~svn/!svn/ver/201/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/.svn/entries	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,31 @@
+10
+
+dir
+206
+https://svn.java.net/svn/c1visualizer~svn/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw
+https://svn.java.net/svn/c1visualizer~svn
+
+
+
+2011-06-30T16:41:14.883751Z
+201
+christianw
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+f598ca33-f47e-61e0-e023-f120d32a8e8d
+
+visualizer
+dir
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/.svn/all-wcprops	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 99
+/svn/c1visualizer~svn/!svn/ver/201/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/.svn/entries	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,31 @@
+10
+
+dir
+206
+https://svn.java.net/svn/c1visualizer~svn/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer
+https://svn.java.net/svn/c1visualizer~svn
+
+
+
+2011-06-30T16:41:14.883751Z
+201
+christianw
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+f598ca33-f47e-61e0-e023-f120d32a8e8d
+
+cfg
+dir
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/.svn/all-wcprops	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,23 @@
+K 25
+svn:wc:ra_dav:version-url
+V 103
+/svn/c1visualizer~svn/!svn/ver/201/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg
+END
+Bundle.properties
+K 25
+svn:wc:ra_dav:version-url
+V 119
+/svn/c1visualizer~svn/!svn/ver/7/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/Bundle.properties
+END
+CfgEditorContext.java
+K 25
+svn:wc:ra_dav:version-url
+V 125
+/svn/c1visualizer~svn/!svn/ver/174/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/CfgEditorContext.java
+END
+layer.xml
+K 25
+svn:wc:ra_dav:version-url
+V 113
+/svn/c1visualizer~svn/!svn/ver/174/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/layer.xml
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/.svn/entries	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,151 @@
+10
+
+dir
+206
+https://svn.java.net/svn/c1visualizer~svn/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg
+https://svn.java.net/svn/c1visualizer~svn
+
+
+
+2011-06-30T16:41:14.883751Z
+201
+christianw
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+f598ca33-f47e-61e0-e023-f120d32a8e8d
+
+model
+dir
+
+graph
+dir
+
+preferences
+dir
+
+visual
+dir
+
+Bundle.properties
+file
+
+
+
+
+2012-01-28T15:08:37.595157Z
+3f4c420dd550e890a0f701e56f75f511
+2007-07-07T21:02:50.702037Z
+7
+christianw
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+41
+
+editor
+dir
+
+icons
+dir
+
+CfgEditorContext.java
+file
+
+
+
+
+2012-01-28T15:08:37.598157Z
+45786941b665b0c2ed7840e406f6664c
+2009-06-28T16:09:31.412666Z
+174
+ChristianW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+395
+
+layer.xml
+file
+
+
+
+
+2012-01-28T15:08:37.602158Z
+d141d34a275fa304984415b3da57158d
+2009-06-28T16:09:31.412666Z
+174
+ChristianW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3449
+
+action
+dir
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/.svn/text-base/Bundle.properties.svn-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,1 @@
+OpenIDE-Module-Name=Control Flow Editor
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/.svn/text-base/CfgEditorContext.java.netbeans-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,13 @@
+
+package at.ssw.visualizer.cfg;
+
+public abstract class CfgEditorContext {
+      
+    public static final int LAYOUT_HIERARCHICALNODELAYOUT = 1;
+    public static final int LAYOUT_HIERARCHICALCOMPOUNDLAYOUT = 2;
+       
+    public static final int ROUTING_DIRECTLINES = 1;  
+    public static final int ROUTING_BEZIER = 2;
+    
+    public static final int MAX_AUTOEDGESVISIBLE = 8;            
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/.svn/text-base/CfgEditorContext.java.svn-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,13 @@
+
+package at.ssw.visualizer.cfg;
+
+public abstract class CfgEditorContext {
+      
+    public static final int LAYOUT_HIERARCHICALNODELAYOUT = 1;
+    public static final int LAYOUT_HIERARCHICALCOMPOUNDLAYOUT = 2;
+       
+    public static final int ROUTING_DIRECTLINES = 1;  
+    public static final int ROUTING_BEZIER = 2;
+    
+    public static final int MAX_AUTOEDGESVISIBLE = 8;            
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/.svn/text-base/layer.xml.netbeans-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.1//EN" "http://www.netbeans.org/dtds/filesystem-1_1.dtd">
+<filesystem>
+    <folder name="OptionsDialog">
+        <file name="CFGOptions.instance">
+            <attr name="instanceClass" stringvalue="at.ssw.visualizer.cfg.preferences.CFGOptionsCategory"/>
+            <attr name="position" intvalue="1"/>
+        </file>              
+    </folder>    
+    <folder name="Actions">
+        <folder name="Window">
+            <file name="ShowCFGEditor.instance">
+                <attr name="instanceClass" stringvalue="at.ssw.visualizer.cfg.action.ShowCFGEditorAction"/>
+            </file>
+        </folder>        
+        <folder name="View">      
+                <file name="BezierRouter.instance">
+                    <attr name="instanceClass" stringvalue="at.ssw.visualizer.cfg.action.UseBezierRouterAction"/>
+                </file>
+                <file name="DirectRouter.instance">
+                    <attr name="instanceClass" stringvalue="at.ssw.visualizer.cfg.action.UseDirectLineRouterAction"/>
+                </file>
+                <file name="HierarchicalNodeLayout.instance">
+                    <attr name="instanceClass" stringvalue="at.ssw.visualizer.cfg.action.HierarchicalNodeLayoutAction"/>
+                </file>
+                <file name="HierarchicalCompoundLayout.instance">
+                    <attr name="instanceClass" stringvalue="at.ssw.visualizer.cfg.action.HierarchicalCompoundLayoutAction"/>
+                </file>           
+                <file name="ShowEdges.instance">
+                    <attr name="instanceClass" stringvalue="at.ssw.visualizer.cfg.action.ShowEdgesAction"/>
+                </file>
+                <file name="HideEdges.instance">
+                    <attr name="instanceClass" stringvalue="at.ssw.visualizer.cfg.action.HideEdgesAction"/>
+                </file>
+                <file name="Color.instance">
+                    <attr name="instanceClass" stringvalue="at.ssw.visualizer.cfg.action.ColorAction"/>
+                </file>    
+                <file name="Export.instance">
+                    <attr name="instanceClass" stringvalue="at.ssw.visualizer.cfg.action.ExportAction"/>
+                </file>    
+                <file name="Zoomin.instance">
+                    <attr name="instanceClass" stringvalue="at.ssw.visualizer.cfg.action.ZoominAction"/>
+                </file>
+                <file name="Zoomout.instance">
+                    <attr name="instanceClass" stringvalue="at.ssw.visualizer.cfg.action.ZoomoutAction"/>
+                </file>  
+                <file name="ShowAll.instance">
+                    <attr name="instanceClass" stringvalue="at.ssw.visualizer.cfg.action.ShowAllAction"/>
+                </file>  
+        </folder>
+    </folder>
+
+    <folder name="Menu">
+        <folder name="Window">
+            <file name="ShowCFGEditor.shadow">
+                <attr name="originalFile" stringvalue="Actions/Window/ShowCFGEditor.instance"/>
+                <attr name="position" intvalue="1300"/>
+            </file>
+        </folder>
+    </folder> 
+    
+    <folder name="at-ssw-visualizer-actions-cfg">
+        <file name="ShowCFGEditor.shadow">
+            <attr name="originalFile" stringvalue="Actions/Window/ShowCFGEditor.instance"/>
+            <attr name="position" intvalue="300"/>
+        </file>
+    </folder>
+       
+</filesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/.svn/text-base/layer.xml.svn-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.1//EN" "http://www.netbeans.org/dtds/filesystem-1_1.dtd">
+<filesystem>
+    <folder name="OptionsDialog">
+        <file name="CFGOptions.instance">
+            <attr name="instanceClass" stringvalue="at.ssw.visualizer.cfg.preferences.CFGOptionsCategory"/>
+            <attr name="position" intvalue="1"/>
+        </file>              
+    </folder>    
+    <folder name="Actions">
+        <folder name="Window">
+            <file name="ShowCFGEditor.instance">
+                <attr name="instanceClass" stringvalue="at.ssw.visualizer.cfg.action.ShowCFGEditorAction"/>
+            </file>
+        </folder>        
+        <folder name="View">      
+                <file name="BezierRouter.instance">
+                    <attr name="instanceClass" stringvalue="at.ssw.visualizer.cfg.action.UseBezierRouterAction"/>
+                </file>
+                <file name="DirectRouter.instance">
+                    <attr name="instanceClass" stringvalue="at.ssw.visualizer.cfg.action.UseDirectLineRouterAction"/>
+                </file>
+                <file name="HierarchicalNodeLayout.instance">
+                    <attr name="instanceClass" stringvalue="at.ssw.visualizer.cfg.action.HierarchicalNodeLayoutAction"/>
+                </file>
+                <file name="HierarchicalCompoundLayout.instance">
+                    <attr name="instanceClass" stringvalue="at.ssw.visualizer.cfg.action.HierarchicalCompoundLayoutAction"/>
+                </file>           
+                <file name="ShowEdges.instance">
+                    <attr name="instanceClass" stringvalue="at.ssw.visualizer.cfg.action.ShowEdgesAction"/>
+                </file>
+                <file name="HideEdges.instance">
+                    <attr name="instanceClass" stringvalue="at.ssw.visualizer.cfg.action.HideEdgesAction"/>
+                </file>
+                <file name="Color.instance">
+                    <attr name="instanceClass" stringvalue="at.ssw.visualizer.cfg.action.ColorAction"/>
+                </file>    
+                <file name="Export.instance">
+                    <attr name="instanceClass" stringvalue="at.ssw.visualizer.cfg.action.ExportAction"/>
+                </file>    
+                <file name="Zoomin.instance">
+                    <attr name="instanceClass" stringvalue="at.ssw.visualizer.cfg.action.ZoominAction"/>
+                </file>
+                <file name="Zoomout.instance">
+                    <attr name="instanceClass" stringvalue="at.ssw.visualizer.cfg.action.ZoomoutAction"/>
+                </file>  
+                <file name="ShowAll.instance">
+                    <attr name="instanceClass" stringvalue="at.ssw.visualizer.cfg.action.ShowAllAction"/>
+                </file>  
+        </folder>
+    </folder>
+
+    <folder name="Menu">
+        <folder name="Window">
+            <file name="ShowCFGEditor.shadow">
+                <attr name="originalFile" stringvalue="Actions/Window/ShowCFGEditor.instance"/>
+                <attr name="position" intvalue="1300"/>
+            </file>
+        </folder>
+    </folder> 
+    
+    <folder name="at-ssw-visualizer-actions-cfg">
+        <file name="ShowCFGEditor.shadow">
+            <attr name="originalFile" stringvalue="Actions/Window/ShowCFGEditor.instance"/>
+            <attr name="position" intvalue="300"/>
+        </file>
+    </folder>
+       
+</filesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/Bundle.properties	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,1 @@
+OpenIDE-Module-Name=Control Flow Editor
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/CfgEditorContext.java	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,13 @@
+
+package at.ssw.visualizer.cfg;
+
+public abstract class CfgEditorContext {
+      
+    public static final int LAYOUT_HIERARCHICALNODELAYOUT = 1;
+    public static final int LAYOUT_HIERARCHICALCOMPOUNDLAYOUT = 2;
+       
+    public static final int ROUTING_DIRECTLINES = 1;  
+    public static final int ROUTING_BEZIER = 2;
+    
+    public static final int MAX_AUTOEDGESVISIBLE = 8;            
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/all-wcprops	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,95 @@
+K 25
+svn:wc:ra_dav:version-url
+V 110
+/svn/c1visualizer~svn/!svn/ver/201/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/action
+END
+AbstractRouterAction.java
+K 25
+svn:wc:ra_dav:version-url
+V 136
+/svn/c1visualizer~svn/!svn/ver/174/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/action/AbstractRouterAction.java
+END
+ShowCFGEditorAction.java
+K 25
+svn:wc:ra_dav:version-url
+V 135
+/svn/c1visualizer~svn/!svn/ver/201/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/action/ShowCFGEditorAction.java
+END
+ShowAllAction.java
+K 25
+svn:wc:ra_dav:version-url
+V 129
+/svn/c1visualizer~svn/!svn/ver/174/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/action/ShowAllAction.java
+END
+ZoominAction.java
+K 25
+svn:wc:ra_dav:version-url
+V 128
+/svn/c1visualizer~svn/!svn/ver/174/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/action/ZoominAction.java
+END
+ZoomoutAction.java
+K 25
+svn:wc:ra_dav:version-url
+V 129
+/svn/c1visualizer~svn/!svn/ver/174/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/action/ZoomoutAction.java
+END
+ColorAction.java
+K 25
+svn:wc:ra_dav:version-url
+V 127
+/svn/c1visualizer~svn/!svn/ver/174/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/action/ColorAction.java
+END
+SwitchLoopClustersAction.java
+K 25
+svn:wc:ra_dav:version-url
+V 140
+/svn/c1visualizer~svn/!svn/ver/174/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/action/SwitchLoopClustersAction.java
+END
+HierarchicalCompoundLayoutAction.java
+K 25
+svn:wc:ra_dav:version-url
+V 148
+/svn/c1visualizer~svn/!svn/ver/174/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/action/HierarchicalCompoundLayoutAction.java
+END
+HideEdgesAction.java
+K 25
+svn:wc:ra_dav:version-url
+V 131
+/svn/c1visualizer~svn/!svn/ver/174/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/action/HideEdgesAction.java
+END
+ExportAction.java
+K 25
+svn:wc:ra_dav:version-url
+V 128
+/svn/c1visualizer~svn/!svn/ver/174/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/action/ExportAction.java
+END
+HierarchicalNodeLayoutAction.java
+K 25
+svn:wc:ra_dav:version-url
+V 144
+/svn/c1visualizer~svn/!svn/ver/174/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/action/HierarchicalNodeLayoutAction.java
+END
+ShowEdgesAction.java
+K 25
+svn:wc:ra_dav:version-url
+V 131
+/svn/c1visualizer~svn/!svn/ver/174/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/action/ShowEdgesAction.java
+END
+AbstractCfgEditorAction.java
+K 25
+svn:wc:ra_dav:version-url
+V 139
+/svn/c1visualizer~svn/!svn/ver/176/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/action/AbstractCfgEditorAction.java
+END
+UseBezierRouterAction.java
+K 25
+svn:wc:ra_dav:version-url
+V 137
+/svn/c1visualizer~svn/!svn/ver/174/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/action/UseBezierRouterAction.java
+END
+UseDirectLineRouterAction.java
+K 25
+svn:wc:ra_dav:version-url
+V 141
+/svn/c1visualizer~svn/!svn/ver/174/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/action/UseDirectLineRouterAction.java
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/entries	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,538 @@
+10
+
+dir
+206
+https://svn.java.net/svn/c1visualizer~svn/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/action
+https://svn.java.net/svn/c1visualizer~svn
+
+
+
+2011-06-30T16:41:14.883751Z
+201
+christianw
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+f598ca33-f47e-61e0-e023-f120d32a8e8d
+
+AbstractRouterAction.java
+file
+
+
+
+
+2012-01-28T15:08:37.556155Z
+42afb619f7ba5d324d3107936493ad1d
+2009-06-28T16:09:31.412666Z
+174
+ChristianW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1654
+
+ShowCFGEditorAction.java
+file
+
+
+
+
+2012-01-28T15:08:37.558155Z
+cd7f997fae54355e1dbada2a098d2d97
+2011-06-30T16:41:14.883751Z
+201
+christianw
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1744
+
+ShowAllAction.java
+file
+
+
+
+
+2012-01-28T15:08:37.564155Z
+8f2325ed63e26c0f99c128bdb36923df
+2009-06-28T16:09:31.412666Z
+174
+ChristianW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+939
+
+ZoominAction.java
+file
+
+
+
+
+2012-01-28T15:08:37.569156Z
+fa1162a9dea5c9b3bfb2d0a781bd6e1c
+2009-06-28T16:09:31.412666Z
+174
+ChristianW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+773
+
+ZoomoutAction.java
+file
+
+
+
+
+2012-01-28T15:08:37.572156Z
+7f7548f29c1c61c67ecfc9b677e8ecfc
+2009-06-28T16:09:31.412666Z
+174
+ChristianW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+772
+
+ColorAction.java
+file
+
+
+
+
+2012-01-28T15:08:37.575156Z
+5303aa59adafad9f5d3f3207ac4965f1
+2009-06-28T16:09:31.412666Z
+174
+ChristianW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+6857
+
+SwitchLoopClustersAction.java
+file
+
+
+
+
+2012-01-28T15:08:37.581156Z
+641610ab201caca1fe6ed29c0764be90
+2009-06-28T16:09:31.412666Z
+174
+ChristianW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1982
+
+HierarchicalCompoundLayoutAction.java
+file
+
+
+
+
+2012-01-28T15:08:37.551155Z
+dbdf7875372c99ca2d5055141062e1e2
+2009-06-28T16:09:31.412666Z
+174
+ChristianW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+925
+
+HideEdgesAction.java
+file
+
+
+
+
+2012-01-28T15:08:37.545154Z
+3e6c126b2295f249079935ed75ac7240
+2009-06-28T16:09:31.412666Z
+174
+ChristianW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1402
+
+ExportAction.java
+file
+
+
+
+
+2012-01-28T15:08:37.542154Z
+3079f7f72c690ab5dc58263c1563e611
+2009-06-28T16:09:31.412666Z
+174
+ChristianW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4965
+
+HierarchicalNodeLayoutAction.java
+file
+
+
+
+
+2012-01-28T15:08:37.553155Z
+8f31ba1ad062695831415e36975aecb6
+2009-06-28T16:09:31.412666Z
+174
+ChristianW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+921
+
+ShowEdgesAction.java
+file
+
+
+
+
+2012-01-28T15:08:37.561155Z
+5c854df85b17867c6c6af584db789629
+2009-06-28T16:09:31.412666Z
+174
+ChristianW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1390
+
+AbstractCfgEditorAction.java
+file
+
+
+
+
+2012-01-28T15:08:37.567156Z
+9a38ec0e94b0b73cdcefef510d3b1711
+2009-06-28T16:17:48.993548Z
+176
+ChristianW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2712
+
+UseBezierRouterAction.java
+file
+
+
+
+
+2012-01-28T15:08:37.578156Z
+fd43f4b983ef815407772ff3e072cde4
+2009-06-28T16:09:31.412666Z
+174
+ChristianW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+715
+
+UseDirectLineRouterAction.java
+file
+
+
+
+
+2012-01-28T15:08:37.583156Z
+faf0fac73f13cf313b5386e9bff0cce2
+2009-06-28T16:09:31.412666Z
+174
+ChristianW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+710
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/AbstractCfgEditorAction.java.svn-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,94 @@
+package at.ssw.visualizer.cfg.action;
+
+
+import at.ssw.visualizer.cfg.graph.CfgEventListener;
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import at.ssw.visualizer.cfg.graph.CfgScene;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.JMenuItem;
+import org.openide.util.actions.CallableSystemAction;
+import org.openide.windows.TopComponent;
+
+/**
+ * The common superclass of all concrete actions related to the CFG visualizer.
+ *
+ * @author Bernhard Stiftner
+ * @author Rumpfhuber Stefan
+ */
+public abstract class AbstractCfgEditorAction extends CallableSystemAction implements CfgEventListener , PropertyChangeListener {
+
+    CfgEditorTopComponent topComponent = null;
+    
+    public AbstractCfgEditorAction() {        
+        TopComponent.getRegistry().addPropertyChangeListener(this);
+        setEnabled(false);
+
+    }
+       
+    protected CfgEditorTopComponent getEditor() {
+        return topComponent;
+    }
+    
+    protected void setEditor(CfgEditorTopComponent newTopComponent) {    
+        CfgEditorTopComponent oldTopComponent = getEditor();
+        if(newTopComponent != oldTopComponent){
+            if(oldTopComponent != null) {
+                oldTopComponent.getCfgScene().removeCfgEventListener(this);
+            }
+            this.topComponent = newTopComponent;         
+            if (newTopComponent != null) {
+                newTopComponent.getCfgScene().addCfgEventListener(this);
+                selectionChanged(newTopComponent.getCfgScene());
+            }
+            this.setEnabled(newTopComponent!=null);
+        }
+    }
+
+    
+    @Override
+    public JMenuItem getMenuPresenter() {
+        return new JMenuItem(this);
+    }
+
+   
+    @Override
+    public JComponent getToolbarPresenter() {
+        JButton b = new JButton(this);
+        if (getIcon() != null) {
+            b.setText(null);
+            b.setToolTipText(getName());
+        }
+        return b;
+    }
+
+   
+    @Override
+    public JMenuItem getPopupPresenter() {       
+        return new JMenuItem(this);
+    }
+    
+   
+    @Override
+    protected boolean asynchronous() {
+        return false;
+    }
+     
+    
+    public void propertyChange(PropertyChangeEvent e) {  
+        if ( e.getPropertyName().equals(TopComponent.Registry.PROP_ACTIVATED)) {
+            if(e.getNewValue() instanceof CfgEditorTopComponent){  
+                CfgEditorTopComponent tc = (CfgEditorTopComponent)e.getNewValue();
+                setEditor(tc);
+                selectionChanged(tc.getCfgScene());
+            } 
+        }
+    }
+    
+    
+    public void selectionChanged(CfgScene scene) {   
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/AbstractRouterAction.java.netbeans-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,61 @@
+package at.ssw.visualizer.cfg.action;
+
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import javax.swing.JComponent;
+import javax.swing.JMenuItem;
+import javax.swing.JRadioButtonMenuItem;
+import javax.swing.JToggleButton;
+import org.openide.util.actions.Presenter;
+
+/**
+ * Common superclass for all actions which set the link router.
+ *
+ * @author Bernhard Stiftner
+ * @author Rumpfhuber Stefan
+ */
+public abstract class AbstractRouterAction extends AbstractCfgEditorAction implements Presenter.Menu, Presenter.Popup, Presenter.Toolbar {
+       
+    public void performAction() {
+        CfgEditorTopComponent tc = getEditor();
+        if (tc != null) {  
+            setLinkRouter(tc);
+        }
+    }
+
+    protected abstract void setLinkRouter(CfgEditorTopComponent editor);
+    
+    @Override
+    public JMenuItem getMenuPresenter() {
+        JMenuItem presenter = new MenuPresenter();
+        presenter.setToolTipText(getName());
+        return presenter;
+    }
+
+    @Override
+    public JMenuItem getPopupPresenter() {
+        return getMenuPresenter();
+    }
+
+    @Override
+    public JComponent getToolbarPresenter() {
+        ToolbarPresenter presenter = new ToolbarPresenter();    
+        presenter.setToolTipText(getName());
+        return presenter;
+    }
+      
+    class MenuPresenter extends JRadioButtonMenuItem {
+
+        public MenuPresenter() {
+            super(AbstractRouterAction.this);
+            setIcon(null);
+        }      
+    }
+
+    class ToolbarPresenter extends JToggleButton {
+
+        public ToolbarPresenter() {
+            super(AbstractRouterAction.this);
+            setText(null);  
+        }
+    } 
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/AbstractRouterAction.java.svn-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,61 @@
+package at.ssw.visualizer.cfg.action;
+
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import javax.swing.JComponent;
+import javax.swing.JMenuItem;
+import javax.swing.JRadioButtonMenuItem;
+import javax.swing.JToggleButton;
+import org.openide.util.actions.Presenter;
+
+/**
+ * Common superclass for all actions which set the link router.
+ *
+ * @author Bernhard Stiftner
+ * @author Rumpfhuber Stefan
+ */
+public abstract class AbstractRouterAction extends AbstractCfgEditorAction implements Presenter.Menu, Presenter.Popup, Presenter.Toolbar {
+       
+    public void performAction() {
+        CfgEditorTopComponent tc = getEditor();
+        if (tc != null) {  
+            setLinkRouter(tc);
+        }
+    }
+
+    protected abstract void setLinkRouter(CfgEditorTopComponent editor);
+    
+    @Override
+    public JMenuItem getMenuPresenter() {
+        JMenuItem presenter = new MenuPresenter();
+        presenter.setToolTipText(getName());
+        return presenter;
+    }
+
+    @Override
+    public JMenuItem getPopupPresenter() {
+        return getMenuPresenter();
+    }
+
+    @Override
+    public JComponent getToolbarPresenter() {
+        ToolbarPresenter presenter = new ToolbarPresenter();    
+        presenter.setToolTipText(getName());
+        return presenter;
+    }
+      
+    class MenuPresenter extends JRadioButtonMenuItem {
+
+        public MenuPresenter() {
+            super(AbstractRouterAction.this);
+            setIcon(null);
+        }      
+    }
+
+    class ToolbarPresenter extends JToggleButton {
+
+        public ToolbarPresenter() {
+            super(AbstractRouterAction.this);
+            setText(null);  
+        }
+    } 
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/ColorAction.java.svn-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,226 @@
+package at.ssw.visualizer.cfg.action;
+
+import at.ssw.visualizer.cfg.graph.CfgEventListener;
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import at.ssw.visualizer.cfg.graph.CfgScene;
+import at.ssw.visualizer.cfg.model.CfgNode;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.event.ActionEvent;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.awt.image.BufferedImage;
+import java.util.Set;
+import javax.swing.AbstractAction;
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+import javax.swing.JPopupMenu;
+import javax.swing.SwingConstants;
+import javax.swing.plaf.basic.BasicArrowButton;
+import org.openide.util.HelpCtx;
+import org.openide.util.actions.Presenter;
+
+/**
+ * Changes the background color of a node.
+ *
+ * @author Bernhard Stiftner
+ * @author Rumpfhuber Stefan
+ */
+public class ColorAction extends AbstractCfgEditorAction implements Presenter.Menu, Presenter.Popup, Presenter.Toolbar {
+
+    public static final int IMAGE_WIDTH = 16;
+    public static final int IMAGE_HEIGHT = 16;
+    
+    
+    /** Names of colors shown in color select lists. */
+    private static final String[] COLOR_NAMES = {"White", "Light Gray", "Dark Gray", "Light Yellow", "Dark Yellow", "Light Green", "Dark Green", "Light Cyan", "Dark Cyan", "Light Blue", "Dark Blue", "Light Magenta", "Dark Magenta", "Light Red", "Dark Red"};
+
+    /** Values of colors shown in color select lists. */
+    private static final Color[] COLORS = {
+        new Color(0xFFFFFF), new Color(0xD4D0C8), new Color(0xA4A098), new Color(0xF0F0B0), new Color(0xE0E040), 
+        new Color(0xB0F0B0), new Color(0x40E040), new Color(0xB0F0F0), new Color(0x40E0E0), new Color(0xB0B0F0), 
+        new Color(0x4040E0), new Color(0xF0B0F0), new Color(0xE040E0), new Color(0xF0B0B0), new Color(0xE04040)
+    };
+
+    public void performAction() {
+        // nothing to do here, the presenters are supposed to call
+        // performAction(Color)
+    }
+
+    protected void performAction(Color color) {
+        CfgEditorTopComponent tc = getEditor();
+        if (tc != null) {
+            tc.getCfgScene().setSelectedNodesColor(color);
+        }
+    }
+
+    public String getName() {
+        return "Change NodeColor";
+    }
+
+    @Override
+    protected String iconResource() {
+        return "at/ssw/visualizer/cfg/icons/color.gif";
+    }
+
+    public HelpCtx getHelpCtx() {
+        return HelpCtx.DEFAULT_HELP;
+    }
+
+    @Override
+    public JMenuItem getMenuPresenter() {
+        return new MenuPresenter();
+    }
+
+    @Override
+    public JMenuItem getPopupPresenter() {
+        return new MenuPresenter();
+    }
+
+    @Override
+    public JComponent getToolbarPresenter() {
+        return new ToolbarPresenter();
+    }
+
+    class MenuPresenter extends JMenu {
+       
+        public MenuPresenter() {
+            super(ColorAction.this);
+            initGUI();
+        }
+        
+        protected void initGUI() {  
+            CfgEditorTopComponent tc = getEditor();
+            if( tc != null && tc.getCfgScene().getSelectedNodes().size()==0) {
+                //no node selected
+                setEnabled(false);
+            } else {
+                add(new SetColorAction(null, "Automatic"));
+                for (int i = 0; i < COLORS.length; i++) {
+                    add(new SetColorAction(COLORS[i], COLOR_NAMES[i]));
+                }         
+            }          
+        }       
+    }
+
+    class ToolbarPresenter extends JButton implements CfgEventListener, MouseListener {
+
+        final int arrowSize = 5;
+        final int arrowMargin = 3;
+        JPopupMenu popup;
+
+        public ToolbarPresenter() {
+            setIcon(createIcon());
+            setToolTipText(ColorAction.this.getName());
+
+            popup = new JPopupMenu();
+            popup.add(new SetColorAction(null, "Automatic"));
+            for (int i = 0; i < COLORS.length; i++) {
+                popup.add(new SetColorAction(COLORS[i], COLOR_NAMES[i]));
+            }
+            addMouseListener(this);
+        }
+
+        public Icon createIcon() {
+            BasicArrowButton arrow = new BasicArrowButton(SwingConstants.SOUTH);
+            BufferedImage img = new BufferedImage(IMAGE_WIDTH + arrowSize + 2 * arrowMargin, IMAGE_HEIGHT, BufferedImage.TYPE_INT_ARGB);
+            Graphics g = img.getGraphics();
+            ColorAction.this.getIcon().paintIcon(this, g, 0, 0);
+            arrow.paintTriangle(g, IMAGE_WIDTH + arrowMargin + arrowSize / 2, IMAGE_HEIGHT / 2 - arrowSize / 2, arrowSize, SwingConstants.SOUTH, true);
+            return new ImageIcon(img);
+        }
+       
+        
+        public void selectionChanged(CfgScene scene) {
+            Set<CfgNode> nodes = scene.getSelectedNodes();
+            setEnabled(nodes.size() > 0);
+        }
+        
+        public void mouseClicked(MouseEvent e) {
+            if (e.getX() < getInsets().left + IMAGE_WIDTH + arrowMargin) {
+                performAction(null);
+            } else {
+                popup.show(this, 0, getSize().height);
+            }
+        }
+
+        public void mouseEntered(MouseEvent e) {
+        }
+
+        public void mouseExited(MouseEvent e) {
+        }
+
+        public void mousePressed(MouseEvent e) {
+        }
+
+        public void mouseReleased(MouseEvent e) {
+        }     
+    }
+
+    protected Icon createIcon(Color color) {
+        if (color == null) {
+            return ColorAction.this.getIcon();
+        } else {
+            return new ColorIcon(color);
+        }
+    }
+
+    class ColorIcon implements Icon {
+
+        Color color;
+
+        public ColorIcon(Color color) {
+            this.color = color;
+        }
+
+        public int getIconWidth() {
+            return IMAGE_WIDTH;
+        }
+
+        public int getIconHeight() {
+            return IMAGE_HEIGHT;
+        }
+
+        public void paintIcon(Component c, Graphics g, int x, int y) {
+            Color oldColor = g.getColor();
+            g.setColor(color);
+            g.fillRect(x, y, IMAGE_WIDTH, IMAGE_HEIGHT);
+            g.setColor(oldColor);
+        }
+    }
+
+    class SetColorAction extends AbstractAction {
+
+        Color color;
+        String name;
+        Icon icon;
+
+        public SetColorAction(Color color, String name) {
+            super(name, createIcon(color));
+            this.color = color;
+            this.name = name;
+            icon = (Icon) getValue(AbstractAction.SMALL_ICON);
+        }
+
+        public Color getColor() {
+            return color;
+        }
+
+        public String getName() {
+            return name;
+        }
+
+        public Icon getIcon() {
+            return icon;
+        }
+
+        public void actionPerformed(ActionEvent e) {
+            performAction(color);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/ExportAction.java.netbeans-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,124 @@
+package at.ssw.visualizer.cfg.action;
+
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import at.ssw.visualizer.cfg.graph.CfgScene;
+import java.io.File;
+import javax.swing.JComponent;
+import javax.swing.JFileChooser;
+import javax.swing.filechooser.FileNameExtensionFilter;
+import org.freehep.graphicsio.emf.EMFGraphics2D;
+import org.freehep.graphicsio.gif.GIFGraphics2D;
+import org.freehep.graphicsio.svg.SVGGraphics2D;
+import org.openide.DialogDescriptor;
+import org.openide.DialogDisplayer;
+import org.openide.util.HelpCtx;
+
+/**
+ * Exports Scene to various Graphics Formats
+ * 
+ * @author Rumpfhuber Stefan
+ */
+public class ExportAction extends AbstractCfgEditorAction {
+    
+    public static final String DESCRIPTION_SVG = "Scaleable Vector Format (.svg)";
+    public static final String DESCRIPTION_EMF = "Extended Meta File (.emf)";
+    public static final String DESCRIPTION_GIF = "Graphics Interchange Format (.gif)";    
+    public static final String EXT_GIF = "gif", EXT_EMF = "emf", EXT_SVG = "svg";
+
+    String lastDirectory = null;
+    
+    @Override
+    public void performAction() {       
+        CfgEditorTopComponent tc = this.getEditor();
+        CfgScene scene = tc.getCfgScene();
+        JComponent view = scene.getView();
+           
+        JFileChooser chooser = new JFileChooser ();
+        chooser.setAcceptAllFileFilterUsed(false);
+        chooser.setDialogTitle (getName());
+        chooser.setDialogType (JFileChooser.SAVE_DIALOG);
+        chooser.setMultiSelectionEnabled (false);
+        chooser.setFileSelectionMode (JFileChooser.FILES_ONLY);              
+        chooser.addChoosableFileFilter(new FileNameExtensionFilter(DESCRIPTION_SVG, EXT_SVG));
+        chooser.addChoosableFileFilter(new FileNameExtensionFilter(DESCRIPTION_EMF, EXT_EMF));
+        chooser.addChoosableFileFilter(new FileNameExtensionFilter(DESCRIPTION_GIF, EXT_GIF));
+        if(lastDirectory != null)
+            chooser.setCurrentDirectory(new File(lastDirectory));
+        chooser.setSelectedFile(new File(tc.getName()));
+        
+                              
+        if (chooser.showSaveDialog (tc) != JFileChooser.APPROVE_OPTION)
+            return;
+
+        File file = chooser.getSelectedFile ();
+                
+        if(file == null)
+            return;
+                
+        FileNameExtensionFilter filter = (FileNameExtensionFilter) chooser.getFileFilter();
+        String fn = file.getAbsolutePath().toLowerCase();
+        String ext = filter.getExtensions()[0];
+        if(!fn.endsWith("." + ext)){
+            file = new File( file.getParentFile(), file.getName() + "." + ext);
+        }
+                        
+        if (file.exists ()) {
+            DialogDescriptor descriptor = new DialogDescriptor (
+                "File (" + file.getAbsolutePath () + ") already exists. Do you want to overwrite it?",
+                "File Exists", true, DialogDescriptor.YES_NO_OPTION, DialogDescriptor.NO_OPTION, null);
+                DialogDisplayer.getDefault ().createDialog (descriptor).setVisible (true);
+                    if (descriptor.getValue () != DialogDescriptor.YES_OPTION)
+                        return;
+        }   
+        
+        lastDirectory = chooser.getCurrentDirectory().getAbsolutePath();
+                        
+        if(ext.equals(EXT_SVG)){                   
+            SVGGraphics2D g;
+            try {                  
+                g = new SVGGraphics2D(file, scene.getBounds().getSize());                   
+                g.startExport();                
+                scene.paint(g);
+                g.endExport();
+            } catch(Exception ex){               
+            }
+        } else if (ext.equals(EXT_EMF)) {                 
+            EMFGraphics2D g;   
+            try {                                                                   
+                g = new EMFGraphics2D(file, scene.getBounds().getSize());                       
+                g.startExport();         
+                scene.paint(g);
+                g.endExport();                     
+            } catch(Exception ex){                
+            }
+        } else if (ext.equals(EXT_GIF)) { 
+            GIFGraphics2D g;
+            try {  
+                //use the view as image source to get a image with the current zoomfactor
+                //using the scene.paint() would always return a image with zoomfactor 1.0
+                g = new GIFGraphics2D(file, view);
+                g.startExport();
+                view.print(g);                     
+                g.endExport();   
+            } catch(Exception ex){
+            }
+        }  
+    }          
+       
+    
+    @Override
+    public String getName() {     
+        return "Export CFG";
+    }
+    
+    @Override
+    public HelpCtx getHelpCtx() {
+        return HelpCtx.DEFAULT_HELP;
+    }
+    
+     @Override
+    protected String iconResource() {
+        return "at/ssw/visualizer/cfg/icons/disk.gif";    
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/ExportAction.java.svn-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,124 @@
+package at.ssw.visualizer.cfg.action;
+
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import at.ssw.visualizer.cfg.graph.CfgScene;
+import java.io.File;
+import javax.swing.JComponent;
+import javax.swing.JFileChooser;
+import javax.swing.filechooser.FileNameExtensionFilter;
+import org.freehep.graphicsio.emf.EMFGraphics2D;
+import org.freehep.graphicsio.gif.GIFGraphics2D;
+import org.freehep.graphicsio.svg.SVGGraphics2D;
+import org.openide.DialogDescriptor;
+import org.openide.DialogDisplayer;
+import org.openide.util.HelpCtx;
+
+/**
+ * Exports Scene to various Graphics Formats
+ * 
+ * @author Rumpfhuber Stefan
+ */
+public class ExportAction extends AbstractCfgEditorAction {
+    
+    public static final String DESCRIPTION_SVG = "Scaleable Vector Format (.svg)";
+    public static final String DESCRIPTION_EMF = "Extended Meta File (.emf)";
+    public static final String DESCRIPTION_GIF = "Graphics Interchange Format (.gif)";    
+    public static final String EXT_GIF = "gif", EXT_EMF = "emf", EXT_SVG = "svg";
+
+    String lastDirectory = null;
+    
+    @Override
+    public void performAction() {       
+        CfgEditorTopComponent tc = this.getEditor();
+        CfgScene scene = tc.getCfgScene();
+        JComponent view = scene.getView();
+           
+        JFileChooser chooser = new JFileChooser ();
+        chooser.setAcceptAllFileFilterUsed(false);
+        chooser.setDialogTitle (getName());
+        chooser.setDialogType (JFileChooser.SAVE_DIALOG);
+        chooser.setMultiSelectionEnabled (false);
+        chooser.setFileSelectionMode (JFileChooser.FILES_ONLY);              
+        chooser.addChoosableFileFilter(new FileNameExtensionFilter(DESCRIPTION_SVG, EXT_SVG));
+        chooser.addChoosableFileFilter(new FileNameExtensionFilter(DESCRIPTION_EMF, EXT_EMF));
+        chooser.addChoosableFileFilter(new FileNameExtensionFilter(DESCRIPTION_GIF, EXT_GIF));
+        if(lastDirectory != null)
+            chooser.setCurrentDirectory(new File(lastDirectory));
+        chooser.setSelectedFile(new File(tc.getName()));
+        
+                              
+        if (chooser.showSaveDialog (tc) != JFileChooser.APPROVE_OPTION)
+            return;
+
+        File file = chooser.getSelectedFile ();
+                
+        if(file == null)
+            return;
+                
+        FileNameExtensionFilter filter = (FileNameExtensionFilter) chooser.getFileFilter();
+        String fn = file.getAbsolutePath().toLowerCase();
+        String ext = filter.getExtensions()[0];
+        if(!fn.endsWith("." + ext)){
+            file = new File( file.getParentFile(), file.getName() + "." + ext);
+        }
+                        
+        if (file.exists ()) {
+            DialogDescriptor descriptor = new DialogDescriptor (
+                "File (" + file.getAbsolutePath () + ") already exists. Do you want to overwrite it?",
+                "File Exists", true, DialogDescriptor.YES_NO_OPTION, DialogDescriptor.NO_OPTION, null);
+                DialogDisplayer.getDefault ().createDialog (descriptor).setVisible (true);
+                    if (descriptor.getValue () != DialogDescriptor.YES_OPTION)
+                        return;
+        }   
+        
+        lastDirectory = chooser.getCurrentDirectory().getAbsolutePath();
+                        
+        if(ext.equals(EXT_SVG)){                   
+            SVGGraphics2D g;
+            try {                  
+                g = new SVGGraphics2D(file, scene.getBounds().getSize());                   
+                g.startExport();                
+                scene.paint(g);
+                g.endExport();
+            } catch(Exception ex){               
+            }
+        } else if (ext.equals(EXT_EMF)) {                 
+            EMFGraphics2D g;   
+            try {                                                                   
+                g = new EMFGraphics2D(file, scene.getBounds().getSize());                       
+                g.startExport();         
+                scene.paint(g);
+                g.endExport();                     
+            } catch(Exception ex){                
+            }
+        } else if (ext.equals(EXT_GIF)) { 
+            GIFGraphics2D g;
+            try {  
+                //use the view as image source to get a image with the current zoomfactor
+                //using the scene.paint() would always return a image with zoomfactor 1.0
+                g = new GIFGraphics2D(file, view);
+                g.startExport();
+                view.print(g);                     
+                g.endExport();   
+            } catch(Exception ex){
+            }
+        }  
+    }          
+       
+    
+    @Override
+    public String getName() {     
+        return "Export CFG";
+    }
+    
+    @Override
+    public HelpCtx getHelpCtx() {
+        return HelpCtx.DEFAULT_HELP;
+    }
+    
+     @Override
+    protected String iconResource() {
+        return "at/ssw/visualizer/cfg/icons/disk.gif";    
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/HideEdgesAction.java.svn-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,52 @@
+package at.ssw.visualizer.cfg.action;
+
+
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import at.ssw.visualizer.cfg.graph.CfgScene;
+import at.ssw.visualizer.cfg.graph.EdgeWidget;
+import at.ssw.visualizer.cfg.model.CfgEdge;
+import at.ssw.visualizer.cfg.model.CfgNode;
+import org.openide.util.HelpCtx;
+
+/**
+ * Hides all edges connected to the selected node.
+ *
+ * @author Bernhard Stiftner
+ * @author Rumpfhuber Stefan
+ */
+public class HideEdgesAction extends AbstractCfgEditorAction {
+
+    public void performAction() {
+        CfgEditorTopComponent tc = getEditor();
+        if (tc != null) {
+             tc.getCfgScene().setSelectedEdgesVisibility(false);
+        }
+    }
+
+    public String getName() {
+        return "Hide Edges";
+    }
+
+    @Override
+    protected String iconResource() {
+        return "at/ssw/visualizer/cfg/icons/hideedges.gif";
+    }
+
+    public HelpCtx getHelpCtx() {
+        return HelpCtx.DEFAULT_HELP;
+    }
+     
+    @Override  
+    public void selectionChanged(CfgScene scene) {        
+        for (CfgNode n : scene.getSelectedNodes()) {  
+            for (CfgEdge e : scene.findNodeEdges(n, true, true) ){
+                EdgeWidget ew = (EdgeWidget) scene.findWidget(e);
+                if(ew.isVisible()) { 
+                    setEnabled(true);
+                    return;
+                }
+            }
+        }
+        setEnabled(false);
+    }   
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/HierarchicalCompoundLayoutAction.java.svn-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,35 @@
+package at.ssw.visualizer.cfg.action;
+
+import at.ssw.visualizer.cfg.CfgEditorContext;
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import at.ssw.visualizer.cfg.graph.CfgScene;
+import org.openide.util.HelpCtx;
+
+
+public class HierarchicalCompoundLayoutAction extends AbstractCfgEditorAction {
+    
+      public void performAction() {
+        CfgEditorTopComponent tc = getEditor();
+        if (tc != null) {
+            CfgScene scene = tc.getCfgScene();
+            scene.setSceneLayout(CfgEditorContext.LAYOUT_HIERARCHICALCOMPOUNDLAYOUT);           
+            scene.applyLayout();                   
+        }
+    }
+
+    public String getName() {
+        return "Hierarchical Compound Layout";
+    }
+
+
+    @Override
+    protected String iconResource() {
+        return "at/ssw/visualizer/cfg/icons/arrangeloop.gif";
+    }
+
+    public HelpCtx getHelpCtx() {
+        return HelpCtx.DEFAULT_HELP;
+    }
+  
+   
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/HierarchicalNodeLayoutAction.java.svn-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,35 @@
+package at.ssw.visualizer.cfg.action;
+
+import at.ssw.visualizer.cfg.CfgEditorContext;
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import at.ssw.visualizer.cfg.graph.CfgScene;
+import org.openide.util.HelpCtx;
+
+
+public class HierarchicalNodeLayoutAction extends AbstractCfgEditorAction {
+
+    @Override
+    public void performAction() {
+        CfgEditorTopComponent tc = getEditor();
+        if (tc != null) {
+            CfgScene scene = tc.getCfgScene();
+            scene.setSceneLayout(CfgEditorContext.LAYOUT_HIERARCHICALNODELAYOUT);
+            scene.applyLayout();                                 
+        }
+    }
+   
+    public String getName() {
+        return "Hierarchical Node Layout";
+    }
+
+
+    @Override
+    protected String iconResource() {
+        return "at/ssw/visualizer/cfg/icons/arrangehier.gif";
+    }
+
+    public HelpCtx getHelpCtx() {
+        return HelpCtx.DEFAULT_HELP;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/ShowAllAction.java.svn-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,40 @@
+package at.ssw.visualizer.cfg.action;
+
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import at.ssw.visualizer.cfg.graph.CfgScene;
+import org.openide.util.HelpCtx;
+
+
+/**
+ * Adjusts the Zoom factor of the Scene to the bounds of Scroll panel 
+ * to get a clean view on the whole graph.
+ *
+ */
+public class ShowAllAction extends AbstractCfgEditorAction {
+    
+    @Override
+    public void performAction() {    
+        CfgEditorTopComponent tc = getEditor();
+        if (tc != null) {
+            CfgScene scene = tc.getCfgScene();  
+            scene.zoomScene();        
+
+        }        
+    }
+    
+    @Override
+    public HelpCtx getHelpCtx() {
+        return HelpCtx.DEFAULT_HELP;
+    }
+    
+    @Override
+    public String getName() {
+        return "Fit Scene to Window";
+    }
+    
+    @Override
+    protected String iconResource() {
+        return "at/ssw/visualizer/cfg/icons/autosize.gif";    
+    }
+          
+}   
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/ShowCFGEditorAction.java.netbeans-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,62 @@
+package at.ssw.visualizer.cfg.action;
+
+import at.ssw.visualizer.cfg.editor.CfgEditorSupport;
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import at.ssw.visualizer.cfg.icons.Icons;
+import at.ssw.visualizer.core.focus.Focus;
+import at.ssw.visualizer.model.cfg.ControlFlowGraph;
+import org.openide.nodes.Node;
+import org.openide.util.HelpCtx;
+import org.openide.util.actions.CookieAction;
+
+/**
+ * Shows the CFG visualizer for the currently selected compilation.
+ *
+ * @author Bernhard Stiftner
+ * @author Christian Wimmer
+ */
+public final class ShowCFGEditorAction extends CookieAction {
+         
+    protected void performAction(Node[] activatedNodes) {       
+        ControlFlowGraph cfg = activatedNodes[0].getLookup().lookup(ControlFlowGraph.class);
+        if (!Focus.findEditor(CfgEditorTopComponent.class, cfg)) {
+            CfgEditorSupport editor = new CfgEditorSupport(cfg);
+            editor.open();
+        }
+    }
+
+    @Override
+    protected boolean enable(Node[] activatedNodes) {
+        if (!super.enable(activatedNodes)) {
+            return false;
+        }
+        ControlFlowGraph cfg = activatedNodes[0].getLookup().lookup(ControlFlowGraph.class);
+        return cfg.getBasicBlocks().size() > 0;
+    }
+
+    public String getName() {
+        return "Open Control Flow Graph";
+    }
+
+    @Override
+    protected String iconResource() {
+        return Icons.CFG;
+    }
+
+    protected int mode() {
+        return CookieAction.MODE_EXACTLY_ONE;
+    }
+
+    protected Class[] cookieClasses() {
+        return new Class[]{ControlFlowGraph.class};
+    }
+
+    public HelpCtx getHelpCtx() {
+        return HelpCtx.DEFAULT_HELP;
+    }
+
+    @Override
+    protected boolean asynchronous() {
+        return false;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/ShowCFGEditorAction.java.svn-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,62 @@
+package at.ssw.visualizer.cfg.action;
+
+import at.ssw.visualizer.cfg.editor.CfgEditorSupport;
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import at.ssw.visualizer.cfg.icons.Icons;
+import at.ssw.visualizer.core.focus.Focus;
+import at.ssw.visualizer.model.cfg.ControlFlowGraph;
+import org.openide.nodes.Node;
+import org.openide.util.HelpCtx;
+import org.openide.util.actions.CookieAction;
+
+/**
+ * Shows the CFG visualizer for the currently selected compilation.
+ *
+ * @author Bernhard Stiftner
+ * @author Christian Wimmer
+ */
+public final class ShowCFGEditorAction extends CookieAction {
+         
+    protected void performAction(Node[] activatedNodes) {       
+        ControlFlowGraph cfg = activatedNodes[0].getLookup().lookup(ControlFlowGraph.class);
+        if (!Focus.findEditor(CfgEditorTopComponent.class, cfg)) {
+            CfgEditorSupport editor = new CfgEditorSupport(cfg);
+            editor.open();
+        }
+    }
+
+    @Override
+    protected boolean enable(Node[] activatedNodes) {
+        if (!super.enable(activatedNodes)) {
+            return false;
+        }
+        ControlFlowGraph cfg = activatedNodes[0].getLookup().lookup(ControlFlowGraph.class);
+        return cfg.getBasicBlocks().size() > 0;
+    }
+
+    public String getName() {
+        return "Open Control Flow Graph";
+    }
+
+    @Override
+    protected String iconResource() {
+        return Icons.CFG;
+    }
+
+    protected int mode() {
+        return CookieAction.MODE_EXACTLY_ONE;
+    }
+
+    protected Class[] cookieClasses() {
+        return new Class[]{ControlFlowGraph.class};
+    }
+
+    public HelpCtx getHelpCtx() {
+        return HelpCtx.DEFAULT_HELP;
+    }
+
+    @Override
+    protected boolean asynchronous() {
+        return false;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/ShowEdgesAction.java.svn-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,52 @@
+package at.ssw.visualizer.cfg.action;
+
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import at.ssw.visualizer.cfg.graph.CfgScene;
+import at.ssw.visualizer.cfg.graph.EdgeWidget;
+import at.ssw.visualizer.cfg.model.CfgEdge;
+import at.ssw.visualizer.cfg.model.CfgNode;
+import org.openide.util.HelpCtx;
+
+/**
+ * Shows all edges connected to the selected node.
+ *
+ * @author Bernhard Stiftner
+ * @author Rumpfhuber Stefan
+ */
+public class ShowEdgesAction extends AbstractCfgEditorAction {
+
+    public void performAction() {
+        CfgEditorTopComponent tc = getEditor();
+        if (tc != null) {
+            tc.getCfgScene().setSelectedEdgesVisibility(true);
+        }
+    }
+
+    public String getName() {
+        return "Show edges";
+    }
+
+
+    @Override
+    protected String iconResource() {
+        return "at/ssw/visualizer/cfg/icons/showedges.gif";
+    }
+
+    public HelpCtx getHelpCtx() {
+        return HelpCtx.DEFAULT_HELP;
+    }
+
+    @Override  
+    public void selectionChanged(CfgScene scene) {      
+        for (CfgNode n : scene.getSelectedNodes()) {  
+            for (CfgEdge e : scene.findNodeEdges(n, true, true) ){
+                EdgeWidget ew = (EdgeWidget) scene.findWidget(e);
+                if(!ew.isVisible()) {
+                    setEnabled(true);
+                    return;
+                }
+            }
+        }
+        setEnabled(false);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/SwitchLoopClustersAction.java.svn-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,66 @@
+package at.ssw.visualizer.cfg.action;
+
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import at.ssw.visualizer.cfg.graph.CfgScene;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import javax.swing.JComponent;
+import javax.swing.JToggleButton;
+import org.openide.util.HelpCtx;
+import org.openide.util.actions.Presenter;
+
+public class SwitchLoopClustersAction extends AbstractCfgEditorAction implements Presenter.Toolbar {
+
+    @Override
+    public void performAction() {
+        CfgEditorTopComponent tc = getEditor();
+        if (tc != null) {  
+            CfgScene scene = tc.getCfgScene();
+            boolean visible = scene.isLoopClusterVisible();
+            scene.setLoopWidgets(!visible);
+        }
+    }
+
+    @Override
+    public String getName() {
+        return "Enable/Disable Loop Clusters";
+    }
+
+    @Override
+    protected String iconResource() {
+        return "at/ssw/visualizer/cfg/icons/cluster.gif";
+    }
+
+    public HelpCtx getHelpCtx() {
+        return HelpCtx.DEFAULT_HELP;
+    }
+    
+    
+    @Override
+    public JComponent getToolbarPresenter() {
+        return new ToolbarPresenter();       
+    }
+    
+    class ToolbarPresenter extends JToggleButton {     
+        private static final String TOOLTIP_ENABLE = "Enable LoopClusters";
+        private static final String TOOLTIP_DISABLE = "Disable LoopClusters";
+        
+        public ToolbarPresenter() {      
+            super(SwitchLoopClustersAction.this);
+            setText(null);    
+            this.setToolTipText(TOOLTIP_DISABLE);
+            this.setSelected(true);
+            
+            this.addItemListener(new ItemListener(){
+                public void itemStateChanged(ItemEvent e) {
+                    if(isSelected()){
+                        setToolTipText(TOOLTIP_DISABLE);
+                    } else {
+                        setToolTipText(TOOLTIP_ENABLE);
+                    }
+                }
+            });      
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/UseBezierRouterAction.java.svn-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,29 @@
+package at.ssw.visualizer.cfg.action;
+
+import at.ssw.visualizer.cfg.CfgEditorContext;
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import org.openide.util.HelpCtx;
+
+
+public class UseBezierRouterAction extends AbstractRouterAction {
+    
+    @Override
+    protected void setLinkRouter(CfgEditorTopComponent editor) {      
+        editor.getCfgScene().setRouter(CfgEditorContext.ROUTING_BEZIER);
+    }
+    
+    @Override
+    public String getName() {
+        return "Use Bezier Router";
+    }
+      
+    @Override
+    protected String iconResource() {
+        return "at/ssw/visualizer/cfg/icons/bezierrouter.gif";
+    }
+
+    public HelpCtx getHelpCtx() {
+        return HelpCtx.DEFAULT_HELP;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/UseDirectLineRouterAction.java.svn-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,28 @@
+package at.ssw.visualizer.cfg.action;
+
+import at.ssw.visualizer.cfg.CfgEditorContext;
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import org.openide.util.HelpCtx;
+
+
+public class UseDirectLineRouterAction extends AbstractRouterAction {
+ 
+    @Override
+    protected void setLinkRouter(CfgEditorTopComponent editor) {
+        editor.getCfgScene().setRouter(CfgEditorContext.ROUTING_DIRECTLINES);
+    }
+    
+    @Override
+    public String getName() {
+        return "User Direct Router";
+    }
+    
+    @Override
+    protected String iconResource() {
+        return "at/ssw/visualizer/cfg/icons/fanrouter.gif";
+    }
+
+    public HelpCtx getHelpCtx() {
+        return HelpCtx.DEFAULT_HELP;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/ZoominAction.java.svn-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,33 @@
+package at.ssw.visualizer.cfg.action;
+
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import at.ssw.visualizer.cfg.graph.CfgScene;
+import org.openide.util.HelpCtx;
+
+
+public class ZoominAction extends AbstractCfgEditorAction {
+       
+    @Override
+    public void performAction() {
+        CfgEditorTopComponent tc = getEditor();
+        if (tc != null) {            
+            CfgScene scene = tc.getCfgScene();    
+            scene.animateZoom(1.1);
+        }
+    }
+    
+    @Override
+    protected String iconResource() {
+        return "at/ssw/visualizer/cfg/icons/zoomin.gif";
+    }
+
+    @Override
+    public String getName() {
+        return "Zoomin";
+    }
+
+    @Override
+    public HelpCtx getHelpCtx() {
+        return HelpCtx.DEFAULT_HELP;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/.svn/text-base/ZoomoutAction.java.svn-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,33 @@
+package at.ssw.visualizer.cfg.action;
+
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import at.ssw.visualizer.cfg.graph.CfgScene;
+import org.openide.util.HelpCtx;
+
+public class ZoomoutAction extends AbstractCfgEditorAction {
+
+    @Override
+    public void performAction() {
+        CfgEditorTopComponent tc = getEditor();
+        if (tc != null) {   
+            CfgScene scene = tc.getCfgScene();     
+            scene.animateZoom(0.9);
+        }
+    }
+    
+    @Override
+    protected String iconResource() {
+        return "at/ssw/visualizer/cfg/icons/zoomout.gif";
+    }
+       
+    @Override
+    public String getName() {
+        return "Zoomout";
+    }
+
+    @Override
+    public HelpCtx getHelpCtx() {
+        return HelpCtx.DEFAULT_HELP;
+    }
+    
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/AbstractCfgEditorAction.java	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,94 @@
+package at.ssw.visualizer.cfg.action;
+
+
+import at.ssw.visualizer.cfg.graph.CfgEventListener;
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import at.ssw.visualizer.cfg.graph.CfgScene;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.JMenuItem;
+import org.openide.util.actions.CallableSystemAction;
+import org.openide.windows.TopComponent;
+
+/**
+ * The common superclass of all concrete actions related to the CFG visualizer.
+ *
+ * @author Bernhard Stiftner
+ * @author Rumpfhuber Stefan
+ */
+public abstract class AbstractCfgEditorAction extends CallableSystemAction implements CfgEventListener , PropertyChangeListener {
+
+    CfgEditorTopComponent topComponent = null;
+    
+    public AbstractCfgEditorAction() {        
+        TopComponent.getRegistry().addPropertyChangeListener(this);
+        setEnabled(false);
+
+    }
+       
+    protected CfgEditorTopComponent getEditor() {
+        return topComponent;
+    }
+    
+    protected void setEditor(CfgEditorTopComponent newTopComponent) {    
+        CfgEditorTopComponent oldTopComponent = getEditor();
+        if(newTopComponent != oldTopComponent){
+            if(oldTopComponent != null) {
+                oldTopComponent.getCfgScene().removeCfgEventListener(this);
+            }
+            this.topComponent = newTopComponent;         
+            if (newTopComponent != null) {
+                newTopComponent.getCfgScene().addCfgEventListener(this);
+                selectionChanged(newTopComponent.getCfgScene());
+            }
+            this.setEnabled(newTopComponent!=null);
+        }
+    }
+
+    
+    @Override
+    public JMenuItem getMenuPresenter() {
+        return new JMenuItem(this);
+    }
+
+   
+    @Override
+    public JComponent getToolbarPresenter() {
+        JButton b = new JButton(this);
+        if (getIcon() != null) {
+            b.setText(null);
+            b.setToolTipText(getName());
+        }
+        return b;
+    }
+
+   
+    @Override
+    public JMenuItem getPopupPresenter() {       
+        return new JMenuItem(this);
+    }
+    
+   
+    @Override
+    protected boolean asynchronous() {
+        return false;
+    }
+     
+    
+    public void propertyChange(PropertyChangeEvent e) {  
+        if ( e.getPropertyName().equals(TopComponent.Registry.PROP_ACTIVATED)) {
+            if(e.getNewValue() instanceof CfgEditorTopComponent){  
+                CfgEditorTopComponent tc = (CfgEditorTopComponent)e.getNewValue();
+                setEditor(tc);
+                selectionChanged(tc.getCfgScene());
+            } 
+        }
+    }
+    
+    
+    public void selectionChanged(CfgScene scene) {   
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/AbstractRouterAction.java	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,61 @@
+package at.ssw.visualizer.cfg.action;
+
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import javax.swing.JComponent;
+import javax.swing.JMenuItem;
+import javax.swing.JRadioButtonMenuItem;
+import javax.swing.JToggleButton;
+import org.openide.util.actions.Presenter;
+
+/**
+ * Common superclass for all actions which set the link router.
+ *
+ * @author Bernhard Stiftner
+ * @author Rumpfhuber Stefan
+ */
+public abstract class AbstractRouterAction extends AbstractCfgEditorAction implements Presenter.Menu, Presenter.Popup, Presenter.Toolbar {
+       
+    public void performAction() {
+        CfgEditorTopComponent tc = getEditor();
+        if (tc != null) {  
+            setLinkRouter(tc);
+        }
+    }
+
+    protected abstract void setLinkRouter(CfgEditorTopComponent editor);
+    
+    @Override
+    public JMenuItem getMenuPresenter() {
+        JMenuItem presenter = new MenuPresenter();
+        presenter.setToolTipText(getName());
+        return presenter;
+    }
+
+    @Override
+    public JMenuItem getPopupPresenter() {
+        return getMenuPresenter();
+    }
+
+    @Override
+    public JComponent getToolbarPresenter() {
+        ToolbarPresenter presenter = new ToolbarPresenter();    
+        presenter.setToolTipText(getName());
+        return presenter;
+    }
+      
+    class MenuPresenter extends JRadioButtonMenuItem {
+
+        public MenuPresenter() {
+            super(AbstractRouterAction.this);
+            setIcon(null);
+        }      
+    }
+
+    class ToolbarPresenter extends JToggleButton {
+
+        public ToolbarPresenter() {
+            super(AbstractRouterAction.this);
+            setText(null);  
+        }
+    } 
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/ColorAction.java	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,226 @@
+package at.ssw.visualizer.cfg.action;
+
+import at.ssw.visualizer.cfg.graph.CfgEventListener;
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import at.ssw.visualizer.cfg.graph.CfgScene;
+import at.ssw.visualizer.cfg.model.CfgNode;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.event.ActionEvent;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.awt.image.BufferedImage;
+import java.util.Set;
+import javax.swing.AbstractAction;
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+import javax.swing.JPopupMenu;
+import javax.swing.SwingConstants;
+import javax.swing.plaf.basic.BasicArrowButton;
+import org.openide.util.HelpCtx;
+import org.openide.util.actions.Presenter;
+
+/**
+ * Changes the background color of a node.
+ *
+ * @author Bernhard Stiftner
+ * @author Rumpfhuber Stefan
+ */
+public class ColorAction extends AbstractCfgEditorAction implements Presenter.Menu, Presenter.Popup, Presenter.Toolbar {
+
+    public static final int IMAGE_WIDTH = 16;
+    public static final int IMAGE_HEIGHT = 16;
+    
+    
+    /** Names of colors shown in color select lists. */
+    private static final String[] COLOR_NAMES = {"White", "Light Gray", "Dark Gray", "Light Yellow", "Dark Yellow", "Light Green", "Dark Green", "Light Cyan", "Dark Cyan", "Light Blue", "Dark Blue", "Light Magenta", "Dark Magenta", "Light Red", "Dark Red"};
+
+    /** Values of colors shown in color select lists. */
+    private static final Color[] COLORS = {
+        new Color(0xFFFFFF), new Color(0xD4D0C8), new Color(0xA4A098), new Color(0xF0F0B0), new Color(0xE0E040), 
+        new Color(0xB0F0B0), new Color(0x40E040), new Color(0xB0F0F0), new Color(0x40E0E0), new Color(0xB0B0F0), 
+        new Color(0x4040E0), new Color(0xF0B0F0), new Color(0xE040E0), new Color(0xF0B0B0), new Color(0xE04040)
+    };
+
+    public void performAction() {
+        // nothing to do here, the presenters are supposed to call
+        // performAction(Color)
+    }
+
+    protected void performAction(Color color) {
+        CfgEditorTopComponent tc = getEditor();
+        if (tc != null) {
+            tc.getCfgScene().setSelectedNodesColor(color);
+        }
+    }
+
+    public String getName() {
+        return "Change NodeColor";
+    }
+
+    @Override
+    protected String iconResource() {
+        return "at/ssw/visualizer/cfg/icons/color.gif";
+    }
+
+    public HelpCtx getHelpCtx() {
+        return HelpCtx.DEFAULT_HELP;
+    }
+
+    @Override
+    public JMenuItem getMenuPresenter() {
+        return new MenuPresenter();
+    }
+
+    @Override
+    public JMenuItem getPopupPresenter() {
+        return new MenuPresenter();
+    }
+
+    @Override
+    public JComponent getToolbarPresenter() {
+        return new ToolbarPresenter();
+    }
+
+    class MenuPresenter extends JMenu {
+       
+        public MenuPresenter() {
+            super(ColorAction.this);
+            initGUI();
+        }
+        
+        protected void initGUI() {  
+            CfgEditorTopComponent tc = getEditor();
+            if( tc != null && tc.getCfgScene().getSelectedNodes().size()==0) {
+                //no node selected
+                setEnabled(false);
+            } else {
+                add(new SetColorAction(null, "Automatic"));
+                for (int i = 0; i < COLORS.length; i++) {
+                    add(new SetColorAction(COLORS[i], COLOR_NAMES[i]));
+                }         
+            }          
+        }       
+    }
+
+    class ToolbarPresenter extends JButton implements CfgEventListener, MouseListener {
+
+        final int arrowSize = 5;
+        final int arrowMargin = 3;
+        JPopupMenu popup;
+
+        public ToolbarPresenter() {
+            setIcon(createIcon());
+            setToolTipText(ColorAction.this.getName());
+
+            popup = new JPopupMenu();
+            popup.add(new SetColorAction(null, "Automatic"));
+            for (int i = 0; i < COLORS.length; i++) {
+                popup.add(new SetColorAction(COLORS[i], COLOR_NAMES[i]));
+            }
+            addMouseListener(this);
+        }
+
+        public Icon createIcon() {
+            BasicArrowButton arrow = new BasicArrowButton(SwingConstants.SOUTH);
+            BufferedImage img = new BufferedImage(IMAGE_WIDTH + arrowSize + 2 * arrowMargin, IMAGE_HEIGHT, BufferedImage.TYPE_INT_ARGB);
+            Graphics g = img.getGraphics();
+            ColorAction.this.getIcon().paintIcon(this, g, 0, 0);
+            arrow.paintTriangle(g, IMAGE_WIDTH + arrowMargin + arrowSize / 2, IMAGE_HEIGHT / 2 - arrowSize / 2, arrowSize, SwingConstants.SOUTH, true);
+            return new ImageIcon(img);
+        }
+       
+        
+        public void selectionChanged(CfgScene scene) {
+            Set<CfgNode> nodes = scene.getSelectedNodes();
+            setEnabled(nodes.size() > 0);
+        }
+        
+        public void mouseClicked(MouseEvent e) {
+            if (e.getX() < getInsets().left + IMAGE_WIDTH + arrowMargin) {
+                performAction(null);
+            } else {
+                popup.show(this, 0, getSize().height);
+            }
+        }
+
+        public void mouseEntered(MouseEvent e) {
+        }
+
+        public void mouseExited(MouseEvent e) {
+        }
+
+        public void mousePressed(MouseEvent e) {
+        }
+
+        public void mouseReleased(MouseEvent e) {
+        }     
+    }
+
+    protected Icon createIcon(Color color) {
+        if (color == null) {
+            return ColorAction.this.getIcon();
+        } else {
+            return new ColorIcon(color);
+        }
+    }
+
+    class ColorIcon implements Icon {
+
+        Color color;
+
+        public ColorIcon(Color color) {
+            this.color = color;
+        }
+
+        public int getIconWidth() {
+            return IMAGE_WIDTH;
+        }
+
+        public int getIconHeight() {
+            return IMAGE_HEIGHT;
+        }
+
+        public void paintIcon(Component c, Graphics g, int x, int y) {
+            Color oldColor = g.getColor();
+            g.setColor(color);
+            g.fillRect(x, y, IMAGE_WIDTH, IMAGE_HEIGHT);
+            g.setColor(oldColor);
+        }
+    }
+
+    class SetColorAction extends AbstractAction {
+
+        Color color;
+        String name;
+        Icon icon;
+
+        public SetColorAction(Color color, String name) {
+            super(name, createIcon(color));
+            this.color = color;
+            this.name = name;
+            icon = (Icon) getValue(AbstractAction.SMALL_ICON);
+        }
+
+        public Color getColor() {
+            return color;
+        }
+
+        public String getName() {
+            return name;
+        }
+
+        public Icon getIcon() {
+            return icon;
+        }
+
+        public void actionPerformed(ActionEvent e) {
+            performAction(color);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/ExportAction.java	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,122 @@
+package at.ssw.visualizer.cfg.action;
+
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import at.ssw.visualizer.cfg.graph.CfgScene;
+import java.io.File;
+import javax.swing.JComponent;
+import javax.swing.JFileChooser;
+import javax.swing.filechooser.FileNameExtensionFilter;
+import org.openide.DialogDescriptor;
+import org.openide.DialogDisplayer;
+import org.openide.util.HelpCtx;
+
+/**
+ * Exports Scene to various Graphics Formats
+ * 
+ * @author Rumpfhuber Stefan
+ */
+public class ExportAction extends AbstractCfgEditorAction {
+    
+    public static final String DESCRIPTION_SVG = "Scaleable Vector Format (.svg)";
+    public static final String DESCRIPTION_EMF = "Extended Meta File (.emf)";
+    public static final String DESCRIPTION_GIF = "Graphics Interchange Format (.gif)";    
+    public static final String EXT_GIF = "gif", EXT_EMF = "emf", EXT_SVG = "svg";
+
+    String lastDirectory = null;
+    
+    @Override
+    public void performAction() {       
+        CfgEditorTopComponent tc = this.getEditor();
+        CfgScene scene = tc.getCfgScene();
+        JComponent view = scene.getView();
+           
+        JFileChooser chooser = new JFileChooser ();
+        chooser.setAcceptAllFileFilterUsed(false);
+        chooser.setDialogTitle (getName());
+        chooser.setDialogType (JFileChooser.SAVE_DIALOG);
+        chooser.setMultiSelectionEnabled (false);
+        chooser.setFileSelectionMode (JFileChooser.FILES_ONLY);              
+        chooser.addChoosableFileFilter(new FileNameExtensionFilter(DESCRIPTION_SVG, EXT_SVG));
+        chooser.addChoosableFileFilter(new FileNameExtensionFilter(DESCRIPTION_EMF, EXT_EMF));
+        chooser.addChoosableFileFilter(new FileNameExtensionFilter(DESCRIPTION_GIF, EXT_GIF));
+        if(lastDirectory != null)
+            chooser.setCurrentDirectory(new File(lastDirectory));
+        chooser.setSelectedFile(new File(tc.getName()));
+        
+                              
+        if (chooser.showSaveDialog (tc) != JFileChooser.APPROVE_OPTION)
+            return;
+
+        File file = chooser.getSelectedFile ();
+                
+        if(file == null)
+            return;
+                
+        FileNameExtensionFilter filter = (FileNameExtensionFilter) chooser.getFileFilter();
+        String fn = file.getAbsolutePath().toLowerCase();
+        String ext = filter.getExtensions()[0];
+        if(!fn.endsWith("." + ext)){
+            file = new File( file.getParentFile(), file.getName() + "." + ext);
+        }
+                        
+        if (file.exists ()) {
+            DialogDescriptor descriptor = new DialogDescriptor (
+                "File (" + file.getAbsolutePath () + ") already exists. Do you want to overwrite it?",
+                "File Exists", true, DialogDescriptor.YES_NO_OPTION, DialogDescriptor.NO_OPTION, null);
+                DialogDisplayer.getDefault ().createDialog (descriptor).setVisible (true);
+                    if (descriptor.getValue () != DialogDescriptor.YES_OPTION)
+                        return;
+        }   
+        
+        lastDirectory = chooser.getCurrentDirectory().getAbsolutePath();
+                        
+        /*if(ext.equals(EXT_SVG)){                   
+            SVGGraphics2D g;
+            try {                  
+                g = new SVGGraphics2D(file, scene.getBounds().getSize());                   
+                g.startExport();                
+                scene.paint(g);
+                g.endExport();
+            } catch(Exception ex){               
+            }
+        } else if (ext.equals(EXT_EMF)) {                 
+            EMFGraphics2D g;   
+            try {                                                                   
+                g = new EMFGraphics2D(file, scene.getBounds().getSize());                       
+                g.startExport();         
+                scene.paint(g);
+                g.endExport();                     
+            } catch(Exception ex){                
+            }
+        } else if (ext.equals(EXT_GIF)) { 
+            GIFGraphics2D g;
+            try {  
+                //use the view as image source to get a image with the current zoomfactor
+                //using the scene.paint() would always return a image with zoomfactor 1.0
+                g = new GIFGraphics2D(file, view);
+                g.startExport();
+                view.print(g);                     
+                g.endExport();   
+            } catch(Exception ex){
+            }
+        }  */
+        // TODO(tw): Add SVG export.
+    }          
+       
+    
+    @Override
+    public String getName() {     
+        return "Export CFG";
+    }
+    
+    @Override
+    public HelpCtx getHelpCtx() {
+        return HelpCtx.DEFAULT_HELP;
+    }
+    
+     @Override
+    protected String iconResource() {
+        return "at/ssw/visualizer/cfg/icons/disk.gif";    
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/HideEdgesAction.java	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,52 @@
+package at.ssw.visualizer.cfg.action;
+
+
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import at.ssw.visualizer.cfg.graph.CfgScene;
+import at.ssw.visualizer.cfg.graph.EdgeWidget;
+import at.ssw.visualizer.cfg.model.CfgEdge;
+import at.ssw.visualizer.cfg.model.CfgNode;
+import org.openide.util.HelpCtx;
+
+/**
+ * Hides all edges connected to the selected node.
+ *
+ * @author Bernhard Stiftner
+ * @author Rumpfhuber Stefan
+ */
+public class HideEdgesAction extends AbstractCfgEditorAction {
+
+    public void performAction() {
+        CfgEditorTopComponent tc = getEditor();
+        if (tc != null) {
+             tc.getCfgScene().setSelectedEdgesVisibility(false);
+        }
+    }
+
+    public String getName() {
+        return "Hide Edges";
+    }
+
+    @Override
+    protected String iconResource() {
+        return "at/ssw/visualizer/cfg/icons/hideedges.gif";
+    }
+
+    public HelpCtx getHelpCtx() {
+        return HelpCtx.DEFAULT_HELP;
+    }
+     
+    @Override  
+    public void selectionChanged(CfgScene scene) {        
+        for (CfgNode n : scene.getSelectedNodes()) {  
+            for (CfgEdge e : scene.findNodeEdges(n, true, true) ){
+                EdgeWidget ew = (EdgeWidget) scene.findWidget(e);
+                if(ew.isVisible()) { 
+                    setEnabled(true);
+                    return;
+                }
+            }
+        }
+        setEnabled(false);
+    }   
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/HierarchicalCompoundLayoutAction.java	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,35 @@
+package at.ssw.visualizer.cfg.action;
+
+import at.ssw.visualizer.cfg.CfgEditorContext;
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import at.ssw.visualizer.cfg.graph.CfgScene;
+import org.openide.util.HelpCtx;
+
+
+public class HierarchicalCompoundLayoutAction extends AbstractCfgEditorAction {
+    
+      public void performAction() {
+        CfgEditorTopComponent tc = getEditor();
+        if (tc != null) {
+            CfgScene scene = tc.getCfgScene();
+            scene.setSceneLayout(CfgEditorContext.LAYOUT_HIERARCHICALCOMPOUNDLAYOUT);           
+            scene.applyLayout();                   
+        }
+    }
+
+    public String getName() {
+        return "Hierarchical Compound Layout";
+    }
+
+
+    @Override
+    protected String iconResource() {
+        return "at/ssw/visualizer/cfg/icons/arrangeloop.gif";
+    }
+
+    public HelpCtx getHelpCtx() {
+        return HelpCtx.DEFAULT_HELP;
+    }
+  
+   
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/HierarchicalNodeLayoutAction.java	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,35 @@
+package at.ssw.visualizer.cfg.action;
+
+import at.ssw.visualizer.cfg.CfgEditorContext;
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import at.ssw.visualizer.cfg.graph.CfgScene;
+import org.openide.util.HelpCtx;
+
+
+public class HierarchicalNodeLayoutAction extends AbstractCfgEditorAction {
+
+    @Override
+    public void performAction() {
+        CfgEditorTopComponent tc = getEditor();
+        if (tc != null) {
+            CfgScene scene = tc.getCfgScene();
+            scene.setSceneLayout(CfgEditorContext.LAYOUT_HIERARCHICALNODELAYOUT);
+            scene.applyLayout();                                 
+        }
+    }
+   
+    public String getName() {
+        return "Hierarchical Node Layout";
+    }
+
+
+    @Override
+    protected String iconResource() {
+        return "at/ssw/visualizer/cfg/icons/arrangehier.gif";
+    }
+
+    public HelpCtx getHelpCtx() {
+        return HelpCtx.DEFAULT_HELP;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/ShowAllAction.java	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,40 @@
+package at.ssw.visualizer.cfg.action;
+
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import at.ssw.visualizer.cfg.graph.CfgScene;
+import org.openide.util.HelpCtx;
+
+
+/**
+ * Adjusts the Zoom factor of the Scene to the bounds of Scroll panel 
+ * to get a clean view on the whole graph.
+ *
+ */
+public class ShowAllAction extends AbstractCfgEditorAction {
+    
+    @Override
+    public void performAction() {    
+        CfgEditorTopComponent tc = getEditor();
+        if (tc != null) {
+            CfgScene scene = tc.getCfgScene();  
+            scene.zoomScene();        
+
+        }        
+    }
+    
+    @Override
+    public HelpCtx getHelpCtx() {
+        return HelpCtx.DEFAULT_HELP;
+    }
+    
+    @Override
+    public String getName() {
+        return "Fit Scene to Window";
+    }
+    
+    @Override
+    protected String iconResource() {
+        return "at/ssw/visualizer/cfg/icons/autosize.gif";    
+    }
+          
+}   
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/ShowCFGEditorAction.java	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,60 @@
+package at.ssw.visualizer.cfg.action;
+
+import at.ssw.visualizer.cfg.editor.CfgEditorSupport;
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import at.ssw.visualizer.cfg.icons.Icons;
+import at.ssw.visualizer.model.cfg.ControlFlowGraph;
+import org.openide.nodes.Node;
+import org.openide.util.HelpCtx;
+import org.openide.util.actions.CookieAction;
+import org.openide.windows.TopComponent;
+
+/**
+ * Shows the CFG visualizer for the currently selected compilation.
+ *
+ * @author Bernhard Stiftner
+ * @author Christian Wimmer
+ */
+public final class ShowCFGEditorAction extends CookieAction {
+         
+    protected void performAction(Node[] activatedNodes) {       
+        ControlFlowGraph cfg = activatedNodes[0].getLookup().lookup(ControlFlowGraph.class);
+        CfgEditorSupport editor = new CfgEditorSupport(cfg);
+        editor.open();
+    }
+
+    @Override
+    protected boolean enable(Node[] activatedNodes) {
+        if (!super.enable(activatedNodes)) {
+            return false;
+        }
+        ControlFlowGraph cfg = activatedNodes[0].getLookup().lookup(ControlFlowGraph.class);
+        return cfg.getBasicBlocks().size() > 0;
+    }
+
+    public String getName() {
+        return "Open Control Flow Graph";
+    }
+
+    @Override
+    protected String iconResource() {
+        return Icons.CFG;
+    }
+
+    protected int mode() {
+        return CookieAction.MODE_EXACTLY_ONE;
+    }
+
+    protected Class[] cookieClasses() {
+        return new Class[]{ControlFlowGraph.class};
+    }
+
+    public HelpCtx getHelpCtx() {
+        return HelpCtx.DEFAULT_HELP;
+    }
+
+    @Override
+    protected boolean asynchronous() {
+        return false;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/ShowEdgesAction.java	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,52 @@
+package at.ssw.visualizer.cfg.action;
+
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import at.ssw.visualizer.cfg.graph.CfgScene;
+import at.ssw.visualizer.cfg.graph.EdgeWidget;
+import at.ssw.visualizer.cfg.model.CfgEdge;
+import at.ssw.visualizer.cfg.model.CfgNode;
+import org.openide.util.HelpCtx;
+
+/**
+ * Shows all edges connected to the selected node.
+ *
+ * @author Bernhard Stiftner
+ * @author Rumpfhuber Stefan
+ */
+public class ShowEdgesAction extends AbstractCfgEditorAction {
+
+    public void performAction() {
+        CfgEditorTopComponent tc = getEditor();
+        if (tc != null) {
+            tc.getCfgScene().setSelectedEdgesVisibility(true);
+        }
+    }
+
+    public String getName() {
+        return "Show edges";
+    }
+
+
+    @Override
+    protected String iconResource() {
+        return "at/ssw/visualizer/cfg/icons/showedges.gif";
+    }
+
+    public HelpCtx getHelpCtx() {
+        return HelpCtx.DEFAULT_HELP;
+    }
+
+    @Override  
+    public void selectionChanged(CfgScene scene) {      
+        for (CfgNode n : scene.getSelectedNodes()) {  
+            for (CfgEdge e : scene.findNodeEdges(n, true, true) ){
+                EdgeWidget ew = (EdgeWidget) scene.findWidget(e);
+                if(!ew.isVisible()) {
+                    setEnabled(true);
+                    return;
+                }
+            }
+        }
+        setEnabled(false);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/SwitchLoopClustersAction.java	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,66 @@
+package at.ssw.visualizer.cfg.action;
+
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import at.ssw.visualizer.cfg.graph.CfgScene;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import javax.swing.JComponent;
+import javax.swing.JToggleButton;
+import org.openide.util.HelpCtx;
+import org.openide.util.actions.Presenter;
+
+public class SwitchLoopClustersAction extends AbstractCfgEditorAction implements Presenter.Toolbar {
+
+    @Override
+    public void performAction() {
+        CfgEditorTopComponent tc = getEditor();
+        if (tc != null) {  
+            CfgScene scene = tc.getCfgScene();
+            boolean visible = scene.isLoopClusterVisible();
+            scene.setLoopWidgets(!visible);
+        }
+    }
+
+    @Override
+    public String getName() {
+        return "Enable/Disable Loop Clusters";
+    }
+
+    @Override
+    protected String iconResource() {
+        return "at/ssw/visualizer/cfg/icons/cluster.gif";
+    }
+
+    public HelpCtx getHelpCtx() {
+        return HelpCtx.DEFAULT_HELP;
+    }
+    
+    
+    @Override
+    public JComponent getToolbarPresenter() {
+        return new ToolbarPresenter();       
+    }
+    
+    class ToolbarPresenter extends JToggleButton {     
+        private static final String TOOLTIP_ENABLE = "Enable LoopClusters";
+        private static final String TOOLTIP_DISABLE = "Disable LoopClusters";
+        
+        public ToolbarPresenter() {      
+            super(SwitchLoopClustersAction.this);
+            setText(null);    
+            this.setToolTipText(TOOLTIP_DISABLE);
+            this.setSelected(true);
+            
+            this.addItemListener(new ItemListener(){
+                public void itemStateChanged(ItemEvent e) {
+                    if(isSelected()){
+                        setToolTipText(TOOLTIP_DISABLE);
+                    } else {
+                        setToolTipText(TOOLTIP_ENABLE);
+                    }
+                }
+            });      
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/UseBezierRouterAction.java	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,29 @@
+package at.ssw.visualizer.cfg.action;
+
+import at.ssw.visualizer.cfg.CfgEditorContext;
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import org.openide.util.HelpCtx;
+
+
+public class UseBezierRouterAction extends AbstractRouterAction {
+    
+    @Override
+    protected void setLinkRouter(CfgEditorTopComponent editor) {      
+        editor.getCfgScene().setRouter(CfgEditorContext.ROUTING_BEZIER);
+    }
+    
+    @Override
+    public String getName() {
+        return "Use Bezier Router";
+    }
+      
+    @Override
+    protected String iconResource() {
+        return "at/ssw/visualizer/cfg/icons/bezierrouter.gif";
+    }
+
+    public HelpCtx getHelpCtx() {
+        return HelpCtx.DEFAULT_HELP;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/UseDirectLineRouterAction.java	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,28 @@
+package at.ssw.visualizer.cfg.action;
+
+import at.ssw.visualizer.cfg.CfgEditorContext;
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import org.openide.util.HelpCtx;
+
+
+public class UseDirectLineRouterAction extends AbstractRouterAction {
+ 
+    @Override
+    protected void setLinkRouter(CfgEditorTopComponent editor) {
+        editor.getCfgScene().setRouter(CfgEditorContext.ROUTING_DIRECTLINES);
+    }
+    
+    @Override
+    public String getName() {
+        return "User Direct Router";
+    }
+    
+    @Override
+    protected String iconResource() {
+        return "at/ssw/visualizer/cfg/icons/fanrouter.gif";
+    }
+
+    public HelpCtx getHelpCtx() {
+        return HelpCtx.DEFAULT_HELP;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/ZoominAction.java	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,33 @@
+package at.ssw.visualizer.cfg.action;
+
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import at.ssw.visualizer.cfg.graph.CfgScene;
+import org.openide.util.HelpCtx;
+
+
+public class ZoominAction extends AbstractCfgEditorAction {
+       
+    @Override
+    public void performAction() {
+        CfgEditorTopComponent tc = getEditor();
+        if (tc != null) {            
+            CfgScene scene = tc.getCfgScene();    
+            scene.animateZoom(1.1);
+        }
+    }
+    
+    @Override
+    protected String iconResource() {
+        return "at/ssw/visualizer/cfg/icons/zoomin.gif";
+    }
+
+    @Override
+    public String getName() {
+        return "Zoomin";
+    }
+
+    @Override
+    public HelpCtx getHelpCtx() {
+        return HelpCtx.DEFAULT_HELP;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/action/ZoomoutAction.java	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,33 @@
+package at.ssw.visualizer.cfg.action;
+
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import at.ssw.visualizer.cfg.graph.CfgScene;
+import org.openide.util.HelpCtx;
+
+public class ZoomoutAction extends AbstractCfgEditorAction {
+
+    @Override
+    public void performAction() {
+        CfgEditorTopComponent tc = getEditor();
+        if (tc != null) {   
+            CfgScene scene = tc.getCfgScene();     
+            scene.animateZoom(0.9);
+        }
+    }
+    
+    @Override
+    protected String iconResource() {
+        return "at/ssw/visualizer/cfg/icons/zoomout.gif";
+    }
+       
+    @Override
+    public String getName() {
+        return "Zoomout";
+    }
+
+    @Override
+    public HelpCtx getHelpCtx() {
+        return HelpCtx.DEFAULT_HELP;
+    }
+    
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/editor/.svn/all-wcprops	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,17 @@
+K 25
+svn:wc:ra_dav:version-url
+V 110
+/svn/c1visualizer~svn/!svn/ver/184/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/editor
+END
+CfgEditorSupport.java
+K 25
+svn:wc:ra_dav:version-url
+V 132
+/svn/c1visualizer~svn/!svn/ver/174/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/editor/CfgEditorSupport.java
+END
+CfgEditorTopComponent.java
+K 25
+svn:wc:ra_dav:version-url
+V 137
+/svn/c1visualizer~svn/!svn/ver/184/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/editor/CfgEditorTopComponent.java
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/editor/.svn/entries	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,96 @@
+10
+
+dir
+206
+https://svn.java.net/svn/c1visualizer~svn/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/editor
+https://svn.java.net/svn/c1visualizer~svn
+
+
+
+2010-06-09T00:03:59.100332Z
+184
+ChristianW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+f598ca33-f47e-61e0-e023-f120d32a8e8d
+
+CfgEditorSupport.java
+file
+
+
+
+
+2012-01-28T15:08:36.568098Z
+456c7bd648c4eb8469736f062aa84589
+2009-06-28T16:09:31.412666Z
+174
+ChristianW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2372
+
+CfgEditorTopComponent.java
+file
+
+
+
+
+2012-01-28T15:08:36.570098Z
+df7b7480f08c83b8c322972f004f04dd
+2010-06-09T00:03:59.100332Z
+184
+ChristianW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+10693
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/editor/.svn/text-base/CfgEditorSupport.java.netbeans-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,77 @@
+package at.ssw.visualizer.cfg.editor;
+
+import at.ssw.visualizer.model.cfg.ControlFlowGraph;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.beans.VetoableChangeListener;
+import java.beans.VetoableChangeSupport;
+import java.io.IOException;
+import org.openide.cookies.OpenCookie;
+import org.openide.windows.CloneableOpenSupport;
+import org.openide.windows.CloneableTopComponent;
+
+
+public class CfgEditorSupport extends CloneableOpenSupport implements OpenCookie  {
+    private ControlFlowGraph cfg;
+
+    public CfgEditorSupport(ControlFlowGraph cfg) {
+        super(new Env());
+        ((Env) env).editorSupport = this;
+        this.cfg = cfg;
+    }
+
+    protected CloneableTopComponent createCloneableTopComponent() {    
+         return new CfgEditorTopComponent(cfg);       
+    }
+
+    public String messageOpened() {
+        return "Opened " + cfg.getCompilation().getMethod() + " - " + cfg.getName();
+    }
+
+    public String messageOpening() {
+        return "Opening " + cfg.getCompilation().getMethod() + " - " + cfg.getName();
+    }
+    
+ 
+    public static class Env implements CloneableOpenSupport.Env {
+        private PropertyChangeSupport prop = new PropertyChangeSupport(this);
+        private VetoableChangeSupport veto = new VetoableChangeSupport(this);
+        private CfgEditorSupport editorSupport;
+
+        public boolean isValid() {
+            return true;
+        }
+
+        public boolean isModified() {
+            return false;
+        }
+
+        public void markModified() throws IOException {
+            throw new IOException("Editor is readonly");
+        }
+
+        public void unmarkModified() {
+            // Nothing to do.
+        }
+
+        public CloneableOpenSupport findCloneableOpenSupport() {
+            return editorSupport;
+        }
+
+        public void addPropertyChangeListener(PropertyChangeListener l) {
+            prop.addPropertyChangeListener(l);
+        }
+
+        public void removePropertyChangeListener(PropertyChangeListener l) {
+            prop.removePropertyChangeListener(l);
+        }
+
+        public void addVetoableChangeListener(VetoableChangeListener l) {
+            veto.addVetoableChangeListener(l);
+        }
+
+        public void removeVetoableChangeListener(VetoableChangeListener l) {
+            veto.removeVetoableChangeListener(l);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/editor/.svn/text-base/CfgEditorSupport.java.svn-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,77 @@
+package at.ssw.visualizer.cfg.editor;
+
+import at.ssw.visualizer.model.cfg.ControlFlowGraph;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.beans.VetoableChangeListener;
+import java.beans.VetoableChangeSupport;
+import java.io.IOException;
+import org.openide.cookies.OpenCookie;
+import org.openide.windows.CloneableOpenSupport;
+import org.openide.windows.CloneableTopComponent;
+
+
+public class CfgEditorSupport extends CloneableOpenSupport implements OpenCookie  {
+    private ControlFlowGraph cfg;
+
+    public CfgEditorSupport(ControlFlowGraph cfg) {
+        super(new Env());
+        ((Env) env).editorSupport = this;
+        this.cfg = cfg;
+    }
+
+    protected CloneableTopComponent createCloneableTopComponent() {    
+         return new CfgEditorTopComponent(cfg);       
+    }
+
+    public String messageOpened() {
+        return "Opened " + cfg.getCompilation().getMethod() + " - " + cfg.getName();
+    }
+
+    public String messageOpening() {
+        return "Opening " + cfg.getCompilation().getMethod() + " - " + cfg.getName();
+    }
+    
+ 
+    public static class Env implements CloneableOpenSupport.Env {
+        private PropertyChangeSupport prop = new PropertyChangeSupport(this);
+        private VetoableChangeSupport veto = new VetoableChangeSupport(this);
+        private CfgEditorSupport editorSupport;
+
+        public boolean isValid() {
+            return true;
+        }
+
+        public boolean isModified() {
+            return false;
+        }
+
+        public void markModified() throws IOException {
+            throw new IOException("Editor is readonly");
+        }
+
+        public void unmarkModified() {
+            // Nothing to do.
+        }
+
+        public CloneableOpenSupport findCloneableOpenSupport() {
+            return editorSupport;
+        }
+
+        public void addPropertyChangeListener(PropertyChangeListener l) {
+            prop.addPropertyChangeListener(l);
+        }
+
+        public void removePropertyChangeListener(PropertyChangeListener l) {
+            prop.removePropertyChangeListener(l);
+        }
+
+        public void addVetoableChangeListener(VetoableChangeListener l) {
+            veto.addVetoableChangeListener(l);
+        }
+
+        public void removeVetoableChangeListener(VetoableChangeListener l) {
+            veto.removeVetoableChangeListener(l);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/editor/.svn/text-base/CfgEditorTopComponent.java.netbeans-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,260 @@
+package at.ssw.visualizer.cfg.editor;
+
+import at.ssw.visualizer.cfg.action.ShowAllAction;
+import at.ssw.visualizer.cfg.action.ColorAction;
+import at.ssw.visualizer.cfg.action.ExportAction;
+import at.ssw.visualizer.cfg.action.HideEdgesAction;
+import at.ssw.visualizer.cfg.action.HierarchicalCompoundLayoutAction;
+import at.ssw.visualizer.cfg.action.HierarchicalNodeLayoutAction;
+import at.ssw.visualizer.cfg.action.ShowEdgesAction;
+import at.ssw.visualizer.cfg.action.SwitchLoopClustersAction;
+import at.ssw.visualizer.cfg.action.UseBezierRouterAction;
+import at.ssw.visualizer.cfg.action.UseDirectLineRouterAction;
+import at.ssw.visualizer.cfg.action.ZoominAction;
+import at.ssw.visualizer.cfg.action.ZoomoutAction;
+import at.ssw.visualizer.cfg.graph.CfgEventListener;
+import at.ssw.visualizer.cfg.graph.CfgScene;
+import at.ssw.visualizer.cfg.graph.EdgeWidget;
+import at.ssw.visualizer.cfg.graph.NodeWidget;
+import at.ssw.visualizer.cfg.model.CfgEdge;
+import at.ssw.visualizer.cfg.model.CfgNode;
+import at.ssw.visualizer.cfg.preferences.CfgPreferences;
+import at.ssw.visualizer.cfg.preferences.FlagsSetting;
+import javax.swing.ScrollPaneConstants;
+import at.ssw.visualizer.core.selection.Selection;
+import at.ssw.visualizer.core.selection.SelectionManager;
+import at.ssw.visualizer.core.selection.SelectionProvider;
+import at.ssw.visualizer.model.cfg.ControlFlowGraph;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.JComponent;
+import javax.swing.JScrollPane;
+import javax.swing.JToggleButton;
+import javax.swing.UIManager;
+import javax.swing.border.Border;
+import org.netbeans.api.visual.widget.Widget;
+import org.openide.awt.Toolbar;
+import org.openide.util.ImageUtilities;
+import org.openide.windows.CloneableTopComponent;
+import org.openide.windows.TopComponent;
+import org.openide.util.actions.SystemAction;
+
+public class CfgEditorTopComponent extends CloneableTopComponent implements PropertyChangeListener, SelectionProvider {
+
+    private CfgScene scene;
+    private JScrollPane jScrollPane;
+    private ControlFlowGraph cfg;
+    private JComponent myView;
+    private Selection selection;
+
+    public CfgEditorTopComponent(ControlFlowGraph cfg) {
+        this.cfg = cfg;
+
+        setIcon(ImageUtilities.loadImage("at/ssw/visualizer/cfg/icons/cfg.gif"));
+        setName(cfg.getParent().getShortName());
+        setToolTipText(cfg.getCompilation().getMethod() + " - " + cfg.getName());
+
+        //panel setup
+        this.jScrollPane = new JScrollPane();
+        this.jScrollPane.setOpaque(true);
+        this.jScrollPane.setBorder(BorderFactory.createEmptyBorder());
+        this.jScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
+        this.scene = new CfgScene(this);
+        this.myView = scene.createView();
+        this.jScrollPane.setViewportView(myView);
+        this.setLayout(new BorderLayout());
+        this.add(createToolbar(), BorderLayout.NORTH);
+        this.add(jScrollPane, BorderLayout.CENTER);
+        jScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
+        jScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
+        jScrollPane.getVerticalScrollBar().setEnabled(true);
+        jScrollPane.getHorizontalScrollBar().setEnabled(true);
+
+        //setup enviroment,register listeners
+        selection = new Selection();
+        selection.put(cfg);
+        selection.put(scene);
+        selection.addChangeListener(scene);
+
+        scene.validate();
+        scene.applyLayout();
+    }
+
+    public Selection getSelection() {
+        return selection;
+    }
+
+    public ControlFlowGraph getCfg() {
+        return cfg;
+    }
+
+    public JScrollPane getJScrollPanel() {
+        return jScrollPane;
+    }
+
+    public CfgScene getCfgScene() {
+        return scene;
+    }
+
+    @Override
+    public int getPersistenceType() {
+        return TopComponent.PERSISTENCE_NEVER;
+    }
+
+    @Override
+    protected void componentOpened() {
+        super.componentOpened();
+        CfgPreferences.getInstance().addPropertyChangeListener(this);
+    }
+
+    @Override
+    protected void componentActivated() {
+        super.componentActivated();
+        SelectionManager.getDefault().setSelection(selection);
+        this.getCfgScene().updateGlobalSelection();
+        this.getCfgScene().fireSelectionChanged();
+    }
+
+    @Override
+    protected void componentClosed() {
+        super.componentClosed();
+        SelectionManager.getDefault().removeSelection(selection);
+        CfgPreferences.getInstance().removePropertyChangeListener(this);
+    }
+
+    @Override
+    protected CloneableTopComponent createClonedObject() {
+        CfgEditorTopComponent component = new CfgEditorTopComponent(cfg);
+        component.setActivatedNodes(getActivatedNodes());
+        return component;
+    }
+
+    public void propertyChange(PropertyChangeEvent evt) {
+        if (this.scene != null) {
+
+            String propName = evt.getPropertyName();
+            CfgPreferences prefs = CfgPreferences.getInstance();
+            if (propName.equals(CfgPreferences.PROP_BACKGROUND_COLOR)) {
+                scene.setBackground(prefs.getBackgroundColor());
+                scene.revalidate();
+            } else if (propName.equals(CfgPreferences.PROP_NODE_COLOR)) {
+                for (NodeWidget nw : scene.getNodeWidgets()) {
+                    //only change the node color if its not a custom color
+                    if (!nw.isNodeColorCustomized()) {
+                        nw.setNodeColor(prefs.getNodeColor(), false);
+                    }
+                }
+            } else if (propName.equals(CfgPreferences.PROP_EDGE_COLOR)) {
+                for (CfgEdge e : scene.getEdges()) {
+                    if (!e.isBackEdge() && !e.isXhandler()) {
+                        EdgeWidget w = (EdgeWidget) scene.findWidget(e);
+                        w.setLineColor(prefs.getEdgeColor());
+                    }
+                }
+            } else if (propName.equals(CfgPreferences.PROP_BACK_EDGE_COLOR)) {
+                for (CfgEdge e : scene.getEdges()) {
+                    if (e.isBackEdge()) {
+                        EdgeWidget w = (EdgeWidget) scene.findWidget(e);
+                        w.setLineColor(prefs.getBackedgeColor());
+                    }
+                }
+            } else if (propName.equals(CfgPreferences.PROP_EXCEPTION_EDGE_COLOR)) {
+                for (CfgEdge e : scene.getEdges()) {
+                    if (e.isXhandler()) {
+                        EdgeWidget w = (EdgeWidget) scene.findWidget(e);
+                        w.setLineColor(prefs.getExceptionEdgeColor());
+                    }
+                }
+            } else if (propName.equals(CfgPreferences.PROP_BORDER_COLOR)) {
+                for (CfgNode n : scene.getNodes()) {
+                    NodeWidget nw = (NodeWidget) scene.findWidget(n);
+                    nw.setBorderColor(prefs.getBorderColor());
+                }
+            } else if (propName.equals(CfgPreferences.PROP_TEXT_FONT)) {
+                for (CfgNode n : scene.getNodes()) {
+                    NodeWidget nw = (NodeWidget) scene.findWidget(n);
+                    nw.adjustFont(prefs.getTextFont());
+                }
+            } else if (propName.equals(CfgPreferences.PROP_TEXT_COLOR)) {
+                for (CfgNode n : scene.getNodes()) {
+                    NodeWidget nw = (NodeWidget) scene.findWidget(n);
+                    nw.setForeground(prefs.getTextColor());
+                }
+            } else if (propName.equals(CfgPreferences.PROP_FLAGS)) {
+                FlagsSetting fs = CfgPreferences.getInstance().getFlagsSetting();
+                for (CfgNode n : scene.getNodes()) {
+                    NodeWidget nw = (NodeWidget) scene.findWidget(n);
+                    Color nodeColor = fs.getColor(n.getBasicBlock().getFlags());
+                    if (nodeColor != null) {
+                        nw.setNodeColor(nodeColor, true);
+                    } else {
+                        nw.setNodeColor(CfgPreferences.getInstance().getNodeColor(), false);
+                    }
+                }
+            } else if (propName.equals(CfgPreferences.PROP_SELECTION_COLOR_BG) || propName.equals(CfgPreferences.PROP_SELECTION_COLOR_FG)) {
+                for (CfgNode n : scene.getNodes()) {
+                    Widget w = scene.findWidget(n);
+                    w.revalidate();
+                }
+            }
+            scene.validate();
+        }
+
+    }
+
+    private Toolbar createToolbar() {
+        Toolbar tb = new Toolbar("CfgToolbar");
+
+        tb.setBorder((Border) UIManager.get("Nb.Editor.Toolbar.border"));
+
+        //zoomin/zoomout buttons
+        tb.add(SystemAction.get(ZoominAction.class).getToolbarPresenter());
+        tb.add(SystemAction.get(ZoomoutAction.class).getToolbarPresenter());
+        tb.addSeparator();
+
+        //router buttons
+        ButtonGroup routerButtons = new ButtonGroup();
+        UseDirectLineRouterAction direct = SystemAction.get(UseDirectLineRouterAction.class);
+        UseBezierRouterAction bezier = SystemAction.get(UseBezierRouterAction.class);
+        JToggleButton button = (JToggleButton) direct.getToolbarPresenter();
+        button.getModel().setGroup(routerButtons);
+        button.setSelected(true);
+        tb.add(button);
+        button = (JToggleButton) bezier.getToolbarPresenter();
+        button.getModel().setGroup(routerButtons);
+        tb.add(button);
+        tb.addSeparator();
+
+        //layout buttons
+        tb.add(SystemAction.get(HierarchicalNodeLayoutAction.class).getToolbarPresenter());
+        tb.add(SystemAction.get(HierarchicalCompoundLayoutAction.class).getToolbarPresenter());
+
+        tb.addSeparator();
+        tb.add(SystemAction.get(ShowAllAction.class).getToolbarPresenter());
+        tb.addSeparator();
+
+        //cluster button
+        tb.add(SystemAction.get(SwitchLoopClustersAction.class).getToolbarPresenter());
+        tb.addSeparator();
+
+        //show/hide edge button
+        tb.add(SystemAction.get(ShowEdgesAction.class).getToolbarPresenter());
+        tb.add(SystemAction.get(HideEdgesAction.class).getToolbarPresenter());
+        tb.addSeparator();
+
+        //color button       
+        JComponent colorButton = SystemAction.get(ColorAction.class).getToolbarPresenter();
+        getCfgScene().addCfgEventListener((CfgEventListener) colorButton);
+        tb.add(colorButton);
+
+        //export button           
+        tb.add(SystemAction.get(ExportAction.class).getToolbarPresenter());
+        tb.doLayout();
+
+        return tb;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/editor/.svn/text-base/CfgEditorTopComponent.java.svn-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,260 @@
+package at.ssw.visualizer.cfg.editor;
+
+import at.ssw.visualizer.cfg.action.ShowAllAction;
+import at.ssw.visualizer.cfg.action.ColorAction;
+import at.ssw.visualizer.cfg.action.ExportAction;
+import at.ssw.visualizer.cfg.action.HideEdgesAction;
+import at.ssw.visualizer.cfg.action.HierarchicalCompoundLayoutAction;
+import at.ssw.visualizer.cfg.action.HierarchicalNodeLayoutAction;
+import at.ssw.visualizer.cfg.action.ShowEdgesAction;
+import at.ssw.visualizer.cfg.action.SwitchLoopClustersAction;
+import at.ssw.visualizer.cfg.action.UseBezierRouterAction;
+import at.ssw.visualizer.cfg.action.UseDirectLineRouterAction;
+import at.ssw.visualizer.cfg.action.ZoominAction;
+import at.ssw.visualizer.cfg.action.ZoomoutAction;
+import at.ssw.visualizer.cfg.graph.CfgEventListener;
+import at.ssw.visualizer.cfg.graph.CfgScene;
+import at.ssw.visualizer.cfg.graph.EdgeWidget;
+import at.ssw.visualizer.cfg.graph.NodeWidget;
+import at.ssw.visualizer.cfg.model.CfgEdge;
+import at.ssw.visualizer.cfg.model.CfgNode;
+import at.ssw.visualizer.cfg.preferences.CfgPreferences;
+import at.ssw.visualizer.cfg.preferences.FlagsSetting;
+import javax.swing.ScrollPaneConstants;
+import at.ssw.visualizer.core.selection.Selection;
+import at.ssw.visualizer.core.selection.SelectionManager;
+import at.ssw.visualizer.core.selection.SelectionProvider;
+import at.ssw.visualizer.model.cfg.ControlFlowGraph;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.JComponent;
+import javax.swing.JScrollPane;
+import javax.swing.JToggleButton;
+import javax.swing.UIManager;
+import javax.swing.border.Border;
+import org.netbeans.api.visual.widget.Widget;
+import org.openide.awt.Toolbar;
+import org.openide.util.ImageUtilities;
+import org.openide.windows.CloneableTopComponent;
+import org.openide.windows.TopComponent;
+import org.openide.util.actions.SystemAction;
+
+public class CfgEditorTopComponent extends CloneableTopComponent implements PropertyChangeListener, SelectionProvider {
+
+    private CfgScene scene;
+    private JScrollPane jScrollPane;
+    private ControlFlowGraph cfg;
+    private JComponent myView;
+    private Selection selection;
+
+    public CfgEditorTopComponent(ControlFlowGraph cfg) {
+        this.cfg = cfg;
+
+        setIcon(ImageUtilities.loadImage("at/ssw/visualizer/cfg/icons/cfg.gif"));
+        setName(cfg.getParent().getShortName());
+        setToolTipText(cfg.getCompilation().getMethod() + " - " + cfg.getName());
+
+        //panel setup
+        this.jScrollPane = new JScrollPane();
+        this.jScrollPane.setOpaque(true);
+        this.jScrollPane.setBorder(BorderFactory.createEmptyBorder());
+        this.jScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
+        this.scene = new CfgScene(this);
+        this.myView = scene.createView();
+        this.jScrollPane.setViewportView(myView);
+        this.setLayout(new BorderLayout());
+        this.add(createToolbar(), BorderLayout.NORTH);
+        this.add(jScrollPane, BorderLayout.CENTER);
+        jScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
+        jScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
+        jScrollPane.getVerticalScrollBar().setEnabled(true);
+        jScrollPane.getHorizontalScrollBar().setEnabled(true);
+
+        //setup enviroment,register listeners
+        selection = new Selection();
+        selection.put(cfg);
+        selection.put(scene);
+        selection.addChangeListener(scene);
+
+        scene.validate();
+        scene.applyLayout();
+    }
+
+    public Selection getSelection() {
+        return selection;
+    }
+
+    public ControlFlowGraph getCfg() {
+        return cfg;
+    }
+
+    public JScrollPane getJScrollPanel() {
+        return jScrollPane;
+    }
+
+    public CfgScene getCfgScene() {
+        return scene;
+    }
+
+    @Override
+    public int getPersistenceType() {
+        return TopComponent.PERSISTENCE_NEVER;
+    }
+
+    @Override
+    protected void componentOpened() {
+        super.componentOpened();
+        CfgPreferences.getInstance().addPropertyChangeListener(this);
+    }
+
+    @Override
+    protected void componentActivated() {
+        super.componentActivated();
+        SelectionManager.getDefault().setSelection(selection);
+        this.getCfgScene().updateGlobalSelection();
+        this.getCfgScene().fireSelectionChanged();
+    }
+
+    @Override
+    protected void componentClosed() {
+        super.componentClosed();
+        SelectionManager.getDefault().removeSelection(selection);
+        CfgPreferences.getInstance().removePropertyChangeListener(this);
+    }
+
+    @Override
+    protected CloneableTopComponent createClonedObject() {
+        CfgEditorTopComponent component = new CfgEditorTopComponent(cfg);
+        component.setActivatedNodes(getActivatedNodes());
+        return component;
+    }
+
+    public void propertyChange(PropertyChangeEvent evt) {
+        if (this.scene != null) {
+
+            String propName = evt.getPropertyName();
+            CfgPreferences prefs = CfgPreferences.getInstance();
+            if (propName.equals(CfgPreferences.PROP_BACKGROUND_COLOR)) {
+                scene.setBackground(prefs.getBackgroundColor());
+                scene.revalidate();
+            } else if (propName.equals(CfgPreferences.PROP_NODE_COLOR)) {
+                for (NodeWidget nw : scene.getNodeWidgets()) {
+                    //only change the node color if its not a custom color
+                    if (!nw.isNodeColorCustomized()) {
+                        nw.setNodeColor(prefs.getNodeColor(), false);
+                    }
+                }
+            } else if (propName.equals(CfgPreferences.PROP_EDGE_COLOR)) {
+                for (CfgEdge e : scene.getEdges()) {
+                    if (!e.isBackEdge() && !e.isXhandler()) {
+                        EdgeWidget w = (EdgeWidget) scene.findWidget(e);
+                        w.setLineColor(prefs.getEdgeColor());
+                    }
+                }
+            } else if (propName.equals(CfgPreferences.PROP_BACK_EDGE_COLOR)) {
+                for (CfgEdge e : scene.getEdges()) {
+                    if (e.isBackEdge()) {
+                        EdgeWidget w = (EdgeWidget) scene.findWidget(e);
+                        w.setLineColor(prefs.getBackedgeColor());
+                    }
+                }
+            } else if (propName.equals(CfgPreferences.PROP_EXCEPTION_EDGE_COLOR)) {
+                for (CfgEdge e : scene.getEdges()) {
+                    if (e.isXhandler()) {
+                        EdgeWidget w = (EdgeWidget) scene.findWidget(e);
+                        w.setLineColor(prefs.getExceptionEdgeColor());
+                    }
+                }
+            } else if (propName.equals(CfgPreferences.PROP_BORDER_COLOR)) {
+                for (CfgNode n : scene.getNodes()) {
+                    NodeWidget nw = (NodeWidget) scene.findWidget(n);
+                    nw.setBorderColor(prefs.getBorderColor());
+                }
+            } else if (propName.equals(CfgPreferences.PROP_TEXT_FONT)) {
+                for (CfgNode n : scene.getNodes()) {
+                    NodeWidget nw = (NodeWidget) scene.findWidget(n);
+                    nw.adjustFont(prefs.getTextFont());
+                }
+            } else if (propName.equals(CfgPreferences.PROP_TEXT_COLOR)) {
+                for (CfgNode n : scene.getNodes()) {
+                    NodeWidget nw = (NodeWidget) scene.findWidget(n);
+                    nw.setForeground(prefs.getTextColor());
+                }
+            } else if (propName.equals(CfgPreferences.PROP_FLAGS)) {
+                FlagsSetting fs = CfgPreferences.getInstance().getFlagsSetting();
+                for (CfgNode n : scene.getNodes()) {
+                    NodeWidget nw = (NodeWidget) scene.findWidget(n);
+                    Color nodeColor = fs.getColor(n.getBasicBlock().getFlags());
+                    if (nodeColor != null) {
+                        nw.setNodeColor(nodeColor, true);
+                    } else {
+                        nw.setNodeColor(CfgPreferences.getInstance().getNodeColor(), false);
+                    }
+                }
+            } else if (propName.equals(CfgPreferences.PROP_SELECTION_COLOR_BG) || propName.equals(CfgPreferences.PROP_SELECTION_COLOR_FG)) {
+                for (CfgNode n : scene.getNodes()) {
+                    Widget w = scene.findWidget(n);
+                    w.revalidate();
+                }
+            }
+            scene.validate();
+        }
+
+    }
+
+    private Toolbar createToolbar() {
+        Toolbar tb = new Toolbar("CfgToolbar");
+
+        tb.setBorder((Border) UIManager.get("Nb.Editor.Toolbar.border"));
+
+        //zoomin/zoomout buttons
+        tb.add(SystemAction.get(ZoominAction.class).getToolbarPresenter());
+        tb.add(SystemAction.get(ZoomoutAction.class).getToolbarPresenter());
+        tb.addSeparator();
+
+        //router buttons
+        ButtonGroup routerButtons = new ButtonGroup();
+        UseDirectLineRouterAction direct = SystemAction.get(UseDirectLineRouterAction.class);
+        UseBezierRouterAction bezier = SystemAction.get(UseBezierRouterAction.class);
+        JToggleButton button = (JToggleButton) direct.getToolbarPresenter();
+        button.getModel().setGroup(routerButtons);
+        button.setSelected(true);
+        tb.add(button);
+        button = (JToggleButton) bezier.getToolbarPresenter();
+        button.getModel().setGroup(routerButtons);
+        tb.add(button);
+        tb.addSeparator();
+
+        //layout buttons
+        tb.add(SystemAction.get(HierarchicalNodeLayoutAction.class).getToolbarPresenter());
+        tb.add(SystemAction.get(HierarchicalCompoundLayoutAction.class).getToolbarPresenter());
+
+        tb.addSeparator();
+        tb.add(SystemAction.get(ShowAllAction.class).getToolbarPresenter());
+        tb.addSeparator();
+
+        //cluster button
+        tb.add(SystemAction.get(SwitchLoopClustersAction.class).getToolbarPresenter());
+        tb.addSeparator();
+
+        //show/hide edge button
+        tb.add(SystemAction.get(ShowEdgesAction.class).getToolbarPresenter());
+        tb.add(SystemAction.get(HideEdgesAction.class).getToolbarPresenter());
+        tb.addSeparator();
+
+        //color button       
+        JComponent colorButton = SystemAction.get(ColorAction.class).getToolbarPresenter();
+        getCfgScene().addCfgEventListener((CfgEventListener) colorButton);
+        tb.add(colorButton);
+
+        //export button           
+        tb.add(SystemAction.get(ExportAction.class).getToolbarPresenter());
+        tb.doLayout();
+
+        return tb;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/editor/CfgEditorSupport.java	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,77 @@
+package at.ssw.visualizer.cfg.editor;
+
+import at.ssw.visualizer.model.cfg.ControlFlowGraph;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.beans.VetoableChangeListener;
+import java.beans.VetoableChangeSupport;
+import java.io.IOException;
+import org.openide.cookies.OpenCookie;
+import org.openide.windows.CloneableOpenSupport;
+import org.openide.windows.CloneableTopComponent;
+
+
+public class CfgEditorSupport extends CloneableOpenSupport implements OpenCookie  {
+    private ControlFlowGraph cfg;
+
+    public CfgEditorSupport(ControlFlowGraph cfg) {
+        super(new Env());
+        ((Env) env).editorSupport = this;
+        this.cfg = cfg;
+    }
+
+    protected CloneableTopComponent createCloneableTopComponent() {    
+         return new CfgEditorTopComponent(cfg);       
+    }
+
+    public String messageOpened() {
+        return "Opened " + cfg.getName();
+    }
+
+    public String messageOpening() {
+        return "Opening " + cfg.getName();
+    }
+    
+ 
+    public static class Env implements CloneableOpenSupport.Env {
+        private PropertyChangeSupport prop = new PropertyChangeSupport(this);
+        private VetoableChangeSupport veto = new VetoableChangeSupport(this);
+        private CfgEditorSupport editorSupport;
+
+        public boolean isValid() {
+            return true;
+        }
+
+        public boolean isModified() {
+            return false;
+        }
+
+        public void markModified() throws IOException {
+            throw new IOException("Editor is readonly");
+        }
+
+        public void unmarkModified() {
+            // Nothing to do.
+        }
+
+        public CloneableOpenSupport findCloneableOpenSupport() {
+            return editorSupport;
+        }
+
+        public void addPropertyChangeListener(PropertyChangeListener l) {
+            prop.addPropertyChangeListener(l);
+        }
+
+        public void removePropertyChangeListener(PropertyChangeListener l) {
+            prop.removePropertyChangeListener(l);
+        }
+
+        public void addVetoableChangeListener(VetoableChangeListener l) {
+            veto.addVetoableChangeListener(l);
+        }
+
+        public void removeVetoableChangeListener(VetoableChangeListener l) {
+            veto.removeVetoableChangeListener(l);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/editor/CfgEditorTopComponent.java	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,254 @@
+package at.ssw.visualizer.cfg.editor;
+
+import at.ssw.visualizer.cfg.action.ShowAllAction;
+import at.ssw.visualizer.cfg.action.ColorAction;
+import at.ssw.visualizer.cfg.action.ExportAction;
+import at.ssw.visualizer.cfg.action.HideEdgesAction;
+import at.ssw.visualizer.cfg.action.HierarchicalCompoundLayoutAction;
+import at.ssw.visualizer.cfg.action.HierarchicalNodeLayoutAction;
+import at.ssw.visualizer.cfg.action.ShowEdgesAction;
+import at.ssw.visualizer.cfg.action.SwitchLoopClustersAction;
+import at.ssw.visualizer.cfg.action.UseBezierRouterAction;
+import at.ssw.visualizer.cfg.action.UseDirectLineRouterAction;
+import at.ssw.visualizer.cfg.action.ZoominAction;
+import at.ssw.visualizer.cfg.action.ZoomoutAction;
+import at.ssw.visualizer.cfg.graph.CfgEventListener;
+import at.ssw.visualizer.cfg.graph.CfgScene;
+import at.ssw.visualizer.cfg.graph.EdgeWidget;
+import at.ssw.visualizer.cfg.graph.NodeWidget;
+import at.ssw.visualizer.cfg.model.CfgEdge;
+import at.ssw.visualizer.cfg.model.CfgNode;
+import at.ssw.visualizer.cfg.preferences.CfgPreferences;
+import at.ssw.visualizer.cfg.preferences.FlagsSetting;
+import javax.swing.ScrollPaneConstants;
+import at.ssw.visualizer.model.cfg.ControlFlowGraph;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.JComponent;
+import javax.swing.JScrollPane;
+import javax.swing.JToggleButton;
+import javax.swing.UIManager;
+import javax.swing.border.Border;
+import org.netbeans.api.visual.widget.Widget;
+import org.openide.awt.Toolbar;
+import org.openide.util.ImageUtilities;
+import org.openide.windows.CloneableTopComponent;
+import org.openide.windows.TopComponent;
+import org.openide.util.actions.SystemAction;
+
+public class CfgEditorTopComponent extends CloneableTopComponent implements PropertyChangeListener {
+
+    private CfgScene scene;
+    private JScrollPane jScrollPane;
+    private ControlFlowGraph cfg;
+    private JComponent myView;
+
+    public CfgEditorTopComponent(ControlFlowGraph cfg) {
+        this.cfg = cfg;
+
+        setIcon(ImageUtilities.loadImage("at/ssw/visualizer/cfg/icons/cfg.gif"));
+//        setName(cfg.getParent().getShortName());
+//        setToolTipText(cfg.getCompilation().getMethod() + " - " + cfg.getName());
+        // TODO(tw): Add title.
+
+        //panel setup
+        this.jScrollPane = new JScrollPane();
+        this.jScrollPane.setOpaque(true);
+        this.jScrollPane.setBorder(BorderFactory.createEmptyBorder());
+        this.jScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
+        this.scene = new CfgScene(this);
+        this.myView = scene.createView();
+        this.jScrollPane.setViewportView(myView);
+        this.setLayout(new BorderLayout());
+        this.add(createToolbar(), BorderLayout.NORTH);
+        this.add(jScrollPane, BorderLayout.CENTER);
+        jScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
+        jScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
+        jScrollPane.getVerticalScrollBar().setEnabled(true);
+        jScrollPane.getHorizontalScrollBar().setEnabled(true);
+
+        //setup enviroment,register listeners
+        // TODO(tw): Add to lookup.
+//        selection = new Selection();
+//        selection.put(cfg);
+//        selection.put(scene);
+//        selection.addChangeListener(scene);
+
+        scene.validate();
+        scene.applyLayout();
+    }
+
+    public ControlFlowGraph getCfg() {
+        return cfg;
+    }
+
+    public JScrollPane getJScrollPanel() {
+        return jScrollPane;
+    }
+
+    public CfgScene getCfgScene() {
+        return scene;
+    }
+
+    @Override
+    public int getPersistenceType() {
+        return TopComponent.PERSISTENCE_NEVER;
+    }
+
+    @Override
+    protected void componentOpened() {
+        super.componentOpened();
+        CfgPreferences.getInstance().addPropertyChangeListener(this);
+    }
+
+    @Override
+    protected void componentActivated() {
+        super.componentActivated();
+//        SelectionManager.getDefault().setSelection(selection);
+        this.getCfgScene().updateGlobalSelection();
+        this.getCfgScene().fireSelectionChanged();
+    }
+
+    @Override
+    protected void componentClosed() {
+        super.componentClosed();
+//        SelectionManager.getDefault().removeSelection(selection);
+        CfgPreferences.getInstance().removePropertyChangeListener(this);
+    }
+
+    @Override
+    protected CloneableTopComponent createClonedObject() {
+        CfgEditorTopComponent component = new CfgEditorTopComponent(cfg);
+        component.setActivatedNodes(getActivatedNodes());
+        return component;
+    }
+
+    public void propertyChange(PropertyChangeEvent evt) {
+        if (this.scene != null) {
+
+            String propName = evt.getPropertyName();
+            CfgPreferences prefs = CfgPreferences.getInstance();
+            if (propName.equals(CfgPreferences.PROP_BACKGROUND_COLOR)) {
+                scene.setBackground(prefs.getBackgroundColor());
+                scene.revalidate();
+            } else if (propName.equals(CfgPreferences.PROP_NODE_COLOR)) {
+                for (NodeWidget nw : scene.getNodeWidgets()) {
+                    //only change the node color if its not a custom color
+                    if (!nw.isNodeColorCustomized()) {
+                        nw.setNodeColor(prefs.getNodeColor(), false);
+                    }
+                }
+            } else if (propName.equals(CfgPreferences.PROP_EDGE_COLOR)) {
+                for (CfgEdge e : scene.getEdges()) {
+                    if (!e.isBackEdge() && !e.isXhandler()) {
+                        EdgeWidget w = (EdgeWidget) scene.findWidget(e);
+                        w.setLineColor(prefs.getEdgeColor());
+                    }
+                }
+            } else if (propName.equals(CfgPreferences.PROP_BACK_EDGE_COLOR)) {
+                for (CfgEdge e : scene.getEdges()) {
+                    if (e.isBackEdge()) {
+                        EdgeWidget w = (EdgeWidget) scene.findWidget(e);
+                        w.setLineColor(prefs.getBackedgeColor());
+                    }
+                }
+            } else if (propName.equals(CfgPreferences.PROP_EXCEPTION_EDGE_COLOR)) {
+                for (CfgEdge e : scene.getEdges()) {
+                    if (e.isXhandler()) {
+                        EdgeWidget w = (EdgeWidget) scene.findWidget(e);
+                        w.setLineColor(prefs.getExceptionEdgeColor());
+                    }
+                }
+            } else if (propName.equals(CfgPreferences.PROP_BORDER_COLOR)) {
+                for (CfgNode n : scene.getNodes()) {
+                    NodeWidget nw = (NodeWidget) scene.findWidget(n);
+                    nw.setBorderColor(prefs.getBorderColor());
+                }
+            } else if (propName.equals(CfgPreferences.PROP_TEXT_FONT)) {
+                for (CfgNode n : scene.getNodes()) {
+                    NodeWidget nw = (NodeWidget) scene.findWidget(n);
+                    nw.adjustFont(prefs.getTextFont());
+                }
+            } else if (propName.equals(CfgPreferences.PROP_TEXT_COLOR)) {
+                for (CfgNode n : scene.getNodes()) {
+                    NodeWidget nw = (NodeWidget) scene.findWidget(n);
+                    nw.setForeground(prefs.getTextColor());
+                }
+            } else if (propName.equals(CfgPreferences.PROP_FLAGS)) {
+                FlagsSetting fs = CfgPreferences.getInstance().getFlagsSetting();
+                for (CfgNode n : scene.getNodes()) {
+                    NodeWidget nw = (NodeWidget) scene.findWidget(n);
+                    Color nodeColor = fs.getColor(n.getBasicBlock().getFlags());
+                    if (nodeColor != null) {
+                        nw.setNodeColor(nodeColor, true);
+                    } else {
+                        nw.setNodeColor(CfgPreferences.getInstance().getNodeColor(), false);
+                    }
+                }
+            } else if (propName.equals(CfgPreferences.PROP_SELECTION_COLOR_BG) || propName.equals(CfgPreferences.PROP_SELECTION_COLOR_FG)) {
+                for (CfgNode n : scene.getNodes()) {
+                    Widget w = scene.findWidget(n);
+                    w.revalidate();
+                }
+            }
+            scene.validate();
+        }
+
+    }
+
+    private Toolbar createToolbar() {
+        Toolbar tb = new Toolbar("CfgToolbar");
+
+        tb.setBorder((Border) UIManager.get("Nb.Editor.Toolbar.border"));
+
+        //zoomin/zoomout buttons
+        tb.add(SystemAction.get(ZoominAction.class).getToolbarPresenter());
+        tb.add(SystemAction.get(ZoomoutAction.class).getToolbarPresenter());
+        tb.addSeparator();
+
+        //router buttons
+        ButtonGroup routerButtons = new ButtonGroup();
+        UseDirectLineRouterAction direct = SystemAction.get(UseDirectLineRouterAction.class);
+        UseBezierRouterAction bezier = SystemAction.get(UseBezierRouterAction.class);
+        JToggleButton button = (JToggleButton) direct.getToolbarPresenter();
+        button.getModel().setGroup(routerButtons);
+        button.setSelected(true);
+        tb.add(button);
+        button = (JToggleButton) bezier.getToolbarPresenter();
+        button.getModel().setGroup(routerButtons);
+        tb.add(button);
+        tb.addSeparator();
+
+        //layout buttons
+        tb.add(SystemAction.get(HierarchicalNodeLayoutAction.class).getToolbarPresenter());
+        tb.add(SystemAction.get(HierarchicalCompoundLayoutAction.class).getToolbarPresenter());
+
+        tb.addSeparator();
+        tb.add(SystemAction.get(ShowAllAction.class).getToolbarPresenter());
+        tb.addSeparator();
+
+        //cluster button
+        tb.add(SystemAction.get(SwitchLoopClustersAction.class).getToolbarPresenter());
+        tb.addSeparator();
+
+        //show/hide edge button
+        tb.add(SystemAction.get(ShowEdgesAction.class).getToolbarPresenter());
+        tb.add(SystemAction.get(HideEdgesAction.class).getToolbarPresenter());
+        tb.addSeparator();
+
+        //color button       
+        JComponent colorButton = SystemAction.get(ColorAction.class).getToolbarPresenter();
+        getCfgScene().addCfgEventListener((CfgEventListener) colorButton);
+        tb.add(colorButton);
+
+        //export button           
+        tb.add(SystemAction.get(ExportAction.class).getToolbarPresenter());
+        tb.doLayout();
+
+        return tb;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/.svn/all-wcprops	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,53 @@
+K 25
+svn:wc:ra_dav:version-url
+V 109
+/svn/c1visualizer~svn/!svn/ver/174/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/graph
+END
+LoopClusterWidget.java
+K 25
+svn:wc:ra_dav:version-url
+V 132
+/svn/c1visualizer~svn/!svn/ver/174/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/graph/LoopClusterWidget.java
+END
+CfgEventListener.java
+K 25
+svn:wc:ra_dav:version-url
+V 131
+/svn/c1visualizer~svn/!svn/ver/174/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/graph/CfgEventListener.java
+END
+SymmetricAnchor.java
+K 25
+svn:wc:ra_dav:version-url
+V 130
+/svn/c1visualizer~svn/!svn/ver/174/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/graph/SymmetricAnchor.java
+END
+EdgeWidget.java
+K 25
+svn:wc:ra_dav:version-url
+V 125
+/svn/c1visualizer~svn/!svn/ver/174/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/graph/EdgeWidget.java
+END
+NodeWidget.java
+K 25
+svn:wc:ra_dav:version-url
+V 125
+/svn/c1visualizer~svn/!svn/ver/174/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/graph/NodeWidget.java
+END
+SelectionWidget.java
+K 25
+svn:wc:ra_dav:version-url
+V 130
+/svn/c1visualizer~svn/!svn/ver/174/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/graph/SelectionWidget.java
+END
+EdgeSwitchWidget.java
+K 25
+svn:wc:ra_dav:version-url
+V 131
+/svn/c1visualizer~svn/!svn/ver/174/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/graph/EdgeSwitchWidget.java
+END
+CfgScene.java
+K 25
+svn:wc:ra_dav:version-url
+V 123
+/svn/c1visualizer~svn/!svn/ver/174/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/graph/CfgScene.java
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/.svn/entries	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,303 @@
+10
+
+dir
+206
+https://svn.java.net/svn/c1visualizer~svn/trunk/C1Visualizer/Control%20Flow%20Editor/src/at/ssw/visualizer/cfg/graph
+https://svn.java.net/svn/c1visualizer~svn
+
+
+
+2009-06-28T16:09:31.412666Z
+174
+ChristianW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+f598ca33-f47e-61e0-e023-f120d32a8e8d
+
+LoopClusterWidget.java
+file
+
+
+
+
+2012-01-28T15:08:36.049069Z
+e959236dd4c38ba2cbcd39e3a180f0f3
+2009-06-28T16:09:31.412666Z
+174
+ChristianW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3737
+
+CfgEventListener.java
+file
+
+
+
+
+2012-01-28T15:08:36.052069Z
+d6db075ad1e2ebb55ade2090130bcf30
+2009-06-28T16:09:31.412666Z
+174
+ChristianW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+261
+
+SymmetricAnchor.java
+file
+
+
+
+
+2012-01-28T15:08:36.054069Z
+f0fcc98a2e965834f80f13a6a41ce2d3
+2009-06-28T16:09:31.412666Z
+174
+ChristianW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5545
+
+EdgeWidget.java
+file
+
+
+
+
+2012-01-28T15:08:36.058069Z
+ec8f2b7aaf91dd475b49c238ec1aa2ee
+2009-06-28T16:09:31.412666Z
+174
+ChristianW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3286
+
+NodeWidget.java
+file
+
+
+
+
+2012-01-28T15:08:36.060069Z
+5d0a9294e18dbb15f9574a6026474a7e
+2009-06-28T16:09:31.412666Z
+174
+ChristianW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+6146
+
+SelectionWidget.java
+file
+
+
+
+
+2012-01-28T15:08:36.063069Z
+a384eb02341d2abf5b1e158cdd15583e
+2009-06-28T16:09:31.412666Z
+174
+ChristianW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1253
+
+EdgeSwitchWidget.java
+file
+
+
+
+
+2012-01-28T15:08:36.066070Z
+78914ff73d8d1d77436b2393bdcd3956
+2009-06-28T16:09:31.412666Z
+174
+ChristianW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+10335
+
+layout
+dir
+
+CfgScene.java
+file
+
+
+
+
+2012-01-28T15:08:36.069070Z
+67afed83a8d263b695e7875d21c8a59c
+2009-06-28T16:09:31.412666Z
+174
+ChristianW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+33480
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/.svn/text-base/CfgEventListener.java.svn-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,13 @@
+package at.ssw.visualizer.cfg.graph;
+
+import java.util.EventListener;
+
+
+public interface CfgEventListener extends EventListener {
+    
+    /**
+     *  the node or the edge selection got changed
+     */
+    public void selectionChanged(CfgScene scene);
+      
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/.svn/text-base/CfgScene.java.netbeans-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,834 @@
+package at.ssw.visualizer.cfg.graph;
+
+
+import at.ssw.visualizer.cfg.model.CfgEdge;
+import at.ssw.visualizer.cfg.CfgEditorContext;
+import at.ssw.visualizer.cfg.action.ColorAction;
+import at.ssw.visualizer.cfg.action.HideEdgesAction;
+import at.ssw.visualizer.cfg.action.ShowEdgesAction;
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import at.ssw.visualizer.cfg.graph.layout.HierarchicalCompoundLayout;
+import at.ssw.visualizer.cfg.graph.layout.HierarchicalNodeLayout;
+import at.ssw.visualizer.cfg.model.CfgEnv;
+import at.ssw.visualizer.cfg.model.CfgNode;
+import at.ssw.visualizer.cfg.model.LoopInfo;
+import at.ssw.visualizer.cfg.preferences.CfgPreferences;
+import at.ssw.visualizer.cfg.visual.PolylineRouter;
+import at.ssw.visualizer.cfg.visual.PolylineRouterV2;
+import at.ssw.visualizer.cfg.visual.WidgetCollisionCollector;
+import at.ssw.visualizer.core.selection.Selection;
+import at.ssw.visualizer.core.selection.SelectionManager;
+import at.ssw.visualizer.model.cfg.BasicBlock;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.RenderingHints;
+import java.awt.event.ActionEvent;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import javax.swing.AbstractAction;
+import javax.swing.JComponent;
+import javax.swing.JMenu;
+import javax.swing.JPopupMenu;
+import javax.swing.JScrollPane;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.swing.event.EventListenerList;
+import org.netbeans.api.visual.action.ActionFactory;
+import org.netbeans.api.visual.action.MoveProvider;
+import org.netbeans.api.visual.action.PopupMenuProvider;
+import org.netbeans.api.visual.action.RectangularSelectDecorator;
+import org.netbeans.api.visual.action.RectangularSelectProvider;
+import org.netbeans.api.visual.action.WidgetAction;
+import org.netbeans.api.visual.anchor.Anchor;
+import org.netbeans.api.visual.anchor.AnchorFactory;
+import org.netbeans.api.visual.graph.GraphScene;
+import org.netbeans.api.visual.graph.layout.GraphLayout;
+import org.netbeans.api.visual.layout.LayoutFactory;
+import org.netbeans.api.visual.layout.SceneLayout;
+import org.netbeans.api.visual.router.Router;
+import org.netbeans.api.visual.router.Router.*;
+import org.netbeans.api.visual.router.RouterFactory;
+import org.netbeans.api.visual.widget.ConnectionWidget;
+import org.netbeans.api.visual.widget.LayerWidget;
+import org.netbeans.api.visual.widget.Widget;
+import org.openide.util.actions.SystemAction;
+
+
+public class CfgScene extends GraphScene<CfgNode, CfgEdge> implements ChangeListener {    
+    private LayerWidget mainLayer = new LayerWidget(this);
+    private LayerWidget connectionLayer = new LayerWidget(this);  
+    private LayerWidget interractionLayer = new LayerWidget(this);
+    private LayerWidget clusterLayer = new LayerWidget(this);  
+    private Set<CfgNode> selectedNodes = Collections.<CfgNode>emptySet();
+    private Map<Integer, LoopClusterWidget> loopidx2clusterwidget = new HashMap<Integer, LoopClusterWidget>();
+    private Map<CfgNode, EdgeSwitchWidget> inputSwitches = new HashMap<CfgNode, EdgeSwitchWidget>();
+    private Map<CfgNode, EdgeSwitchWidget> outputSwitches = new HashMap<CfgNode, EdgeSwitchWidget>();    
+    private WidgetAction moveAction = ActionFactory.createMoveAction (ActionFactory.createFreeMoveStrategy(), this.createMoveProvider());   
+    private SceneLayout sceneLayout;
+    private CfgEnv env;
+    private int currentLayout=-1;
+    private int currentRouter=-1;
+    private CfgEditorTopComponent cfgtc;
+    private EventListenerList listenerList = new EventListenerList();
+    private WidgetAction contextPopupAction = this.createContextMenuAction(this); 
+    private List<NodeWidget> nodeWidgets=null;
+    private boolean loopClustersVisible = true;
+    
+    
+    public CfgScene(final CfgEditorTopComponent cfgtc){    
+        addChild(clusterLayer); 
+        addChild(mainLayer);       
+        addChild(interractionLayer);
+        addChild(connectionLayer);    
+        this.loadDefaults();   
+        this.cfgtc=cfgtc;           
+        this.loadModel(new CfgEnv(cfgtc.getCfg()));     
+        this.setSceneLayout(CfgEditorContext.LAYOUT_HIERARCHICALNODELAYOUT);//default   
+        this.getInputBindings().setZoomActionModifiers(0);
+        this.getActions().addAction(ActionFactory.createMouseCenteredZoomAction(1.1));
+        this.getActions().addAction(ActionFactory.createPanAction());   
+        this.getActions().addAction(ActionFactory.createRectangularSelectAction(
+                this.createSelectDecorator(this),
+                interractionLayer, 
+                this.createRectangularSelectProvider())
+        ); 
+        this.getActions().addAction(this.contextPopupAction);
+        this.addSceneListener(createSceneListener(this));
+        this.validate();
+    }
+    
+    private void loadModel(CfgEnv cfgenv) {
+        this.env = cfgenv;
+        for(CfgNode n : env.getNodes()) {         
+            addNode(n);
+        }
+        for(CfgEdge e : env.getEdges()) {         
+            addEdge(e);        
+            setEdgeSource(e, e.getSourceNode());
+            setEdgeTarget(e, e.getTargetNode());
+        }        
+        this.stackLoops(cfgenv.getLoopMap());    
+        this.autoHideEdges();        
+    }
+           
+    public void loadDefaults() {
+        this.setRouter(CfgEditorContext.ROUTING_DIRECTLINES);       
+        CfgPreferences prefs = CfgPreferences.getInstance();
+        this.setBackground(prefs.getBackgroundColor());
+    }
+    
+    //sets the parent Widget of all LoopClusterWidgets
+    private void stackLoops(Map<CfgNode, LoopInfo> map) {  
+        this.clusterLayer.removeChildren();
+      
+        Set<LoopInfo> cache = new HashSet<LoopInfo>();
+        for(LoopInfo info : map.values()){
+            if(cache.contains(info)) continue;
+            LoopClusterWidget widget = this.loopidx2clusterwidget.get(info.getLoopIndex());           
+            LoopInfo parent = info.getParent(); 
+            while(parent != null){                
+                LoopClusterWidget parentWidget = this.loopidx2clusterwidget.get(parent.getLoopIndex());
+                assert parentWidget != null;
+                if(widget.getParentWidget()!=null)
+                    widget.removeFromParent();
+                parentWidget.addChild(widget);
+                widget=parentWidget;
+                parent = parent.getParent();         
+            }           
+            widget.removeFromParent();
+            this.clusterLayer.addChild(widget);//parent == null => parent is clusterlayer
+        } 
+    }
+   
+    //hide in|output edges 
+    private void autoHideEdges(){
+        for(CfgNode n : this.getNodes()){
+             int fanin = n.getInputEdges().length;
+             int fanout = n.getOutputEdges().length;                                    
+             if (fanin > CfgEditorContext.MAX_AUTOEDGESVISIBLE){
+                assert(inputSwitches.containsKey(n));
+                if(this.inputSwitches.containsKey(n)){                   
+                    EdgeSwitchWidget esw = this.inputSwitches.get(n);
+                    esw.changeEdgeVisibility(false);
+                }            
+             } 
+             if(fanout > CfgEditorContext.MAX_AUTOEDGESVISIBLE){              
+                if(this.outputSwitches.containsKey(n)){
+                    EdgeSwitchWidget esw = this.outputSwitches.get(n);
+                    esw.changeEdgeVisibility(false);
+                }
+             }
+        }
+        
+    }
+    
+     //apply current cfggraphscene layout  
+    public void applyLayout(){      
+        this.sceneLayout.invokeLayoutImmediately();  
+    }
+    
+    //returns a Set with the currently selected Nodes    
+    public Set<CfgNode> getSelectedNodes() {
+        return Collections.<CfgNode>unmodifiableSet(selectedNodes);
+    }
+    
+    
+    public Map<Integer, LoopClusterWidget> getLoopidx2clusterwidget() {
+        return loopidx2clusterwidget;
+    }
+    
+    /**
+     * Sets the color of the currently selected Nodes
+     * If the supplied color is null the default color will be used
+     */
+    public void setSelectedNodesColor(Color color) {
+        if(color == null) { //set default color
+            CfgPreferences prefs = CfgPreferences.getInstance();
+            boolean customized=false;
+            for(CfgNode n : this.selectedNodes){
+                 color=null;
+                 color = prefs.getFlagsSetting().getColor(n.getBasicBlock().getFlags());
+                 customized = (color!=null); 
+                 NodeWidget nw = (NodeWidget) this.findWidget(n);                                                
+                 nw.setNodeColor((customized) ? color : prefs.getNodeColor(), customized);  
+            }
+        } else  {
+            for(CfgNode n : this.selectedNodes){
+                NodeWidget nw = (NodeWidget) this.findWidget(n);
+                nw.setNodeColor(color, true);
+            }
+        }
+        this.validate();
+    }
+
+    public void setSelectedEdgesVisibility(boolean visible) {
+        for(CfgNode n : this.selectedNodes){        
+            EdgeSwitchWidget in = this.inputSwitches.get(n);
+            EdgeSwitchWidget out = this.outputSwitches.get(n);            
+            if(in != null) in.changeEdgeVisibility(visible);
+            if(out != null) out.changeEdgeVisibility(visible);        
+        }
+        this.fireSelectionChanged();     
+        this.validate();
+    }
+
+    public EdgeSwitchWidget getInputSwitch(CfgNode n){
+        return this.inputSwitches.get(n);
+    }
+    public EdgeSwitchWidget getOutputSwitch(CfgNode n){
+        return this.outputSwitches.get(n);
+    }
+    
+    public CfgEnv getCfgEnv() {
+        return env;
+    }
+       
+    public boolean isLoopClusterVisible() {
+        return loopClustersVisible;
+    }
+    
+    public void setLoopWidgets(boolean visible) {      
+        for(Widget w : this.loopidx2clusterwidget.values()){
+            w.setVisible(visible);
+            w.revalidate();
+        }
+        this.loopClustersVisible=visible;
+        this.validate();
+    }
+    
+    public void setRouter(int newRouter){
+        if(newRouter == this.currentRouter) return;
+        
+        this.currentRouter=newRouter;
+        
+        Router router;
+       
+        switch (newRouter) {
+            case CfgEditorContext.ROUTING_BEZIER:                
+                router = new PolylineRouterV2(new WidgetCollisionCollector() {  
+                    public void collectCollisions(List<Widget> collisions) {
+                        collisions.addAll(getNodeWidgets());  
+                    }
+                });           
+                break;
+            case CfgEditorContext.ROUTING_DIRECTLINES:             
+                router = RouterFactory.createDirectRouter();               
+                break;           
+            default: 
+                throw new IllegalStateException ("Unknown Router ID: " + newRouter); // NOI18N
+        } 
+        
+        for(CfgEdge e : this.getEdges()){              
+            EdgeWidget ew = (EdgeWidget) this.findWidget(e);           
+            ew.setRouter(router);           
+        }
+        this.validate();
+    }
+    
+   
+        
+    public Collection<NodeWidget> getNodeWidgets() {
+        if(nodeWidgets != null && nodeWidgets.size()==this.getNodes().size()) return nodeWidgets;
+        
+        List<NodeWidget> widgets = new ArrayList<NodeWidget>();
+        for(CfgNode n : this.getNodes()){
+            NodeWidget w = (NodeWidget) this.findWidget(n);
+            widgets.add(w);
+        }
+        
+        nodeWidgets = Collections.unmodifiableList(widgets);
+        return widgets;        
+    }
+      
+    
+   
+    public void setSceneLayout(int newLayout){   
+        
+        if(currentLayout == newLayout) return;
+                
+        GraphLayout<CfgNode,CfgEdge> graphLayout=null;
+        
+        switch (newLayout) {               
+            case CfgEditorContext.LAYOUT_HIERARCHICALNODELAYOUT:
+                graphLayout = new HierarchicalNodeLayout(this); 
+                break;
+            
+            case CfgEditorContext.LAYOUT_HIERARCHICALCOMPOUNDLAYOUT:
+                graphLayout = new HierarchicalCompoundLayout(this);
+                break;
+        }  
+        
+        this.currentLayout=newLayout;
+        if(graphLayout != null)
+            this.sceneLayout=LayoutFactory.createSceneGraphLayout(this, graphLayout);     
+    }
+   
+      
+    @Override
+    protected void attachEdgeSourceAnchor(CfgEdge edge, CfgNode oldSourceNode, CfgNode sourceNode) {    
+        Anchor sourceAnchor;
+        EdgeWidget edgeWidget = (EdgeWidget) findWidget (edge);
+        Widget sourceWidget = findWidget(sourceNode);
+       
+        if (edge.isSymmetric()) {
+            sourceAnchor =  new SymmetricAnchor(sourceWidget, true, true); 
+        } else {
+            sourceAnchor = AnchorFactory.createRectangularAnchor(sourceWidget);
+        }  
+        edgeWidget.setSourceAnchor (sourceAnchor);  
+    }
+
+    @Override
+    protected void attachEdgeTargetAnchor(CfgEdge edge, CfgNode oldtarget, CfgNode targetNode) { 
+        Anchor targetAnchor; 
+        ConnectionWidget edgeWidget = (ConnectionWidget) findWidget (edge);              
+        Widget targetWidget = findWidget(targetNode);
+        
+        if (edge.isSymmetric()) {
+            targetAnchor =  new SymmetricAnchor(targetWidget, true, false);                 
+        } else {
+            targetAnchor = AnchorFactory.createRectangularAnchor(targetWidget);
+        }                 
+        edgeWidget.setTargetAnchor (targetAnchor);      
+    }
+
+  
+    @Override
+    protected Widget attachEdgeWidget(CfgEdge edge) {      
+        EdgeWidget widget = new EdgeWidget(this, edge);
+        connectionLayer.addChild(widget);      
+        attachSourceSwitchWidget(edge);           
+        attachTargetSwitchWidget(edge);       
+        return widget;
+    }
+
+    
+   
+    @Override
+    protected Widget attachNodeWidget(CfgNode node) {   
+        this.nodeWidgets = null;
+        
+        NodeWidget nw  = new NodeWidget(this,node);
+        WidgetAction.Chain actions = nw.getActions();        
+        actions.addAction(this.contextPopupAction);
+        actions.addAction(this.moveAction);
+        actions.addAction(this.createObjectHoverAction());
+           
+        if ( node.isLoopMember() ) {           
+            LoopClusterWidget loopWidget = this.attachLoopMember(node);           
+            loopWidget.addMember(nw);      
+        } 
+        mainLayer.addChild(nw);           
+        return nw;
+    }
+    
+    
+    private LoopClusterWidget attachLoopMember(CfgNode node) {
+        LoopClusterWidget lw = this.loopidx2clusterwidget.get(node.getLoopIndex());
+        if(lw == null) {
+            lw = new LoopClusterWidget(this, node.getLoopDepth(), node.getLoopIndex());
+            this.loopidx2clusterwidget.put(node.getLoopIndex(), lw);
+            this.clusterLayer.addChild(lw);
+        }
+        return lw;
+    }
+    
+    
+    private boolean detachLoopMember(CfgNode node, NodeWidget nodeWidget) { 
+        LoopClusterWidget rm = this.loopidx2clusterwidget.get(node.getLoopIndex());
+        if( rm == null) return false;//not added
+        
+        if ( rm.removeMember(nodeWidget) ) {
+            if(rm.getMembers().size() == 0){
+                this.loopidx2clusterwidget.remove(rm.getLoopIndex());
+                List<Widget> childs = new ArrayList<Widget>(rm.getChildren());
+                for (Widget w : childs){//append stacked loopwidgets
+                    w.removeFromParent();
+                    rm.getParentWidget().addChild(w);
+                }
+                rm.removeFromParent();
+            }
+            return true;
+        }
+        return false;       
+    }
+
+    //this function is not invoked by any class  of the module
+    //however to ensure that the edge switches are treatet corretly
+    //when a future version removes nodes it was implemented too.
+    
+    @Override
+    protected void detachNodeWidget(CfgNode node, Widget nodeWidget) {
+        if(node.isLoopMember() && nodeWidget instanceof NodeWidget ) {
+            this.detachLoopMember(node,(NodeWidget)nodeWidget);        
+        }
+        super.detachNodeWidget(node, nodeWidget);
+        assert nodeWidget.getParentWidget()== null;
+        if(this.inputSwitches.containsKey(node)) {
+            EdgeSwitchWidget esw = this.inputSwitches.remove(node);
+            this.connectionLayer.removeChild(esw);
+        }
+        if(this.outputSwitches.containsKey(node)){
+            EdgeSwitchWidget esw = this.outputSwitches.remove(node);
+            this.connectionLayer.removeChild(esw);
+        }       
+    }
+       
+    protected EdgeSwitchWidget attachSourceSwitchWidget(CfgEdge e){
+        CfgNode sourceNode = e.getSourceNode();   
+        NodeWidget sourceWidget = (NodeWidget) this.findWidget(sourceNode);
+        EdgeSwitchWidget out = outputSwitches.get(sourceNode);       
+        if (out==null) {
+            out = new EdgeSwitchWidget(this, sourceWidget, true);
+            this.connectionLayer.addChild(out); 
+            outputSwitches.put(sourceNode, out);
+        }        
+        return out;  
+    }
+    
+    
+    protected EdgeSwitchWidget attachTargetSwitchWidget(CfgEdge e){      
+        CfgNode targetNode = e.getTargetNode();
+        NodeWidget targetWidget = (NodeWidget) this.findWidget(targetNode);
+        EdgeSwitchWidget in = inputSwitches.get(targetNode);      
+        if (in==null) {       
+            in = new EdgeSwitchWidget(this, targetWidget, false);
+            this.connectionLayer.addChild(in);                  
+            inputSwitches.put(targetNode, in);
+        }
+        return in;   
+    }
+    
+    //resets the selection state of all NodeWidgets
+    private void cleanNodeSelection(){
+        if( this.selectedNodes.size() != 0) {
+            this.userSelectionSuggested(Collections.<CfgNode>emptySet(), false);
+            this.selectedNodes = Collections.<CfgNode>emptySet();
+            this.fireSelectionChanged();
+            this.validate();            
+        }
+    }
+    
+    
+    //sets the scene & global node selection
+    public void setNodeSelection(Set<CfgNode> newSelection){   
+        this.setSceneSelection(newSelection);
+        this.updateGlobalSelection();         
+    }
+    
+    //sets the scene selection
+    private void setSceneSelection(Set<CfgNode> newSelection){
+        if(newSelection.equals(selectedNodes)) return;
+        
+        this.selectedNodes=newSelection;
+        
+        Set<Object> selectedObjects = new HashSet<Object>();
+        
+        for(CfgNode n : newSelection){
+            selectedObjects.addAll(this.findNodeEdges(n, true, true));
+        }
+        selectedObjects.addAll(newSelection);
+        
+        //if the selection gets updated from a change in the block view
+        //the scene will be centered
+        if(selectionUpdating)
+            this.centerSelection();
+        
+        this.userSelectionSuggested(selectedObjects, false);
+        this.fireSelectionChanged();           
+        this.validate();
+    }
+    
+    //updates selection of Block View
+    public void updateGlobalSelection() {
+        Selection selection = SelectionManager.getDefault().getCurSelection();
+        ArrayList<BasicBlock> newBlocks = new ArrayList<BasicBlock>();
+        for (CfgNode n : this.selectedNodes) {
+            newBlocks.add(n.getBasicBlock());
+        }
+        BasicBlock[] curBlocks = newBlocks.toArray(new BasicBlock[newBlocks.size()]);     
+        selection.put(curBlocks);
+    }
+    
+    private boolean selectionUpdating = false;
+    
+    //change of blockview selection   
+    public void stateChanged(ChangeEvent event) {      
+        if (selectionUpdating) {            
+            return;
+        }
+       
+        selectionUpdating = true;
+        
+        Object source = event.getSource();
+        if(source instanceof Selection){
+            Selection selection=(Selection) source;
+            Set<CfgNode> newSelection = new HashSet<CfgNode>();
+            BasicBlock[] newBlocks = selection.get(BasicBlock[].class);                  
+            if (newBlocks != null) {
+                for(BasicBlock b : newBlocks){
+                    for(CfgNode n : this.getNodes()){
+                        if(n.getBasicBlock() == b) newSelection.add(n);
+                    }
+                }
+                this.setSceneSelection(newSelection);                               
+            } 
+        }       
+        selectionUpdating = false;
+    }
+      
+    //centers the viewport on the currently selected nodewidgets
+    private void centerSelection(){         
+        Point sceneCenter = null;
+        Collection<CfgNode> nodes = this.selectedNodes;
+        if(nodes.size()==0) {
+            nodes = this.getNodes();
+        } 
+        
+        for(CfgNode n : nodes) {
+            if(sceneCenter==null) {
+                sceneCenter = this.findWidget(n).getLocation();
+                continue;
+            }
+            Point location = this.findWidget(n).getLocation();
+            sceneCenter.x = (location.x+sceneCenter.x)/2;
+            sceneCenter.y = (location.y+sceneCenter.y)/2;
+        }    
+        
+        JComponent view = this.getView ();
+        if (view != null) {
+            Rectangle viewBounds = view.getVisibleRect ();
+
+            Point viewCenter = this.convertSceneToView (sceneCenter);
+
+            view.scrollRectToVisible (new Rectangle (
+                viewCenter.x - viewBounds.width / 2,
+                viewCenter.y - viewBounds.height / 2,
+                viewBounds.width,
+                viewBounds.height
+            ));
+        }
+    }
+    
+    //animated scene Zoom to the max bounds of current viewport
+    public void zoomScene(){
+        JScrollPane pane = this.cfgtc.getJScrollPanel();
+      
+        Rectangle prefBounds = this.getPreferredBounds(); 
+        Dimension viewDim = pane.getViewportBorderBounds().getSize();
+        
+        double realwidth = (double)prefBounds.width*this.getZoomFactor();
+        double realheight = (double)prefBounds.height*this.getZoomFactor();        
+        
+        double zoomX = (double)viewDim.width / realwidth;
+        double zoomY = (double)viewDim.height / realheight;  
+        double zoomFactor = Math.min(zoomX, zoomY);     
+                
+        this.animateZoom(zoomFactor*0.9);         
+    }
+    
+    
+    //animated animateZoom function for scene animateZoom factor 
+    public void animateZoom(double zoomfactor) {
+        this.getSceneAnimator().animateZoomFactor(this.getZoomFactor() * zoomfactor);
+    }
+   
+    public void addCfgEventListener(CfgEventListener l) {
+        listenerList.add(CfgEventListener.class, l);
+    }
+
+    public void removeCfgEventListener(CfgEventListener l) {
+        listenerList.remove(CfgEventListener.class, l);
+    }
+       
+    public void fireSelectionChanged() {
+        Object[] listeners = listenerList.getListenerList();
+        for (int i = listeners.length-2; i>=0; i-=2) {
+            if (listeners[i]==CfgEventListener.class) {
+                ((CfgEventListener)listeners[i+1]).selectionChanged(this);
+            }
+        }
+    }
+       
+       
+    //Enables Antialiasing
+    @Override
+    public void paintChildren () {
+        Object anti = getGraphics ().getRenderingHint (RenderingHints.KEY_ANTIALIASING);
+        Object textAnti = getGraphics ().getRenderingHint (RenderingHints.KEY_TEXT_ANTIALIASING);
+
+        getGraphics ().setRenderingHint (
+                RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+        getGraphics ().setRenderingHint (
+                RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
+
+        super.paintChildren ();
+
+        getGraphics ().setRenderingHint (RenderingHints.KEY_ANTIALIASING, anti);
+        getGraphics ().setRenderingHint (RenderingHints.KEY_TEXT_ANTIALIASING, textAnti);
+    }
+    
+       
+     //select provider for node selection
+    private RectangularSelectProvider createRectangularSelectProvider() {
+            return new RectangularSelectProvider() {
+                public void performSelection(Rectangle rectangle) {
+                    HashSet<CfgNode> set=new HashSet<CfgNode>();
+
+                    //change to a rectangle with (x,offsetY) at the top left
+                    if(rectangle.width < 0){
+                        rectangle.x=rectangle.x+rectangle.width;
+                        rectangle.width*=-1;
+                    }
+                    if(rectangle.height < 0){
+                        rectangle.y=rectangle.y+rectangle.height;
+                        rectangle.height*=-1;
+                    }
+
+                    for(NodeWidget n: getNodeWidgets()) {
+                        Point p = n.getLocation();
+                        if (p != null && rectangle.contains(p)) {                     
+                            set.add(n.getNodeModel());
+                        }
+                    }        
+                    setNodeSelection(set);              
+                }
+            };    
+    }
+    
+    //select decorator for node selection
+    private RectangularSelectDecorator createSelectDecorator(final CfgScene scene){ 
+        return new RectangularSelectDecorator() {
+            public Widget createSelectionWidget() {
+                scene.cleanNodeSelection();//unselected all nodes
+                scene.revalidate();
+                return new SelectionWidget(getScene());
+            }
+        };
+    }
+    
+    
+    private MoveProvider createMoveProvider() {
+        return new MoveProvider(){
+            private HashMap<Widget, Point> originals = new HashMap<Widget, Point>();
+          
+            private Point original=null;
+               
+            public void movementStarted(Widget widget) {
+                originals.clear();              
+                NodeWidget nw = (NodeWidget) widget;    
+                if(selectedNodes.contains(nw.getNodeModel())) {//move current selection
+                    for(CfgNode n : selectedNodes){
+                        Widget w = findWidget(n);
+                        originals.put(w, w.getLocation());
+                    }
+                } else {//a newly-selected node will be moved               
+                    CfgNode n = nw.getNodeModel();     
+                    HashSet<CfgNode> selectedNode = new HashSet<CfgNode>(1);
+                    selectedNode.add(n);
+                    setNodeSelection(selectedNode);
+                    originals.put(widget, widget.getPreferredLocation());
+                    widget.revalidate();
+                    validate();
+                    
+                }               
+            }
+
+            public void movementFinished(Widget widget) {                                           
+                NodeWidget nw = (NodeWidget) widget;    
+                if(selectedNodes.contains(nw.getNodeModel())) {
+                    return;//to be able to move the current selection
+                }
+
+                HashSet<CfgNode> selectedNode = new HashSet<CfgNode>(1);
+                selectedNode.add(nw.getNodeModel());  
+                setNodeSelection(selectedNode);         
+                originals.clear ();
+                original = null;
+                
+            }
+
+            public Point getOriginalLocation(Widget widget) {           
+                if(original==null) 
+                    original = widget.getLocation();
+
+                return original;          
+            }
+            //todo : find a cache algorithm which only routes edges
+            //which are intersected by bounds of the moved rectangle
+            public void setNewLocation(Widget widget, Point location) {
+                Point org = getOriginalLocation(widget);
+                int dx = location.x - org.x;
+                int dy = location.y - org.y;
+                for (Map.Entry<Widget, Point> entry : originals.entrySet ()) {
+                    Point point = entry.getValue ();
+                    entry.getKey ().setPreferredLocation (new Point (point.x + dx, point.y + dy));
+                }  
+                for(CfgEdge e : getEdges()) {             
+                    EdgeWidget ew = (EdgeWidget) findWidget(e);
+                    if(ew.isVisible())
+                        ew.reroute();
+                }     
+            }
+        };
+    }
+       
+   
+    private WidgetAction createContextMenuAction(final CfgScene scene) {     
+        return ActionFactory.createPopupMenuAction(new PopupMenuProvider() {
+            public JPopupMenu getPopupMenu(Widget widget, Point point) {
+                JPopupMenu menu = new JPopupMenu(); 
+                NodeWidget nw = null;
+                if(widget instanceof NodeWidget) {
+                    nw = (NodeWidget) widget;
+                    if(!selectedNodes.contains(nw.getNodeModel())){
+                        HashSet<CfgNode> selectedNode = new HashSet<CfgNode>(1);
+                        selectedNode.add(nw.getNodeModel());
+                        setNodeSelection(selectedNode);
+                    }
+                } else if  (scene.getSelectedNodes().size() == 1) {
+                    nw = (NodeWidget) scene.findWidget(scene.getSelectedNodes().iterator().next());
+                }
+                
+                if(nw != null){
+                    CfgNode node = nw.getNodeModel();                    
+                    ArrayList<CfgNode> successors = new ArrayList<CfgNode>();
+                    ArrayList<CfgNode> predecessors = new ArrayList<CfgNode>();
+                    for(CfgEdge e : node.getOutputEdges()){
+                        successors.add(e.getTargetNode());
+                    }
+                    for(CfgEdge e : node.getInputEdges()){
+                        predecessors.add(e.getSourceNode());
+                    }
+                    
+                    if(predecessors.size()>0){
+                        Collections.sort(predecessors, new NodeNameComparator());
+                        JMenu predmenu = new JMenu("Go to predecessor");
+                        for (CfgNode n : predecessors) {                     
+                            GotoNodeAction action = new GotoNodeAction(n); 
+                            predmenu.add(action);
+                        }
+                       menu.add(predmenu);   
+                    }
+                    if(successors.size()>0){
+                        Collections.sort(successors, new NodeNameComparator());
+                        JMenu succmenu = new JMenu("Go to successor");                
+                        for (CfgNode n : successors) {                     
+                            GotoNodeAction action = new GotoNodeAction(n); 
+                            succmenu.add(action);
+                        }
+                        menu.add(succmenu);                     
+                    } 
+                    if ( successors.size() > 0 || predecessors.size() > 0)
+                        menu.addSeparator();    
+                }        
+                
+                menu.add(SystemAction.get(ShowEdgesAction.class));
+                menu.add(SystemAction.get(HideEdgesAction.class));
+                menu.addSeparator();
+                menu.add(SystemAction.get(ColorAction.class).getPopupPresenter()); 
+                return menu;
+            }
+        });
+    }
+      
+    private class NodeNameComparator implements Comparator<CfgNode> {
+        public int compare(CfgNode node1, CfgNode node2) {                
+            String name1 = node1.getBasicBlock().getName().substring(1);
+            String name2 = node2.getBasicBlock().getName().substring(1);
+            Integer blocknum1 = Integer.parseInt(name1);
+            Integer blocknum2 = Integer.parseInt(name2);
+            return blocknum1.compareTo(blocknum2);                                             
+        }
+    }
+    
+    private class GotoNodeAction extends AbstractAction {   
+        CfgNode node ;      
+        
+        GotoNodeAction(CfgNode node){
+            super(node.getBasicBlock().getName());          
+            this.node = node;           
+        }
+        public void actionPerformed(ActionEvent e) {            
+              Set<CfgNode> nodes = new HashSet<CfgNode>(1);
+              nodes.add(node);
+              setNodeSelection(nodes);
+              centerSelection();    
+        }      
+    }
+    
+    private SceneListener createSceneListener(final CfgScene scene){
+        return new SceneListener() {
+            
+            public void sceneRepaint() {              
+            }
+
+            public void sceneValidating() {              
+            }
+ 
+            public void sceneValidated() {
+                if (scene.isLoopClusterVisible()){ //update only if visible
+                    for(LoopClusterWidget cw : getLoopidx2clusterwidget().values()){
+                        cw.updateClusterBounds();     
+                    }
+                }
+                for(EdgeSwitchWidget esw : inputSwitches.values()){
+                    esw.updatePosition();
+                }
+
+                for(EdgeSwitchWidget esw : outputSwitches.values()){
+                    esw.updatePosition();
+                } 
+           }
+        };
+    } 
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/.svn/text-base/CfgScene.java.svn-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,834 @@
+package at.ssw.visualizer.cfg.graph;
+
+
+import at.ssw.visualizer.cfg.model.CfgEdge;
+import at.ssw.visualizer.cfg.CfgEditorContext;
+import at.ssw.visualizer.cfg.action.ColorAction;
+import at.ssw.visualizer.cfg.action.HideEdgesAction;
+import at.ssw.visualizer.cfg.action.ShowEdgesAction;
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import at.ssw.visualizer.cfg.graph.layout.HierarchicalCompoundLayout;
+import at.ssw.visualizer.cfg.graph.layout.HierarchicalNodeLayout;
+import at.ssw.visualizer.cfg.model.CfgEnv;
+import at.ssw.visualizer.cfg.model.CfgNode;
+import at.ssw.visualizer.cfg.model.LoopInfo;
+import at.ssw.visualizer.cfg.preferences.CfgPreferences;
+import at.ssw.visualizer.cfg.visual.PolylineRouter;
+import at.ssw.visualizer.cfg.visual.PolylineRouterV2;
+import at.ssw.visualizer.cfg.visual.WidgetCollisionCollector;
+import at.ssw.visualizer.core.selection.Selection;
+import at.ssw.visualizer.core.selection.SelectionManager;
+import at.ssw.visualizer.model.cfg.BasicBlock;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.RenderingHints;
+import java.awt.event.ActionEvent;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import javax.swing.AbstractAction;
+import javax.swing.JComponent;
+import javax.swing.JMenu;
+import javax.swing.JPopupMenu;
+import javax.swing.JScrollPane;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.swing.event.EventListenerList;
+import org.netbeans.api.visual.action.ActionFactory;
+import org.netbeans.api.visual.action.MoveProvider;
+import org.netbeans.api.visual.action.PopupMenuProvider;
+import org.netbeans.api.visual.action.RectangularSelectDecorator;
+import org.netbeans.api.visual.action.RectangularSelectProvider;
+import org.netbeans.api.visual.action.WidgetAction;
+import org.netbeans.api.visual.anchor.Anchor;
+import org.netbeans.api.visual.anchor.AnchorFactory;
+import org.netbeans.api.visual.graph.GraphScene;
+import org.netbeans.api.visual.graph.layout.GraphLayout;
+import org.netbeans.api.visual.layout.LayoutFactory;
+import org.netbeans.api.visual.layout.SceneLayout;
+import org.netbeans.api.visual.router.Router;
+import org.netbeans.api.visual.router.Router.*;
+import org.netbeans.api.visual.router.RouterFactory;
+import org.netbeans.api.visual.widget.ConnectionWidget;
+import org.netbeans.api.visual.widget.LayerWidget;
+import org.netbeans.api.visual.widget.Widget;
+import org.openide.util.actions.SystemAction;
+
+
+public class CfgScene extends GraphScene<CfgNode, CfgEdge> implements ChangeListener {    
+    private LayerWidget mainLayer = new LayerWidget(this);
+    private LayerWidget connectionLayer = new LayerWidget(this);  
+    private LayerWidget interractionLayer = new LayerWidget(this);
+    private LayerWidget clusterLayer = new LayerWidget(this);  
+    private Set<CfgNode> selectedNodes = Collections.<CfgNode>emptySet();
+    private Map<Integer, LoopClusterWidget> loopidx2clusterwidget = new HashMap<Integer, LoopClusterWidget>();
+    private Map<CfgNode, EdgeSwitchWidget> inputSwitches = new HashMap<CfgNode, EdgeSwitchWidget>();
+    private Map<CfgNode, EdgeSwitchWidget> outputSwitches = new HashMap<CfgNode, EdgeSwitchWidget>();    
+    private WidgetAction moveAction = ActionFactory.createMoveAction (ActionFactory.createFreeMoveStrategy(), this.createMoveProvider());   
+    private SceneLayout sceneLayout;
+    private CfgEnv env;
+    private int currentLayout=-1;
+    private int currentRouter=-1;
+    private CfgEditorTopComponent cfgtc;
+    private EventListenerList listenerList = new EventListenerList();
+    private WidgetAction contextPopupAction = this.createContextMenuAction(this); 
+    private List<NodeWidget> nodeWidgets=null;
+    private boolean loopClustersVisible = true;
+    
+    
+    public CfgScene(final CfgEditorTopComponent cfgtc){    
+        addChild(clusterLayer); 
+        addChild(mainLayer);       
+        addChild(interractionLayer);
+        addChild(connectionLayer);    
+        this.loadDefaults();   
+        this.cfgtc=cfgtc;           
+        this.loadModel(new CfgEnv(cfgtc.getCfg()));     
+        this.setSceneLayout(CfgEditorContext.LAYOUT_HIERARCHICALNODELAYOUT);//default   
+        this.getInputBindings().setZoomActionModifiers(0);
+        this.getActions().addAction(ActionFactory.createMouseCenteredZoomAction(1.1));
+        this.getActions().addAction(ActionFactory.createPanAction());   
+        this.getActions().addAction(ActionFactory.createRectangularSelectAction(
+                this.createSelectDecorator(this),
+                interractionLayer, 
+                this.createRectangularSelectProvider())
+        ); 
+        this.getActions().addAction(this.contextPopupAction);
+        this.addSceneListener(createSceneListener(this));
+        this.validate();
+    }
+    
+    private void loadModel(CfgEnv cfgenv) {
+        this.env = cfgenv;
+        for(CfgNode n : env.getNodes()) {         
+            addNode(n);
+        }
+        for(CfgEdge e : env.getEdges()) {         
+            addEdge(e);        
+            setEdgeSource(e, e.getSourceNode());
+            setEdgeTarget(e, e.getTargetNode());
+        }        
+        this.stackLoops(cfgenv.getLoopMap());    
+        this.autoHideEdges();        
+    }
+           
+    public void loadDefaults() {
+        this.setRouter(CfgEditorContext.ROUTING_DIRECTLINES);       
+        CfgPreferences prefs = CfgPreferences.getInstance();
+        this.setBackground(prefs.getBackgroundColor());
+    }
+    
+    //sets the parent Widget of all LoopClusterWidgets
+    private void stackLoops(Map<CfgNode, LoopInfo> map) {  
+        this.clusterLayer.removeChildren();
+      
+        Set<LoopInfo> cache = new HashSet<LoopInfo>();
+        for(LoopInfo info : map.values()){
+            if(cache.contains(info)) continue;
+            LoopClusterWidget widget = this.loopidx2clusterwidget.get(info.getLoopIndex());           
+            LoopInfo parent = info.getParent(); 
+            while(parent != null){                
+                LoopClusterWidget parentWidget = this.loopidx2clusterwidget.get(parent.getLoopIndex());
+                assert parentWidget != null;
+                if(widget.getParentWidget()!=null)
+                    widget.removeFromParent();
+                parentWidget.addChild(widget);
+                widget=parentWidget;
+                parent = parent.getParent();         
+            }           
+            widget.removeFromParent();
+            this.clusterLayer.addChild(widget);//parent == null => parent is clusterlayer
+        } 
+    }
+   
+    //hide in|output edges 
+    private void autoHideEdges(){
+        for(CfgNode n : this.getNodes()){
+             int fanin = n.getInputEdges().length;
+             int fanout = n.getOutputEdges().length;                                    
+             if (fanin > CfgEditorContext.MAX_AUTOEDGESVISIBLE){
+                assert(inputSwitches.containsKey(n));
+                if(this.inputSwitches.containsKey(n)){                   
+                    EdgeSwitchWidget esw = this.inputSwitches.get(n);
+                    esw.changeEdgeVisibility(false);
+                }            
+             } 
+             if(fanout > CfgEditorContext.MAX_AUTOEDGESVISIBLE){              
+                if(this.outputSwitches.containsKey(n)){
+                    EdgeSwitchWidget esw = this.outputSwitches.get(n);
+                    esw.changeEdgeVisibility(false);
+                }
+             }
+        }
+        
+    }
+    
+     //apply current cfggraphscene layout  
+    public void applyLayout(){      
+        this.sceneLayout.invokeLayoutImmediately();  
+    }
+    
+    //returns a Set with the currently selected Nodes    
+    public Set<CfgNode> getSelectedNodes() {
+        return Collections.<CfgNode>unmodifiableSet(selectedNodes);
+    }
+    
+    
+    public Map<Integer, LoopClusterWidget> getLoopidx2clusterwidget() {
+        return loopidx2clusterwidget;
+    }
+    
+    /**
+     * Sets the color of the currently selected Nodes
+     * If the supplied color is null the default color will be used
+     */
+    public void setSelectedNodesColor(Color color) {
+        if(color == null) { //set default color
+            CfgPreferences prefs = CfgPreferences.getInstance();
+            boolean customized=false;
+            for(CfgNode n : this.selectedNodes){
+                 color=null;
+                 color = prefs.getFlagsSetting().getColor(n.getBasicBlock().getFlags());
+                 customized = (color!=null); 
+                 NodeWidget nw = (NodeWidget) this.findWidget(n);                                                
+                 nw.setNodeColor((customized) ? color : prefs.getNodeColor(), customized);  
+            }
+        } else  {
+            for(CfgNode n : this.selectedNodes){
+                NodeWidget nw = (NodeWidget) this.findWidget(n);
+                nw.setNodeColor(color, true);
+            }
+        }
+        this.validate();
+    }
+
+    public void setSelectedEdgesVisibility(boolean visible) {
+        for(CfgNode n : this.selectedNodes){        
+            EdgeSwitchWidget in = this.inputSwitches.get(n);
+            EdgeSwitchWidget out = this.outputSwitches.get(n);            
+            if(in != null) in.changeEdgeVisibility(visible);
+            if(out != null) out.changeEdgeVisibility(visible);        
+        }
+        this.fireSelectionChanged();     
+        this.validate();
+    }
+
+    public EdgeSwitchWidget getInputSwitch(CfgNode n){
+        return this.inputSwitches.get(n);
+    }
+    public EdgeSwitchWidget getOutputSwitch(CfgNode n){
+        return this.outputSwitches.get(n);
+    }
+    
+    public CfgEnv getCfgEnv() {
+        return env;
+    }
+       
+    public boolean isLoopClusterVisible() {
+        return loopClustersVisible;
+    }
+    
+    public void setLoopWidgets(boolean visible) {      
+        for(Widget w : this.loopidx2clusterwidget.values()){
+            w.setVisible(visible);
+            w.revalidate();
+        }
+        this.loopClustersVisible=visible;
+        this.validate();
+    }
+    
+    public void setRouter(int newRouter){
+        if(newRouter == this.currentRouter) return;
+        
+        this.currentRouter=newRouter;
+        
+        Router router;
+       
+        switch (newRouter) {
+            case CfgEditorContext.ROUTING_BEZIER:                
+                router = new PolylineRouterV2(new WidgetCollisionCollector() {  
+                    public void collectCollisions(List<Widget> collisions) {
+                        collisions.addAll(getNodeWidgets());  
+                    }
+                });           
+                break;
+            case CfgEditorContext.ROUTING_DIRECTLINES:             
+                router = RouterFactory.createDirectRouter();               
+                break;           
+            default: 
+                throw new IllegalStateException ("Unknown Router ID: " + newRouter); // NOI18N
+        } 
+        
+        for(CfgEdge e : this.getEdges()){              
+            EdgeWidget ew = (EdgeWidget) this.findWidget(e);           
+            ew.setRouter(router);           
+        }
+        this.validate();
+    }
+    
+   
+        
+    public Collection<NodeWidget> getNodeWidgets() {
+        if(nodeWidgets != null && nodeWidgets.size()==this.getNodes().size()) return nodeWidgets;
+        
+        List<NodeWidget> widgets = new ArrayList<NodeWidget>();
+        for(CfgNode n : this.getNodes()){
+            NodeWidget w = (NodeWidget) this.findWidget(n);
+            widgets.add(w);
+        }
+        
+        nodeWidgets = Collections.unmodifiableList(widgets);
+        return widgets;        
+    }
+      
+    
+   
+    public void setSceneLayout(int newLayout){   
+        
+        if(currentLayout == newLayout) return;
+                
+        GraphLayout<CfgNode,CfgEdge> graphLayout=null;
+        
+        switch (newLayout) {               
+            case CfgEditorContext.LAYOUT_HIERARCHICALNODELAYOUT:
+                graphLayout = new HierarchicalNodeLayout(this); 
+                break;
+            
+            case CfgEditorContext.LAYOUT_HIERARCHICALCOMPOUNDLAYOUT:
+                graphLayout = new HierarchicalCompoundLayout(this);
+                break;
+        }  
+        
+        this.currentLayout=newLayout;
+        if(graphLayout != null)
+            this.sceneLayout=LayoutFactory.createSceneGraphLayout(this, graphLayout);     
+    }
+   
+      
+    @Override
+    protected void attachEdgeSourceAnchor(CfgEdge edge, CfgNode oldSourceNode, CfgNode sourceNode) {    
+        Anchor sourceAnchor;
+        EdgeWidget edgeWidget = (EdgeWidget) findWidget (edge);
+        Widget sourceWidget = findWidget(sourceNode);
+       
+        if (edge.isSymmetric()) {
+            sourceAnchor =  new SymmetricAnchor(sourceWidget, true, true); 
+        } else {
+            sourceAnchor = AnchorFactory.createRectangularAnchor(sourceWidget);
+        }  
+        edgeWidget.setSourceAnchor (sourceAnchor);  
+    }
+
+    @Override
+    protected void attachEdgeTargetAnchor(CfgEdge edge, CfgNode oldtarget, CfgNode targetNode) { 
+        Anchor targetAnchor; 
+        ConnectionWidget edgeWidget = (ConnectionWidget) findWidget (edge);              
+        Widget targetWidget = findWidget(targetNode);
+        
+        if (edge.isSymmetric()) {
+            targetAnchor =  new SymmetricAnchor(targetWidget, true, false);                 
+        } else {
+            targetAnchor = AnchorFactory.createRectangularAnchor(targetWidget);
+        }                 
+        edgeWidget.setTargetAnchor (targetAnchor);      
+    }
+
+  
+    @Override
+    protected Widget attachEdgeWidget(CfgEdge edge) {      
+        EdgeWidget widget = new EdgeWidget(this, edge);
+        connectionLayer.addChild(widget);      
+        attachSourceSwitchWidget(edge);           
+        attachTargetSwitchWidget(edge);       
+        return widget;
+    }
+
+    
+   
+    @Override
+    protected Widget attachNodeWidget(CfgNode node) {   
+        this.nodeWidgets = null;
+        
+        NodeWidget nw  = new NodeWidget(this,node);
+        WidgetAction.Chain actions = nw.getActions();        
+        actions.addAction(this.contextPopupAction);
+        actions.addAction(this.moveAction);
+        actions.addAction(this.createObjectHoverAction());
+           
+        if ( node.isLoopMember() ) {           
+            LoopClusterWidget loopWidget = this.attachLoopMember(node);           
+            loopWidget.addMember(nw);      
+        } 
+        mainLayer.addChild(nw);           
+        return nw;
+    }
+    
+    
+    private LoopClusterWidget attachLoopMember(CfgNode node) {
+        LoopClusterWidget lw = this.loopidx2clusterwidget.get(node.getLoopIndex());
+        if(lw == null) {
+            lw = new LoopClusterWidget(this, node.getLoopDepth(), node.getLoopIndex());
+            this.loopidx2clusterwidget.put(node.getLoopIndex(), lw);
+            this.clusterLayer.addChild(lw);
+        }
+        return lw;
+    }
+    
+    
+    private boolean detachLoopMember(CfgNode node, NodeWidget nodeWidget) { 
+        LoopClusterWidget rm = this.loopidx2clusterwidget.get(node.getLoopIndex());
+        if( rm == null) return false;//not added
+        
+        if ( rm.removeMember(nodeWidget) ) {
+            if(rm.getMembers().size() == 0){
+                this.loopidx2clusterwidget.remove(rm.getLoopIndex());
+                List<Widget> childs = new ArrayList<Widget>(rm.getChildren());
+                for (Widget w : childs){//append stacked loopwidgets
+                    w.removeFromParent();
+                    rm.getParentWidget().addChild(w);
+                }
+                rm.removeFromParent();
+            }
+            return true;
+        }
+        return false;       
+    }
+
+    //this function is not invoked by any class  of the module
+    //however to ensure that the edge switches are treatet corretly
+    //when a future version removes nodes it was implemented too.
+    
+    @Override
+    protected void detachNodeWidget(CfgNode node, Widget nodeWidget) {
+        if(node.isLoopMember() && nodeWidget instanceof NodeWidget ) {
+            this.detachLoopMember(node,(NodeWidget)nodeWidget);        
+        }
+        super.detachNodeWidget(node, nodeWidget);
+        assert nodeWidget.getParentWidget()== null;
+        if(this.inputSwitches.containsKey(node)) {
+            EdgeSwitchWidget esw = this.inputSwitches.remove(node);
+            this.connectionLayer.removeChild(esw);
+        }
+        if(this.outputSwitches.containsKey(node)){
+            EdgeSwitchWidget esw = this.outputSwitches.remove(node);
+            this.connectionLayer.removeChild(esw);
+        }       
+    }
+       
+    protected EdgeSwitchWidget attachSourceSwitchWidget(CfgEdge e){
+        CfgNode sourceNode = e.getSourceNode();   
+        NodeWidget sourceWidget = (NodeWidget) this.findWidget(sourceNode);
+        EdgeSwitchWidget out = outputSwitches.get(sourceNode);       
+        if (out==null) {
+            out = new EdgeSwitchWidget(this, sourceWidget, true);
+            this.connectionLayer.addChild(out); 
+            outputSwitches.put(sourceNode, out);
+        }        
+        return out;  
+    }
+    
+    
+    protected EdgeSwitchWidget attachTargetSwitchWidget(CfgEdge e){      
+        CfgNode targetNode = e.getTargetNode();
+        NodeWidget targetWidget = (NodeWidget) this.findWidget(targetNode);
+        EdgeSwitchWidget in = inputSwitches.get(targetNode);      
+        if (in==null) {       
+            in = new EdgeSwitchWidget(this, targetWidget, false);
+            this.connectionLayer.addChild(in);                  
+            inputSwitches.put(targetNode, in);
+        }
+        return in;   
+    }
+    
+    //resets the selection state of all NodeWidgets
+    private void cleanNodeSelection(){
+        if( this.selectedNodes.size() != 0) {
+            this.userSelectionSuggested(Collections.<CfgNode>emptySet(), false);
+            this.selectedNodes = Collections.<CfgNode>emptySet();
+            this.fireSelectionChanged();
+            this.validate();            
+        }
+    }
+    
+    
+    //sets the scene & global node selection
+    public void setNodeSelection(Set<CfgNode> newSelection){   
+        this.setSceneSelection(newSelection);
+        this.updateGlobalSelection();         
+    }
+    
+    //sets the scene selection
+    private void setSceneSelection(Set<CfgNode> newSelection){
+        if(newSelection.equals(selectedNodes)) return;
+        
+        this.selectedNodes=newSelection;
+        
+        Set<Object> selectedObjects = new HashSet<Object>();
+        
+        for(CfgNode n : newSelection){
+            selectedObjects.addAll(this.findNodeEdges(n, true, true));
+        }
+        selectedObjects.addAll(newSelection);
+        
+        //if the selection gets updated from a change in the block view
+        //the scene will be centered
+        if(selectionUpdating)
+            this.centerSelection();
+        
+        this.userSelectionSuggested(selectedObjects, false);
+        this.fireSelectionChanged();           
+        this.validate();
+    }
+    
+    //updates selection of Block View
+    public void updateGlobalSelection() {
+        Selection selection = SelectionManager.getDefault().getCurSelection();
+        ArrayList<BasicBlock> newBlocks = new ArrayList<BasicBlock>();
+        for (CfgNode n : this.selectedNodes) {
+            newBlocks.add(n.getBasicBlock());
+        }
+        BasicBlock[] curBlocks = newBlocks.toArray(new BasicBlock[newBlocks.size()]);     
+        selection.put(curBlocks);
+    }
+    
+    private boolean selectionUpdating = false;
+    
+    //change of blockview selection   
+    public void stateChanged(ChangeEvent event) {      
+        if (selectionUpdating) {            
+            return;
+        }
+       
+        selectionUpdating = true;
+        
+        Object source = event.getSource();
+        if(source instanceof Selection){
+            Selection selection=(Selection) source;
+            Set<CfgNode> newSelection = new HashSet<CfgNode>();
+            BasicBlock[] newBlocks = selection.get(BasicBlock[].class);                  
+            if (newBlocks != null) {
+                for(BasicBlock b : newBlocks){
+                    for(CfgNode n : this.getNodes()){
+                        if(n.getBasicBlock() == b) newSelection.add(n);
+                    }
+                }
+                this.setSceneSelection(newSelection);                               
+            } 
+        }       
+        selectionUpdating = false;
+    }
+      
+    //centers the viewport on the currently selected nodewidgets
+    private void centerSelection(){         
+        Point sceneCenter = null;
+        Collection<CfgNode> nodes = this.selectedNodes;
+        if(nodes.size()==0) {
+            nodes = this.getNodes();
+        } 
+        
+        for(CfgNode n : nodes) {
+            if(sceneCenter==null) {
+                sceneCenter = this.findWidget(n).getLocation();
+                continue;
+            }
+            Point location = this.findWidget(n).getLocation();
+            sceneCenter.x = (location.x+sceneCenter.x)/2;
+            sceneCenter.y = (location.y+sceneCenter.y)/2;
+        }    
+        
+        JComponent view = this.getView ();
+        if (view != null) {
+            Rectangle viewBounds = view.getVisibleRect ();
+
+            Point viewCenter = this.convertSceneToView (sceneCenter);
+
+            view.scrollRectToVisible (new Rectangle (
+                viewCenter.x - viewBounds.width / 2,
+                viewCenter.y - viewBounds.height / 2,
+                viewBounds.width,
+                viewBounds.height
+            ));
+        }
+    }
+    
+    //animated scene Zoom to the max bounds of current viewport
+    public void zoomScene(){
+        JScrollPane pane = this.cfgtc.getJScrollPanel();
+      
+        Rectangle prefBounds = this.getPreferredBounds(); 
+        Dimension viewDim = pane.getViewportBorderBounds().getSize();
+        
+        double realwidth = (double)prefBounds.width*this.getZoomFactor();
+        double realheight = (double)prefBounds.height*this.getZoomFactor();        
+        
+        double zoomX = (double)viewDim.width / realwidth;
+        double zoomY = (double)viewDim.height / realheight;  
+        double zoomFactor = Math.min(zoomX, zoomY);     
+                
+        this.animateZoom(zoomFactor*0.9);         
+    }
+    
+    
+    //animated animateZoom function for scene animateZoom factor 
+    public void animateZoom(double zoomfactor) {
+        this.getSceneAnimator().animateZoomFactor(this.getZoomFactor() * zoomfactor);
+    }
+   
+    public void addCfgEventListener(CfgEventListener l) {
+        listenerList.add(CfgEventListener.class, l);
+    }
+
+    public void removeCfgEventListener(CfgEventListener l) {
+        listenerList.remove(CfgEventListener.class, l);
+    }
+       
+    public void fireSelectionChanged() {
+        Object[] listeners = listenerList.getListenerList();
+        for (int i = listeners.length-2; i>=0; i-=2) {
+            if (listeners[i]==CfgEventListener.class) {
+                ((CfgEventListener)listeners[i+1]).selectionChanged(this);
+            }
+        }
+    }
+       
+       
+    //Enables Antialiasing
+    @Override
+    public void paintChildren () {
+        Object anti = getGraphics ().getRenderingHint (RenderingHints.KEY_ANTIALIASING);
+        Object textAnti = getGraphics ().getRenderingHint (RenderingHints.KEY_TEXT_ANTIALIASING);
+
+        getGraphics ().setRenderingHint (
+                RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+        getGraphics ().setRenderingHint (
+                RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
+
+        super.paintChildren ();
+
+        getGraphics ().setRenderingHint (RenderingHints.KEY_ANTIALIASING, anti);
+        getGraphics ().setRenderingHint (RenderingHints.KEY_TEXT_ANTIALIASING, textAnti);
+    }
+    
+       
+     //select provider for node selection
+    private RectangularSelectProvider createRectangularSelectProvider() {
+            return new RectangularSelectProvider() {
+                public void performSelection(Rectangle rectangle) {
+                    HashSet<CfgNode> set=new HashSet<CfgNode>();
+
+                    //change to a rectangle with (x,offsetY) at the top left
+                    if(rectangle.width < 0){
+                        rectangle.x=rectangle.x+rectangle.width;
+                        rectangle.width*=-1;
+                    }
+                    if(rectangle.height < 0){
+                        rectangle.y=rectangle.y+rectangle.height;
+                        rectangle.height*=-1;
+                    }
+
+                    for(NodeWidget n: getNodeWidgets()) {
+                        Point p = n.getLocation();
+                        if (p != null && rectangle.contains(p)) {                     
+                            set.add(n.getNodeModel());
+                        }
+                    }        
+                    setNodeSelection(set);              
+                }
+            };    
+    }
+    
+    //select decorator for node selection
+    private RectangularSelectDecorator createSelectDecorator(final CfgScene scene){ 
+        return new RectangularSelectDecorator() {
+            public Widget createSelectionWidget() {
+                scene.cleanNodeSelection();//unselected all nodes
+                scene.revalidate();
+                return new SelectionWidget(getScene());
+            }
+        };
+    }
+    
+    
+    private MoveProvider createMoveProvider() {
+        return new MoveProvider(){
+            private HashMap<Widget, Point> originals = new HashMap<Widget, Point>();
+          
+            private Point original=null;
+               
+            public void movementStarted(Widget widget) {
+                originals.clear();              
+                NodeWidget nw = (NodeWidget) widget;    
+                if(selectedNodes.contains(nw.getNodeModel())) {//move current selection
+                    for(CfgNode n : selectedNodes){
+                        Widget w = findWidget(n);
+                        originals.put(w, w.getLocation());
+                    }
+                } else {//a newly-selected node will be moved               
+                    CfgNode n = nw.getNodeModel();     
+                    HashSet<CfgNode> selectedNode = new HashSet<CfgNode>(1);
+                    selectedNode.add(n);
+                    setNodeSelection(selectedNode);
+                    originals.put(widget, widget.getPreferredLocation());
+                    widget.revalidate();
+                    validate();
+                    
+                }               
+            }
+
+            public void movementFinished(Widget widget) {                                           
+                NodeWidget nw = (NodeWidget) widget;    
+                if(selectedNodes.contains(nw.getNodeModel())) {
+                    return;//to be able to move the current selection
+                }
+
+                HashSet<CfgNode> selectedNode = new HashSet<CfgNode>(1);
+                selectedNode.add(nw.getNodeModel());  
+                setNodeSelection(selectedNode);         
+                originals.clear ();
+                original = null;
+                
+            }
+
+            public Point getOriginalLocation(Widget widget) {           
+                if(original==null) 
+                    original = widget.getLocation();
+
+                return original;          
+            }
+            //todo : find a cache algorithm which only routes edges
+            //which are intersected by bounds of the moved rectangle
+            public void setNewLocation(Widget widget, Point location) {
+                Point org = getOriginalLocation(widget);
+                int dx = location.x - org.x;
+                int dy = location.y - org.y;
+                for (Map.Entry<Widget, Point> entry : originals.entrySet ()) {
+                    Point point = entry.getValue ();
+                    entry.getKey ().setPreferredLocation (new Point (point.x + dx, point.y + dy));
+                }  
+                for(CfgEdge e : getEdges()) {             
+                    EdgeWidget ew = (EdgeWidget) findWidget(e);
+                    if(ew.isVisible())
+                        ew.reroute();
+                }     
+            }
+        };
+    }
+       
+   
+    private WidgetAction createContextMenuAction(final CfgScene scene) {     
+        return ActionFactory.createPopupMenuAction(new PopupMenuProvider() {
+            public JPopupMenu getPopupMenu(Widget widget, Point point) {
+                JPopupMenu menu = new JPopupMenu(); 
+                NodeWidget nw = null;
+                if(widget instanceof NodeWidget) {
+                    nw = (NodeWidget) widget;
+                    if(!selectedNodes.contains(nw.getNodeModel())){
+                        HashSet<CfgNode> selectedNode = new HashSet<CfgNode>(1);
+                        selectedNode.add(nw.getNodeModel());
+                        setNodeSelection(selectedNode);
+                    }
+                } else if  (scene.getSelectedNodes().size() == 1) {
+                    nw = (NodeWidget) scene.findWidget(scene.getSelectedNodes().iterator().next());
+                }
+                
+                if(nw != null){
+                    CfgNode node = nw.getNodeModel();                    
+                    ArrayList<CfgNode> successors = new ArrayList<CfgNode>();
+                    ArrayList<CfgNode> predecessors = new ArrayList<CfgNode>();
+                    for(CfgEdge e : node.getOutputEdges()){
+                        successors.add(e.getTargetNode());
+                    }
+                    for(CfgEdge e : node.getInputEdges()){
+                        predecessors.add(e.getSourceNode());
+                    }
+                    
+                    if(predecessors.size()>0){
+                        Collections.sort(predecessors, new NodeNameComparator());
+                        JMenu predmenu = new JMenu("Go to predecessor");
+                        for (CfgNode n : predecessors) {                     
+                            GotoNodeAction action = new GotoNodeAction(n); 
+                            predmenu.add(action);
+                        }
+                       menu.add(predmenu);   
+                    }
+                    if(successors.size()>0){
+                        Collections.sort(successors, new NodeNameComparator());
+                        JMenu succmenu = new JMenu("Go to successor");                
+                        for (CfgNode n : successors) {                     
+                            GotoNodeAction action = new GotoNodeAction(n); 
+                            succmenu.add(action);
+                        }
+                        menu.add(succmenu);                     
+                    } 
+                    if ( successors.size() > 0 || predecessors.size() > 0)
+                        menu.addSeparator();    
+                }        
+                
+                menu.add(SystemAction.get(ShowEdgesAction.class));
+                menu.add(SystemAction.get(HideEdgesAction.class));
+                menu.addSeparator();
+                menu.add(SystemAction.get(ColorAction.class).getPopupPresenter()); 
+                return menu;
+            }
+        });
+    }
+      
+    private class NodeNameComparator implements Comparator<CfgNode> {
+        public int compare(CfgNode node1, CfgNode node2) {                
+            String name1 = node1.getBasicBlock().getName().substring(1);
+            String name2 = node2.getBasicBlock().getName().substring(1);
+            Integer blocknum1 = Integer.parseInt(name1);
+            Integer blocknum2 = Integer.parseInt(name2);
+            return blocknum1.compareTo(blocknum2);                                             
+        }
+    }
+    
+    private class GotoNodeAction extends AbstractAction {   
+        CfgNode node ;      
+        
+        GotoNodeAction(CfgNode node){
+            super(node.getBasicBlock().getName());          
+            this.node = node;           
+        }
+        public void actionPerformed(ActionEvent e) {            
+              Set<CfgNode> nodes = new HashSet<CfgNode>(1);
+              nodes.add(node);
+              setNodeSelection(nodes);
+              centerSelection();    
+        }      
+    }
+    
+    private SceneListener createSceneListener(final CfgScene scene){
+        return new SceneListener() {
+            
+            public void sceneRepaint() {              
+            }
+
+            public void sceneValidating() {              
+            }
+ 
+            public void sceneValidated() {
+                if (scene.isLoopClusterVisible()){ //update only if visible
+                    for(LoopClusterWidget cw : getLoopidx2clusterwidget().values()){
+                        cw.updateClusterBounds();     
+                    }
+                }
+                for(EdgeSwitchWidget esw : inputSwitches.values()){
+                    esw.updatePosition();
+                }
+
+                for(EdgeSwitchWidget esw : outputSwitches.values()){
+                    esw.updatePosition();
+                } 
+           }
+        };
+    } 
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/.svn/text-base/EdgeSwitchWidget.java.svn-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,291 @@
+package at.ssw.visualizer.cfg.graph;
+
+import at.ssw.visualizer.cfg.model.CfgEdge;
+import at.ssw.visualizer.cfg.model.CfgNode;
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.Point;
+import java.awt.Polygon;
+import java.awt.Rectangle;
+import java.awt.geom.AffineTransform;
+import java.util.ArrayList;
+import java.util.Collection;
+import org.netbeans.api.visual.action.ActionFactory;
+import org.netbeans.api.visual.action.SelectProvider;
+import org.netbeans.api.visual.action.TwoStateHoverProvider;
+import org.netbeans.api.visual.action.WidgetAction;
+import org.netbeans.api.visual.model.ObjectState;
+import org.netbeans.api.visual.widget.Widget;
+
+
+public class EdgeSwitchWidget extends Widget {
+    private final static Color color_enabled = Color.gray;
+    private final static Color color_hover = Color.lightGray; 
+    private float width=1;
+    private float height=1;
+    private CfgScene scene;
+    private NodeWidget nodeWidget;    
+    private boolean output;
+    private WidgetAction hoverAction;
+    private static final String TT_HIDE_EDGES = "Hide Edges";
+    private static final String TT_SHOW_EDGES = "Show Edges";   
+    private static SelectProvider selectProvider = createSelectProvider();
+     
+    
+    public EdgeSwitchWidget(final CfgScene scene, NodeWidget nodeWidget, boolean output) {        
+        super(scene);
+        this.scene = scene;   
+        this.output = output;
+        this.nodeWidget = nodeWidget;  
+  
+        this.getActions().addAction(ActionFactory.createSelectAction(selectProvider));
+        TwoStateHoverProvider ts = new TsHover(this);   
+        WidgetAction wa = ActionFactory.createHoverAction(ts);
+        this.hoverAction = wa;
+        this.getActions().addAction(wa);
+        scene.getActions().addAction(wa);
+        this.setToolTipText(TT_HIDE_EDGES);      
+        this.setForeground(color_enabled);
+        this.setState(ObjectState.createNormal());
+    }
+    
+    
+    @Override
+    protected Rectangle calculateClientArea() {
+       if (this.nodeWidget.getBounds() == null) return new Rectangle(0, 0, 1, 1);
+       int hw = (int) (this.width / 2);
+       int hh = (int) (this.height /2);
+       
+       return new Rectangle(-hw, -hh, 2*hw, 2*hh); 
+   }    
+     
+   
+    public void updatePosition() { 
+        if (this.nodeWidget.getBounds() != null) {   
+            this.width = nodeWidget.getBounds().width*9;
+            this.width /=10;
+            this.height = nodeWidget.getBounds().height/4;      
+            int offset=(int)(2 * (height / 3));
+                        
+            Rectangle bounds = nodeWidget.getBounds();
+            Point location = nodeWidget.getLocation();
+          
+            Point newLoc = new Point();           
+            newLoc.x = location.x;
+             
+            if(output) {               
+                newLoc.y = +location.y + bounds.height/2+offset;      
+            }else {            
+                newLoc.y = location.y - bounds.height/2-offset;
+            }          
+            this.setPreferredLocation(newLoc);           
+        }           
+    }
+ 
+    private Collection<CfgEdge> getEdges(){
+        Collection<CfgEdge> edges;
+        CfgNode node = nodeWidget.getNodeModel();
+        if (output) {
+            edges = scene.findNodeEdges(node, true, false);
+        } else {
+            edges = scene.findNodeEdges(node, false, true);
+        }
+        return edges;
+    }
+ 
+    //change visibility for all Edges
+    public void changeEdgeVisibility(boolean visible){
+        Collection<CfgEdge> edges = this.getEdges();  
+            
+        for(CfgEdge e: edges) {
+            EdgeWidget ew = (EdgeWidget) scene.findWidget(e);
+            if(visible != ew.isEdgeVisible()){              
+                ew.setEdgeVisible(visible);     
+                if(output){
+                    scene.getInputSwitch(e.getTargetNode()).updateStatus();
+                } else {
+                    scene.getOutputSwitch(e.getSourceNode()).updateStatus();
+                }              
+            }
+        }
+        if(visible)    
+            this.setToolTipText(TT_HIDE_EDGES); 
+        else 
+            this.setToolTipText(TT_SHOW_EDGES);
+   
+        this.setForeground(color_enabled);
+        this.bringToBack();
+        ObjectState os = this.getState();   
+        this.setState(os.deriveSelected(!visible));
+    }
+    
+    /**
+     *  Update the status of the switch to the current state of the edges
+     *  usually needed when the opposit switch changes the state
+     */
+    private void updateStatus(){
+        Collection<CfgEdge> edges = this.getEdges(); 
+        boolean hiddenFound=false;
+        for(CfgEdge e: edges) {
+            EdgeWidget ew = (EdgeWidget) scene.findWidget(e);
+            if(!ew.isVisible()) {
+                hiddenFound=true;
+                break;
+            }
+        }        
+        ObjectState os = this.getState();
+        if(os.isSelected() && !hiddenFound) {
+            this.setState(os.deriveSelected(false));
+            setToolTipText(TT_HIDE_EDGES);
+        } else if (!os.isSelected() && hiddenFound) {
+            this.setState(os.deriveSelected(true));
+            setToolTipText(TT_SHOW_EDGES); 
+        }
+        this.revalidate();
+    }
+    
+
+    public void startPreview() {        
+        ObjectState os = this.getState();
+        
+        for(CfgEdge e : getEdges()) {
+            EdgeWidget ew = (EdgeWidget) scene.findWidget(e);
+            if(!os.isSelected() || !ew.isVisible()){             
+                ObjectState edgeState = ew.getState();              
+                ew.setState(edgeState.deriveHighlighted(true));
+            }
+        }               
+    }
+    
+    public void endPreview(){       
+       for(CfgEdge e : getEdges()) {
+            EdgeWidget ew = (EdgeWidget) scene.findWidget(e);
+            ObjectState os = ew.getState();          
+            ew.setState(os.deriveHighlighted(false));
+        }      
+    }
+  
+    /**
+     * shows or hides the edges of the switch
+     */
+    public void switchEdges() { 
+        endPreview();
+        ObjectState os = this.getState();
+        Collection<CfgEdge> edges = this.getEdges(); 
+        ArrayList<CfgEdge> updates = new ArrayList<CfgEdge>();
+        boolean visible=os.isSelected();
+        this.setState(os.deriveSelected(!visible));     
+        for(CfgEdge e: edges) {
+            EdgeWidget ew = (EdgeWidget) scene.findWidget(e);
+                if(ew.isEdgeVisible() != visible){
+                    updates.add(e);
+                    ew.setEdgeVisible(visible);
+                    if(output){
+                        scene.getInputSwitch(e.getTargetNode()).updateStatus();
+                    } else {
+                        scene.getOutputSwitch(e.getSourceNode()).updateStatus();
+                    }      
+                }
+        }
+        if(visible)
+             this.setToolTipText(TT_HIDE_EDGES);    
+        else
+             this.setToolTipText(TT_SHOW_EDGES);    
+               
+        scene.fireSelectionChanged();//updates Edge visibility for context action        
+        revalidate();   
+    }
+  
+  
+
+ 
+    private class TsHover implements TwoStateHoverProvider {       
+        EdgeSwitchWidget tw;    
+       
+        TsHover(EdgeSwitchWidget tw) {
+            this.tw = tw;
+        }
+       
+        public void unsetHovering(Widget w) {
+            w.setForeground(color_enabled);  
+            ObjectState state = w.getState();          
+            w.setState(state.deriveWidgetHovered(false));           
+            w.bringToBack();
+            endPreview();
+        }
+
+        public void setHovering(Widget w) {        
+            ObjectState state = w.getState();          
+            w.setState(state.deriveWidgetHovered(true));          
+            w.setForeground(color_hover);
+            w.bringToFront();
+            nodeWidget.bringToFront();                
+            startPreview();
+        }
+    }
+    
+    @Override
+    public void paintWidget() {   
+        ObjectState os = this.getState();       
+        if(!os.isHovered() && !os.isSelected()) return; //all previewEdges visible and not hovering, 
+                                                        //no need to paint the switch         
+        float hw = width/2;    
+        Polygon pol = new Polygon();
+        pol.addPoint(0,(int) -height/2); 
+        pol.addPoint((int)hw,(int) height/2);
+        pol.addPoint((int)-hw,(int) height/2);  
+        Graphics2D gr = getGraphics();
+        gr.setColor(this.getForeground());
+        BasicStroke bs = new BasicStroke(2.0f, BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND);
+        gr.setStroke(bs);
+        AffineTransform previousTransform;
+        previousTransform = gr.getTransform ();
+        if(output) {
+            if(os.isSelected() ){//hidden
+                 gr.scale(1.0, -1.0);
+            }
+        } else { //input switch
+            if(os.isHovered() && !os.isSelected()){
+                 gr.scale(1.0, -1.0);
+            }     
+        }            
+        gr.fillPolygon(pol);
+        gr.setTransform(previousTransform);
+        
+    }
+    
+   
+    
+    //the constructor adds the hover WidgetAction to the scene
+    //the action is removed from the scene when the object gets destroyed
+    @Override
+    protected void finalize() throws Throwable { 
+        this.getScene().getActions().removeAction(hoverAction);
+        this.getActions().removeAction(hoverAction);
+    }
+    
+    @Override
+    public String toString(){
+        return "EDGESWITCH("+this.nodeWidget.getNodeModel().toString()+")";
+    }
+    
+    private static SelectProvider createSelectProvider() {
+        return new SelectProvider(){
+            public boolean isAimingAllowed(Widget arg0, Point arg1, boolean arg2) {
+                return false;
+            }
+            
+            public boolean isSelectionAllowed(Widget arg0, Point arg1, boolean arg2) {
+                return true;
+            }
+            
+            public void select(Widget w, Point arg1, boolean arg2) {              
+                if(w instanceof EdgeSwitchWidget){
+                    EdgeSwitchWidget tw = (EdgeSwitchWidget) w;                    
+                    tw.switchEdges();
+                }                                    
+            }
+        };
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/.svn/text-base/EdgeWidget.java.svn-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,97 @@
+package at.ssw.visualizer.cfg.graph;
+
+import at.ssw.visualizer.cfg.model.CfgEdge;
+import at.ssw.visualizer.cfg.preferences.CfgPreferences;
+import at.ssw.visualizer.cfg.visual.BezierWidget;
+import at.ssw.visualizer.cfg.visual.SplineConnectionWidget;
+import org.netbeans.api.visual.anchor.AnchorShapeFactory;
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Stroke;
+import org.netbeans.api.visual.anchor.AnchorShape;
+import org.netbeans.api.visual.model.ObjectState;
+
+//public class EdgeWidget extends BezierWidget {
+public class EdgeWidget extends SplineConnectionWidget {
+    
+    private boolean visible=true;//to store the visible state when entering the preview 
+    protected static final Stroke selectedStroke = new BasicStroke(3.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);
+    protected static final Stroke defaultStroke = new BasicStroke(1.5f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);
+    protected static final Stroke previewStroke = new BasicStroke(
+            0.5f,                      // Width
+            BasicStroke.CAP_SQUARE,    // End cap
+            BasicStroke.JOIN_MITER,    // Join style
+            10.0f,                     // Miter limit
+            new float[] {5.0f, 5.0f},  // Dash pattern
+            0.0f);              
+    
+    
+    
+    public EdgeWidget(CfgScene scene, CfgEdge edge) {
+        super(scene);       
+        Color lineColor;
+        CfgPreferences prefs = CfgPreferences.getInstance();
+        
+        if(edge.isBackEdge()) 
+            lineColor = prefs.getBackedgeColor();       
+        else if (edge.isXhandler())
+            lineColor = prefs.getExceptionEdgeColor();
+        else    
+            lineColor = prefs.getEdgeColor();
+        
+        setLineColor(lineColor);
+        AnchorShape as;
+        if(edge.isReflexive())//small Arrow
+            as = AnchorShapeFactory.createTriangleAnchorShape(6, true, false, 5);
+        else
+            as =AnchorShapeFactory.createTriangleAnchorShape(10, true, false, 9);
+    
+        setTargetAnchorShape(as);  
+        setToolTipText(edge.toString());              
+    }
+ 
+    public CfgEdge getEdgeModel() {
+        CfgScene scene = (CfgScene) this.getScene();
+        return (CfgEdge) scene.findObject(this);
+    }
+    
+    public void setEdgeVisible(boolean visible) {
+        this.visible=visible;
+        this.setVisible(visible);
+        this.reroute();
+        this.revalidate();
+    }
+    
+    
+    public boolean isEdgeVisible(){
+        return visible;
+    }
+    
+        
+    @Override
+    public void notifyStateChanged(ObjectState oldState, ObjectState newState) {
+       setForeground (getLineColor());
+      
+       if(newState.isHighlighted() && !oldState.isHighlighted()){
+            this.setStroke(previewStroke);
+            this.setVisible(true);
+       } else {
+           if(newState.isSelected()){
+                this.setStroke(selectedStroke);
+           } else {
+                this.setStroke(defaultStroke);
+           }
+           if(this.isEdgeVisible()){
+                this.setVisible(true);
+           } else {
+                this.setVisible(false);
+           }
+       }       
+    }
+    
+    
+    @Override
+    public String toString(){
+        return "EdgeWidget[" + getEdgeModel().toString() + "]";
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/.svn/text-base/LoopClusterWidget.java.netbeans-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,107 @@
+package at.ssw.visualizer.cfg.graph;
+
+import at.ssw.visualizer.cfg.model.LoopInfo;
+import java.awt.Color;
+import java.awt.Rectangle;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+import org.netbeans.api.visual.action.ActionFactory;
+import org.netbeans.api.visual.action.EditProvider;
+import org.netbeans.api.visual.border.BorderFactory;
+import org.netbeans.api.visual.widget.Widget;
+
+public class LoopClusterWidget extends Widget implements Comparable<LoopClusterWidget> {
+    private static final int INSET = 10;//min space between node members and cluster border
+    private static final int DASHSIZE = 10;  
+    private Color color = Color.BLUE;
+    private int loopIndex;
+    private int loopDepth; 
+    private CfgScene cfgscene;
+    private ArrayList<NodeWidget> members = new ArrayList<NodeWidget>();
+  
+    public LoopClusterWidget(CfgScene scene,  int loopdepth, final int loopindex) {
+        super(scene);
+        this.cfgscene = scene;
+        this.loopIndex = loopindex;
+        this.loopDepth = loopdepth;          
+        this.setBorder(BorderFactory.createDashedBorder(color, DASHSIZE, DASHSIZE/2, true));          
+        this.getActions().addAction(ActionFactory.createEditAction( new EditProvider() { //double click action
+            public void edit(Widget w) {
+                if(w instanceof LoopClusterWidget){                 
+                    for(LoopInfo info : cfgscene.getCfgEnv().getLoopMap().values()){
+                        if(info.getLoopIndex() == loopindex){              
+                            cfgscene.setNodeSelection(info.getMembers());                         
+                            break;
+                        }
+                    }   
+                }
+            }
+        }));
+               
+    }
+
+    public List<NodeWidget> getMembers() {
+        return members;
+    }
+
+    public int getLoopIndex() {
+        return loopIndex;
+    }
+    
+    public void addMember(NodeWidget nw) {
+        assert(!this.members.contains(nw));        
+        members.add(nw);       
+    }
+
+    public boolean removeMember(NodeWidget nw) {
+        if(this.members.contains(nw)){
+            members.remove(nw);       
+            return true;
+        }
+        return false;
+    }
+  
+    public void setrandomColor(){
+        if(this.loopDepth == 0 ) return; 
+        Random rand = new Random();
+        Color randColor = Color.getHSBColor(rand.nextFloat()%360,0.1f,1.0f);      
+        this.setBackground(randColor);
+    }
+    
+    //updates the bounds of the widget,
+    //and revalidates the widget if a membernode changed the scene position
+    public void updateClusterBounds(){      
+        Rectangle boundRect=null;
+        
+        for(NodeWidget nw : this.members){
+            if(boundRect==null){
+                boundRect = nw.convertLocalToScene(nw.getBounds());  
+            } else {
+                boundRect = boundRect.union(nw.convertLocalToScene(nw.getBounds()));
+            }  
+        }
+        if(boundRect==null) return;
+        for(Widget w : this.getChildren()) {
+            if(w instanceof LoopClusterWidget) {            
+                LoopClusterWidget lc = (LoopClusterWidget)w;
+                lc.updateClusterBounds();
+                boundRect = boundRect.union(w.convertLocalToScene(w.getBounds()));
+            }
+        }
+       
+        boundRect.grow(INSET, INSET);
+        this.setPreferredBounds(boundRect);               
+    }
+    
+    
+    public int compareTo(LoopClusterWidget o) {
+        return new Integer(this.loopDepth).compareTo(o.loopDepth);
+    }
+    
+    
+    @Override
+    public String toString(){
+        return "LoopCluster: [DEPTH "+this.loopDepth+ "] [INDEX "+this.loopIndex+"]";
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/.svn/text-base/LoopClusterWidget.java.svn-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,107 @@
+package at.ssw.visualizer.cfg.graph;
+
+import at.ssw.visualizer.cfg.model.LoopInfo;
+import java.awt.Color;
+import java.awt.Rectangle;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+import org.netbeans.api.visual.action.ActionFactory;
+import org.netbeans.api.visual.action.EditProvider;
+import org.netbeans.api.visual.border.BorderFactory;
+import org.netbeans.api.visual.widget.Widget;
+
+public class LoopClusterWidget extends Widget implements Comparable<LoopClusterWidget> {
+    private static final int INSET = 10;//min space between node members and cluster border
+    private static final int DASHSIZE = 10;  
+    private Color color = Color.BLUE;
+    private int loopIndex;
+    private int loopDepth; 
+    private CfgScene cfgscene;
+    private ArrayList<NodeWidget> members = new ArrayList<NodeWidget>();
+  
+    public LoopClusterWidget(CfgScene scene,  int loopdepth, final int loopindex) {
+        super(scene);
+        this.cfgscene = scene;
+        this.loopIndex = loopindex;
+        this.loopDepth = loopdepth;          
+        this.setBorder(BorderFactory.createDashedBorder(color, DASHSIZE, DASHSIZE/2, true));          
+        this.getActions().addAction(ActionFactory.createEditAction( new EditProvider() { //double click action
+            public void edit(Widget w) {
+                if(w instanceof LoopClusterWidget){                 
+                    for(LoopInfo info : cfgscene.getCfgEnv().getLoopMap().values()){
+                        if(info.getLoopIndex() == loopindex){              
+                            cfgscene.setNodeSelection(info.getMembers());                         
+                            break;
+                        }
+                    }   
+                }
+            }
+        }));
+               
+    }
+
+    public List<NodeWidget> getMembers() {
+        return members;
+    }
+
+    public int getLoopIndex() {
+        return loopIndex;
+    }
+    
+    public void addMember(NodeWidget nw) {
+        assert(!this.members.contains(nw));        
+        members.add(nw);       
+    }
+
+    public boolean removeMember(NodeWidget nw) {
+        if(this.members.contains(nw)){
+            members.remove(nw);       
+            return true;
+        }
+        return false;
+    }
+  
+    public void setrandomColor(){
+        if(this.loopDepth == 0 ) return; 
+        Random rand = new Random();
+        Color randColor = Color.getHSBColor(rand.nextFloat()%360,0.1f,1.0f);      
+        this.setBackground(randColor);
+    }
+    
+    //updates the bounds of the widget,
+    //and revalidates the widget if a membernode changed the scene position
+    public void updateClusterBounds(){      
+        Rectangle boundRect=null;
+        
+        for(NodeWidget nw : this.members){
+            if(boundRect==null){
+                boundRect = nw.convertLocalToScene(nw.getBounds());  
+            } else {
+                boundRect = boundRect.union(nw.convertLocalToScene(nw.getBounds()));
+            }  
+        }
+        if(boundRect==null) return;
+        for(Widget w : this.getChildren()) {
+            if(w instanceof LoopClusterWidget) {            
+                LoopClusterWidget lc = (LoopClusterWidget)w;
+                lc.updateClusterBounds();
+                boundRect = boundRect.union(w.convertLocalToScene(w.getBounds()));
+            }
+        }
+       
+        boundRect.grow(INSET, INSET);
+        this.setPreferredBounds(boundRect);               
+    }
+    
+    
+    public int compareTo(LoopClusterWidget o) {
+        return new Integer(this.loopDepth).compareTo(o.loopDepth);
+    }
+    
+    
+    @Override
+    public String toString(){
+        return "LoopCluster: [DEPTH "+this.loopDepth+ "] [INDEX "+this.loopIndex+"]";
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/.svn/text-base/NodeWidget.java.svn-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,155 @@
+package at.ssw.visualizer.cfg.graph;
+
+import at.ssw.visualizer.cfg.model.CfgNode;
+import at.ssw.visualizer.cfg.preferences.CfgPreferences;
+import java.awt.AlphaComposite;
+import java.awt.Color;
+import java.awt.Composite;
+import java.awt.Font;
+import java.awt.Graphics2D;
+import java.awt.Insets;
+import java.awt.Rectangle;
+import java.awt.font.FontRenderContext;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Rectangle2D;
+import java.awt.geom.RoundRectangle2D;
+import org.netbeans.api.visual.border.BorderFactory;
+import org.netbeans.api.visual.model.ObjectState;
+import org.netbeans.api.visual.widget.Widget;
+
+
+public class NodeWidget extends Widget  {    
+    
+    
+    //basic block node dimension
+    private final int halfheight=12;
+    private final int halfwidth=17;
+      
+    private final int height=halfheight*2+1;  
+    private final int width=halfwidth*2+1;     
+    private final int arcHeight=(halfheight/4)*3;
+    private final int arcWidth = arcHeight; 
+    private final int FONT_MAXSIZE=18;
+    
+    private int borderWidth;
+    private boolean selected=false; 
+    private boolean nodeColorCustomized;
+    private String text;
+    private Rectangle2D fontRect;
+    private Color nodeColor;
+    
+    protected static final Color HOVER_BACKGROUND = new Color(0xEEEEEE);
+    protected static final Color HOVER_FOREGROUND = new Color(0xCDCDCD);
+
+    public NodeWidget(CfgScene scene, CfgNode nodeModel ){        
+        super(scene);   
+        this.setToolTipText("<html>" + nodeModel.getDescription().replaceAll("\n", "<br>") + "</html>");
+        this.selected=false;        
+        this.text = nodeModel.getBasicBlock().getName();   
+        this.borderWidth = nodeModel.getLoopDepth()+1;           
+        this.setBorder(BorderFactory.createRoundedBorder(arcWidth+borderWidth, arcHeight+borderWidth, borderWidth, borderWidth, Color.BLACK, Color.BLACK));
+        CfgPreferences prefs = CfgPreferences.getInstance();
+        Color color = prefs.getFlagsSetting().getColor(nodeModel.getBasicBlock().getFlags());
+        this.nodeColorCustomized = (color!=null);
+        this.nodeColor = (nodeColorCustomized) ? color : prefs.getNodeColor();
+        this.adjustFont(null);   
+    }
+
+    public void setBorderColor(Color color){ 
+        this.setBorder(BorderFactory.createRoundedBorder(arcWidth+borderWidth, arcHeight+borderWidth, borderWidth, borderWidth, color, color));
+    }
+    
+    public boolean isNodeColorCustomized() {    
+        return nodeColorCustomized;        
+    }
+    
+    //sets a customColor node color
+    public void setNodeColor(Color color, boolean customColor) {
+        this.nodeColorCustomized=customColor;
+        this.nodeColor=color;
+        this.revalidate();
+    }
+    
+    public Color getNodeColor() {
+        return this.nodeColor;
+    }
+    
+    public CfgNode getNodeModel() {
+        CfgScene scene = (CfgScene) this.getScene();
+        return (CfgNode) scene.findObject(this);    
+    }
+      
+   
+    @Override
+    public void notifyStateChanged(ObjectState oldState, ObjectState newState) {
+        if(!oldState.equals(newState))
+            this.revalidate();
+        if(!oldState.isSelected() && newState.isSelected())
+            this.bringToFront();
+    }
+       
+    @Override
+    protected Rectangle calculateClientArea() {       
+        return new Rectangle(-(halfwidth+1), -(1+halfheight), width+1, height+1);//add border
+    }
+
+    public void adjustFont(Font font){
+        if(font==null)
+            font = CfgPreferences.getInstance().getTextFont();
+        if(font.getSize()>FONT_MAXSIZE){
+            font = new Font(font.getFamily(), font.getStyle(), FONT_MAXSIZE);
+        }
+        int size=font.getSize();
+        int fontStyle = font.getStyle();
+        String fontName = font.getFamily();
+        FontRenderContext frc = new FontRenderContext(new AffineTransform(), false, false);
+        Rectangle2D bounds = font.getStringBounds(text, frc);
+        while(size > 1 && bounds.getWidth() > width) {
+            font = new Font(fontName, fontStyle, --size);
+            bounds = font.getStringBounds(text, frc);
+        }       
+        this.fontRect=bounds;
+        this.setFont(font);
+    }
+
+    @Override
+    protected void paintWidget() {     
+        Graphics2D gr = getGraphics(); 
+        gr.setColor(nodeColor); 
+        Insets borderInsets  = this.getBorder().getInsets();    
+        RoundRectangle2D.Float innerRect = new RoundRectangle2D.Float(-(halfwidth+1), -(halfheight+1), width+1, height+1,arcWidth-1, arcHeight-1);    
+        gr.fill(innerRect);
+        gr.setColor(getForeground()); 
+        gr.setFont(getFont());
+        float textX  = (float)( - fontRect.getCenterX());
+        float textY  = (float)( - fontRect.getCenterY());                   
+        gr.drawString(text, textX, textY); 
+            
+        RoundRectangle2D.Float outerRect = new RoundRectangle2D.Float(-(halfwidth+borderInsets.left + 1), -(halfheight+borderInsets.top + 1), 
+            width+borderInsets.left + borderInsets.right + 1, height + borderInsets.top + borderInsets.bottom + 1, 
+            arcWidth + borderWidth, arcHeight + borderWidth); 
+
+        ObjectState os =this.getState();
+        if(os.isSelected()){
+            Composite composite = gr.getComposite();
+            gr.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP, 0.5f));                     
+            gr.setColor(CfgPreferences.getInstance().getSelectionColorForeground());
+            gr.fill(outerRect);
+            gr.setColor(CfgPreferences.getInstance().getSelectionColorBackground());            
+            gr.setComposite(composite);       
+        }  
+        if(os.isHovered()){
+            Composite composite = gr.getComposite();
+            gr.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP, 0.5f));
+            gr.setColor(HOVER_FOREGROUND);
+            gr.fill(outerRect); 
+            gr.setColor(HOVER_BACKGROUND);
+            gr.setComposite(composite);        
+        }       
+    }  
+    
+    @Override
+    public String toString() {
+        return "NodeWidget[" + getNodeModel().getBasicBlock().getName() + "]";
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/.svn/text-base/SelectionWidget.java.netbeans-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,39 @@
+package at.ssw.visualizer.cfg.graph;
+
+import at.ssw.visualizer.cfg.preferences.CfgPreferences;
+import java.awt.AlphaComposite;
+import java.awt.Composite;
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import org.netbeans.api.visual.widget.Scene;
+import org.netbeans.api.visual.widget.Widget;
+
+
+public class SelectionWidget extends Widget {
+    public SelectionWidget(Scene scene) {
+        super(scene);
+    }
+    
+    public static void renderSelectedRect(Graphics2D gr, Rectangle rect) {
+        if (rect == null) {
+            return;
+        }
+        gr.setColor(CfgPreferences.getInstance().getSelectionColorBackground());
+        gr.fillRect(rect.x, rect.y, rect.width, rect.height);
+        gr.setColor(CfgPreferences.getInstance().getSelectionColorForeground());
+    }
+
+    public void renderSelectionRectangle(Graphics2D gr, Rectangle selectionRectangle) {
+        Composite composite = gr.getComposite();
+        gr.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP, 0.5f));
+       
+        renderSelectedRect(gr, selectionRectangle);
+        gr.setComposite(composite);
+    }
+    
+    @Override
+    public void paintWidget(){       
+        this.renderSelectionRectangle(this.getGraphics(), this.getBounds());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/.svn/text-base/SelectionWidget.java.svn-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,39 @@
+package at.ssw.visualizer.cfg.graph;
+
+import at.ssw.visualizer.cfg.preferences.CfgPreferences;
+import java.awt.AlphaComposite;
+import java.awt.Composite;
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import org.netbeans.api.visual.widget.Scene;
+import org.netbeans.api.visual.widget.Widget;
+
+
+public class SelectionWidget extends Widget {
+    public SelectionWidget(Scene scene) {
+        super(scene);
+    }
+    
+    public static void renderSelectedRect(Graphics2D gr, Rectangle rect) {
+        if (rect == null) {
+            return;
+        }
+        gr.setColor(CfgPreferences.getInstance().getSelectionColorBackground());
+        gr.fillRect(rect.x, rect.y, rect.width, rect.height);
+        gr.setColor(CfgPreferences.getInstance().getSelectionColorForeground());
+    }
+
+    public void renderSelectionRectangle(Graphics2D gr, Rectangle selectionRectangle) {
+        Composite composite = gr.getComposite();
+        gr.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP, 0.5f));
+       
+        renderSelectedRect(gr, selectionRectangle);
+        gr.setComposite(composite);
+    }
+    
+    @Override
+    public void paintWidget(){       
+        this.renderSelectionRectangle(this.getGraphics(), this.getBounds());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/.svn/text-base/SymmetricAnchor.java.svn-base	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,157 @@
+package at.ssw.visualizer.cfg.graph;
+
+import org.netbeans.api.visual.widget.Widget;
+import org.netbeans.api.visual.anchor.Anchor;
+import java.awt.*;
+
+
+/**
+ * This Anchor can be used with symmetric edges to create parallel Edges.
+ * Two Directed Edges are symmetric if they are connecting the same Nodes in different directions.
+ * e.g.  Nodes (1, 2) Edges(a , b)  with (1)-a->(2)  ,  (2)-b->(1)  
+ * Start-/End positions are calculated with a fixed offset to prevent edges from overlapping. 
+ * If the edges are drawn as straight lines they will appear as parallel edges.
+ */
+
+public final class SymmetricAnchor extends Anchor {
+    
+   private final static int OFFSET = 10;
+   private boolean includeBorders;  
+   private int offx;
+   private int offy;
+   
+   public SymmetricAnchor (Widget widget, boolean includeBorders, boolean source) {
+        super (widget);
+        this.includeBorders = includeBorders;        
+        if (source) {
+            offx = OFFSET;
+            offy = OFFSET;        
+        }
+        else {
+            offx = -OFFSET;
+            offy = -OFFSET;
+        }
+    }
+
+    public Result compute (Entry entry) {        
+        Point relatedLocation = //center of the widget 
+                getRelatedSceneLocation ();
+        Point oppositeLocation = //center of the widget
+                getOppositeSceneLocation (entry);
+
+        Widget widget = getRelatedWidget ();
+        Rectangle bounds = widget.getBounds ();
+        if (! includeBorders) {
+            Insets insets = widget.getBorder ().getInsets ();
+            bounds.x += insets.left;
+            bounds.y += insets.top;
+            bounds.width -= insets.left + insets.right;
+            bounds.height -= insets.top + insets.bottom;
+        }
+      
+        bounds = widget.convertLocalToScene (bounds);
+       
+        if (bounds.isEmpty ()  || relatedLocation.equals (oppositeLocation))
+            return new Anchor.Result (relatedLocation, Anchor.DIRECTION_ANY);
+
+        float dx  //distance  x-axis
+                = oppositeLocation.x - relatedLocation.x;
+        float dy  //distance y-axis  
+                = oppositeLocation.y - relatedLocation.y;
+       
+        
+        float ddx 
+                = Math.abs (dx) / (float) bounds.width;
+        float ddy = 
+                Math.abs (dy) / (float) bounds.height;
+
+        Anchor.Direction direction;
+      
+
+        if (ddx >= ddy) {
+            if(dx >= 0.0f){        
+                direction = Direction.RIGHT;
+                relatedLocation.y -= offy;
+            } else {
+                direction = Direction.LEFT;
+                relatedLocation.y += offy;
+            }         
+        } else {
+            if(dy >= 0.0f){
+                direction = Direction.BOTTOM;
+                relatedLocation.x += offx;
+            } else {
+                direction = Direction.TOP;
+                relatedLocation.x -= offx;            
+            }           
+        }
+        
+
+        float scale = 0.5f / Math.max (ddx, ddy);
+
+        float ex = scale * dx;
+        float ey = scale * dy;
+        
+        Point point = new Point (Math.round (relatedLocation.x + ex), Math.round (relatedLocation.y + ey));
+            
+         if(direction == Direction.RIGHT) {
+             int top = bounds.y;//-bounds.height;// left y of the widget
+             int bottom = bounds.y + bounds.height;// right y of the widget
+             if(point.y < top) {//above the widget
+                 int cor = top-point.y;
+                 point.x -= cor;
+                 point.y += cor;              
+             } else if ( point.y > bottom) {
+                 int cor = point.y-bottom;
+                 point.x -= cor;
+                 point.y -= cor;
+             }
+             
+         } else if (direction == Direction.LEFT) {
+             int top = bounds.y;//-bounds.height;// left y of the widget
+             int bottom = bounds.y + bounds.height;// right y of the widget
+                         
+           
+                        
+             if(point.y < top) {//above the widget
+                 int cor = top-point.y;
+                 point.x += cor;
+                 point.y += cor;
+             } else if ( point.y > bottom) {              
+                int cor = bottom-point.y;
+                point.x -= cor;
+                point.y += cor;
+             }
+            
+                      
+         } else if (direction == Direction.BOTTOM) {
+             int left = bounds.x;//-bounds.height;// left y of the widget
+             int right = bounds.x + bounds.width;// right y of the widget
+             if(point.x < left) {//above the widget
+                int cor = left-point.x;                
+                point.x += cor;
+                point.y -= cor;
+             } else if ( point.x > right) {
+                int cor = point.x- right;
+                point.x -= cor;
+                point.y -= cor;
+             }
+         
+         } else if (direction == Direction.TOP) {
+            int left = bounds.x;//-bounds.height;// left y of the widget
+            int right = bounds.x + bounds.width;// right y of the widget
+            if(point.x < left) {//above the widget
+                int cor = left-point.x;
+                point.x += cor;
+                point.y += cor;
+             } else if ( point.x > right) {
+                 int cor = point.x - right;
+                 point.x -= cor;
+                 point.y += cor;
+             }
+         
+         }          
+        
+        return new Anchor.Result (point, direction);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/CfgEventListener.java	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,13 @@
+package at.ssw.visualizer.cfg.graph;
+
+import java.util.EventListener;
+
+
+public interface CfgEventListener extends EventListener {
+    
+    /**
+     *  the node or the edge selection got changed
+     */
+    public void selectionChanged(CfgScene scene);
+      
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/graph/CfgScene.java	Tue Jan 31 00:23:10 2012 +0100
@@ -0,0 +1,834 @@
+package at.ssw.visualizer.cfg.graph;
+
+
+import at.ssw.visualizer.cfg.model.CfgEdge;
+import at.ssw.visualizer.cfg.CfgEditorContext;
+import at.ssw.visualizer.cfg.action.ColorAction;
+import at.ssw.visualizer.cfg.action.HideEdgesAction;
+import at.ssw.visualizer.cfg.action.ShowEdgesAction;
+import at.ssw.visualizer.cfg.editor.CfgEditorTopComponent;
+import at.ssw.visualizer.cfg.graph.layout.HierarchicalCompoundLayout;
+import at.ssw.visualizer.cfg.graph.layout.HierarchicalNodeLayout;
+import at.ssw.visualizer.cfg.model.CfgEnv;
+import at.ssw.visualizer.cfg.model.CfgNode;
+import at.ssw.visualizer.cfg.model.LoopInfo;
+import at.ssw.visualizer.cfg.preferences.CfgPreferences;
+import at.ssw.visualizer.cfg.visual.PolylineRouter;
+import at.ssw.visualizer.cfg.visual.PolylineRouterV2;
+import at.ssw.visualizer.cfg.visual.WidgetCollisionCollector;
+import at.ssw.visualizer.model.cfg.BasicBlock;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.RenderingHints;
+import java.awt.event.ActionEvent;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import javax.swing.AbstractAction;
+import javax.swing.JComponent;
+import javax.swing.JMenu;
+import javax.swing.JPopupMenu;
+import javax.swing.JScrollPane;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.swing.event.EventListenerList;
+import org.netbeans.api.visual.action.ActionFactory;
+import org.netbeans.api.visual.action.MoveProvider;
+import org.netbeans.api.visual.action.PopupMenuProvider;
+import org.netbeans.api.visual.action.RectangularSelectDecorator;
+import org.netbeans.api.visual.action.RectangularSelectProvider;
+import org.netbeans.api.visual.action.WidgetAction;
+import org.netbeans.api.visual.anchor.Anchor;
+import org.netbeans.api.visual.anchor.AnchorFactory;
+import org.netbeans.api.visual.graph.GraphScene;
+import org.netbeans.api.visual.graph.layout.GraphLayout;
+import org.netbeans.api.visual.layout.LayoutFactory;
+import org.netbeans.api.visual.layout.SceneLayout;
+import org.netbeans.api.visual.router.Router;
+import org.netbeans.api.visual.router.Router.*;
+import org.netbeans.api.visual.router.RouterFactory;
+import org.netbeans.api.visual.widget.ConnectionWidget;
+import org.netbeans.api.visual.widget.LayerWidget;
+import org.netbeans.api.visual.widget.Widget;
+import org.openide.util.actions.SystemAction;
+
+
+public class CfgScene extends GraphScene<CfgNode, CfgEdge> implements ChangeListener {    
+    private LayerWidget mainLayer = new LayerWidget(this);
+    private LayerWidget connectionLayer = new LayerWidget(this);  
+    private LayerWidget interractionLayer = new LayerWidget(this);
+    private LayerWidget clusterLayer = new LayerWidget(this);  
+    private Set<CfgNode> selectedNodes = Collections.<CfgNode>emptySet();
+    private Map<Integer, LoopClusterWidget> loopidx2clusterwidget = new HashMap<Integer, LoopClusterWidget>();
+    private Map<CfgNode, EdgeSwitchWidget> inputSwitches = new HashMap<CfgNode, EdgeSwitchWidget>();
+    private Map<CfgNode, EdgeSwitchWidget> outputSwitches = new HashMap<CfgNode, EdgeSwitchWidget>();    
+    private WidgetAction moveAction = ActionFactory.createMoveAction (ActionFactory.createFreeMoveStrategy(), this.createMoveProvider());   
+    private SceneLayout sceneLayout;
+    private CfgEnv env;
+    private int currentLayout=-1;
+    private int currentRouter=-1;
+    private CfgEditorTopComponent cfgtc;
+    private EventListenerList listenerList = new EventListenerList();
+    private WidgetAction contextPopupAction = this.createContextMenuAction(this); 
+    private List<NodeWidget> nodeWidgets=null;
+    private boolean loopClustersVisible = true;
+    
+    
+    public CfgScene(final CfgEditorTopComponent cfgtc){    
+        addChild(clusterLayer); 
+        addChild(mainLayer);       
+        addChild(interractionLayer);
+        addChild(connectionLayer);    
+        this.loadDefaults();   
+        this.cfgtc=cfgtc;           
+        this.loadModel(new CfgEnv(cfgtc.getCfg()));     
+        this.setSceneLayout(CfgEditorContext.LAYOUT_HIERARCHICALNODELAYOUT);//default   
+        this.getInputBindings().setZoomActionModifiers(0);
+        this.getActions().addAction(ActionFactory.createMouseCenteredZoomAction(1.1));
+        this.getActions().addAction(ActionFactory.createPanAction());   
+        this.getActions().addAction(ActionFactory.createRectangularSelectAction(
+                this.createSelectDecorator(this),
+                interractionLayer, 
+                this.createRectangularSelectProvider())
+        ); 
+        this.getActions().addAction(this.contextPopupAction);
+        this.addSceneListener(createSceneListener(this));
+        this.validate();
+    }
+    
+    private void loadModel(CfgEnv cfgenv) {
+        this.env = cfgenv;
+        for(CfgNode n : env.getNodes()) {         
+            addNode(n);
+        }
+        for(CfgEdge e : env.getEdges()) {         
+            addEdge(e);        
+            setEdgeSource(e, e.getSourceNode());
+            setEdgeTarget(e, e.getTargetNode());
+        }        
+        this.stackLoops(cfgenv.getLoopMap());    
+        this.autoHideEdges();        
+    }
+           
+    public void loadDefaults() {
+        this.setRouter(CfgEditorContext.ROUTING_DIRECTLINES);       
+        CfgPreferences prefs = CfgPreferences.getInstance();
+        this.setBackground(prefs.getBackgroundColor());
+    }
+    
+    //sets the parent Widget of all LoopClusterWidgets
+    private void stackLoops(Map<CfgNode, LoopInfo> map) {  
+        this.clusterLayer.removeChildren();
+      
+        Set<LoopInfo> cache = new HashSet<LoopInfo>();
+        for(LoopInfo info : map.values()){
+            if(cache.contains(info)) continue;
+            LoopClusterWidget widget = this.loopidx2clusterwidget.get(info.getLoopIndex());           
+            LoopInfo parent = info.getParent(); 
+            while(parent != null){                
+                LoopClusterWidget parentWidget = this.loopidx2clusterwidget.get(parent.getLoopIndex());
+                assert parentWidget != null;
+                if(widget.getParentWidget()!=null)
+                    widget.removeFromParent();
+                parentWidget.addChild(widget);
+                widget=parentWidget;
+                parent = parent.getParent();         
+            }           
+            widget.removeFromParent();
+            this.clusterLayer.addChild(widget);//parent == null => parent is clusterlayer
+        } 
+    }
+   
+    //hide in|output edges 
+    private void autoHideEdges(){
+        for(CfgNode n : this.getNodes()){
+             int fanin = n.getInputEdges().length;
+             int fanout = n.getOutputEdges().length;                                    
+             if (fanin > CfgEditorContext.MAX_AUTOEDGESVISIBLE){
+                assert(inputSwitches.containsKey(n));
+                if(this.inputSwitches.containsKey(n)){                   
+                    EdgeSwitchWidget esw = this.inputSwitches.get(n);
+                    esw.changeEdgeVisibility(false);
+                }            
+             } 
+             if(fanout > CfgEditorContext.MAX_AUTOEDGESVISIBLE){              
+                if(this.outputSwitches.containsKey(n)){
+                    EdgeSwitchWidget esw = this.outputSwitches.get(n);
+                    esw.changeEdgeVisibility(false);
+                }
+             }
+        }
+        
+    }
+    
+     //apply current cfggraphscene layout  
+    public void applyLayout(){      
+        this.sceneLayout.invokeLayoutImmediately();  
+    }
+    
+    //returns a Set with the currently selected Nodes    
+    public Set<CfgNode> getSelectedNodes() {
+        return Collections.<CfgNode>unmodifiableSet(selectedNodes);
+    }
+    
+    
+    public Map<Integer, LoopClusterWidget> getLoopidx2clusterwidget() {
+        return loopidx2clusterwidget;
+    }
+    
+    /**
+     * Sets the color of the currently selected Nodes
+     * If the supplied color is null the default color will be used
+     */
+    public void setSelectedNodesColor(Color color) {
+        if(color == null) { //set default color
+            CfgPreferences prefs = CfgPreferences.getInstance();
+            boolean customized=false;
+            for(CfgNode n : this.selectedNodes){
+                 color=null;
+                 color = prefs.getFlagsSetting().getColor(n.getBasicBlock().getFlags());
+                 customized = (color!=null); 
+                 NodeWidget nw = (NodeWidget) this.findWidget(n);                                                
+                 nw.setNodeColor((customized) ? color : prefs.getNodeColor(), customized);  
+            }
+        } else  {
+            for(CfgNode n : this.selectedNodes){
+                NodeWidget nw = (NodeWidget) this.findWidget(n);
+                nw.setNodeColor(color, true);
+            }
+        }
+        this.validate();
+    }
+
+    public void setSelectedEdgesVisibility(boolean visible) {
+        for(CfgNode n : this.selectedNodes){        
+            EdgeSwitchWidget in = this.inputSwitches.get(n);
+            EdgeSwitchWidget out = this.outputSwitches.get(n);            
+            if(in != null) in.changeEdgeVisibility(visible);
+            if(out != null) out.changeEdgeVisibility(visible);        
+        }
+        this.fireSelectionChanged();     
+        this.validate();
+    }
+
+    public EdgeSwitchWidget getInputSwitch(CfgNode n){
+        return this.inputSwitches.get(n);
+    }
+    public EdgeSwitchWidget getOutputSwitch(CfgNode n){
+        return this.outputSwitches.get(n);
+    }
+    
+    public CfgEnv getCfgEnv() {
+        return env;
+    }
+       
+    public boolean isLoopClusterVisible() {
+        return loopClustersVisible;
+    }
+    
+    public void setLoopWidgets(boolean visible) {      
+        for(Widget w : this.loopidx2clusterwidget.values()){
+            w.setVisible(visible);
+            w.revalidate();
+        }
+        this.loopClustersVisible=visible;
+        this.validate();
+    }
+    
+    public void setRouter(int newRouter){
+        if(newRouter == this.currentRouter) return;
+        
+        this.currentRouter=newRouter;
+        
+        Router router;
+       
+        switch (newRouter) {
+            case CfgEditorContext.ROUTING_BEZIER:                
+                router = new PolylineRouterV2(new WidgetCollisionCollector() {  
+                    public void collectCollisions(List<Widget> collisions) {
+                        collisions.addAll(getNodeWidgets());  
+                    }
+                });           
+                break;
+            case CfgEditorContext.ROUTING_DIRECTLINES:             
+                router = RouterFactory.createDirectRouter();               
+                break;           
+            default: 
+                throw new IllegalStateException ("Unknown Router ID: " + newRouter); // NOI18N
+        } 
+        
+        for(CfgEdge e : this.getEdges()){              
+            EdgeWidget ew = (EdgeWidget) this.findWidget(e);           
+            ew.setRouter(router);           
+        }
+        this.validate();
+    }
+    
+   
+        
+    public Collection<NodeWidget> getNodeWidgets() {
+        if(nodeWidgets != null && nodeWidgets.size()==this.getNodes().size()) return nodeWidgets;
+        
+        List<NodeWidget> widgets = new ArrayList<NodeWidget>();
+        for(CfgNode n : this.getNodes()){
+            NodeWidget w = (NodeWidget) this.findWidget(n);
+            widgets.add(w);
+        }
+        
+        nodeWidgets = Collections.unmodifiableList(widgets);
+        return widgets;        
+    }
+      
+    
+   
+    public void setSceneLayout(int newLayout){   
+        
+        if(currentLayout == newLayout) return;
+                
+        GraphLayout<CfgNode,CfgEdge> graphLayout=null;
+        
+        switch (newLayout) {               
+            case CfgEditorContext.LAYOUT_HIERARCHICALNODELAYOUT:
+                graphLayout = new HierarchicalNodeLayout(this); 
+                break;
+            
+            case CfgEditorContext.LAYOUT_HIERARCHICALCOMPOUNDLAYOUT:
+                graphLayout = new HierarchicalCompoundLayout(this);
+                break;
+        }  
+        
+        this.currentLayout=newLayout;
+        if(graphLayout != null)
+            this.sceneLayout=LayoutFactory.createSceneGraphLayout(this, graphLayout);     
+    }
+   
+      
+    @Override
+    protected void attachEdgeSourceAnchor(CfgEdge edge, CfgNode oldSourceNode, CfgNode sourceNode) {    
+        Anchor sourceAnchor;
+        EdgeWidget edgeWidget = (EdgeWidget) findWidget (edge);
+        Widget sourceWidget = findWidget(sourceNode);
+       
+        if (edge.isSymmetric()) {
+            sourceAnchor =  new SymmetricAnchor(sourceWidget, true, true); 
+        } else {
+            sourceAnchor = AnchorFactory.createRectangularAnchor(sourceWidget);
+        }  
+        edgeWidget.setSourceAnchor (sourceAnchor);  
+    }
+
+    @Override
+    protected void attachEdgeTargetAnchor(CfgEdge edge, CfgNode oldtarget, CfgNode targetNode) { 
+        Anchor targetAnchor; 
+        ConnectionWidget edgeWidget = (ConnectionWidget) findWidget (edge);              
+        Widget targetWidget = findWidget(targetNode);
+        
+        if (edge.isSymmetric()) {
+            targetAnchor =  new SymmetricAnchor(targetWidget, true, false);                 
+        } else {
+            targetAnchor = AnchorFactory.createRectangularAnchor(targetWidget);
+        }                 
+        edgeWidget.setTargetAnchor (targetAnchor);      
+    }
+
+  
+    @Override
+    protected Widget attachEdgeWidget(CfgEdge edge) {      
+        EdgeWidget widget = new EdgeWidget(this, edge);
+        connectionLayer.addChild(widget);      
+        attachSourceSwitchWidget(edge);           
+        attachTargetSwitchWidget(edge);       
+        return widget;
+    }
+
+    
+   
+    @Override
+    protected Widget attachNodeWidget(CfgNode node) {   
+        this.nodeWidgets = null;
+        
+        NodeWidget nw  = new NodeWidget(this,node);
+        WidgetAction.Chain actions = nw.getActions();        
+        actions.addAction(this.contextPopupAction);
+        actions.addAction(this.moveAction);
+        actions.addAction(this.createObjectHoverAction());
+           
+        if ( node.isLoopMember() ) {           
+            LoopClusterWidget loopWidget = this.attachLoopMember(node);           
+            loopWidget.addMember(nw);      
+        } 
+        mainLayer.addChild(nw);           
+        return nw;
+    }
+    
+    
+    private LoopClusterWidget attachLoopMember(CfgNode node) {
+        LoopClusterWidget lw = this.loopidx2clusterwidget.get(node.getLoopIndex());
+        if(lw == null) {
+            lw = new LoopClusterWidget(this, node.getLoopDepth(), node.getLoopIndex());
+            this.loopidx2clusterwidget.put(node.getLoopIndex(), lw);
+            this.clusterLayer.addChild(lw);
+        }
+        return lw;
+    }
+    
+    
+    private boolean detachLoopMember(CfgNode node, NodeWidget nodeWidget) { 
+        LoopClusterWidget rm = this.loopidx2clusterwidget.get(node.getLoopIndex());
+        if( rm == null) return false;//not added
+        
+        if ( rm.removeMember(nodeWidget) ) {
+            if(rm.getMembers().size() == 0){
+                this.loopidx2clusterwidget.remove(rm.getLoopIndex());
+                List<Widget> childs = new ArrayList<Widget>(rm.getChildren());
+                for (Widget w : childs){//append stacked loopwidgets
+                    w.removeFromParent();
+                    rm.getParentWidget().addChild(w);
+                }
+                rm.removeFromParent();
+            }
+            return true;
+        }
+        return false;       
+    }
+
+    //this function is not invoked by any class  of the module
+    //however to ensure that the edge switches are treatet corretly
+    //when a future version removes nodes it was implemented too.
+    
+    @Override
+    protected void detachNodeWidget(CfgNode node, Widget nodeWidget) {
+        if(node.isLoopMember() && nodeWidget instanceof NodeWidget ) {
+            this.detachLoopMember(node,(NodeWidget)nodeWidget);        
+        }
+        super.detachNodeWidget(node, nodeWidget);
+        assert nodeWidget.getParentWidget()== null;
+        if(this.inputSwitches.containsKey(node)) {
+            EdgeSwitchWidget esw = this.inputSwitches.remove(node);
+            this.connectionLayer.removeChild(esw);
+        }
+        if(this.outputSwitches.containsKey(node)){
+            EdgeSwitchWidget esw = this.outputSwitches.remove(node);
+            this.connectionLayer.removeChild(esw);
+        }       
+    }
+       
+    protected EdgeSwitchWidget attachSourceSwitchWidget(CfgEdge e){
+        CfgNode sourceNode = e.getSourceNode();   
+        NodeWidget sourceWidget = (NodeWidget) this.findWidget(sourceNode);
+        EdgeSwitchWidget out = outputSwitches.get(sourceNode);       
+        if (out==null) {
+            out = new EdgeSwitchWidget(this, sourceWidget, true);
+            this.connectionLayer.addChild(out); 
+            outputSwitches.put(sourceNode, out);
+        }        
+        return out;  
+    }
+    
+    
+    protected EdgeSwitchWidget attachTargetSwitchWidget(CfgEdge e){      
+        CfgNode targetNode = e.getTargetNode();
+        NodeWidget targetWidget = (NodeWidget) this.findWidget(targetNode);
+        EdgeSwitchWidget in = inputSwitches.get(targetNode);      
+        if (in==null) {       
+            in = new EdgeSwitchWidget(this, targetWidget, false);
+            this.connectionLayer.addChild(in);                  
+            inputSwitches.put(targetNode, in);
+        }
+        return in;   
+    }
+    
+    //resets the selection state of all NodeWidgets
+    private void cleanNodeSelection(){
+        if( this.selectedNodes.size() != 0) {
+            this.userSelectionSuggested(Collections.<CfgNode>emptySet(), false);
+            this.selectedNodes = Collections.<CfgNode>emptySet();
+            this.fireSelectionChanged();
+            this.validate();            
+        }
+    }
+    
+    
+    //sets the scene & global node selection
+    public void setNodeSelection(Set<CfgNode> newSelection){   
+        this.setSceneSelection(newSelection);
+        this.updateGlobalSelection();         
+    }
+    
+    //sets the scene selection
+    private void setSceneSelection(Set<CfgNode> newSelection){
+        if(newSelection.equals(selectedNodes)) return;
+        
+        this.selectedNodes=newSelection;
+        
+        Set<Object> selectedObjects = new HashSet<Object>();
+        
+        for(CfgNode n : newSelection){
+            selectedObjects.addAll(this.findNodeEdges(n, true, true));
+        }
+        selectedObjects.addAll(newSelection);
+        
+        //if the selection gets updated from a change in the block view
+        //the scene will be centered
+        if(selectionUpdating)
+            this.centerSelection();
+        
+        this.userSelectionSuggested(selectedObjects, false);
+        this.fireSelectionChanged();           
+        this.validate();
+    }
+    
+    //updates selection of Block View
+    public void updateGlobalSelection() {
+        // TODO(tw): Add selection management.
+//        Selection selection = SelectionManager.getDefault().getCurSelection();
+//        ArrayList<BasicBlock> newBlocks = new ArrayList<BasicBlock>();
+//        for (CfgNode n : this.selectedNodes) {
+//            newBlocks.add(n.getBasicBlock());
+//        }
+//        BasicBlock[] curBlocks = newBlocks.toArray(new BasicBlock[newBlocks.size()]);     
+//        selection.put(curBlocks);
+    }
+    
+    private boolean selectionUpdating = false;
+    
+    //change of blockview selection   
+    public void stateChanged(ChangeEvent event) {      
+        if (selectionUpdating) {            
+            return;
+        }
+       
+        selectionUpdating = true;
+        
+        Object source = event.getSource();
+//        if(source instanceof Selection){
+//            Selection selection=(Selection) source;
+//            Set<CfgNode> newSelection = new HashSet<CfgNode>();
+//            BasicBlock[] newBlocks = selection.get(BasicBlock[].class);                  
+//            if (newBlocks != null) {
+//                for(BasicBlock b : newBlocks){
+//                    for(CfgNode n : this.getNodes()){
+//                        if(n.getBasicBlock() == b) newSelection.add(n);
+//                    }
+//                }
+//                this.setSceneSelection(newSelection);                               
+//            } 
+//        }       
+        selectionUpdating = false;
+        // TODO(tw): Add selection management.
+    }
+      
+    //centers the viewport on the currently selected nodewidgets
+    private void centerSelection(){         
+        Point sceneCenter = null;
+        Collection<CfgNode> nodes = this.selectedNodes;
+        if(nodes.size()==0) {
+            nodes = this.getNodes();
+        } 
+        
+        for(CfgNode n : nodes) {
+            if(sceneCenter==null) {
+                sceneCenter = this.findWidget(n).getLocation();
+                continue;
+            }
+            Point location = this.findWidget(n).getLocation();
+            sceneCenter.x = (location.x+sceneCenter.x)/2;
+            sceneCenter.y = (location.y+sceneCenter.y)/2;
+        }    
+        
+        JComponent view = this.getView ();
+        if (view != null) {
+            Rectangle viewBounds = view.getVisibleRect ();
+
+            Point viewCenter = this.convertSceneToView (sceneCenter);
+
+            view.scrollRectToVisible (new Rectangle (
+                viewCenter.x - viewBounds.width / 2,
+                viewCenter.y - viewBounds.height / 2,
+                viewBounds.width,
+                viewBounds.height
+            ));
+        }
+    }
+    
+    //animated scene Zoom to the max bounds of current viewport
+    public void zoomScene(){
+        JScrollPane pane = this.cfgtc.getJScrollPanel();
+      
+        Rectangle prefBounds = this.getPreferredBounds(); 
+        Dimension viewDim = pane.getViewportBorderBounds().getSize();
+        
+        double realwidth = (double)prefBounds.width*this.getZoomFactor();
+        double realheight = (double)prefBounds.height*this.getZoomFactor();        
+        
+        double zoomX = (double)viewDim.width / realwidth;
+        double zoomY = (double)viewDim.height / realheight;  
+        double zoomFactor = Math.min(zoomX, zoomY);     
+                
+        this.animateZoom(zoomFactor*0.9);         
+    }
+    
+    
+    //animated animateZoom function for scene animateZoom factor 
+    public void animateZoom(double zoomfactor) {
+        this.getSceneAnimator().animateZoomFactor(this.getZoomFactor() * zoomfactor);
+    }
+   
+    public void addCfgEventListener(CfgEventListener l) {
+        listenerList.add(CfgEventListener.class, l);
+    }
+
+    public void removeCfgEventListener(CfgEventListener l) {
+        listenerList.remove(CfgEventListener.class, l);
+    }
+       
+    public void fireSelectionChanged() {
+        Object[] listeners = listenerList.getListenerList();
+        for (int i = listeners.length-2; i>=0; i-=2) {
+            if (listeners[i]==CfgEventListener.class) {
+                ((CfgEventListener)listeners[i+1]).selectionChanged(this);
+            }
+        }
+    }
+       
+       
+    //Enables Antialiasing
+    @Override
+    public void paintChildren () {
+        Object anti = getGraphics ().getRenderingHint (RenderingHints.KEY_ANTIALIASING);
+        Object textAnti = getGraphics ().getRenderingHint (RenderingHints.KEY_TEXT_ANTIALIASING);
+
+        getGraphics ().setRenderingHint (
+                RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+        getGraphics ().setRenderingHint (
+                RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
+
+        super.paintChildren ();
+
+        getGraphics ().setRenderingHint (RenderingHints.KEY_ANTIALIASING, anti);
+        getGraphics ().setRenderingHint (RenderingHints.KEY_TEXT_ANTIALIASING, textAnti);
+    }
+    
+       
+     //select provider for node selection
+    private RectangularSelectProvider createRectangularSelectProvider() {
+            return new RectangularSelectProvider() {
+                public void performSelection(Rectangle rectangle) {
+                    HashSet<CfgNode> set=new HashSet<CfgNode>();
+
+                    //change to a rectangle with (x,offsetY) at the top left
+                    if(rectangle.width < 0){
+                        rectangle.x=rectangle.x+rectangle.width;
+                        rectangle.width*=-1;
+                    }
+                    if(rectangle.height < 0){
+                        rectangle.y=rectangle.y+rectangle.height;
+                        rectangle.height*=-1;
+                    }
+
+                    for(NodeWidget n: getNodeWidgets()) {
+                        Point p = n.getLocation();
+                        if (p != null && rectangle.contains(p)) {                     
+                            set.add(n.getNodeModel());
+                        }
+                    }        
+                    setNodeSelection(set);              
+                }
+            };    
+    }
+    
+    //select decorator for node selection
+    private RectangularSelectDecorator createSelectDecorator(final CfgScene scene){ 
+        return new RectangularSelectDecorator() {
+            public Widget createSelectionWidget() {
+                scene.cleanNodeSelection();//unselected all nodes
+                scene.revalidate();
+                return new SelectionWidget(getScene());
+            }
+        };
+    }
+    
+    
+    private MoveProvider createMoveProvider() {
+        return new MoveProvider(){
+            private HashMap<Widget, Point> originals = new HashMap<Widget, Point>();
+          
+            private Point original=null;
+               
+            public void movementStarted(Widget widget) {
+                originals.clear();              
+                NodeWidget nw = (NodeWidget) widget;    
+                if(selectedNodes.contains(nw.getNodeModel())) {//move current selection
+                    for(CfgNode n : selectedNodes){
+                        Widget w = findWidget(n);
+                        originals.put(w, w.getLocation());
+                    }
+                } else {//a newly-selected node will be moved               
+                    CfgNode n = nw.getNodeModel();     
+                    HashSet<CfgNode> selectedNode = new HashSet<CfgNode>(1);
+                    selectedNode.add(n);
+                    setNodeSelection(selectedNode);
+                    originals.put(widget, widget.getPreferredLocation());
+                    widget.revalidate();
+                    validate();
+                    
+                }               
+            }
+
+            public void movementFinished(Widget widget) {                                           
+                NodeWidget nw = (NodeWidget) widget;    
+                if(selectedNodes.contains(nw.getNodeModel())) {
+                    return;//to be able to move the current selection
+                }
+
+                HashSet<CfgNode> selectedNode = new HashSet<CfgNode>(1);
+                selectedNode.add(nw.getNodeModel());  
+                setNodeSelection(selectedNode);         
+                originals.clear ();
+                original = null;
+                
+            }
+
+            public Point getOriginalLocation(Widget widget) {           
+                if(original==null) 
+                    original = widget.getLocation();
+
+                return original;          
+            }
+            //todo : find a cache algorithm which only routes edges
+            //which are intersected by bounds of the moved rectangle
+            public void setNewLocation(Widget widget, Point location) {
+                Point org = getOriginalLocation(widget);
+                int dx = location.x - org.x;
+                int dy = location.y - org.y;
+                for (Map.Entry<Widget, Point> entry : originals.entrySet ()) {
+                    Point point = entry.getValue ();
+                    entry.getKey ().setPreferredLocation (new Point (point.x + dx, point.y + dy));
+                }  
+                for(CfgEdge e : getEdges()) {             
+                    EdgeWidget ew = (EdgeWidget) findWidget(e);
+                    if(ew.isVisible())
+                        ew.reroute();
+                }     
+            }
+        };
+    }
+       
+   
+    private WidgetAction createContextMenuAction(final CfgScene scene) {     
+        return ActionFactory.createPopupMenuAction(new PopupMenuProvider() {
+            public JPopupMenu getPopupMenu(Widget widget, Point point) {
+                JPopupMenu menu = new JPopupMenu(); 
+                NodeWidget nw = null;
+                if(widget instanceof NodeWidget) {
+                    nw = (NodeWidget) widget;
+                    if(!selectedNodes.contains(nw.getNodeModel())){
+                        HashSet<CfgNode> selectedNode = new HashSet<CfgNode>(1);
+                        selectedNode.add(nw.getNodeModel());
+                        setNodeSelection(selectedNode);
+                    }
+                } else if  (scene.getSelectedNodes().size() == 1) {
+                    nw = (NodeWidget) scene.findWidget(scene.getSelectedNodes().iterator().next());
+                }
+                
+                if(nw != null){
+                    CfgNode node = nw.getNodeModel();                    
+                    ArrayList<CfgNode> successors = new ArrayList<CfgNode>();
+                    ArrayList<CfgNode> predecessors = new ArrayList<CfgNode>();
+                    for(CfgEdge e : node.getOutputEdges()){
+                        successors.add(e.getTargetNode());
+                    }
+                    for(CfgEdge e : node.getInputEdges()){
+                        predecessors.add(e.getSourceNode());
+                    }
+                    
+                    if(predecessors.size()>0){
+                        Collections.sort(predecessors, new NodeNameComparator());
+                        JMenu predmenu = new JMenu("Go to predecessor");
+                        for (CfgNode n : predecessors) {                     
+                            GotoNodeAction action = new GotoNodeAction(n); 
+                            predmenu.add(action);
+                        }
+                       menu.add(predmenu);   
+                    }
+                    if(successors.size()>0){
+                        Collections.sort(successors, new NodeNameComparator());
+                        JMenu succmenu = new JMenu("Go to successor");                
+                        for (CfgNode n : successors) {                     
+                            GotoNodeAction action = new GotoNodeAction(n); 
+                            succmenu.add(action);
+                        }
+                        menu.add(succmenu);                     
+                    } 
+                    if ( successors.size() > 0 || predecessors.size() > 0)
+                        menu.addSeparator();    
+                }        
+                
+                menu.add(SystemAction.get(ShowEdgesAction.class));
+                menu.add(SystemAction.get(HideEdgesAction.class));
+                menu.addSeparator();
+                menu.add(SystemAction.get(ColorAction.class).getPopupPresenter()); 
+                return menu;
+            }
+        });
+    }
+      
+    private class NodeNameComparator implements Comparator<CfgNode> {
+        public int compare(CfgNode node1, CfgNode node2) {                
+            String name1 = node1.getBasicBlock().getName().substring(1);
+            String name2 = node2.getBasicBlock().getName().substring(1);
+            Integer blocknum1 = Integer.parseInt(name1);
+            Integer blocknum2 = Integer.parseInt(name2);
+            return blocknum1.compareTo(blocknum2);                                             
+        }
+    }
+    
+    private class GotoNodeAction extends AbstractAction {   
+        CfgNode node ;      
+        
+        GotoNodeAction(CfgNode node){
+            super(node.getBasicBlock().getName());          
+            this.node = node;           
+        }
+        public void actionPerformed(ActionEvent e) {            
+              Set<CfgNode> nodes = new HashSet<CfgNode>(1);
+              nodes.add(node);
+              setNodeSelection(nodes);
+              centerSelection();    
+        }      
+    }
+    
+    private SceneListener createSceneListener(final CfgScene scene){
+        return new SceneListener() {
+            
+            public void sceneRepaint() {              
+            }
+
+            public void sceneValidating() {              
+            }
+ 
+            public void sceneValidated() {
+                if (scene.isLoopClusterVisible()){ //update only if visible
+                    for(LoopClusterWidget cw : getLoopidx2clusterwidget().values()){
+                        cw.updateClusterBounds();     
+                    }
+                }
+                for(EdgeSwitchWidget esw : inputSwitches.values()){
+                    esw.updatePosition();
+                }
+
+                for(EdgeSwitchWidget esw : outputSwitches.values()){