public override void Attach( IGraphControl control ) { m_GraphControl = control; m_GraphControl.BaseControl.MouseDown += MouseDown; m_GraphControl.BaseControl.MouseMove += MouseMove; m_GraphControl.BaseControl.MouseUp += MouseUp; }
public override void Detach( IGraphControl control ) { System.Diagnostics.Debug.Assert( control == m_GraphControl ); m_GraphControl.BaseControl.MouseDown -= MouseDown; m_GraphControl.BaseControl.MouseMove -= MouseMove; m_GraphControl.BaseControl.MouseUp -= MouseUp; m_GraphControl = null; }
/// <summary> /// Animates the control of a vertex to a given position. /// </summary> /// <param name="control">Vertex control which should be animated to its new position</param> /// <param name="coord">New vertex position coordinates</param> public void AddVertexData(IGraphControl control, Measure.Point coord) { if (double.IsNaN(coord.X) || double.IsNaN(coord.Y)) throw new GX_InvalidDataException("AddVertexData() -> NaN coordinated has been supplied! Correct coordinates was expected."); if (!VertexStorage.ContainsKey(control)) VertexStorage.Add(control, coord); else throw new GX_GeneralException("AddVertexData() -> Same control can't be loaded in animation list twice!"); }
/// <summary> /// Storyboard creation /// </summary> /// <param name="control">Control</param> /// <param name="start">Start param value</param> /// <param name="end">End Param value</param> /// <returns></returns> private Storyboard CreateStory(IGraphControl control, double start, double end, EventHandler callback) { var story = new Storyboard(); var fadeAnimation = new DoubleAnimation(start, end, new Duration(Duration), FillBehavior.Stop); if(callback != null) fadeAnimation.Completed += callback; story.Children.Add(fadeAnimation); Storyboard.SetTarget(fadeAnimation, control as Control); Storyboard.SetTargetProperty(fadeAnimation, new PropertyPath(UIElement.OpacityProperty)); return story; }
private void RunAnimation(IGraphControl target) { //create and run animation var story = new Storyboard(); var fadeAnimation = new DoubleAnimation(1, 0, new Duration(TimeSpan.FromSeconds(Duration)), FillBehavior.Stop); fadeAnimation.Completed += (sender, e) => { OnCompleted(target); }; story.Children.Add(fadeAnimation); Storyboard.SetTarget(fadeAnimation, target as FrameworkElement); Storyboard.SetTargetProperty(fadeAnimation, new PropertyPath(UIElement.OpacityProperty)); story.Begin(target as FrameworkElement); }
/// <summary> /// Storyboard creation /// </summary> /// <param name="control">Control</param> /// <param name="start">Start param value</param> /// <param name="end">End Param value</param> /// <returns></returns> private Storyboard CreateStory(IGraphControl control, double start, double end, EventHandler callback) { var story = new Storyboard(); var fadeAnimation = new DoubleAnimation(start, end, new Duration(Duration), FillBehavior.Stop); if (callback != null) { fadeAnimation.Completed += callback; } story.Children.Add(fadeAnimation); Storyboard.SetTarget(fadeAnimation, control as Control); Storyboard.SetTargetProperty(fadeAnimation, new PropertyPath(UIElement.OpacityProperty)); return(story); }
/// <summary> /// Animates the control of a vertex to a given position. /// </summary> /// <param name="control">Vertex control which should be animated to its new position</param> /// <param name="coord">New vertex position coordinates</param> public void AddVertexData(IGraphControl control, Measure.Point coord) { if (double.IsNaN(coord.X) || double.IsNaN(coord.Y)) { throw new GX_InvalidDataException("AddVertexData() -> NaN coordinated has been supplied! Correct coordinates was expected."); } if (!VertexStorage.ContainsKey(control)) { VertexStorage.Add(control, coord); } else { throw new GX_GeneralException("AddVertexData() -> Same control can't be loaded in animation list twice!"); } }
/// <summary> /// Destroys all underlying graphs /// </summary> public virtual void Dispose() { IGraphControl graph = null; IDisposable disposeMe = null; for (int i = -1; i <= Intermediate.Count; i++) { graph = GraphAt(i); graph.Stop(); disposeMe = graph as IDisposable; if (disposeMe != null) { disposeMe.Dispose(); } } }
private void RunAnimation(IGraphControl target) { //create and run animation var story = new Storyboard(); var fadeAnimation = new DoubleAnimation {Duration = new Duration(TimeSpan.FromSeconds(Duration)), FillBehavior = FillBehavior.Stop, From = 1, To = 0}; fadeAnimation.Completed += (sender, e) => OnCompleted(target); story.Children.Add(fadeAnimation); Storyboard.SetTarget(fadeAnimation, target as FrameworkElement); #if WPF Storyboard.SetTargetProperty(fadeAnimation, new PropertyPath(UIElement.OpacityProperty)); story.Begin(target as FrameworkElement); #elif METRO Storyboard.SetTargetProperty(fadeAnimation, "Opacity"); story.Begin(); #else throw new NotImplementedException(); #endif }
internal void AddGraph(IGraphControl graphControl) { graphControl.Data = Data; IDisposable d = graphControl.Visualizing.Subscribe( v => { if (v == false) { n += 1; } if (v == false && n >= wn) { _onStopVisualization.OnNext(Unit.Default); } }); _graphControlList.Add(graphControl); _disposableDic.Add(graphControl.SortAlgorithm.Name, d); }
private void RunAnimation(IGraphControl target) { //create and run animation var story = new Storyboard(); var fadeAnimation = new DoubleAnimation { Duration = new Duration(TimeSpan.FromSeconds(Duration)), FillBehavior = FillBehavior.Stop, From = 1, To = 0 }; fadeAnimation.Completed += (sender, e) => OnCompleted(target); story.Children.Add(fadeAnimation); Storyboard.SetTarget(fadeAnimation, target as FrameworkElement); #if WPF Storyboard.SetTargetProperty(fadeAnimation, new PropertyPath(UIElement.OpacityProperty)); story.Begin(target as FrameworkElement); #elif METRO Storyboard.SetTargetProperty(fadeAnimation, "Opacity"); story.Begin(); #else throw new NotImplementedException(); #endif }
private void RegisterGraphControl(IGraphControl control) { if (!string.IsNullOrEmpty(control.GraphId)) GraphControls[control.GraphId] = control; }
public void OnCompleted(IGraphControl target) { if (Completed != null) Completed(this, new ControlEventArgs(target)); }
/// <summary> /// Get controls related to specified control /// </summary> /// <param name="vc">Original control</param> /// <param name="resultType">Type of resulting related controls</param> /// <param name="edgesType">Optional edge controls type</param> public virtual List <IGraphControl> GetRelatedControls(IGraphControl ctrl, GraphControlType resultType = GraphControlType.VertexAndEdge, EdgesType edgesType = EdgesType.Out) { return(null); }
public ControlEventArgs(IGraphControl vc) : base() { Control = vc; }
public ControlEventArgs(IGraphControl vc, bool removeDataObject) { RemoveDataObject = removeDataObject; Control = vc; }
public ControlEventArgs(IGraphControl vc) { Control = vc; }
/// <summary> /// Get controls related to specified control /// </summary> /// <param name="ctrl">Original control</param> /// <param name="resultType">Type of resulting related controls</param> /// <param name="edgesType">Optional edge controls type</param> public abstract List <IGraphControl> GetRelatedControls(IGraphControl ctrl, GraphControlType resultType = GraphControlType.VertexAndEdge, EdgesType edgesType = EdgesType.Out);
private void OnCompleted(IGraphControl target, bool removeDataObject) { Completed?.Invoke(this, new ControlEventArgs(target, removeDataObject)); }
/// <summary> /// Additional edge animation performed along with vertex animation /// </summary> /// <param name="control">Edge control</param> public void AddEdgeData(IGraphControl control) { if (!EdgeStorage.Contains(control)) EdgeStorage.Add(control); else throw new GX_GeneralException("AddEdgeData() -> Same control can't be loaded in animation list twice!"); }
/// <summary> /// Get controls related to specified control /// </summary> /// <param name="ctrl">Original control</param> /// <param name="resultType">Type of resulting related controls</param> /// <param name="edgesType">Optional edge controls type</param> public abstract List<IGraphControl> GetRelatedControls(IGraphControl ctrl, GraphControlType resultType = GraphControlType.VertexAndEdge, EdgesType edgesType = EdgesType.Out);
public virtual void Detach( IGraphControl control ) { }