MCPcopy Create free account
hub / github.com/BombusMod/BombusMod / paint

Method paint

src/main/java/javax/microedition/lcdui/Screen.java:64–104  ·  view source on GitHub ↗
(Graphics g)

Source from the content-addressed store, hash-verified

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);

Callers

nothing calls this directly

Calls 13

paintMethod · 0.95
getHeightMethod · 0.95
paintContentMethod · 0.95
setGrayScaleMethod · 0.80
getTitleMethod · 0.80
setScrollUpMethod · 0.65
getWidthMethod · 0.65
getHeightMethod · 0.65
setScrollDownMethod · 0.65
fillRectMethod · 0.45
translateMethod · 0.45
drawLineMethod · 0.45

Tested by

no test coverage detected