|
@@ -78,6 +78,9 @@ public class OsdWindow extends JDialog implements MouseListener,
|
78
|
78
|
/** Is this a config instance? */
|
79
|
79
|
private final boolean config;
|
80
|
80
|
|
|
81
|
+ /** Timeout before the windows are automatically closed */
|
|
82
|
+ private final Integer timeout;
|
|
83
|
+
|
81
|
84
|
/**
|
82
|
85
|
* Creates a new instance of OsdWindow.
|
83
|
86
|
*
|
|
@@ -96,6 +99,8 @@ public class OsdWindow extends JDialog implements MouseListener,
|
96
|
99
|
|
97
|
100
|
this.config = config;
|
98
|
101
|
this.osdManager = osdManager;
|
|
102
|
+ this.timeout = IdentityManager.getGlobalConfig()
|
|
103
|
+ .getOptionInt(osdManager.getPlugin().getDomain(), "timeout");
|
99
|
104
|
|
100
|
105
|
setFocusableWindowState(false);
|
101
|
106
|
setAlwaysOnTop(true);
|
|
@@ -136,15 +141,16 @@ public class OsdWindow extends JDialog implements MouseListener,
|
136
|
141
|
addMouseListener(this);
|
137
|
142
|
} else {
|
138
|
143
|
addMouseListener(this);
|
139
|
|
- new Timer("OSD Display Timer").schedule(new TimerTask() {
|
140
|
|
-
|
141
|
|
- /** {@inheritDoc} */
|
142
|
|
- @Override
|
143
|
|
- public void run() {
|
144
|
|
- osdManager.closeWindow(OsdWindow.this);
|
145
|
|
- }
|
146
|
|
- }, Math.max(IdentityManager.getGlobalConfig().getOptionInt(plugin
|
147
|
|
- .getDomain(), "timeout"), 1) * 1000);
|
|
144
|
+ if (timeout != null) {
|
|
145
|
+ new Timer("OSD Display Timer").schedule(new TimerTask() {
|
|
146
|
+
|
|
147
|
+ /** {@inheritDoc} */
|
|
148
|
+ @Override
|
|
149
|
+ public void run() {
|
|
150
|
+ osdManager.closeWindow(OsdWindow.this);
|
|
151
|
+ }
|
|
152
|
+ }, Math.max(timeout, 1) * 1000);
|
|
153
|
+ }
|
148
|
154
|
}
|
149
|
155
|
}
|
150
|
156
|
|