MCPcopy Create free account
hub / github.com/Card-Forge/forge / draw

Method draw

forge-gui-mobile/src/forge/toolbox/FContainer.java:47–84  ·  view source on GitHub ↗
(Graphics g)

Source from the content-addressed store, hash-verified

45 }
46
47 public void draw(Graphics g) {
48 try {
49 drawBackground(g);
50
51 boolean needOverlayDrawn = true;
52 for (FDisplayObject child : children) {
53 if (child.isVisible()) {
54 if (child.drawAboveOverlay() && needOverlayDrawn) {
55 drawOverlay(g);
56 needOverlayDrawn = false;
57 }
58
59 final boolean disabled = !child.isEnabled();
60 if (disabled) {
61 g.setAlphaComposite(DISABLED_COMPOSITE);
62 }
63
64 g.draw(child);
65
66 if (disabled) {
67 g.resetAlphaComposite();
68 }
69
70 child.drawOnContainer(g); //give child an additional chance to draw additional content on container outside its bounds
71 }
72 }
73
74 if (needOverlayDrawn) {
75 drawOverlay(g);
76 }
77 }
78 catch (ConcurrentModificationException ex) {
79 //ignore concurrent modification exceptions during render
80 }
81 catch (Exception ex) {
82 BugReporter.reportException(ex);
83 }
84 }
85
86 protected void drawOverlay(Graphics g) {
87 }

Callers 1

renderMethod · 0.95

Calls 10

drawBackgroundMethod · 0.95
drawOverlayMethod · 0.95
reportExceptionMethod · 0.95
setAlphaCompositeMethod · 0.80
resetAlphaCompositeMethod · 0.80
isVisibleMethod · 0.65
isEnabledMethod · 0.65
drawMethod · 0.65
drawAboveOverlayMethod · 0.45
drawOnContainerMethod · 0.45

Tested by

no test coverage detected