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

Method drawButton

app/src/processing/app/ui/EditorStatus.java:415–431  ·  view source on GitHub ↗

@param pos A zero-based button index with 0 as the rightmost button

(Graphics g, String symbol, int pos, boolean highlight)

Source from the content-addressed store, hash-verified

413 * @param pos A zero-based button index with 0 as the rightmost button
414 */
415 private void drawButton(Graphics g, String symbol, int pos, boolean highlight) {
416 int left = sizeW - (pos + 1) * buttonSize;
417 // Overlap very long errors
418 g.drawImage(bgImage[mode], left, 0, buttonSize, sizeH, this);
419
420 if (highlight) {
421 // disabling since this doesn't match any of our other UI
422// g.setColor(whitishTint);
423// g.fillRect(left, 0, sizeH, sizeH);
424 g.setColor(urlColor);
425 } else {
426 g.setColor(fgColor[mode]);
427 }
428 g.drawString(symbol,
429 left + (buttonSize - g.getFontMetrics().stringWidth(symbol))/2,
430 (sizeH + ascent) / 2);
431 }
432
433
434 public Dimension getPreferredSize() {

Callers 1

paintMethod · 0.95

Calls 3

drawStringMethod · 0.80
setColorMethod · 0.45
getFontMetricsMethod · 0.45

Tested by

no test coverage detected