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

Method draw

app/src/processing/app/ui/EditorFooter.java:386–412  ·  view source on GitHub ↗
(Graphics g)

Source from the content-addressed store, hash-verified

384 }
385
386 void draw(Graphics g) {
387 int state = isCurrent() ? SELECTED : UNSELECTED;
388 g.setColor(tabColor[state]);
389// if (notification) {
390// g.setColor(errorColor);
391// }
392
393 Graphics2D g2 = (Graphics2D) g;
394 g2.fill(Toolkit.createRoundRect(left, TAB_TOP, right, TAB_BOTTOM, 0, 0,
395 isLast() ? CURVE_RADIUS : 0,
396 isFirst() ? CURVE_RADIUS : 0));
397
398 if (hasIcon()) {
399 Image icon = (isCurrent() || notification) ? selectedIcon : enabledIcon;
400 g.drawImage(icon, left + MARGIN, ICON_TOP, ICON_WIDTH, ICON_HEIGHT, null);
401 }
402
403 int textLeft = getTextLeft();
404 if (notification && state == UNSELECTED) {
405 g.setColor(textColor[SELECTED]);
406 } else {
407 g.setColor(textColor[state]);
408 }
409 int tabHeight = TAB_BOTTOM - TAB_TOP;
410 int baseline = TAB_TOP + (tabHeight + fontAscent) / 2;
411 g.drawString(name, textLeft, baseline);
412 }
413 }
414}

Callers 2

paintComponentMethod · 0.45
drawTabsMethod · 0.45

Calls 9

isCurrentMethod · 0.95
createRoundRectMethod · 0.95
isLastMethod · 0.95
isFirstMethod · 0.95
hasIconMethod · 0.95
getTextLeftMethod · 0.95
drawStringMethod · 0.80
setColorMethod · 0.45
fillMethod · 0.45

Tested by

no test coverage detected