(Graphics g, int width, int height)
| 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(); |
nothing calls this directly
no test coverage detected