protected override void OnModelPropertyChanged( string propertyName )
        {
            if( propertyName == "Presentation" )
            {
                if( myPresentation == Model.Presentation )
                {
                    return;
                }

                if( myPresentation != null )
                {
                    myPresentation.GraphVisibilityChanged -= OnGraphVisibilityChanged;
                }

                myPresentation = Model.Presentation;

                if( myPresentation != null )
                {
                    myPresentation.GraphVisibilityChanged += OnGraphVisibilityChanged;

                    OnGraphVisibilityChanged( null, EventArgs.Empty );
                }

                OnPropertyChanged( "IsEnabled" );
            }
        }
        // TODO: we have to consider StyleModule
        private void GenerateDotFile( IGraphPresentation presentation )
        {
            var labelModule = presentation.GetPropertySetFor<Caption>();
            using( var writer = new StreamWriter( myDotFile.FullName ) )
            {
                writer.WriteLine( "digraph {" );
                writer.WriteLine( "  ratio=\"compress\"" );
                writer.WriteLine( "  rankdir=BT" );
                writer.WriteLine( "  ranksep=\"2.0 equally\"" );

                foreach( var node in presentation.Graph.Nodes.Where( n => presentation.Picking.Pick( n ) ) )
                {
                    // pass label to trigger dot.exe to create proper size of node bounding box
                    var label = labelModule.Get( node.Id ).DisplayText;

                    writer.WriteLine( "  \"{0}\" [label=\"{1}\"]", node.Id, label );
                }

                foreach( var edge in presentation.Graph.Edges.Where( e => presentation.Picking.Pick( e ) ) )
                {
                    writer.WriteLine( "  \"{0}\" -> \"{1}\"", edge.Source.Id, edge.Target.Id );
                }

                writer.WriteLine( "}" );
            }
        }
            public Entry( INodeMask mask, IGraphPresentation presentation )
            {
                Contract.RequiresNotNull( mask, "mask" );
                Contract.RequiresNotNull( presentation, "presentation" );

                Mask = mask;
                myPresentation = presentation;

                SetToolTip( mask );
            }
        public PickingCache( IGraphPresentation presentation, IGraphPicking realPicking )
        {
            Contract.RequiresNotNull( presentation, "presentation" );
            Contract.RequiresNotNull( realPicking, "realPicking" );

            myPresentation = presentation;
            myPicking = realPicking;

            myCache = new Dictionary<string, bool>();

            myPresentation.GraphVisibilityChanged += OnGraphVisibilityChanged;
        }
        public void Relayout( IGraphPresentation presentation )
        {
            GenerateDotFile( presentation );

            myConverter.Convert( myDotFile, myPlainFile );

            var nodeLayouts = new List<NodeLayout>();
            var edgeLayouts = new List<EdgeLayout>();

            ParsePlainFile( nodeLayouts, edgeLayouts );

            var module = presentation.GetModule<IGraphLayoutModule>();
            module.Set( nodeLayouts, edgeLayouts );
        }
        public BasicDocumentProcessor( IGraphPresentation presentation )
        {
            myPresentation = presentation;

            DocumentCreators = new Dictionary<string, Func<IDocument>>();
            DocumentCreators[ ".plain" ] = () => new DotPlainDocument();
            DocumentCreators[ ".graphml" ] = () => new GraphMLDocument();
            DocumentCreators[ ".dgml" ] = () => new DgmlDocument();

            AssociatedDocumentCreators = new Dictionary<string, Func<IDocument>>();
            AssociatedDocumentCreators[ ".tips" ] = () => new ToolTipsDocument();

            myFailedItems = new List<FailedItem>();
        }
        protected override void OnModelPropertyChanged( string propertyName )
        {
            if ( propertyName == "Presentation" )
            {
                if ( myPresentation == Model.Presentation )
                {
                    return;
                }

                if ( myPresentation != null )
                {
                    myPresentation.GetModule<INodeMaskModule>().CollectionChanged -= OnMasksChanged;
                }

                myPresentation = Model.Presentation;

                if ( myPresentation != null )
                {
                    UpdateMasks();

                    myPresentation.GetModule<INodeMaskModule>().CollectionChanged += OnMasksChanged;
                }
            }
        }
Example #8
0
 public ShowPath(IGraphPresentation presentation)
     : base(presentation)
 {
 }
Example #9
0
        public ShowCycles(IGraphPresentation presentation)
        {
            Contract.RequiresNotNull(presentation, "presentation");

            myPresentation = presentation;
        }
        public ShowNodesOutsideClusters(IGraphPresentation presentation)
        {
            Contract.RequiresNotNull(presentation, "presentation");

            myPresentation = presentation;
        }
        public AddVisibleNodesOutsideClustersToCluster(IGraphPresentation presentation)
        {
            Contract.RequiresNotNull(presentation, "presentation");

            myPresentation = presentation;
        }
        public HideSingleNode( IGraphPresentation presentation )
        {
            Contract.RequiresNotNull( presentation, "presentation" );

            myPresentation = presentation;
        }
Example #13
0
        public ChangeClusterAssignment(IGraphPresentation presentation)
        {
            Contract.RequiresNotNull(presentation, "presentation");

            myPresentation = presentation;
        }
Example #14
0
 public AddRemoveTransitiveHull(IGraphPresentation presentation)
     : base(presentation)
 {
     Add     = true;
     Reverse = false;
 }
        protected override void OnModelPropertyChanged( string propertyName )
        {
            if( propertyName == "Presentation" )
            {
                if( myPresentation == Model.Presentation )
                {
                    return;
                }

                if( myPresentation != null )
                {
                    myPresentation.GetModule<INodeMaskModule>().CollectionChanged -= OnMasksChanged;
                }

                myPresentation = Model.Presentation;

                Filter = null;

                {
                    myPresentation.GetModule<INodeMaskModule>().CollectionChanged += OnMasksChanged;
                }

                myPreviewNodes = null;
                PreviewNodes.Refresh();
            }
        }
Example #16
0
 public static IGraph TransformedGraph(this IGraphPresentation presentation)
 {
     return(presentation.GetModule <ITransformationModule>().Graph);
 }
Example #17
0
 public static INodeMaskModule Masks(this IGraphPresentation presentation)
 {
     return(presentation.GetModule <INodeMaskModule>());
 }
Example #18
0
        public ShowHideIncomings(IGraphPresentation presentation)
        {
            Contract.RequiresNotNull(presentation, "presentation");

            myPresentation = presentation;
        }
Example #19
0
        public SelectAll(IGraphPresentation presentation)
        {
            Contract.RequiresNotNull(presentation, "presentation");

            myPresentation = presentation;
        }
        public AbstractAlgorithm(IGraphPresentation presentation)
        {
            Contract.RequiresNotNull(presentation, nameof(presentation));

            Presentation = presentation;
        }
        public ShowCycles(IGraphPresentation presentation)
        {
            Contract.RequiresNotNull(presentation, "presentation");

            myPresentation = presentation;
        }
Example #22
0
 public ShowHideNodes(IGraphPresentation presentation, bool show)
     : this(presentation, show, false)
 {
 }
Example #23
0
 public RemoveNodesNotConnectedOutsideCluster(IGraphPresentation presentation)
     : base(presentation)
 {
 }
Example #24
0
 public NodeVisual(Node owner, IGraphPresentation presentation)
 {
     Owner          = owner;
     myPresentation = presentation;
 }
Example #25
0
        public TracePath(IGraphPresentation presentation)
        {
            Contract.RequiresNotNull(presentation, "presentation");

            myPresentation = presentation;
        }
        public UnfoldAndHide(IGraphPresentation presentation)
        {
            Contract.RequiresNotNull(presentation, "presentation");

            myPresentation = presentation;
        }
        public RemoveNodesWithoutEdges(IGraphPresentation presentation)
        {
            Contract.RequiresNotNull(presentation, "presentation");

            myPresentation = presentation;
        }
Example #28
0
 public RemoveNodesWithoutSiblings(IGraphPresentation presentation)
     : base(presentation)
 {
     SiblingsType = SiblingsType.Any;
 }
        protected override void OnModelPropertyChanged( string propertyName )
        {
            if( propertyName == "Presentation" )
            {
                if( Presentation == Model.Presentation )
                {
                    return;
                }

                Presentation = Model.Presentation;

                Labels.Clear();

                var converter = new GenericLabelConverter( ConversionSteps );
                var captionModule = Presentation.GetPropertySetFor<Caption>();
                foreach( var node in Presentation.Graph.Nodes )
                {
                    var label = new LabelViewModel( captionModule.Get( node.Id ).Label );
                    label.Commited = converter.Convert( label.Original );

                    Labels.Add( label );
                }

                OnPropertyChanged( "Labels" );
            }
        }
        public ShowNodeWithSiblings( IGraphPresentation presentation )
        {
            Contract.RequiresNotNull( presentation, "presentation" );

            myPresentation = presentation;
        }
Example #31
0
        public RemoveNodesReachableFromMultipleClusters(IGraphPresentation presentation)
        {
            Contract.RequiresNotNull(presentation, "presentation");

            myPresentation = presentation;
        }
Example #32
0
 public GetNodesOutsideCluster(IGraphPresentation presentation)
     : base(presentation)
 {
 }
 public EdgeVisual( Edge owner, IGraphPresentation presentation )
 {
     Owner = owner;
     myPresentation = presentation;
 }
        protected override void OnModelPropertyChanged(string propertyName)
        {
            if (propertyName == "Model")
            {
                OnConfigChanged(this, EventArgs.Empty);
            }
            else if (propertyName == "Presentation")
            {
                if (myPresentation == Model.Presentation)
                {
                    return;
                }

                myPresentation = Model.Presentation;

                myPresentation.GetModule<INodeMaskModule>().AutoHideAllNodesForShowMasks = true;

                if (myPresentation.Graph.Nodes.Count() > 300)
                {
                    var hideAllButOne = new NodeMask();
                    hideAllButOne.IsShowMask = true;
                    hideAllButOne.IsApplied = true;
                    hideAllButOne.Label = "Hide all but one node";

                    hideAllButOne.Set(myPresentation.Graph.Nodes.Take(1));

                    myPresentation.GetModule<INodeMaskModule>().Push(hideAllButOne);

                    OnOpenFilterEditor();
                }

                OnPropertyChanged("IsEnabled");
            }
        }
Example #35
0
 public GraphPicking(IGraphPresentation presentation)
 {
     myPresentation = presentation;
 }
 public NodeVisual( Node owner, IGraphPresentation presentation )
 {
     Owner = owner;
     myPresentation = presentation;
 }
 public GraphPicking( IGraphPresentation presentation )
 {
     myPresentation = presentation;
 }
 public abstract void Invert(IGraphPresentation presentation);