MCPcopy Index your code
hub / github.com/benfry/processing4 / update

Method update

app/src/processing/app/laf/PdeButtonUI.java:62–81  ·  view source on GitHub ↗
(Graphics g, JComponent c)

Source from the content-addressed store, hash-verified

60
61
62 @Override
63 public void update(Graphics g, JComponent c) {
64 ButtonModel model = ((AbstractButton) c).getModel();
65
66// if (c.isOpaque()) {
67 //g.setColor(c.getBackground());
68 //g.fillRect(0, 0, c.getWidth(),c.getHeight());
69 if (model.isPressed()) {
70 g.setColor(pressedBgColor);
71 } else if (model.isEnabled()) {
72 g.setColor(enabledBgColor);
73 } else {
74 g.setColor(disabledBgColor);
75 }
76 //g.setColor(c.isEnabled() ? bgColor : disabledBgColor);
77 Toolkit.prepareGraphics(g);
78 g.fillRoundRect(0, 0, c.getWidth(), c.getHeight(), 8, 8);
79// }
80 paint(g, c);
81 }
82
83
84 /*

Callers

nothing calls this directly

Calls 6

prepareGraphicsMethod · 0.95
setColorMethod · 0.45
isEnabledMethod · 0.45
getWidthMethod · 0.45
getHeightMethod · 0.45
paintMethod · 0.45

Tested by

no test coverage detected