public NNGraph() { InitializeComponent(); _editorManager = new EditorObjectManager(graphArea, zoomCtrl); var dgLogic = new LogicCoreExample(); graphArea.LogicCore = dgLogic; graphArea.VertexSelected += graphArea_VertexSelected; graphArea.EdgeSelected += graphArea_EdgeSelected; graphArea.SetVerticesMathShape(VertexShape.Circle); dgLogic.DefaultLayoutAlgorithm = LayoutAlgorithmTypeEnum.Custom; dgLogic.DefaultOverlapRemovalAlgorithm = OverlapRemovalAlgorithmTypeEnum.None; dgLogic.DefaultEdgeRoutingAlgorithm = EdgeRoutingAlgorithmTypeEnum.None; dgLogic.EdgeCurvingEnabled = true; zoomCtrl.IsAnimationEnabled = false; ZoomControl.SetViewFinderVisibility(zoomCtrl, Visibility.Visible); zoomCtrl.Zoom = 2; zoomCtrl.MinZoom = .5; zoomCtrl.MaxZoom = 50; zoomCtrl.ZoomSensitivity = 25; zoomCtrl.MouseDown += zoomCtrl_MouseDown; butDelete.Checked += ToolbarButton_Checked; butSelect.Checked += ToolbarButton_Checked; butEdit.Checked += ToolbarButton_Checked; butSelect.IsChecked = true; }
private void MasterRefresh() { GetRandomizerData(); if (graph != null) { graph.Dispose(); } graph = Grapher.CreateTransitionGraph(); if (zoom == null) { zoom = new ZoomControl(); ZoomControl.SetViewFinderVisibility(zoom, Visibility.Visible); elementHost1.Child = zoom; } zoom.Content = graph; zoom.Zoom = 0.01f; zoomToVertexSelect.Items.Clear(); zoomToVertexSelect.Items.AddRange(roomRandomizer ? rooms.ToArray() : areas.ToArray()); graph.GenerateGraph(true); Grapher.RecolorVertices(graph); edgeLabelsToggled = false; zoom.ZoomToFill(); }
UIElement RedrawGraph(ref BiGraphArea <string> _gArea) { _zoomctrl = new ZoomControl(); ZoomControl.SetViewFinderVisibility(_zoomctrl, Visibility.Visible); var logic = new GXLogicCore <Node <string>, Base.Edge <string>, BidirectionalGraph <Node <string>, Base.Edge <string> > >(); _gArea = new BiGraphArea <string> { // EnableWinFormsHostingMode = false, LogicCore = logic, EdgeLabelFactory = new DefaultEdgelabelFactory() }; _gArea.ShowAllEdgesLabels(true); logic.Graph = current_graph; logic.DefaultLayoutAlgorithm = ((LayoutAlgorithmTypeEnum)(layoutcombo.SelectedItem as ComboBoxItem).Tag); logic.DefaultLayoutAlgorithmParams = logic.AlgorithmFactory.CreateLayoutParameters(((LayoutAlgorithmTypeEnum)(layoutcombo.SelectedItem as ComboBoxItem).Tag)); //((LinLogLayoutParameters)logic.DefaultLayoutAlgorithmParams). = 100; logic.DefaultOverlapRemovalAlgorithm = OverlapRemovalAlgorithmTypeEnum.FSA; logic.DefaultOverlapRemovalAlgorithmParams = logic.AlgorithmFactory.CreateOverlapRemovalParameters(OverlapRemovalAlgorithmTypeEnum.FSA); ((OverlapRemovalParameters)logic.DefaultOverlapRemovalAlgorithmParams).HorizontalGap = 50; ((OverlapRemovalParameters)logic.DefaultOverlapRemovalAlgorithmParams).VerticalGap = 50; logic.DefaultEdgeRoutingAlgorithm = ((EdgeRoutingAlgorithmTypeEnum)(ercombo.SelectedItem as ComboBoxItem).Tag); logic.EnableParallelEdges = paredge.Checked; logic.ParallelEdgeDistance = edgedist.Value; logic.AsyncAlgorithmCompute = false; _zoomctrl.Content = _gArea; _gArea.RelayoutFinished += gArea_RelayoutFinished; var myResourceDictionary = new ResourceDictionary { Source = new Uri("WpfTemplate\\template.xaml", UriKind.Relative) }; _zoomctrl.Resources.MergedDictionaries.Add(myResourceDictionary); return(_zoomctrl); }
public MainWindow() { InitializeComponent(); ZoomControl.SetViewFinderVisibility(zoomctrl, Visibility.Visible); zoomctrl.ZoomToFill(); }
public UIElement GenerateWpfVisuals(GraphExample example) { ZoomControl = new ZoomControl(); ZoomControl.SetViewFinderVisibility(ZoomControl, System.Windows.Visibility.Visible); /* ENABLES WINFORMS HOSTING MODE --- >*/ var logic = new GXLogicCore <DataVertex, DataEdge, BidirectionalGraph <DataVertex, DataEdge> >(); GraphArea = new GraphAreaExample() { EnableWinFormsHostingMode = true, LogicCore = logic }; logic.Graph = example; logic.DefaultLayoutAlgorithm = GraphX.LayoutAlgorithmTypeEnum.KK; logic.DefaultLayoutAlgorithmParams = logic.AlgorithmFactory.CreateLayoutParameters(GraphX.LayoutAlgorithmTypeEnum.KK); ((KKLayoutParameters)logic.DefaultLayoutAlgorithmParams).MaxIterations = 100; logic.DefaultOverlapRemovalAlgorithm = GraphX.OverlapRemovalAlgorithmTypeEnum.FSA; logic.DefaultOverlapRemovalAlgorithmParams = logic.AlgorithmFactory.CreateOverlapRemovalParameters(GraphX.OverlapRemovalAlgorithmTypeEnum.FSA); ((OverlapRemovalParameters)logic.DefaultOverlapRemovalAlgorithmParams).HorizontalGap = 50; ((OverlapRemovalParameters)logic.DefaultOverlapRemovalAlgorithmParams).VerticalGap = 50; logic.DefaultEdgeRoutingAlgorithm = GraphX.EdgeRoutingAlgorithmTypeEnum.None; logic.AsyncAlgorithmCompute = false; ZoomControl.Content = GraphArea; GraphArea.RelayoutFinished += GAreaRelayoutFinished; var myResourceDictionary = new ResourceDictionary { Source = new Uri("Templates\\template.xaml", UriKind.Relative) }; ZoomControl.Resources.MergedDictionaries.Add(myResourceDictionary); return(ZoomControl); }
public GraphView() { InitializeComponent(); mainWindow = App.Current.MainWindow as MainWindow; dataGraph = new TestFeederGenerator.Models.GraphX(); mainWindow.graphView = this; ZoomControl.SetViewFinderVisibility(zoomctrl, Visibility.Visible); zoomctrl.ZoomToFill(); last_added_id = 1; //setup Area properties GraphAreaExample_Setup(); //setup graph properties startGraphDrawing(); undo.IsEnabled = false; redo.IsEnabled = false; (mainWindow.graphView.DataContext as GraphViewModel).undoRedoCommander = new UndoRedoCommander(this.DataContext); }
private void GeneralGraph_Constructor() { var gg_Logic = new LogicCoreExample(); gg_Area.LogicCore = gg_Logic; //gg_Area.DefaulOverlapRemovalAlgorithm gg_layalgo.ItemsSource = Enum.GetValues(typeof(LayoutAlgorithmTypeEnum)).Cast <LayoutAlgorithmTypeEnum>(); gg_layalgo.SelectedIndex = 0; gg_oralgo.ItemsSource = Enum.GetValues(typeof(OverlapRemovalAlgorithmTypeEnum)).Cast <OverlapRemovalAlgorithmTypeEnum>(); gg_oralgo.SelectedIndex = 0; gg_eralgo.ItemsSource = Enum.GetValues(typeof(EdgeRoutingAlgorithmTypeEnum)).Cast <EdgeRoutingAlgorithmTypeEnum>(); gg_eralgo.SelectedIndex = 2; gg_but_randomgraph.Click += gg_but_randomgraph_Click; gg_vertexCount.Text = "30"; gg_async.Checked += gg_async_Checked; gg_async.Unchecked += gg_async_Checked; gg_Area.RelayoutFinished += gg_Area_RelayoutFinished; gg_Area.GenerateGraphFinished += gg_Area_GenerateGraphFinished; gg_Logic.DefaultEdgeRoutingAlgorithm = EdgeRoutingAlgorithmTypeEnum.None; ZoomControl.SetViewFinderVisibility(gg_zoomctrl, System.Windows.Visibility.Visible); gg_zoomctrl.IsAnimationDisabled = false; gg_zoomctrl.MaxZoomDelta = 2; this.Loaded += GG_Loaded; }
private UIElement initEmptyGraphVisualization() { _zoomControl = new ZoomControl(); ZoomControl.SetViewFinderVisibility(_zoomControl, Visibility.Visible); var logic = new GXLogicCore <NodeV, EdgeV, BidirectionalGraph <NodeV, EdgeV> >(); _graphAreaVisualizer = new GraphAreaVisualizer { LogicCore = logic, EdgeLabelFactory = new DefaultEdgelabelFactory() }; logic.DefaultLayoutAlgorithm = LayoutAlgorithmTypeEnum.LinLog; logic.DefaultLayoutAlgorithmParams = logic.AlgorithmFactory.CreateLayoutParameters(LayoutAlgorithmTypeEnum.LinLog); //((LinLogLayoutParameters)logic.DefaultLayoutAlgorithmParams). = 100; logic.DefaultOverlapRemovalAlgorithm = OverlapRemovalAlgorithmTypeEnum.FSA; logic.DefaultOverlapRemovalAlgorithmParams = logic.AlgorithmFactory.CreateOverlapRemovalParameters(OverlapRemovalAlgorithmTypeEnum.FSA); ((OverlapRemovalParameters)logic.DefaultOverlapRemovalAlgorithmParams).HorizontalGap = 50; ((OverlapRemovalParameters)logic.DefaultOverlapRemovalAlgorithmParams).VerticalGap = 50; logic.DefaultEdgeRoutingAlgorithm = EdgeRoutingAlgorithmTypeEnum.None; logic.AsyncAlgorithmCompute = false; _graphAreaVisualizer.ShowAllEdgesLabels(true); _zoomControl.Content = _graphAreaVisualizer; var myResourceDictionary = new ResourceDictionary { Source = new Uri("Templates\\template.xaml", UriKind.Relative) }; _zoomControl.Resources.MergedDictionaries.Add(myResourceDictionary); return(_zoomControl); }
private void Window_Loaded(object sender, RoutedEventArgs e) { ZoomControl.SetViewFinderVisibility(ZoomCtrl, Visibility.Visible); ZoomCtrl.ZoomToFill(); LayoutAlgorithmComboBox.ItemsSource = GetLayoutAlgorithmName(); LayoutAlgorithmComboBox.SelectedIndex = 0; }
private UIElement GenerateWpfVisuals() { _zoomctrl = new ZoomControl(); ZoomControl.SetViewFinderVisibility(_zoomctrl, Visibility.Visible); var logic = new GXLogicCore <DataVertex, DataEdge, BidirectionalGraph <DataVertex, DataEdge> >(); _gArea = new GraphAreaExample { // EnableWinFormsHostingMode = false, LogicCore = logic, EdgeLabelFactory = new DefaultEdgelabelFactory() }; _gArea.ShowAllEdgesLabels(true); logic.Graph = GenerateGraph(); logic.DefaultLayoutAlgorithm = LayoutAlgorithmTypeEnum.LinLog; logic.DefaultLayoutAlgorithmParams = logic.AlgorithmFactory.CreateLayoutParameters(LayoutAlgorithmTypeEnum.LinLog); //((LinLogLayoutParameters)logic.DefaultLayoutAlgorithmParams). = 100; logic.DefaultOverlapRemovalAlgorithm = OverlapRemovalAlgorithmTypeEnum.FSA; logic.DefaultOverlapRemovalAlgorithmParams = logic.AlgorithmFactory.CreateOverlapRemovalParameters(OverlapRemovalAlgorithmTypeEnum.FSA); ((OverlapRemovalParameters)logic.DefaultOverlapRemovalAlgorithmParams).HorizontalGap = 50; ((OverlapRemovalParameters)logic.DefaultOverlapRemovalAlgorithmParams).VerticalGap = 50; logic.DefaultEdgeRoutingAlgorithm = EdgeRoutingAlgorithmTypeEnum.None; logic.AsyncAlgorithmCompute = false; _zoomctrl.Content = _gArea; _gArea.RelayoutFinished += gArea_RelayoutFinished; var myResourceDictionary = new ResourceDictionary { Source = new Uri("Templates\\template.xaml", UriKind.Relative) }; _zoomctrl.Resources.MergedDictionaries.Add(myResourceDictionary); return(_zoomctrl); }
private UIElement GenerateWpfVisuals() { zoomctrl = new ZoomControl(); ZoomControl.SetViewFinderVisibility(zoomctrl, System.Windows.Visibility.Visible); /* ENABLES WINFORMS HOSTING MODE --- >*/ var logic = new GXLogicCore <DataVertex, DataEdge, BidirectionalGraph <DataVertex, DataEdge> >(); gArea = new GraphAreaExample() { EnableWinFormsHostingMode = true, LogicCore = logic }; logic.Graph = GenerateGraph(); logic.DefaultLayoutAlgorithm = GraphX.LayoutAlgorithmTypeEnum.KK; logic.DefaultLayoutAlgorithmParams = logic.AlgorithmFactory.CreateLayoutParameters(GraphX.LayoutAlgorithmTypeEnum.KK); ((KKLayoutParameters)logic.DefaultLayoutAlgorithmParams).MaxIterations = 100; logic.DefaultOverlapRemovalAlgorithm = GraphX.OverlapRemovalAlgorithmTypeEnum.FSA; logic.DefaultOverlapRemovalAlgorithmParams = logic.AlgorithmFactory.CreateOverlapRemovalParameters(GraphX.OverlapRemovalAlgorithmTypeEnum.FSA); ((OverlapRemovalParameters)logic.DefaultOverlapRemovalAlgorithmParams).HorizontalGap = 50; ((OverlapRemovalParameters)logic.DefaultOverlapRemovalAlgorithmParams).VerticalGap = 50; logic.DefaultEdgeRoutingAlgorithm = GraphX.EdgeRoutingAlgorithmTypeEnum.None; logic.AsyncAlgorithmCompute = false; zoomctrl.Content = gArea; gArea.RelayoutFinished += gArea_RelayoutFinished; return(zoomctrl); }
private UIElement GenerateElementVisuals() { _zoomControl = new ZoomControl(); ZoomControl.SetViewFinderVisibility(_zoomControl, Visibility.Visible); GXLogicCore <Node, BeltPlanGraphEdge, BeltPlanGraphCore> logicCore = new GXLogicCore <Node, BeltPlanGraphEdge, BeltPlanGraphCore>(); _graph = new BeltPlanGraph { LogicCore = logicCore, EdgeLabelFactory = new DefaultEdgelabelFactory(), }; _graph.ShowAllEdgesLabels(false); logicCore.Graph = GenerateGraphCore(); logicCore.DefaultLayoutAlgorithm = _layoutAlgorithm; logicCore.DefaultLayoutAlgorithmParams = logicCore.AlgorithmFactory.CreateLayoutParameters(_layoutAlgorithm); logicCore.DefaultOverlapRemovalAlgorithm = _overlapAlgorithm; logicCore.DefaultOverlapRemovalAlgorithmParams = logicCore.AlgorithmFactory.CreateOverlapRemovalParameters(_overlapAlgorithm); logicCore.DefaultOverlapRemovalAlgorithmParams.HorizontalGap = 50; logicCore.DefaultOverlapRemovalAlgorithmParams.VerticalGap = 50; logicCore.DefaultEdgeRoutingAlgorithm = _edgeAlgorithm; logicCore.DefaultEdgeRoutingAlgorithmParams = logicCore.AlgorithmFactory.CreateEdgeRoutingParameters(_edgeAlgorithm); logicCore.AsyncAlgorithmCompute = false; _zoomControl.Content = _graph; return(_zoomControl); }
public FsmGraph() { InitializeComponent(); ZoomControl.SetViewFinderVisibility(GraphZoomControl, Visibility.Collapsed); Loaded += Window_OnLoaded; _graphManager.GraphPropertyChanged += GraphManagerOnGraphPropertyChanged; }
/// <summary> /// コンストラクタ /// </summary> public MainWindow() { InitializeComponent(); //Customize Zoombox a bit //Set minimap (overview) window to be visible by default ZoomControl.SetViewFinderVisibility(zoomControl, Visibility.Visible); //Set Fill zooming strategy so whole graph will be always visible zoomControl.ZoomToFill(); this.Loaded += MainWindow_Loaded; }
public MainWindow() { InitializeComponent(); ZoomControl.SetViewFinderVisibility(zoomctrl, Visibility.Visible); zoomctrl.ZoomToFill(); GraphAreaModel_Setup(); Loaded += MainWindow_Loaded; }
public DialogWindow() { InitializeComponent(); ZoomControl.SetViewFinderVisibility(zoomctrl, Visibility.Visible); //Set Fill zooming strategy so whole graph will be always visible zoomctrl.ZoomToFill(); SetupGraph(); Loaded += DialogWindow_Loaded; }
/// <summary> /// Конструктор по умолчанию. /// </summary> public MainWindow() { InitializeComponent(); // Включение панели навигации ZoomControl.SetViewFinderVisibility(zoomCtrl, Visibility.Visible); // Установка масштаба чтобы весь граф был виден zoomCtrl.ZoomToFill(); // Настройка значений класса MainGraphArea MainGraphArea_Setup(); Loaded += MainWindow_Loaded; }
public void InitGraphArea(ref GraphAreaExample graphArea, ref ZoomControl zoomControl, Visibility visibility) { Events.ViewGraphArea = graphArea; ZoomControl.SetViewFinderVisibility(zoomControl, Visibility.Visible); zoomControl.ZoomToFill(); LogicCoreSetup(ref graphArea); GraphAreaSetup(ref graphArea); zoomControl.ZoomToFill(); }
public Scene() { this.InitializeComponent(); this.editorManager = new EditorObjectManager(this.graphArea, this.zoomControl); ZoomControl.SetViewFinderVisibility(this.zoomControl, Visibility.Hidden); this.graphArea.VertexSelected += this.VertexSelectedAction; this.graphArea.EdgeSelected += this.EdgeSelectedAction; this.zoomControl.MouseDown += this.OnSceneMouseDown; this.zoomControl.Drop += this.ZoomControlDrop; }
public MainWindow() { InitializeComponent(); //Set minimap (overview) window to be visible by default ZoomControl.SetViewFinderVisibility(zoomctrl, Visibility.Visible); //Lets setup GraphArea settings GraphAreaExample_Setup(); IGraphParser parser = new SimpleGraphParser(0.001); parser.OpenGraph("test1.csv"); }
private void ThemedGraph_Constructor() { var tg_Logic = new LogicCoreExample(); tg_Area.LogicCore = tg_Logic; tg_Logic.DefaultLayoutAlgorithm = LayoutAlgorithmTypeEnum.LinLog; tg_Logic.DefaultOverlapRemovalAlgorithm = OverlapRemovalAlgorithmTypeEnum.FSA; tg_Logic.DefaultOverlapRemovalAlgorithmParams = tg_Logic.AlgorithmFactory.CreateOverlapRemovalParameters(OverlapRemovalAlgorithmTypeEnum.FSA); (tg_Logic.DefaultOverlapRemovalAlgorithmParams as OverlapRemovalParameters).HorizontalGap = 150; (tg_Logic.DefaultOverlapRemovalAlgorithmParams as OverlapRemovalParameters).VerticalGap = 150; tg_Logic.DefaultEdgeRoutingAlgorithm = EdgeRoutingAlgorithmTypeEnum.SimpleER; tg_Logic.EdgeCurvingEnabled = true; tg_Logic.AsyncAlgorithmCompute = true; tg_edgeMode.ItemsSource = new string[] { "Draw all edges", "Draw edges by vertex selection" }; tg_edgeMode.SelectedIndex = 0; tg_edgeType.ItemsSource = Enum.GetValues(typeof(EdgesType)).Cast <EdgesType>(); tg_edgeType.SelectedItem = EdgesType.All; tg_moveAnimation.ItemsSource = Enum.GetValues(typeof(MoveAnimation)).Cast <MoveAnimation>(); tg_moveAnimation.SelectedItem = MoveAnimation.Move; tg_deleteAnimation.ItemsSource = Enum.GetValues(typeof(DeleteAnimation)).Cast <DeleteAnimation>(); tg_deleteAnimation.SelectedItem = DeleteAnimation.Shrink; tg_mouseoverAnimation.ItemsSource = Enum.GetValues(typeof(MouseOverAnimation)).Cast <MouseOverAnimation>(); tg_mouseoverAnimation.SelectedItem = MouseOverAnimation.Scale; tg_highlightStrategy.ItemsSource = Enum.GetValues(typeof(HighlightStrategy)).Cast <HighlightStrategy>(); tg_highlightStrategy.SelectedItem = HighlightStrategy.UseExistingControls; tg_highlightType.ItemsSource = Enum.GetValues(typeof(GraphControlType)).Cast <GraphControlType>(); tg_highlightType.SelectedItem = GraphControlType.VertexAndEdge; tg_highlightEdgeType.ItemsSource = Enum.GetValues(typeof(EdgesType)).Cast <EdgesType>(); tg_highlightEdgeType.SelectedItem = EdgesType.All; //tg_Area.UseNativeObjectArrange = false; //tg_Area.SideExpansionSize = new Size(100, 100); //additional space for correct scale animation //tg_Area.DefaultEdgeRoutingAlgorithm = EdgeRoutingAlgorithmTypeEnum.SimpleER; tg_highlightEnabled_Checked(null, null); tg_dragMoveEdges_Checked(null, null); tg_dragEnabled_Checked(null, null); tg_Area.VertexSelected += tg_Area_VertexSelected; tg_Area.GenerateGraphFinished += tg_Area_GenerateGraphFinished; tg_Area.RelayoutFinished += tg_Area_RelayoutFinished; tg_dragMoveEdges.Checked += tg_dragMoveEdges_Checked; tg_dragMoveEdges.Unchecked += tg_dragMoveEdges_Checked; ZoomControl.SetViewFinderVisibility(tg_zoomctrl, System.Windows.Visibility.Visible); TGRegisterCommands(); }
public MainWindow() { InitializeComponent(); //Customize Zoombox a bit //Set minimap (overview) window to be visible by default ZoomControl.SetViewFinderVisibility(ZoomControl, Visibility.Visible); //Set Fill zooming strategy so whole graph will be always visible ZoomControl.ZoomToFill(); _analyzer.Execute(); foreach (var sentence in _analyzer.Sentences) { ListBoxSentence.Items.Add(new SentenceViewModel(sentence).Text); } }
// private ZoomControl tg_zoomctrl = new ZoomControl(); public ThemedGraph() { InitializeComponent(); var logic = new LogicCoreExample(); tg_Area.LogicCore = logic; logic.DefaultLayoutAlgorithm = LayoutAlgorithmTypeEnum.KK; logic.DefaultOverlapRemovalAlgorithm = OverlapRemovalAlgorithmTypeEnum.FSA; logic.DefaultOverlapRemovalAlgorithmParams.HorizontalGap = 50; logic.DefaultOverlapRemovalAlgorithmParams.VerticalGap = 50; logic.DefaultEdgeRoutingAlgorithm = EdgeRoutingAlgorithmTypeEnum.SimpleER; logic.EdgeCurvingEnabled = true; logic.AsyncAlgorithmCompute = true; tg_Area.SetVerticesDrag(true); tg_dragEnabled.IsChecked = true; tg_edgeMode.ItemsSource = new[] { "Draw all", "Draw for selected" }; tg_edgeMode.SelectedIndex = 0; tg_edgeType.ItemsSource = Enum.GetValues(typeof(EdgesType)).Cast <EdgesType>(); tg_edgeType.SelectedItem = EdgesType.All; tg_moveAnimation.ItemsSource = Enum.GetValues(typeof(MoveAnimation)).Cast <MoveAnimation>(); tg_moveAnimation.SelectedItem = MoveAnimation.Move; tg_deleteAnimation.ItemsSource = Enum.GetValues(typeof(DeleteAnimation)).Cast <DeleteAnimation>(); tg_deleteAnimation.SelectedItem = DeleteAnimation.Shrink; tg_mouseoverAnimation.ItemsSource = Enum.GetValues(typeof(MouseOverAnimation)).Cast <MouseOverAnimation>(); tg_mouseoverAnimation.SelectedItem = MouseOverAnimation.Scale; tg_highlightStrategy.ItemsSource = Enum.GetValues(typeof(HighlightStrategy)).Cast <HighlightStrategy>(); tg_highlightStrategy.SelectedItem = HighlightStrategy.UseExistingControls; tg_highlightType.ItemsSource = Enum.GetValues(typeof(GraphControlType)).Cast <GraphControlType>(); tg_highlightType.SelectedItem = GraphControlType.VertexAndEdge; tg_highlightEdgeType.ItemsSource = Enum.GetValues(typeof(EdgesType)).Cast <EdgesType>(); tg_highlightEdgeType.SelectedItem = EdgesType.All; tg_highlightEnabled_Checked(null, null); tg_dragMoveEdges_Checked(null, null); tg_dragEnabled_Checked(null, null); tg_Area.VertexSelected += tg_Area_VertexSelected; tg_Area.GenerateGraphFinished += tg_Area_GenerateGraphFinished; tg_Area.RelayoutFinished += tg_Area_RelayoutFinished; tg_dragMoveEdges.Checked += tg_dragMoveEdges_Checked; tg_dragMoveEdges.Unchecked += tg_dragMoveEdges_Checked; ZoomControl.SetViewFinderVisibility(tg_zoomctrl, Visibility.Visible); TgRegisterCommands(); }
//.GetLogicCore<LogicCoreExample>() private void ERGraph_Constructor() { var erg_Logic = new LogicCoreExample(); erg_Area.LogicCore = erg_Logic; erg_Area.LogicCore.ParallelEdgeDistance = 20; erg_showEdgeArrows.IsChecked = true; erg_BundleEdgeRoutingParameters = (BundleEdgeRoutingParameters)erg_Logic.AlgorithmFactory.CreateEdgeRoutingParameters(EdgeRoutingAlgorithmTypeEnum.Bundling); erg_SimpleERParameters = (SimpleERParameters)erg_Logic.AlgorithmFactory.CreateEdgeRoutingParameters(EdgeRoutingAlgorithmTypeEnum.SimpleER); erg_PFERParameters = (PathFinderEdgeRoutingParameters)erg_Logic.AlgorithmFactory.CreateEdgeRoutingParameters(EdgeRoutingAlgorithmTypeEnum.PathFinder); erg_pfprm_formula.ItemsSource = Enum.GetValues(typeof(PathFindAlgorithm)).Cast <PathFindAlgorithm>(); erg_pfprm_formula.SelectedIndex = 0; erg_but_randomgraph.Click += erg_but_randomgraph_Click; erg_but_relayout.Click += erg_but_relayout_Click; erg_useExternalERAlgo.Checked += erg_useExternalERAlgo_Checked; erg_useExternalERAlgo.Unchecked += erg_useExternalERAlgo_Checked; erg_dashstyle.ItemsSource = Enum.GetValues(typeof(EdgeDashStyle)).Cast <EdgeDashStyle>(); erg_dashstyle.SelectedIndex = 0; erg_dashstyle.SelectionChanged += erg_dashstyle_SelectionChanged; erg_eralgo.ItemsSource = Enum.GetValues(typeof(EdgeRoutingAlgorithmTypeEnum)).Cast <EdgeRoutingAlgorithmTypeEnum>(); erg_eralgo.SelectedIndex = 0; erg_eralgo.SelectionChanged += erg_eralgo_SelectionChanged; erg_prmsbox.Visibility = System.Windows.Visibility.Collapsed; erg_recalculate.Checked += erg_recalculate_Checked; erg_recalculate.Unchecked += erg_recalculate_Checked; erg_randomizeAll.Click += erg_randomizeAll_Click; erg_showEdgeArrows.Checked += erg_showEdgeArrows_Checked; erg_showEdgeArrows.Unchecked += erg_showEdgeArrows_Checked; erg_showEdgeLabels.Checked += erg_showEdgeLabels_Checked; erg_showEdgeLabels.Unchecked += erg_showEdgeLabels_Checked; erg_alignEdgeLabels.Checked += erg_alignEdgeLabels_Checked; erg_alignEdgeLabels.Unchecked += erg_alignEdgeLabels_Checked; erg_enableParallelEdges.Checked += erg_enableParallelEdges_Checked; erg_enableParallelEdges.Unchecked += erg_enableParallelEdges_Checked; erg_randomizeArrows.Click += erg_randomizeArrows_Click; erg_useCurves.Checked += erg_useCurves_Checked; erg_useCurves.Unchecked += erg_useCurves_Checked; ZoomControl.SetViewFinderVisibility(erg_zoomctrl, System.Windows.Visibility.Visible); //erg_Area.UseNativeObjectArrange = true; }
public NNGraph() { InitializeComponent(); _editorManager = new EditorObjectManager(graphArea, zoomCtrl); var dgLogic = new LogicCoreExample(); graphArea.LogicCore = dgLogic; graphArea.VertexSelected += graphArea_VertexSelected; graphArea.EdgeSelected += graphArea_EdgeSelected; graphArea.SetVerticesMathShape(VertexShape.Circle); // addVertexButton.Click += addVertexButton_Click; // addEdgeButton.Click += addEdgeButton_Click; dgLogic.DefaultLayoutAlgorithm = LayoutAlgorithmTypeEnum.Custom; dgLogic.DefaultOverlapRemovalAlgorithm = OverlapRemovalAlgorithmTypeEnum.None; dgLogic.DefaultEdgeRoutingAlgorithm = EdgeRoutingAlgorithmTypeEnum.None; dgLogic.EdgeCurvingEnabled = true; //graphArea.MoveAnimation = AnimationFactory.CreateMoveAnimation(MoveAnimation.Move, TimeSpan.FromSeconds(0.5)); //graphArea.MoveAnimation.Completed += MoveAnimation_Completed; //graphArea.VertexSelected += dg_Area_VertexSelected; zoomCtrl.IsAnimationDisabled = true; ZoomControl.SetViewFinderVisibility(zoomCtrl, Visibility.Visible); zoomCtrl.Zoom = 2; zoomCtrl.MinZoom = .5; zoomCtrl.MaxZoom = 50; zoomCtrl.ZoomSensitivity = 25; zoomCtrl.MouseDown += zoomCtrl_MouseDown; var tb = new TextBlock() { Text = "AAAA" }; //zoomCtrl.ZoomToContent(new System.Windows.Rect(0,0, 500, 500)); butDelete.Checked += ToolbarButton_Checked; butSelect.Checked += ToolbarButton_Checked; butEdit.Checked += ToolbarButton_Checked; butSelect.IsChecked = true; }
public EdgeRoutingGraph() { InitializeComponent(); DataContext = this; _logicCore = new LogicCoreExample(); erg_Area.LogicCore = _logicCore; erg_Area.LogicCore.ParallelEdgeDistance = 20; erg_Area.EdgeLabelFactory = new DefaultEdgelabelFactory(); erg_showEdgeArrows.IsChecked = true; BundleEdgeRoutingParameters = (BundleEdgeRoutingParameters)_logicCore.AlgorithmFactory.CreateEdgeRoutingParameters(EdgeRoutingAlgorithmTypeEnum.Bundling); SimpleErParameters = (SimpleERParameters)_logicCore.AlgorithmFactory.CreateEdgeRoutingParameters(EdgeRoutingAlgorithmTypeEnum.SimpleER); PfErParameters = (PathFinderEdgeRoutingParameters)_logicCore.AlgorithmFactory.CreateEdgeRoutingParameters(EdgeRoutingAlgorithmTypeEnum.PathFinder); erg_pfprm_formula.ItemsSource = Enum.GetValues(typeof(PathFindAlgorithm)).Cast <PathFindAlgorithm>(); erg_pfprm_formula.SelectedIndex = 0; erg_but_randomgraph.Click += erg_but_randomgraph_Click; erg_but_relayout.Click += erg_but_relayout_Click; erg_useExternalERAlgo.Checked += erg_useExternalERAlgo_Checked; erg_useExternalERAlgo.Unchecked += erg_useExternalERAlgo_Checked; erg_dashstyle.ItemsSource = Enum.GetValues(typeof(EdgeDashStyle)).Cast <EdgeDashStyle>(); erg_dashstyle.SelectedIndex = 0; erg_dashstyle.SelectionChanged += erg_dashstyle_SelectionChanged; erg_eralgo.ItemsSource = Enum.GetValues(typeof(EdgeRoutingAlgorithmTypeEnum)).Cast <EdgeRoutingAlgorithmTypeEnum>(); erg_eralgo.SelectedIndex = 0; erg_eralgo.SelectionChanged += erg_eralgo_SelectionChanged; erg_prmsbox.Visibility = Visibility.Collapsed; erg_recalculate.Checked += erg_recalculate_Checked; erg_recalculate.Unchecked += erg_recalculate_Checked; erg_randomizeAll.Click += erg_randomizeAll_Click; erg_showEdgeArrows.Checked += erg_showEdgeArrows_Checked; erg_showEdgeArrows.Unchecked += erg_showEdgeArrows_Checked; erg_showEdgeLabels.Checked += erg_showEdgeLabels_Checked; erg_showEdgeLabels.Unchecked += erg_showEdgeLabels_Checked; erg_alignEdgeLabels.Checked += erg_alignEdgeLabels_Checked; erg_alignEdgeLabels.Unchecked += erg_alignEdgeLabels_Checked; erg_enableParallelEdges.Checked += erg_enableParallelEdges_Checked; erg_enableParallelEdges.Unchecked += erg_enableParallelEdges_Checked; erg_randomizeArrows.Click += erg_randomizeArrows_Click; erg_useCurves.Checked += erg_useCurves_Checked; erg_useCurves.Unchecked += erg_useCurves_Checked; ZoomControl.SetViewFinderVisibility(erg_zoomctrl, Visibility.Visible); }
public MainWindow() { InitializeComponent(); //Customize Zoombox a bit //Set minimap (overview) window to be visible by default ZoomControl.SetViewFinderVisibility(zoomctrl, Visibility.Visible); //Set Fill zooming strategy so whole graph will be always visible zoomctrl.ZoomToFill(); //Lets setup GraphArea settings GraphAreaExample_Setup(); gg_but_randomgraph.Click += gg_but_randomgraph_Click; gg_but_relayout.Click += gg_but_relayout_Click; Loaded += MainWindow_Loaded; }
public MainWindow() { this.InitializeComponent(); this.editorManager = new EditorObjectManager(this.g_Area, this.g_zoomctrl); this.dataGraph = new GraphExample(); var logic = new GXLogicCore <DataVertex, DataEdge, BidirectionalGraph <DataVertex, DataEdge> >(); this.g_Area.LogicCore = logic; logic.Graph = this.dataGraph; logic.DefaultLayoutAlgorithm = LayoutAlgorithmTypeEnum.LinLog; this.g_Area.VertexSelected += this.VertexSelectedAction; this.g_Area.EdgeSelected += this.EdgeSelectedAction; this.g_zoomctrl.Click += this.ClearSelection; this.elementsListBox.MouseDoubleClick += this.ElementInBoxSelectedAction; ZoomControl.SetViewFinderVisibility(this.g_zoomctrl, Visibility.Visible); this.g_zoomctrl.Loaded += (sender, args) => { (this.g_zoomctrl.ViewFinder.Parent as Grid).Children.Remove(this.g_zoomctrl.ViewFinder); this.rightPanel.Children.Add(this.g_zoomctrl.ViewFinder); Grid.SetRow(this.g_zoomctrl.ViewFinder, 0); }; logic.DefaultLayoutAlgorithmParams = logic.AlgorithmFactory.CreateLayoutParameters(LayoutAlgorithmTypeEnum.LinLog); logic.DefaultOverlapRemovalAlgorithm = OverlapRemovalAlgorithmTypeEnum.FSA; logic.DefaultOverlapRemovalAlgorithmParams = logic.AlgorithmFactory.CreateOverlapRemovalParameters(OverlapRemovalAlgorithmTypeEnum.FSA); ((OverlapRemovalParameters)logic.DefaultOverlapRemovalAlgorithmParams).HorizontalGap = 50; ((OverlapRemovalParameters)logic.DefaultOverlapRemovalAlgorithmParams).VerticalGap = 50; logic.DefaultEdgeRoutingAlgorithm = EdgeRoutingAlgorithmTypeEnum.None; logic.AsyncAlgorithmCompute = false; this.Closed += this.CloseChildrenWindows; var modelName = "RobotsTestModel"; this.g_zoomctrl.MouseDown += (object sender, MouseButtonEventArgs e) => this.ZoomCtrl_MouseDown(sender, e, modelName); this.InitPalette(modelName); this.InitModel(modelName); }
private UIElement GenerateWpfVisual2Export(string g6) { _zoomctrl = new ZoomControl(); ZoomControl.SetViewFinderVisibility(_zoomctrl, Visibility.Hidden); var logic = new GXLogicCore <DataVertex, DataEdge, BidirectionalGraph <DataVertex, DataEdge> >(); _gArea = new GraphAreaView { LogicCore = logic, EdgeLabelFactory = new DefaultEdgelabelFactory() }; _gArea.ShowAllEdgesLabels(false); logic.DefaultLayoutAlgorithm = LayoutAlgorithmTypeEnum.LinLog; logic.DefaultLayoutAlgorithmParams = logic.AlgorithmFactory.CreateLayoutParameters(LayoutAlgorithmTypeEnum.LinLog); /*if (listOfG6Exp.Items[i].ToString().Length != 0) * { * * }*/ logic.Graph = Conversor.G6toQuickGraph(g6); logic.DefaultOverlapRemovalAlgorithm = OverlapRemovalAlgorithmTypeEnum.FSA; logic.DefaultOverlapRemovalAlgorithmParams = logic.AlgorithmFactory.CreateOverlapRemovalParameters(OverlapRemovalAlgorithmTypeEnum.FSA); ((OverlapRemovalParameters)logic.DefaultOverlapRemovalAlgorithmParams).HorizontalGap = 100; ((OverlapRemovalParameters)logic.DefaultOverlapRemovalAlgorithmParams).VerticalGap = 100; logic.DefaultEdgeRoutingAlgorithm = EdgeRoutingAlgorithmTypeEnum.None; logic.AsyncAlgorithmCompute = false; _zoomctrl.Content = _gArea; _gArea.RelayoutFinished += gArea_RelayoutFinished; //Edge visualization edit _gArea.SetEdgesDashStyle(EdgeDashStyle.Solid); _gArea.ShowAllEdgesArrows(false); var myResourceDictionary = new ResourceDictionary { Source = new Uri("GraphX_Utils\\template.xaml", UriKind.Relative) }; _zoomctrl.Resources.MergedDictionaries.Add(myResourceDictionary); return(_zoomctrl); }
public GeneralGraph() { InitializeComponent(); DataContext = this; gg_vertexCount.Text = "30"; var ggLogic = new LogicCoreExample(); gg_Area.LogicCore = ggLogic; gg_layalgo.SelectionChanged += gg_layalgo_SelectionChanged; gg_oralgo.SelectionChanged += gg_oralgo_SelectionChanged; gg_eralgo.SelectionChanged += gg_eralgo_SelectionChanged; gg_layalgo.ItemsSource = Enum.GetValues(typeof(LayoutAlgorithmTypeEnum)).Cast <LayoutAlgorithmTypeEnum>(); gg_layalgo.SelectedItem = LayoutAlgorithmTypeEnum.KK; gg_oralgo.ItemsSource = Enum.GetValues(typeof(OverlapRemovalAlgorithmTypeEnum)).Cast <OverlapRemovalAlgorithmTypeEnum>(); gg_oralgo.SelectedIndex = 0; gg_eralgo.ItemsSource = Enum.GetValues(typeof(EdgeRoutingAlgorithmTypeEnum)).Cast <EdgeRoutingAlgorithmTypeEnum>(); gg_eralgo.SelectedItem = EdgeRoutingAlgorithmTypeEnum.SimpleER; gg_but_randomgraph.Click += gg_but_randomgraph_Click; gg_async.Checked += gg_async_Checked; gg_async.Unchecked += gg_async_Checked; gg_Area.RelayoutFinished += gg_Area_RelayoutFinished; gg_Area.GenerateGraphFinished += gg_Area_GenerateGraphFinished; gg_Area.VertexLabelFactory = new DefaultVertexlabelFactory(); ggLogic.DefaultEdgeRoutingAlgorithm = EdgeRoutingAlgorithmTypeEnum.SimpleER; ggLogic.EdgeCurvingEnabled = true; gg_Area.ShowAllEdgesArrows(true); ZoomControl.SetViewFinderVisibility(gg_zoomctrl, Visibility.Visible); gg_zoomctrl.IsAnimationEnabled = true; gg_zoomctrl.ZoomStep = 2; Loaded += GG_Loaded; }