public override void InitElements() { base.InitElements(); Window.SetBackground(45, 45, 45); Window.SetHeight(250); Window.SetWidth(450); var title = UiElements.GetDialogWindowTitleBar("Find Shortest Path"); var layout = UiElements.GetDialogWindowLayout(title.GetHeight()); _info.SetText("Find SST in undirected graph made from generated one:"); _prim.EventMouseClick += OnPrimButtonClick; _kruskal.EventMouseClick += OnKruskalButtonClick; _total.EventMouseClick += OnTotalButtonClick; Window.AddItems(title, layout); layout.AddItems( _info, _prim, _kruskal, _total, _output); title.GetCloseButton().EventMouseClick = (sender, args) => { Close(); }; }
public override void InitElements() { base.InitElements(); Window.SetBackground(45, 45, 45); Window.SetHeight(250); Window.SetWidth(400); var title = UiElements.GetDialogWindowTitleBar("Decode Prufer's Code"); var layout = UiElements.GetDialogWindowLayout(title.GetHeight()); layout.SetSpacing(vertical: 15); _info.SetText("Enter Prufer's code or 'Empty':"); _generate.EventMouseClick += OnGenerateButtonClick; Window.AddItems(title, layout); layout.AddItems( _info, _pruferCode, _generate, _output); title.GetCloseButton().EventMouseClick = (sender, args) => { Close(); }; }
public override void InitElements() { base.InitElements(); Window.SetBackground(45, 45, 45); Window.SetHeight(450); Window.SetWidth(400); //Window.IsLocked = true; var title = UiElements.GetDialogWindowTitleBar("Generate Graph"); var layout = UiElements.GetDialogWindowLayout(title.GetHeight()); _info.SetText("Enter Graph Parameters:"); _verticesInfo.SetText($"Vertices: 2 <= x <= {_maxVertices}"); _densityInfo.SetText("Density: 0 <= x <= 1 "); _weightInfo.SetText("-100 <= Min Weight <= Max Weight <= 100"); _generate.SetShadow(5, 0, 4, Color.FromArgb(150, 0, 0, 0)); _generate.EventMouseClick += OnGenerateButtonClick; Window.AddItems(title, layout); layout.AddItems( _info, _verticesInfo, _densityInfo, _weightInfo, _verticesAmount, _density, _minWeight, _maxWeight, _errorOutput, _generate); title.GetCloseButton().EventMouseClick = (sender, args) => { Close(); }; }
public override void InitElements() { base.InitElements(); Window.SetBackground(45, 45, 45); Window.SetHeight(300); Window.SetWidth(250); //Window.IsLocked = true; var title = UiElements.GetDialogWindowTitleBar("Check Path Existence"); var layout = UiElements.GetDialogWindowLayout(title.GetHeight()); _info.SetText("Check if there is path between vertices:"); _check.SetShadow(5, 0, 4, Color.FromArgb(150, 0, 0, 0)); _check.EventMouseClick += OnCheckButtonClick; _check.SetWidth(100); Window.AddItems(title, layout); layout.AddItems( _info, _firstVertex, _secondVertex, _check, _output); title.GetCloseButton().EventMouseClick = (sender, args) => { Close(); }; }
public override void InitElements() { base.InitElements(); Window.SetBackground(45, 45, 45); Window.SetHeight(300); Window.SetWidth(250); var title = UiElements.GetDialogWindowTitleBar("Find Shortest Path"); var layout = UiElements.GetDialogWindowLayout(title.GetHeight()); _info.SetText("Enter vertices to find path between:"); _dijkstra.EventMouseClick += OnDijkstraButtonClick; _bellmanFord.EventMouseClick += OnBellmanFordButtonClick; _floyd.EventMouseClick += OnFloydButtonClick; Window.AddItems(title, layout); layout.AddItems( _info, _firstVertex, _secondVertex, _dijkstra, _bellmanFord, _floyd, _output); title.GetCloseButton().EventMouseClick = (sender, args) => { Close(); }; }
public override void InitElements() { base.InitElements(); Window.SetBackground(45, 45, 45); Window.SetHeight(_vertices * 16 + 500); Window.SetWidth(_vertices * 16 + 300); //Window.IsLocked = true; var title = UiElements.GetDialogWindowTitleBar("Shimbel's Algorithm"); var layout = UiElements.GetDialogWindowLayout(title.GetHeight()); var buttonsLayout = UiElements.GetHorizontalButtonLayout(); _info.SetText("Compute paths of given length:"); _info2.SetText("Edges: 1 <= x <= Graph Vertices"); _shortestButton.SetShadow(5, 0, 4, Color.FromArgb(150, 0, 0, 0)); _shortestButton.EventMouseClick += OnShortestButtonClick; _shortestButton.SetWidth(100); _longestButton.SetShadow(5, 0, 4, Color.FromArgb(150, 0, 0, 0)); _longestButton.EventMouseClick += OnLongestButtonClick; _longestButton.SetWidth(100); _output.SetPadding(top: 12); _output.SetTextAlignment(ItemAlignment.Top, ItemAlignment.HCenter); Window.AddItems(title, layout); layout.AddItems( _info, _info2, _edgesAmount, buttonsLayout, _output); buttonsLayout.AddItems(_shortestButton, _longestButton); title.GetCloseButton().EventMouseClick = (sender, args) => { Close(); }; }