private void layout() { height = 0; selectedValueCpu = 0; selectedValueGpu = 0; rootLine.layout(0); frameTimeValue.setText(df.format(getMsFromNs(prof.getAverageFrameTime())) + "ms"); frameTimeValue.setLocalTranslation(PANEL_WIDTH / 2, -PADDING, 0); setColor(frameTimeValue, prof.getAverageFrameTime(), totalTimeCpu, false, false); frameCpuTimeValue.setText(df.format(getMsFromNs(totalTimeCpu)) + "ms"); frameCpuTimeValue.setLocalTranslation(new Vector3f(PANEL_WIDTH / 4 - bigFont.getLineWidth(frameCpuTimeValue.getText()) / 2, -PADDING - 50, 0)); setColor(frameCpuTimeValue, totalTimeCpu, totalTimeCpu, false, false); frameGpuTimeValue.setText(df.format(getMsFromNs(totalTimeGpu)) + "ms"); frameGpuTimeValue.setLocalTranslation(new Vector3f(3 * PANEL_WIDTH / 4 - bigFont.getLineWidth(frameGpuTimeValue.getText()) / 2, -PADDING - 50, 0)); setColor(frameGpuTimeValue, totalTimeGpu, totalTimeGpu, false, false); selectedField.setText("Selected: " + df.format(getMsFromNs(selectedValueCpu)) + "ms / " + df.format(getMsFromNs(selectedValueGpu)) + "ms"); selectedField.setLocalTranslation(3 * PANEL_WIDTH / 4 - font.getLineWidth(selectedField.getText()) / 2, -PADDING - 75, 0); }
public void layout(int indent) { boolean insignificant; cpuText.setText(df.format(getMsFromNs(cpuValue)) + "ms /"); insignificant = setColor(cpuText, cpuValue, totalTimeCpu, !children.isEmpty(), expended); gpuText.setText(" " + df.format(getMsFromNs(gpuValue)) + "ms"); insignificant &= setColor(gpuText, gpuValue, totalTimeGpu, !children.isEmpty(), expended); if (insignificant && hideInsignificant) { setVisible(false); } if (!visible) { return; } if (selected) { label.setColor(ColorRGBA.Yellow); selectedValueCpu += cpuValue; selectedValueGpu += gpuValue; } else { label.setColor(ColorRGBA.White); } int y = -(height * LINE_HEIGHT + HEADER_HEIGHT); label.setLocalTranslation(PADDING + indent * PADDING, y, 0); float gpuPos = PANEL_WIDTH - font.getLineWidth(gpuText.getText()) - PADDING * (maxLevel - indent + 1); cpuText.setLocalTranslation(gpuPos - font.getLineWidth(cpuText.getText()), y, 0); gpuText.setLocalTranslation(gpuPos, y, 0); checkBox.setLocalTranslation(3, y, 0); height++; for (StatLineView child : children) { child.layout(indent + 1); } }
private void layout() { height = 0; selectedValueCpu = 0; selectedValueGpu = 0; rootLine.layout(0); frameTimeValue.setText(df.format(getMsFromNs(prof.getAverageFrameTime())) + "ms"); frameTimeValue.setLocalTranslation(PANEL_WIDTH / 2, -PADDING, 0); setColor(frameTimeValue, prof.getAverageFrameTime(), totalTimeCpu, false, false); frameCpuTimeValue.setText(df.format(getMsFromNs(totalTimeCpu)) + "ms"); frameCpuTimeValue.setLocalTranslation(new Vector3f(PANEL_WIDTH / 4 - bigFont.getLineWidth(frameCpuTimeValue.getText()) / 2, -PADDING - 50, 0)); setColor(frameCpuTimeValue, totalTimeCpu, totalTimeCpu, false, false); frameGpuTimeValue.setText(df.format(getMsFromNs(totalTimeGpu)) + "ms"); frameGpuTimeValue.setLocalTranslation(new Vector3f(3 * PANEL_WIDTH / 4 - bigFont.getLineWidth(frameGpuTimeValue.getText()) / 2, -PADDING - 50, 0)); setColor(frameGpuTimeValue, totalTimeGpu, totalTimeGpu, false, false); selectedField.setText("Selected: " + df.format(getMsFromNs(selectedValueCpu)) + "ms / " + df.format(getMsFromNs(selectedValueGpu)) + "ms"); selectedField.setLocalTranslation(3 * PANEL_WIDTH / 4 - font.getLineWidth(selectedField.getText()) / 2, -PADDING - 75, 0); }
public void layout(int indent) { boolean insignificant; cpuText.setText(df.format(getMsFromNs(cpuValue)) + "ms /"); insignificant = setColor(cpuText, cpuValue, totalTimeCpu, !children.isEmpty(), expended); gpuText.setText(" " + df.format(getMsFromNs(gpuValue)) + "ms"); insignificant &= setColor(gpuText, gpuValue, totalTimeGpu, !children.isEmpty(), expended); if (insignificant && hideInsignificant) { setVisible(false); } if (!visible) { return; } if (selected) { label.setColor(ColorRGBA.Yellow); selectedValueCpu += cpuValue; selectedValueGpu += gpuValue; } else { label.setColor(ColorRGBA.White); } int y = -(height * LINE_HEIGHT + HEADER_HEIGHT); label.setLocalTranslation(PADDING + indent * PADDING, y, 0); float gpuPos = PANEL_WIDTH - font.getLineWidth(gpuText.getText()) - PADDING * (maxLevel - indent + 1); cpuText.setLocalTranslation(gpuPos - font.getLineWidth(cpuText.getText()), y, 0); gpuText.setLocalTranslation(gpuPos, y, 0); checkBox.setLocalTranslation(3, y, 0); height++; for (StatLineView child : children) { child.layout(indent + 1); } }