/// <summary> /// Creates the menu for a GUIpanel. /// </summary> /// <param name="myGUIpanel">the GUIpanel that this menu is attached to</param> /// <param name="dataPanel">a reference to the data view panel</param> /// <param name="contourTreePanel">a reference to the contour tree view panel</param> /// <param name="joinTreePanel">a reference to the join tree view panel</param> /// <param name="splitTreePanel">a reference to the split tree view panel</param> /// <param name="uncertaintyPanel">a reference to the uncertainty view panel</param> /// <param name="label">the text to display on the "label" ToolStripMenuItem when this is first instantiated</param> public GUIpanelMenu(GUIpanel myGUIpanel, Panel dataPanel, Panel contourTreePanel, JoinTreeView joinTreePanel, Panel splitTreePanel, Panel uncertaintyPanel, string label) : base() { // display properties this.Anchor = (AnchorStyles)((AnchorStyles.Left | AnchorStyles.Top) | AnchorStyles.Right); // panel references this.myGUIpanel = myGUIpanel; this.dataPanel = dataPanel; this.contourTreePanel = contourTreePanel; this.joinTreePanel = joinTreePanel; this.splitTreePanel = splitTreePanel; this.uncertaintyPanel = uncertaintyPanel; // menu items ToolStripMenuItem display = new ToolStripMenuItem("Display..."); this.Items.Add(display); display.DropDownItems.Add(new ToolStripMenuItem("Data", null, new EventHandler(displayData))); display.DropDownItems.Add(new ToolStripMenuItem("Contour Tree", null, new EventHandler(displayContourTree))); display.DropDownItems.Add(new ToolStripMenuItem("Join Tree", null, new EventHandler(displayJoinTree))); display.DropDownItems.Add(new ToolStripMenuItem("Split Tree", null, new EventHandler(displaySplitTree))); display.DropDownItems.Add(new ToolStripMenuItem("Uncertainty", null, new EventHandler(displayUncertainty))); // the label this.label = new ToolStripMenuItem(label); this.Items.Add(label); }
/// <summary> /// Creates a new instance of the GUI. /// </summary> public GUI() { // Create the panels that display views. this.joinTreeView = new JoinTreeView(); this.splitTreeView = new SplitTreeView(); this.contourTreeView = new ContourTreeView(); this.topology = new TopologyChangeView(); // Keep track of how many data files have been read. this.currentTimeStep = 0; this.fileDataList = new List<FileDataAbstract>(); // Required by C# for GUI stuff. InitializeComponent(); // Create the actual panels and make them display one view each. GUIpanel ULpanel = new GUIpanel(new Panel(), contourTreeView, joinTreeView, splitTreeView, topology, joinTreeView); GUIpanel URpanel = new GUIpanel(new Panel(), contourTreeView, joinTreeView, splitTreeView, topology, splitTreeView); GUIpanel BLpanel = new GUIpanel(new Panel(), contourTreeView, joinTreeView, splitTreeView, topology, contourTreeView); GUIpanel BMpanel = new GUIpanel(new Panel(), contourTreeView, joinTreeView, splitTreeView, topology, new Panel()); GUIpanel BRpanel = new GUIpanel(new Panel(), contourTreeView, joinTreeView, splitTreeView, topology, topology); // Add the panels to the GUI. this.GUI_layout.Controls.Add(ULpanel); this.GUI_layout.Controls.Add(URpanel); this.GUI_layout.Controls.Add(BLpanel); this.GUI_layout.Controls.Add(BMpanel); this.GUI_layout.Controls.Add(BRpanel); // Set the spacing to look nice. this.GUI_layout.SetColumnSpan(ULpanel, 3); this.GUI_layout.SetColumnSpan(URpanel, 3); this.GUI_layout.SetColumnSpan(BLpanel, 2); this.GUI_layout.SetColumnSpan(BMpanel, 2); this.GUI_layout.SetColumnSpan(BRpanel, 2); }