标签:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
public class AppStartup implements Runnable { AppContext appContext = new AppContext(); public static void main(String[] args) { try { UIManager.setLookAndFeel( "com.seaglasslookandfeel.SeaGlassLookAndFeel" ); // UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception ex) { java.util.logging.Logger.getLogger(AppStartup. class .getName()).log(java.util.logging.Level.SEVERE, null , ex); } java.awt.EventQueue.invokeLater( new AppStartup()); } @Override public void run() { long time = System.currentTimeMillis(); LoginView loginView = appContext.getSingleView(LoginView. class ); loginView.setVisible( true ); System.out.println(System.currentTimeMillis() - time); appContext.start(); new initApp().start(); } class initApp extends Thread { @Override public void run() { long time = System.currentTimeMillis(); initTheme(); appContext.getSingleView(MainView. class ); appContext.getSingleView(TrayView. class ); appContext.getSingleView(FindView. class ); appContext.getSingleView(AddView. class ); System.out.println(System.currentTimeMillis() - time); } void initTheme() { Theme theme = (Theme) ConfigManage.get(Theme.config_file_path, Theme. class ); Image imaeg = new ImageIcon(theme.getWindowBackgroundImage()).getImage(); BufferedImage bi = new BufferedImage(imaeg.getWidth( null ), imaeg.getHeight( null ), BufferedImage.TYPE_INT_RGB); Graphics2D biContext = bi.createGraphics(); biContext.drawImage(imaeg, 0 , 0 , null ); bi = OnlyImageUtil.applyGaussianFilter(bi, null , theme.getGaussian()); UIBox.put( "key_window_background_image" , bi); // // for (OnlyBorderFrame ourFrame : UIBox.frameSet) { // ourFrame.setBackgroundImage(bi); // } // for (OnlyBorderDialog ourFrame : UIBox.dialogSet) { // ourFrame.setBackgroundImage(bi); // } } } } |
标签:
原文地址:http://www.cnblogs.com/imsoft/p/5093693.html