MCPcopy Index your code
hub / github.com/BombusMod/BombusMod / draw

Method draw

src/main/java/ui/ReconnectWindow.java:57–82  ·  view source on GitHub ↗
(Graphics g, int width, int height)

Source from the content-addressed store, hash-verified

55 }
56
57 public void draw(Graphics g, int width, int height) {
58 int reconnectPos = pos * 4;
59 int reconnectTimeout = timeout * 4;
60
61 if (!isActive()) {
62 return;
63 }
64 if (!(reconnectTimeout > reconnectPos && reconnectPos != 0)) {
65 return;
66 }
67
68 int strWidth = g.getFont().stringWidth(SR.MS_RECONNECT);
69 int progressWidth = (width / 3) * 2;
70 progressWidth = (strWidth > progressWidth) ? strWidth : progressWidth;
71 int progressX = (width - progressWidth) / 2;
72 if (pb == null) {
73 pb = new Progress(progressX, height / 2, progressWidth);
74 }
75 int popHeight = pb.getHeight();
76 g.setColor(ColorTheme.getColor(ColorTheme.POPUP_SYSTEM_BGND));
77 g.fillRoundRect(progressX - 2, (height / 2) - (popHeight * 2), progressWidth + 4, (popHeight * 2) + 1, 6, 6);
78 g.setColor(ColorTheme.getColor(ColorTheme.POPUP_SYSTEM_INK));
79 g.drawRoundRect(progressX - 2, (height / 2) - (popHeight * 2), progressWidth + 4, (popHeight * 2) + 1, 6, 6);
80 FontCache.drawString(g, SR.MS_RECONNECT, width / 2, (height / 2) - (popHeight * 2), Graphics.TOP | Graphics.HCENTER);
81 pb.draw(g, reconnectPos * progressWidth / reconnectTimeout, reconnectString);
82 }
83
84 private void redraw() {
85 VirtualCanvas.getInstance().repaint();

Callers

nothing calls this directly

Calls 9

isActiveMethod · 0.95
getColorMethod · 0.95
drawStringMethod · 0.95
stringWidthMethod · 0.65
getFontMethod · 0.65
getHeightMethod · 0.65
setColorMethod · 0.45
fillRoundRectMethod · 0.45
drawRoundRectMethod · 0.45

Tested by

no test coverage detected