-
Notifications
You must be signed in to change notification settings - Fork 0
/
RunMazeUI.java
61 lines (48 loc) · 2.14 KB
/
RunMazeUI.java
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
57
58
59
60
61
import maize.*;
import maize.ui.*;
import javax.swing.UIManager;
import java.io.IOException;
import java.io.*;
import java.awt.image.*;
import javax.imageio.*;
import java.util.*;
import maize.log.*;
public class RunMazeUI{
// config file
private static String CONFIG_LOCATION = "maize.cfg";
public static void main(String[] args){
// For windows, try to acquire native L+F
try{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}catch(Exception e) {}
// For linux, attempt to access GTK. Falls through if on windows,
try{
UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
}catch(Exception e){}
// Construct a series of maze factories
MazeTest mt = new MazeTest();
mt.factories.add( new BaffleMazeFactory() );
mt.factories.add( new CircleMazeFactory() );
mt.factories.add( new FullDFSMazeFactory() );
mt.factories.add( new EmptyMazeFactory() );
mt.factories.add( new LineMazeFactory() );
mt.factories.add( new PrimMazeFactory() );
mt.factories.add( new RandomScatterMazeFactory() );
mt.factories.add( new ScatterMazeFactory() );
//mt.factories.add( new ());
mt.factories.add( new RandomTransformMazeFactory( new BaffleMazeFactory() ) );
mt.factories.add( new RandomTransformMazeFactory( new CircleMazeFactory() ) );
mt.factories.add( new RandomTransformMazeFactory( new FullDFSMazeFactory() ) );
mt.factories.add( new RandomTransformMazeFactory( new EmptyMazeFactory() ) );
mt.factories.add( new RandomTransformMazeFactory( new LineMazeFactory() ) );
mt.factories.add( new RandomTransformMazeFactory( new PrimMazeFactory() ) );
mt.factories.add( new RandomTransformMazeFactory( new RandomScatterMazeFactory() ) );
mt.factories.add( new RandomTransformMazeFactory( new ScatterMazeFactory() ) );
if(!MazeUISettingsManager.loadConfig(CONFIG_LOCATION)){
Log.log("Error loading resources. Please attend to your config file, to be found at " + CONFIG_LOCATION);
System.exit(1);
}
// Launch the UI itself.
new MazeUI(mt);
}
}