MCPcopy Create free account
hub / github.com/GateNLP/gate-core / block

Method block

src/main/java/gate/swing/BlockingGlassPane.java:53–73  ·  view source on GitHub ↗

Start or end blocking. @param block should blocking be started or ended

(boolean block)

Source from the content-addressed store, hash-verified

51 * @param block should blocking be started or ended
52 */
53 public void block(boolean block) {
54 if (block) {
55 if (blockCount == 0) {
56 setVisible(true);
57
58 setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
59
60 FocusManager.getCurrentManager().addKeyEventDispatcher(blockKeys);
61 }
62 blockCount++;
63 } else {
64 blockCount--;
65 if (blockCount == 0) {
66 FocusManager.getCurrentManager().removeKeyEventDispatcher(blockKeys);
67
68 setCursor(Cursor.getDefaultCursor());
69
70 setVisible(false);
71 }
72 }
73 }
74
75 /**
76 * Test if this glasspane is blocked.

Callers 6

actionPerformedMethod · 0.95
actionPerformedMethod · 0.95
actionPerformedMethod · 0.95
runMethod · 0.80
runMethod · 0.80
runMethod · 0.80

Calls 1

setVisibleMethod · 0.45

Tested by

no test coverage detected