MCPcopy Create free account
hub / github.com/XUANXUQAQ/File-Engine / TaskBar

Method TaskBar

src/main/java/file/engine/frames/TaskBar.java:44–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42 }
43
44 private TaskBar() {
45 startShowMessageThread();
46 showTaskBar();
47 addActionListener();
48
49 ThreadPoolUtil.getInstance().executeTask(() -> {
50 EventManagement instance = EventManagement.getInstance();
51 while (instance.notMainExit()) {
52 if (popupMenu != null && popupMenu.isVisible() && (GetHandle.INSTANCE.isKeyPressed(L_BUTTON) || GetHandle.INSTANCE.isKeyPressed(R_BUTTON))) {
53 Point point = java.awt.MouseInfo.getPointerInfo().getLocation();
54 Point location = popupMenu.getLocationOnScreen();
55 int X = location.x;
56 int Y = location.y;
57 int width = popupMenu.getWidth();
58 int height = popupMenu.getHeight();
59 if (!(X <= point.x && point.x <= X + width && Y < point.y && point.y <= Y + height)) {
60 SwingUtilities.invokeLater(() -> popupMenu.setVisible(false));
61 }
62 }
63 try {
64 TimeUnit.MILLISECONDS.sleep(50);
65 } catch (InterruptedException e) {
66 throw new RuntimeException(e);
67 }
68 }
69 });
70 }
71
72 /**
73 * 显示托盘消息线程

Callers

nothing calls this directly

Calls 10

showTaskBarMethod · 0.95
addActionListenerMethod · 0.95
getInstanceMethod · 0.95
getInstanceMethod · 0.95
notMainExitMethod · 0.95
executeTaskMethod · 0.80
isVisibleMethod · 0.80
isKeyPressedMethod · 0.80
setVisibleMethod · 0.80

Tested by

no test coverage detected