MCPcopy Create free account
hub / github.com/HumbleUI/JWM / accept

Method accept

examples/dashboard/java/Example.java:169–234  ·  view source on GitHub ↗
(Event e)

Source from the content-addressed store, hash-verified

167 }
168
169 @Override
170 public void accept(Event e) {
171 if (!initialized)
172 return;
173
174 if (e instanceof EventWindowClose) {
175 if (App._windows.size() == 0)
176 App.terminate();
177 return;
178 }
179
180 panelTextInput.accept(e);
181 panelScreens.accept(e);
182 panelMouse.accept(e);
183 panelMouseCursors.accept(e);
184 panelRendering.accept(e);
185 panelEvents.accept(e);
186 panelTheme.accept(e);
187 panelTouch.accept(e);
188
189 float scale = window.getScreen().getScale();
190 if (e instanceof EventKey eventKey) {
191 if (eventKey.isPressed() == true && eventKey.isModifierDown(MODIFIER)) {
192 switch (eventKey.getKey()) {
193 case P -> {
194 paused = !paused;
195 if (!paused)
196 window.requestFrame();
197 }
198 case N ->
199 new Example();
200 case H ->
201 window.setVisible(false);
202 case W ->
203 window.close();
204 case F ->
205 window.setFullScreen(!window.isFullScreen());
206 case O ->
207 window.setOpacity(window.getOpacity() == 1f ? 0.5f : 1f);
208 case UP ->
209 window.maximize();
210 case DOWN ->
211 window.restore();
212 case M ->
213 window.minimize();
214 case B ->
215 setProgressBar(progressBars.next());
216 case A -> {
217 if (window instanceof WindowMac windowMac) {
218 boolean enabled = !windowMac.isPressAndHoldEnabled();
219 windowMac.setPressAndHoldEnabled(enabled);
220 System.out.println("PressAndHold enabled: " + enabled + " (globally: " + WindowMac.isPressAndHoldEnabledGlobally() + ")");
221 }
222 }
223 }
224 }
225 } else if (e instanceof EventFrame) {
226 if (!paused)

Callers

nothing calls this directly

Calls 15

terminateMethod · 0.95
setProgressBarMethod · 0.95
paintMethod · 0.95
sizeMethod · 0.80
nextMethod · 0.80
isPressAndHoldEnabledMethod · 0.80
closeMethod · 0.65
getWidthMethod · 0.65
getHeightMethod · 0.65
getScaleMethod · 0.45

Tested by

no test coverage detected