(ImBoolean showImPlotWindow)
| 47 | } |
| 48 | |
| 49 | public static void show(ImBoolean showImPlotWindow) { |
| 50 | ImGui.setNextWindowSize(500, 400, ImGuiCond.Once); |
| 51 | ImGui.setNextWindowPos(ImGui.getMainViewport().getPosX() + 100, ImGui.getMainViewport().getPosY() + 100, ImGuiCond.Once); |
| 52 | if (ImGui.begin("ImPlot Demo", showImPlotWindow)) { |
| 53 | ImGui.text("This a demo for ImPlot"); |
| 54 | |
| 55 | ImGui.alignTextToFramePadding(); |
| 56 | ImGui.text("Repo:"); |
| 57 | ImGui.sameLine(); |
| 58 | if (ImGui.button(URL)) { |
| 59 | try { |
| 60 | Desktop.getDesktop().browse(new URI(URL)); |
| 61 | } catch (Exception e) { |
| 62 | e.printStackTrace(); |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | ImGui.checkbox("Show ImPlot Built-In Demo", showDemo); |
| 67 | |
| 68 | if (showDemo.get()) { |
| 69 | ImPlot.showDemoWindow(showDemo); |
| 70 | } else { |
| 71 | if (ImPlot.beginPlot("Example Plot")) { |
| 72 | ImPlot.plotShaded("Shaded", xs, ys1, ys2); |
| 73 | ImPlot.plotLine("Line", xs, ys); |
| 74 | ImPlot.plotBars("Bars", xs, ys); |
| 75 | ImPlot.endPlot(); |
| 76 | } |
| 77 | |
| 78 | if (ImPlot.beginPlot("Example Scatterplot")) { |
| 79 | ImPlot.plotScatter("Scatter", xs, ys); |
| 80 | ImPlot.endPlot(); |
| 81 | } |
| 82 | |
| 83 | if (ImPlot.beginPlot("Example Piechart")) { |
| 84 | ImPlot.plotPieChart(new String[]{"1", "2", "3", "4", "5", "6"}, xs, .5, .5, .4); |
| 85 | ImPlot.endPlot(); |
| 86 | } |
| 87 | |
| 88 | if (ImPlot.beginPlot("Example Heatmap")) { |
| 89 | ImPlot.plotHeatmap("Heatmap", new int[]{1, 3, 6, 2, 8, 5, 4, 3}, 2, 4, 0, 0, "%d", new ImPlotPoint(0, 0), new ImPlotPoint(10, 10)); |
| 90 | ImPlot.endPlot(); |
| 91 | } |
| 92 | |
| 93 | // ImPlot v1.0 PR #672: per-index color/size via ImPlotSpec. |
| 94 | if (ImPlot.beginPlot("Per-Index Colors (v1.0 PR #672)")) { |
| 95 | ImPlot.plotLine("Rainbow", xs, ys, perIndexSpec); |
| 96 | ImPlot.endPlot(); |
| 97 | } |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | ImGui.end(); |
| 102 | } |
| 103 | } |
no test coverage detected