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; } } }
public ShowPath(IGraphPresentation presentation) : base(presentation) { }
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; }
public ChangeClusterAssignment(IGraphPresentation presentation) { Contract.RequiresNotNull(presentation, "presentation"); myPresentation = presentation; }
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(); } }
public static IGraph TransformedGraph(this IGraphPresentation presentation) { return(presentation.GetModule <ITransformationModule>().Graph); }
public static INodeMaskModule Masks(this IGraphPresentation presentation) { return(presentation.GetModule <INodeMaskModule>()); }
public ShowHideIncomings(IGraphPresentation presentation) { Contract.RequiresNotNull(presentation, "presentation"); myPresentation = presentation; }
public SelectAll(IGraphPresentation presentation) { Contract.RequiresNotNull(presentation, "presentation"); myPresentation = presentation; }
public AbstractAlgorithm(IGraphPresentation presentation) { Contract.RequiresNotNull(presentation, nameof(presentation)); Presentation = presentation; }
public ShowHideNodes(IGraphPresentation presentation, bool show) : this(presentation, show, false) { }
public RemoveNodesNotConnectedOutsideCluster(IGraphPresentation presentation) : base(presentation) { }
public NodeVisual(Node owner, IGraphPresentation presentation) { Owner = owner; myPresentation = presentation; }
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; }
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; }
public RemoveNodesReachableFromMultipleClusters(IGraphPresentation presentation) { Contract.RequiresNotNull(presentation, "presentation"); myPresentation = presentation; }
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"); } }
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);