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

Method drawButton

app/src/processing/app/ui/EditorStatus.java:459–469  ·  view source on GitHub ↗
(Graphics g, int pos, ImageIcon icon, float alpha)

Source from the content-addressed store, hash-verified

457 */
458 //private void drawButton(Graphics g, String symbol, int pos, boolean highlight) {
459 private void drawButton(Graphics g, int pos, ImageIcon icon, float alpha) {
460 int left = sizeW - (pos + 1) * buttonEach;
461
462 Graphics2D g2 = (Graphics2D) g.create();
463 g2.setComposite(AlphaComposite.SrcAtop.derive(alpha));
464 //icon.paintIcon(c, g2, x, y);
465 icon.paintIcon(this, g2,
466 left + (buttonEach - icon.getIconWidth()) / 2,
467 (buttonEach - icon.getIconHeight()) / 2);
468 g2.dispose();
469 }
470
471
472 public Dimension getPreferredSize() {

Callers 1

paintMethod · 0.95

Calls 5

paintIconMethod · 0.80
getIconWidthMethod · 0.80
getIconHeightMethod · 0.80
createMethod · 0.45
disposeMethod · 0.45

Tested by

no test coverage detected