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

Method draw

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

Source from the content-addressed store, hash-verified

360 }
361
362 void draw(Graphics g) {
363 int state = isCurrent() ? SELECTED : UNSELECTED;
364 g.setColor(tabColor[state]);
365
366 Graphics2D g2 = (Graphics2D) g;
367// g2.fill(Toolkit.createRoundRect(left, TAB_TOP, right, TAB_BOTTOM, 0, 0,
368// isLast() ? CURVE_RADIUS : 0,
369// hastLeftCurve() ? CURVE_RADIUS : 0));
370 g2.fill(Toolkit.createRoundRect(left, TAB_TOP,
371 right, TAB_BOTTOM,
372 hasLeftNotch() ? CURVE_RADIUS : 0,
373 hasRightNotch() ? CURVE_RADIUS : 0,
374 0, 0));
375
376 if (hasIcon()) {
377 Image icon = (isCurrent() || notification) ? selectedIcon : enabledIcon;
378 g.drawImage(icon, left + MARGIN, ICON_TOP, ICON_WIDTH, ICON_HEIGHT, null);
379 }
380
381 int textLeft = getTextLeft();
382 if (notification && state == UNSELECTED) {
383 g.setColor(textColor[SELECTED]);
384 } else {
385 g.setColor(textColor[state]);
386 }
387 int tabHeight = TAB_BOTTOM - TAB_TOP;
388 int baseline = TAB_TOP + (tabHeight + fontAscent) / 2;
389 g.drawString(name, textLeft, baseline);
390 }
391 }
392}

Callers 1

drawTabsMethod · 0.45

Calls 9

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

Tested by

no test coverage detected