Browse Source

Initial work on UI

master
Chris Smith 15 years ago
parent
commit
d4d1343409

BIN
lib/miglayout-3.6.2.jar View File


+ 4
- 2
nbproject/project.properties View File

@@ -24,6 +24,7 @@ file.reference.derby.jar=lib/derby.jar
24 24
 file.reference.jaxen-core.jar=lib/jaxen-core.jar
25 25
 file.reference.jaxen-jdom.jar=lib/jaxen-jdom.jar
26 26
 file.reference.jdom.jar=lib/jdom.jar
27
+file.reference.miglayout-3.6.2.jar=lib/miglayout-3.6.2.jar
27 28
 file.reference.saxpath.jar=lib/saxpath.jar
28 29
 file.reference.xalan.jar=lib/xalan.jar
29 30
 file.reference.xerces.jar=lib/xerces.jar
@@ -38,7 +39,8 @@ javac.classpath=\
38 39
     ${file.reference.xerces.jar}:\
39 40
     ${file.reference.xml-apis.jar}:\
40 41
     ${file.reference.derby.jar}:\
41
-    ${file.reference.jdom.jar}
42
+    ${file.reference.jdom.jar}:\
43
+    ${file.reference.miglayout-3.6.2.jar}
42 44
 # Space-separated list of extra javac options
43 45
 javac.compilerargs=
44 46
 javac.deprecation=false
@@ -73,7 +75,7 @@ run.jvmargs=
73 75
 run.test.classpath=\
74 76
     ${javac.test.classpath}:\
75 77
     ${build.test.classes.dir}:\
76
-    :${file.reference.emma.jar}
78
+    ${file.reference.emma.jar}
77 79
 source.encoding=UTF-8
78 80
 src.dir=src
79 81
 test.src.dir=test

+ 4
- 0
src/uk/co/md87/evetool/Main.java View File

@@ -25,7 +25,9 @@ package uk.co.md87.evetool;
25 25
 import java.util.logging.Handler;
26 26
 import java.util.logging.Level;
27 27
 import java.util.logging.Logger;
28
+
28 29
 import uk.co.md87.evetool.api.EveApi;
30
+import uk.co.md87.evetool.ui.MainWindow;
29 31
 
30 32
 /**
31 33
  *
@@ -42,6 +44,8 @@ public class Main {
42 44
         for (Handler handler : Logger.getLogger("").getHandlers()) {
43 45
             handler.setLevel(Level.ALL);
44 46
         }
47
+
48
+        new MainWindow().setVisible(true);
45 49
         
46 50
         final EveApi api = ApiFactory.getApi();
47 51
         api.setApiKey("yaISaqXrSnaQPnRSFi4ODeWjSzWu2gNq1h6F0tVevtSGr5dzoEkZ6YrzHeBzzgNg");

+ 43
- 0
src/uk/co/md87/evetool/ui/ContentPanel.java View File

@@ -0,0 +1,43 @@
1
+/*
2
+ * Copyright (c) 2009 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package uk.co.md87.evetool.ui;
24
+
25
+import java.awt.Color;
26
+import javax.swing.JLabel;
27
+import javax.swing.JPanel;
28
+import net.miginfocom.swing.MigLayout;
29
+
30
+/**
31
+ *
32
+ * @author chris
33
+ */
34
+public class ContentPanel extends JPanel {
35
+
36
+    public ContentPanel() {
37
+        super(new MigLayout());
38
+
39
+        setBackground(Color.BLUE);
40
+        add(new JLabel("Main content", JLabel.CENTER), "push, grow");
41
+    }
42
+
43
+}

+ 54
- 0
src/uk/co/md87/evetool/ui/MainWindow.java View File

@@ -0,0 +1,54 @@
1
+/*
2
+ * Copyright (c) 2009 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package uk.co.md87.evetool.ui;
24
+
25
+import java.awt.Dimension;
26
+import java.awt.HeadlessException;
27
+import javax.swing.JFrame;
28
+import net.miginfocom.swing.MigLayout;
29
+
30
+/**
31
+ *
32
+ * TODO: Document
33
+ * @author chris
34
+ */
35
+public class MainWindow extends JFrame {
36
+
37
+    public MainWindow() throws HeadlessException {
38
+        super("EVE Tool");
39
+
40
+        setLayout(new MigLayout("insets 0, fill, wrap 2",
41
+                "[]0[fill,grow]", "[fill,grow]0[]"));
42
+        addComponents();
43
+        setMinimumSize(new Dimension(300, 300));
44
+        setPreferredSize(new Dimension(800, 600));
45
+        setDefaultCloseOperation(EXIT_ON_CLOSE);
46
+    }
47
+
48
+    protected void addComponents() {
49
+        add(new MenuPanel(), "width 200!");
50
+        add(new ContentPanel());
51
+        add(new StatusPanel(), "growx, span, height 30!");
52
+    }
53
+
54
+}

+ 44
- 0
src/uk/co/md87/evetool/ui/MenuPanel.java View File

@@ -0,0 +1,44 @@
1
+/*
2
+ * Copyright (c) 2009 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package uk.co.md87.evetool.ui;
24
+
25
+import java.awt.Color;
26
+import javax.swing.JLabel;
27
+import javax.swing.JPanel;
28
+import net.miginfocom.swing.MigLayout;
29
+
30
+/**
31
+ *
32
+ * TODO: Document
33
+ * @author chris
34
+ */
35
+public class MenuPanel extends JPanel {
36
+
37
+    public MenuPanel() {
38
+        super(new MigLayout());
39
+
40
+        setBackground(Color.RED);
41
+        add(new JLabel("Menu + char portraits", JLabel.CENTER), "push, grow");
42
+    }
43
+
44
+}

+ 43
- 0
src/uk/co/md87/evetool/ui/StatusPanel.java View File

@@ -0,0 +1,43 @@
1
+/*
2
+ * Copyright (c) 2009 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package uk.co.md87.evetool.ui;
24
+
25
+import java.awt.Color;
26
+import javax.swing.JLabel;
27
+import javax.swing.JPanel;
28
+import net.miginfocom.swing.MigLayout;
29
+
30
+/**
31
+ *
32
+ * @author chris
33
+ */
34
+public class StatusPanel extends JPanel {
35
+
36
+    public StatusPanel() {
37
+        super(new MigLayout());
38
+
39
+        setBackground(Color.GREEN);
40
+        add(new JLabel("Status information", JLabel.CENTER), "push, grow");
41
+    }
42
+
43
+}

Loading…
Cancel
Save