コード例 #1
0
        /// <summary>
        /// Create a new instance of this class.
        /// </summary>
        public GraphUndoForm()
        {
            InitializeComponent();
            graphControl.FileOperationsEnabled = true;
            ZoomInButton.SetCommand(Commands.IncreaseZoom, graphControl);
            ZoomOutButton.SetCommand(Commands.DecreaseZoom, graphControl);
            FitContentButton.SetCommand(Commands.FitContent, graphControl);

            undoButton.SetCommand(Commands.Undo, graphControl);
            redoButton.SetCommand(Commands.Redo, graphControl);

            // File menu
            openToolStripMenuItem.SetCommand(Commands.Open, graphControl);
            saveAsToolStripMenuItem.SetCommand(Commands.Save, graphControl);
            // Edit menu
            undoToolStripMenuItem.SetCommand(Commands.Undo, graphControl);
            redoToolStripMenuItem.SetCommand(Commands.Redo, graphControl);
            cutToolStripMenuItem.SetCommand(Commands.Cut, graphControl);
            copyToolStripMenuItem.SetCommand(Commands.Copy, graphControl);
            pasteToolStripMenuItem.SetCommand(Commands.Paste, graphControl);
            deleteToolStripMenuItem.SetCommand(Commands.Delete, graphControl);

            // View menu
            zoomInToolStripMenuItem.SetCommand(Commands.IncreaseZoom, graphControl);
            zoomOutToolStripMenuItem.SetCommand(Commands.DecreaseZoom, graphControl);
            fitToSizeToolStripMenuItem.SetCommand(Commands.FitGraphBounds, graphControl);

            openButton.SetCommand(Commands.Open, graphControl);
            saveButton.SetCommand(Commands.Save, graphControl);
            cutButton.SetCommand(Commands.Cut, graphControl);
            copyButton.SetCommand(Commands.Copy, graphControl);
            pasteButton.SetCommand(Commands.Paste, graphControl);
        }
コード例 #2
0
 /// <summary>
 /// Create a new instance of this class.
 /// </summary>
 public GraphCollapseForm()
 {
     InitializeComponent();
     // assign zoom commands
     ZoomInButton.SetCommand(Commands.IncreaseZoom, graphControl);
     ZoomOutButton.SetCommand((Commands.DecreaseZoom), graphControl);
     FitContentButton.SetCommand(Commands.FitContent, graphControl);
     // load description
     descriptionTextBox.LoadFile(new MemoryStream(Resources.description), RichTextBoxStreamType.RichText);
 }
コード例 #3
0
 /// <summary>
 /// Automatically generated by Visual Studio.
 /// Wires up the UI components and adds a
 /// <see cref="GraphControl"/> to the form.
 /// </summary>
 public InteractiveOrganicForm()
 {
     InitializeComponent();
     // enable load and save
     graphControl.FileOperationsEnabled = true;
     // register zoom commands on buttons
     ZoomInButton.SetCommand(Commands.IncreaseZoom, graphControl);
     ZoomOutButton.SetCommand(Commands.DecreaseZoom, graphControl);
     FitContentButton.SetCommand(Commands.FitGraphBounds, graphControl);
 }
 private void ConfigureComponents()
 {
     // load description
     description.LoadFile(new MemoryStream(Resources.description), RichTextBoxStreamType.RichText);
     // set commands for buttons
     OpenButton.SetCommand(Commands.Open, graphControl);
     PrintButton.SetCommand(Commands.Print, graphControl);
     ZoomInButton.SetCommand(Commands.IncreaseZoom, graphControl);
     ZoomOutButton.SetCommand(Commands.DecreaseZoom, graphControl);
     FitContentButton.SetCommand(Commands.FitGraphBounds, graphControl.FitContentViewMargins, graphControl);
 }
コード例 #5
0
        /// <summary>
        /// Called upon loading of the form.
        /// This method initializes the graph and the input mode.
        /// </summary>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            description.LoadFile(new MemoryStream(Resources.description), RichTextBoxStreamType.RichText);
            // initialize the graph
            Graph.SetUndoEngineEnabled(true);
            graphControl.FileOperationsEnabled = true;
            ZoomInButton.SetCommand(Commands.IncreaseZoom, graphControl);
            ZoomOutButton.SetCommand(Commands.DecreaseZoom, graphControl);
            FitContentButton.SetCommand(Commands.FitContent, graphControl);

            SaveMenuItem.SetCommand(Commands.SaveAs, graphControl);
            OpenMenuItem.SetCommand(Commands.Open, graphControl);
            sampleFilesComboBox.SelectedIndex = 0;
        }
        /// <summary>
        /// Automatically generated by Visual Studio.
        /// Wires up the UI components and adds a
        /// <see cref="GraphControl"/> to the window.
        /// </summary>
        public NodeLabelingForm()
        {
            InitializeComponent();

            ZoomInButton.SetCommand(Commands.IncreaseZoom, graphControl);
            ZoomOutButton.SetCommand(Commands.DecreaseZoom, graphControl);
            FitContentButton.SetCommand(Commands.FitContent, graphControl);

            // View menu
            zoomInToolStripMenuItem.SetCommand(Commands.IncreaseZoom, graphControl);
            zoomOutToolStripMenuItem.SetCommand(Commands.DecreaseZoom, graphControl);
            fitGraphBoundsToolStripMenuItem.SetCommand(Commands.FitContent, graphControl);

            deleteButton.SetCommand(Commands.Delete, graphControl);
        }
        /// <summary>
        /// Automatically generated by Visual Studio.
        /// Wires up the UI components and adds a
        /// <see cref="GraphControl"/> to the form.
        /// </summary>
        public IncrementalHierarchicLayoutForm()
        {
            InitializeComponent();

            // Configure the GraphMLIOHandler so that a layout runs automatically after loading a graph
            graphControl.GraphMLIOHandler.Parsed += delegate {
                if (!this.updateLayout)
                {
                    // after the file has been loaded - create an initial layout
                    graphControl.Graph.ApplyLayout(CreateLayout(), new HierarchicLayoutData {
                        LayerIndices = layerIndices
                    });

                    // update the layers
                    layerVisualCreator.UpdateLayers(graphControl.Graph, layerIndices);
                }
            };

            ZoomInButton.SetCommand(Commands.IncreaseZoom, graphControl);
            ZoomOutButton.SetCommand(Commands.DecreaseZoom, graphControl);

            FitContentButton.SetCommand(Commands.FitGraphBounds, graphControl);
        }
コード例 #8
0
 private void RegisterToolStripCommands()
 {
     ZoomInButton.SetCommand(Commands.IncreaseZoom, graphControl);
     ZoomOutButton.SetCommand(Commands.DecreaseZoom, graphControl);
     FitContentButton.SetCommand(Commands.FitContent, graphControl);
 }