Esempio n. 1
0
        private void ERGraph_Constructor()
        {
            erg_showEdgeArrows.IsChecked    = true;
            erg_BundleEdgeRoutingParameters = (BundleEdgeRoutingParameters)erg_Area.AlgorithmFactory.CreateEdgeRoutingParameters(EdgeRoutingAlgorithmTypeEnum.Bundling);
            erg_SimpleERParameters          = (SimpleERParameters)erg_Area.AlgorithmFactory.CreateEdgeRoutingParameters(EdgeRoutingAlgorithmTypeEnum.SimpleER);
            erg_PFERParameters = (PathFinderEdgeRoutingParameters)erg_Area.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_randomizeArrows.Click       += erg_randomizeArrows_Click;
            erg_useCurves.Checked           += erg_useCurves_Checked;
            erg_useCurves.Unchecked         += erg_useCurves_Checked;
            Zoombox.SetViewFinderVisibility(erg_zoomctrl, System.Windows.Visibility.Visible);

            erg_Area.UseNativeObjectArrange = true;
        }
Esempio n. 2
0
        private void ThemedGraph_Constructor()
        {
            tg_Area.DefaultOverlapRemovalAlgorithm       = OverlapRemovalAlgorithmTypeEnum.FSA;
            tg_Area.DefaultOverlapRemovalAlgorithmParams = dg_Area.AlgorithmFactory.CreateOverlapRemovalParameters(OverlapRemovalAlgorithmTypeEnum.FSA);
            (tg_Area.DefaultOverlapRemovalAlgorithmParams as OverlapRemovalParameters).HorizontalGap = 150;
            (tg_Area.DefaultOverlapRemovalAlgorithmParams as OverlapRemovalParameters).VerticalGap   = 150;
            tg_Area.DefaultEdgeRoutingAlgorithm = EdgeRoutingAlgorithmTypeEnum.SimpleER;
            tg_Area.EdgeCurvingEnabled          = 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     = true;
            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.AsyncAlgorithmCompute = true;

            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;

            Zoombox.SetViewFinderVisibility(tg_zoomctrl, System.Windows.Visibility.Visible);

            TGRegisterCommands();
        }
Esempio n. 3
0
        public MainWindow()
        {
            InitializeComponent();

            //Customize Zoombox a bit
            //Set minimap (overview) window to be visible by default
            Zoombox.SetViewFinderVisibility(zoomctrl, System.Windows.Visibility.Visible);
            //Set Fill zooming strategy so whole graph will be always visible
            zoomctrl.FillToBounds();

            //Lets create filled data graph with edges and vertices
            _dataGraph = GraphExample_Setup();

            //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;
        }
Esempio n. 4
0
        public void DynamicGraph_Construtor()
        {
            dg_addvertex.Click += dg_addvertex_Click;
            dg_remvertex.Click += dg_remvertex_Click;
            dg_addedge.Click   += dg_addedge_Click;
            dg_remedge.Click   += dg_remedge_Click;
            dg_Area.DefaultOverlapRemovalAlgorithm = OverlapRemovalAlgorithmTypeEnum.FSA;
            dg_Area.DefaultEdgeRoutingAlgorithm    = EdgeRoutingAlgorithmTypeEnum.None;
            dg_Area.MoveAnimation = AnimationFactory.CreateMoveAnimation(MoveAnimation.Move, TimeSpan.FromSeconds(0.5));
            //dg_Area.DeleteAnimation = AnimationFactory.CreateDeleteAnimation(DeleteAnimation.Fade, TimeSpan.FromSeconds(0.3));
            // dg_Area.MouseOverAnimation = AnimationFactory.CreateMouseOverAnimation(MouseOverAnimation.Scale, TimeSpan.FromSeconds(0.3));
            dg_Area.Graph                  = new GraphExample();
            dg_Area.VertexSelected        += dg_Area_VertexSelected;
            dg_test.Visibility             = System.Windows.Visibility.Collapsed;
            dg_test.Click                 += dg_test_Click;
            dg_Area.EdgeCurvingEnabled     = true;
            dg_zoomctrl.AreaSelected      += dg_zoomctrl_AreaSelected;
            dg_Area.UseNativeObjectArrange = true;


            dg_dragsource.PreviewMouseLeftButtonDown += dg_dragsource_PreviewMouseLeftButtonDown;
            dg_zoomctrl.AllowDrop    = true;
            dg_zoomctrl.PreviewDrop += dg_Area_Drop;
            dg_zoomctrl.DragEnter   += dg_Area_DragEnter;

            dg_zoomctrl.AnimationAccelerationRatio = 0;
            dg_zoomctrl.AnimationDecelerationRatio = 0;
            dg_zoomctrl.AnimationDuration          = new System.Windows.Duration(TimeSpan.FromSeconds(0));
            dg_zoomctrl.IsAnimated = false;
            Zoombox.SetViewFinderVisibility(dg_zoomctrl, System.Windows.Visibility.Visible);


            dg_zoomctrl.PreviewMouseMove += dg_Area_MouseMove;
            dg_zoomctrl.MouseDown        += dg_zoomctrl_MouseDown;

            //dg_zoomctrl.KeepContentInBounds = true;
        }
Esempio n. 5
0
        public MainWindow()
        {
            InitializeComponent();
            Zoombox.SetViewFinderVisibility(zoom_control, System.Windows.Visibility.Visible);

            CreateNewGraph();
            zoom_control.CenterContent();
            zoom_control.DragModifiers.Clear();
            zoom_control.DragModifiers.Add(GraphX.Xceed.Wpf.Toolkit.Core.Input.KeyModifier.Ctrl);
            zoom_control.DragModifiers.Add(GraphX.Xceed.Wpf.Toolkit.Core.Input.KeyModifier.Shift);
            zoom_control.DragModifiers.Add(GraphX.Xceed.Wpf.Toolkit.Core.Input.KeyModifier.Exact);
            zoom_control.ZoomModifiers.Clear();
            zoom_control.ZoomModifiers.Add(GraphX.Xceed.Wpf.Toolkit.Core.Input.KeyModifier.Ctrl);
            zoom_control.ZoomModifiers.Add(GraphX.Xceed.Wpf.Toolkit.Core.Input.KeyModifier.Alt);
            zoom_control.ZoomModifiers.Add(GraphX.Xceed.Wpf.Toolkit.Core.Input.KeyModifier.Exact);

            PreferencesExpander.Collapsed += delegate
            {
                PrefTopRow.Height = new GridLength(1, GridUnitType.Auto);
            };

            PreferencesExpander.Expanded += delegate
            {
                PrefTopRow.Height = new GridLength(1, GridUnitType.Star);
            };

            dir_count_cancellation_token = dir_count_token_source.Token;
            ctags_cancellation_token     = ctags_token_source.Token;

            NotesEditor.TextArea.TextView.MouseDown += NotesEditor_MouseDown;
            NotesEditor.TextArea.TextView.LineTransformers.Add(new NotesLinkUnderliner());

            if (File.Exists(Properties.Settings.Default.PreviousFile))
            {
                load_project(Properties.Settings.Default.PreviousFile);
            }
        }