(Graphics g)
| 62 | |
| 63 | |
| 64 | final void paint(Graphics g) |
| 65 | { |
| 66 | int contentHeight = 0; |
| 67 | int translatedY; |
| 68 | |
| 69 | if (viewPortY == 0) { |
| 70 | currentDisplay.setScrollUp(false); |
| 71 | } else { |
| 72 | currentDisplay.setScrollUp(true); |
| 73 | } |
| 74 | |
| 75 | g.setGrayScale(255); |
| 76 | g.fillRect(0, 0, getWidth(), getHeight()); |
| 77 | |
| 78 | g.setGrayScale(0); |
| 79 | |
| 80 | g.translate(0, contentHeight); |
| 81 | translatedY = contentHeight; |
| 82 | |
| 83 | // TODO move to Displayable |
| 84 | // TODO remove this StringComponent object when native UI is completed |
| 85 | StringComponent title = new StringComponent(getTitle()); |
| 86 | contentHeight += title.paint(g); |
| 87 | g.drawLine(0, title.getHeight(), getWidth(), title.getHeight()); |
| 88 | contentHeight += 1; |
| 89 | |
| 90 | g.translate(0, contentHeight - translatedY); |
| 91 | translatedY = contentHeight; |
| 92 | |
| 93 | g.setClip(0, 0, getWidth(), getHeight() - contentHeight); |
| 94 | g.translate(0, -viewPortY); |
| 95 | contentHeight += paintContent(g); |
| 96 | g.translate(0, viewPortY); |
| 97 | |
| 98 | if (contentHeight - viewPortY > getHeight()) { |
| 99 | currentDisplay.setScrollDown(true); |
| 100 | } else { |
| 101 | currentDisplay.setScrollDown(false); |
| 102 | } |
| 103 | g.translate(0, -translatedY); |
| 104 | } |
| 105 | |
| 106 | |
| 107 | abstract int paintContent(Graphics g); |
nothing calls this directly
no test coverage detected