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

Method setVisible

forge-gui-mobile/src/forge/toolbox/FOverlay.java:96–134  ·  view source on GitHub ↗
(boolean visible0)

Source from the content-addressed store, hash-verified

94 }
95
96 @Override
97 public void setVisible(boolean visible0) {
98 FThreads.assertExecutedByEdt(true); //prevent showing or hiding overlays from background thread
99
100 if (this.isVisible() == visible0) { return; }
101
102 //ensure task to hide temporary overlay cancelled and run if another overlay becomes shown or hidden
103 if (tempOverlay != this && hideTempOverlayTask.isScheduled()) {
104 hideTempOverlayTask.cancel();
105 hideTempOverlayTask.run();
106 }
107
108 if (visible0) {
109 //rotate overlay to face top human player if needed
110 setRotate180(MatchController.getView() != null && MatchController.getView().isTopHumanPlayerActive());
111 overlays.push(this);
112 openedOnScreen = Forge.getCurrentScreen();
113 }
114 else {
115 openedOnScreen = null;
116
117 if (!hidingAll) { //hiding all handles cleaning up overlay collection
118 if (overlays.get(overlays.size() - 1) == this) {
119 //after removing the top overlay, delay hiding overlay for a brief period
120 //to prevent back color flickering if another popup immediately follows
121 if (tempOverlay != this && backColor != null) {
122 tempOverlay = this;
123 Timer.schedule(hideTempOverlayTask, 0.025f);
124 return;
125 }
126 overlays.pop();
127 }
128 else {
129 overlays.remove(this);
130 }
131 }
132 }
133 super.setVisible(visible0);
134 }
135
136 public FSkinColor getBackColor() {
137 return backColor;

Callers 2

showMethod · 0.95
hideMethod · 0.95

Calls 14

assertExecutedByEdtMethod · 0.95
getViewMethod · 0.95
getCurrentScreenMethod · 0.95
isVisibleMethod · 0.65
cancelMethod · 0.65
runMethod · 0.65
getMethod · 0.65
sizeMethod · 0.65
setVisibleMethod · 0.65
setRotate180Method · 0.45
pushMethod · 0.45

Tested by

no test coverage detected