MCPcopy Index your code
hub / github.com/SpaiR/imgui-java / show

Method show

example/src/main/java/ExampleImPlot.java:49–102  ·  view source on GitHub ↗
(ImBoolean showImPlotWindow)

Source from the content-addressed store, hash-verified

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}

Callers 1

showMethod · 0.95

Calls 15

setNextWindowSizeMethod · 0.95
setNextWindowPosMethod · 0.95
getMainViewportMethod · 0.95
beginMethod · 0.95
textMethod · 0.95
sameLineMethod · 0.95
buttonMethod · 0.95
checkboxMethod · 0.95
showDemoWindowMethod · 0.95
beginPlotMethod · 0.95
plotShadedMethod · 0.95

Tested by

no test coverage detected