MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / renderComponent

Method renderComponent

CodenameOne/src/com/codename1/ui/List.java:1445–1470  ·  view source on GitHub ↗
(Graphics g, Component cmp, int x, int y, int width, int height)

Source from the content-addressed store, hash-verified

1443
1444 /// Renders the current component on the screen
1445 private void renderComponent(Graphics g, Component cmp, int x, int y, int width, int height) {
1446 Style s = cmp.getStyle();
1447 int left = s.getMarginLeft(isRTL());
1448 int top = s.getMarginTop();
1449 cmp.setWidth(width - left - s.getMarginRight(isRTL()));
1450 cmp.setHeight(height - top - s.getMarginBottom());
1451 cmp.setX(x + left);
1452 cmp.setY(y + top);
1453
1454 int oX = g.getClipX();
1455 int oY = g.getClipY();
1456 int oWidth = g.getClipWidth();
1457 int oHeight = g.getClipHeight();
1458 //g.pushClip();
1459 g.clipRect(cmp.getX(), cmp.getY(), cmp.getWidth(), cmp.getHeight());
1460 if (cmp instanceof Container) {
1461 ((Container) cmp).layoutContainer();
1462 }
1463 cmp.paint(g);
1464 Border b = s.getBorder();
1465 if (b != null && !b.isBackgroundPainter()) {
1466 cmp.paintBorder(g);
1467 }
1468 g.setClip(oX, oY, oWidth, oHeight);
1469 //g.popClip();
1470 }
1471
1472 private void renderComponentBackground(Graphics g, Component cmp, int x, int y, int width, int height) {
1473 Style s = cmp.getStyle();

Callers 2

paintMethod · 0.95
paintFocusMethod · 0.95

Calls 15

getMarginLeftMethod · 0.95
getMarginTopMethod · 0.95
getMarginRightMethod · 0.95
getMarginBottomMethod · 0.95
getBorderMethod · 0.95
isBackgroundPainterMethod · 0.95
getStyleMethod · 0.65
setWidthMethod · 0.65
setHeightMethod · 0.65
getXMethod · 0.65
getYMethod · 0.65
getWidthMethod · 0.65

Tested by

no test coverage detected