1
1
package muon ;
2
2
3
3
import muon .screens .appwin .MainContainer ;
4
- import muon .screens .appwin .UserInputDialog ;
4
+ import muon .screens .dialogs .BannerDialog ;
5
+ import muon .screens .dialogs .UserInputDialog ;
5
6
import muon .screens .sessiontabs .InputBlockerDialog ;
6
7
import muon .service .UserInputService ;
7
8
import muon .service .UserInputServiceImpl ;
8
- import muon .styles .AppTheme ;
9
9
import muon .styles .FlatLookAndFeel ;
10
10
import muon .util .AppUtils ;
11
- import muon .util .IconCode ;
12
- import muon .util .IconFont ;
13
11
import muon .widgets .CustomFrame ;
14
- import muon .widgets .TabbedPanel ;
15
12
16
13
import javax .swing .*;
17
- import javax .swing .border .CompoundBorder ;
18
- import javax .swing .border .EmptyBorder ;
19
- import javax .swing .border .MatteBorder ;
20
- import javax .swing .table .TableCellRenderer ;
21
- import java .awt .*;
22
14
import java .lang .reflect .InvocationTargetException ;
23
15
24
16
/**
@@ -28,15 +20,25 @@ public class App {
28
20
29
21
private static InputBlockerDialog inputBlockerDialog ;
30
22
private static UserInputService userInputService ;
23
+ private static JFrame appWindow ;
31
24
32
25
public static InputBlockerDialog getInputBlockerDialog () {
33
26
return inputBlockerDialog ;
34
27
}
35
28
36
- public static UserInputService getUserInputService () {
29
+ public static synchronized UserInputService getUserInputService () {
30
+ if (userInputService == null ) {
31
+ userInputService = new UserInputServiceImpl (
32
+ new UserInputDialog (appWindow ),
33
+ new BannerDialog (appWindow ));
34
+ }
37
35
return userInputService ;
38
36
}
39
37
38
+ public static JFrame getAppWindow () {
39
+ return appWindow ;
40
+ }
41
+
40
42
public static void main (String [] args ) throws InterruptedException , InvocationTargetException , UnsupportedLookAndFeelException , ClassNotFoundException , InstantiationException , IllegalAccessException {
41
43
System .setProperty ("sun.java2d.metal" , "false" );
42
44
System .setProperty ("apple.awt.application.appearance" , "system" );
@@ -45,8 +47,8 @@ public static void main(String[] args) throws InterruptedException, InvocationTa
45
47
var isWindows = "windows" .equalsIgnoreCase (System .getProperty ("os.name" ));
46
48
47
49
var f = isWindows ? new CustomFrame ("Muon 1.0.23" ) : new JFrame ("Muon 1.0.23" );
50
+ appWindow = f ;
48
51
inputBlockerDialog = new InputBlockerDialog (f );
49
- userInputService = new UserInputServiceImpl (new UserInputDialog (f ));
50
52
51
53
f .setSize (AppUtils .calculateDefaultWindowSize ());
52
54
f .setLocationRelativeTo (null );
0 commit comments