1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package jr239.co620;
19
20
21 import weka.gui.LogPanel;
22
23 import java.awt.Color;
24 import javax.swing.ImageIcon;
25 import javax.swing.JFrame;
26
27 import org.apache.log4j.xml.DOMConfigurator;
28
29
30
31
32
33
34
35
36 public class Main {
37
38 protected static Main getInstance(){
39 synchronized(Main.class) {
40
41 if (singleInstace == null){
42 singleInstace = new Main();
43 setLogging();
44 setOutputPanel();
45 ACOjoinedAttrbSearch.getInstance();
46 ACOjoinedAttrbSearch.startSearch(wl);
47 }
48 }
49
50 return singleInstace;
51 }
52
53
54
55
56 public static void main (String[] args ){
57
58 Main inst = getInstance();
59 }
60
61
62 private Main(){}
63 private static void setLogging(){
64 String resourceXml = system+"co620log4Properties.xml";
65 DOMConfigurator.configure( resourceXml);
66
67 }
68
69 private static void setOutputPanel(){
70 java.net.URL imgURL = Main.class.getResource("icons/b.png");
71 JFrame.setDefaultLookAndFeelDecorated(true);
72 frame = new JFrame("ACOjoinedAttrbSearch");
73
74 frame.setIconImage(new ImageIcon(imgURL).getImage());
75 Color bg = new Color(0.7f,0.8f, 0.8f), fg = new Color(0.9f,0.99f, 1.0f);
76 wl.setBackground(bg);
77 wl.setForeground(fg);
78 frame.add(wl);
79 frame.setLocationRelativeTo(null);
80 frame.pack();
81 frame.setExtendedState(frame.getExtendedState()|JFrame.MAXIMIZED_BOTH);
82 frame.setVisible(true);
83
84 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
85 }
86
87
88
89
90 protected static String projectResources = "resources/";
91 protected static String data= projectResources +"dataSets/";
92 protected static String system = projectResources + "system/";
93
94
95 private static LogPanel wl =new LogPanel();
96 private static JFrame frame ;
97
98 private static volatile Main singleInstace = null;
99
100 }
101