MCPcopy Create free account
hub / github.com/benfry/processing4 / draw

Method draw

app/src/processing/app/contrib/ManagerTabs.java:270–289  ·  view source on GitHub ↗
(Graphics g)

Source from the content-addressed store, hash-verified

268 }
269
270 void draw(Graphics g) {
271 int state = isCurrent() ? SELECTED : UNSELECTED;
272 g.setColor(tabColor[state]);
273
274 Graphics2D g2 = (Graphics2D) g;
275 g2.fill(Toolkit.createRoundRect(left, 0,
276 right, HIGH,
277 hasLeftNotch() ? CURVE_RADIUS : 0,
278 hasRightNotch() ? CURVE_RADIUS : 0,
279 0, 0));
280
281 int textLeft = getTextLeft();
282 if (notification && state == UNSELECTED) {
283 g.setColor(textColor[SELECTED]);
284 } else {
285 g.setColor(textColor[state]);
286 }
287 int baseline = (HIGH + fontAscent) / 2;
288 g.drawString(name, textLeft, baseline);
289 }
290 }
291}

Callers 2

renderProgressIconMethod · 0.45
drawTabsMethod · 0.45

Calls 8

isCurrentMethod · 0.95
createRoundRectMethod · 0.95
hasLeftNotchMethod · 0.95
hasRightNotchMethod · 0.95
getTextLeftMethod · 0.95
setColorMethod · 0.45
fillMethod · 0.45
drawStringMethod · 0.45

Tested by

no test coverage detected