Browse Source

Simpler layouts for the installer steps

git-svn-id: http://svn.dmdirc.com/trunk@1912 00569f92-eb28-0410-84fd-f71c24880f
tags/0.5
Gregory Holmes 17 years ago
parent
commit
b3f0d70223

+ 5
- 15
src/com/dmdirc/installer/StepConfirm.java View File

@@ -27,10 +27,9 @@ import com.dmdirc.ui.swing.dialogs.wizard.Step;
27 27
 import static com.dmdirc.ui.swing.UIUtilities.LARGE_BORDER;
28 28
 import static com.dmdirc.ui.swing.UIUtilities.SMALL_BORDER;
29 29
 
30
-import java.awt.GridBagConstraints;
31
-import java.awt.GridBagLayout;
30
+import java.awt.BorderLayout;
31
+
32 32
 import javax.swing.BorderFactory;
33
-import javax.swing.Box;
34 33
 import javax.swing.JTextArea;
35 34
 
36 35
 /**
@@ -42,7 +41,7 @@ public final class StepConfirm extends Step implements SpecialStep {
42 41
 	 * structure is changed (or anything else that would prevent serialized
43 42
 	 * objects being unserialized with the new class).
44 43
 	 */
45
-	private static final long serialVersionUID = 1;
44
+	private static final long serialVersionUID = 2;
46 45
 	
47 46
 	/** Text area showing the install information */
48 47
 	private JTextArea infoLabel = new JTextArea("");
@@ -52,8 +51,7 @@ public final class StepConfirm extends Step implements SpecialStep {
52 51
 	 */
53 52
 	public StepConfirm() {
54 53
 		super();
55
-		final GridBagConstraints constraints = new GridBagConstraints();
56
-		setLayout(new GridBagLayout());
54
+		setLayout(new BorderLayout());
57 55
 		setBorder(BorderFactory.createEmptyBorder(LARGE_BORDER, LARGE_BORDER, SMALL_BORDER, LARGE_BORDER));
58 56
 		
59 57
 		infoLabel.setEditable(false);
@@ -63,15 +61,7 @@ public final class StepConfirm extends Step implements SpecialStep {
63 61
 		infoLabel.setBackground(getBackground());
64 62
 		infoLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, SMALL_BORDER, 0));
65 63
 			
66
-		constraints.weightx = 1.0;
67
-		constraints.fill = constraints.BOTH;
68
-		constraints.gridx = 0;
69
-		constraints.gridy = 0;
70
-		add(infoLabel, constraints);
71
-
72
-		constraints.weighty = 1.0;
73
-		constraints.gridy = 4;
74
-		add(Box.createVerticalGlue(), constraints);
64
+		add(infoLabel, BorderLayout.CENTER);
75 65
 	}
76 66
 	
77 67
 	/**

+ 5
- 15
src/com/dmdirc/installer/StepError.java View File

@@ -26,10 +26,9 @@ import com.dmdirc.ui.swing.dialogs.wizard.Step;
26 26
 import static com.dmdirc.ui.swing.UIUtilities.LARGE_BORDER;
27 27
 import static com.dmdirc.ui.swing.UIUtilities.SMALL_BORDER;
28 28
 
29
-import java.awt.GridBagConstraints;
30
-import java.awt.GridBagLayout;
29
+import java.awt.BorderLayout;
30
+
31 31
 import javax.swing.BorderFactory;
32
-import javax.swing.Box;
33 32
 import javax.swing.JTextArea;
34 33
 
35 34
 /**
@@ -41,15 +40,14 @@ public final class StepError extends Step {
41 40
 	 * structure is changed (or anything else that would prevent serialized
42 41
 	 * objects being unserialized with the new class).
43 42
 	 */
44
-	private static final long serialVersionUID = 1;
43
+	private static final long serialVersionUID = 2;
45 44
 	
46 45
 	/**
47 46
 	 * Creates a new instance of StepOne.
48 47
 	 */
49 48
 	public StepError() {
50 49
 		super();
51
-		final GridBagConstraints constraints = new GridBagConstraints();
52
-		setLayout(new GridBagLayout());
50
+		setLayout(new BorderLayout());
53 51
 		setBorder(BorderFactory.createEmptyBorder(LARGE_BORDER, LARGE_BORDER, SMALL_BORDER, LARGE_BORDER));
54 52
 		
55 53
 		JTextArea infoLabel;
@@ -61,14 +59,6 @@ public final class StepError extends Step {
61 59
 		infoLabel.setBackground(getBackground());
62 60
 		infoLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, SMALL_BORDER, 0));
63 61
 			
64
-		constraints.weightx = 1.0;
65
-		constraints.fill = constraints.BOTH;
66
-		constraints.gridx = 0;
67
-		constraints.gridy = 0;
68
-		add(infoLabel, constraints);
69
-
70
-		constraints.weighty = 1.0;
71
-		constraints.gridy = 4;
72
-		add(Box.createVerticalGlue(), constraints);
62
+		add(infoLabel, BorderLayout.CENTER);
73 63
 	}
74 64
 }

+ 5
- 15
src/com/dmdirc/installer/StepInstall.java View File

@@ -28,10 +28,9 @@ import com.dmdirc.ui.swing.dialogs.wizard.Step;
28 28
 import static com.dmdirc.ui.swing.UIUtilities.LARGE_BORDER;
29 29
 import static com.dmdirc.ui.swing.UIUtilities.SMALL_BORDER;
30 30
 
31
-import java.awt.GridBagConstraints;
32
-import java.awt.GridBagLayout;
31
+import java.awt.BorderLayout;
32
+
33 33
 import javax.swing.BorderFactory;
34
-import javax.swing.Box;
35 34
 import javax.swing.JTextArea;
36 35
 
37 36
 /**
@@ -43,7 +42,7 @@ public final class StepInstall extends Step implements SpecialStep, TextStep {
43 42
 	 * structure is changed (or anything else that would prevent serialized
44 43
 	 * objects being unserialized with the new class).
45 44
 	 */
46
-	private static final long serialVersionUID = 1;
45
+	private static final long serialVersionUID = 2;
47 46
 	
48 47
 	/** Text area showing the install information */
49 48
 	private JTextArea infoLabel = new JTextArea("Beginning Install");
@@ -53,8 +52,7 @@ public final class StepInstall extends Step implements SpecialStep, TextStep {
53 52
 	 */
54 53
 	public StepInstall() {
55 54
 		super();
56
-		final GridBagConstraints constraints = new GridBagConstraints();
57
-		setLayout(new GridBagLayout());
55
+		setLayout(new BorderLayout());
58 56
 		setBorder(BorderFactory.createEmptyBorder(LARGE_BORDER, LARGE_BORDER, SMALL_BORDER, LARGE_BORDER));
59 57
 		
60 58
 		infoLabel.setEditable(false);
@@ -64,15 +62,7 @@ public final class StepInstall extends Step implements SpecialStep, TextStep {
64 62
 		infoLabel.setBackground(getBackground());
65 63
 		infoLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, SMALL_BORDER, 0));
66 64
 			
67
-		constraints.weightx = 1.0;
68
-		constraints.fill = constraints.BOTH;
69
-		constraints.gridx = 0;
70
-		constraints.gridy = 0;
71
-		add(infoLabel, constraints);
72
-
73
-		constraints.weighty = 1.0;
74
-		constraints.gridy = 4;
75
-		add(Box.createVerticalGlue(), constraints);
65
+		add(infoLabel, BorderLayout.CENTER);
76 66
 	}
77 67
 	
78 68
 	/**

+ 17
- 11
src/com/dmdirc/installer/StepSettings.java View File

@@ -28,6 +28,8 @@ import static com.dmdirc.ui.swing.UIUtilities.SMALL_BORDER;
28 28
 
29 29
 import java.awt.GridBagConstraints;
30 30
 import java.awt.GridBagLayout;
31
+import java.awt.Insets;
32
+
31 33
 import javax.swing.BorderFactory;
32 34
 import javax.swing.Box;
33 35
 import javax.swing.JCheckBox;
@@ -44,7 +46,7 @@ public final class StepSettings extends Step {
44 46
 	 * structure is changed (or anything else that would prevent serialized
45 47
 	 * objects being unserialized with the new class).
46 48
 	 */
47
-	private static final long serialVersionUID = 1;
49
+	private static final long serialVersionUID = 2;
48 50
 	
49 51
 	/** Shorcuts checkbox. */
50 52
 	private final JCheckBox shortcuts = new JCheckBox("Setup shortcuts to DMDirc?");
@@ -68,6 +70,8 @@ public final class StepSettings extends Step {
68 70
 		infoLabel.setHighlighter(null);
69 71
 		infoLabel.setBackground(getBackground());
70 72
 		infoLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, SMALL_BORDER, 0));
73
+                
74
+                shortcuts.setSelected(true);
71 75
 			
72 76
 		constraints.weightx = 1.0;
73 77
 		constraints.fill = constraints.BOTH;
@@ -76,23 +80,25 @@ public final class StepSettings extends Step {
76 80
 		constraints.gridwidth = 2;
77 81
 		add(infoLabel, constraints);
78 82
 
83
+                constraints.weightx = 0.0;
79 84
 		constraints.gridwidth = 1;
80 85
 		constraints.gridy = 1;
81
-		add(new JLabel("Install Location:"), constraints);
86
+                constraints.fill = constraints.NONE;
87
+		add(new JLabel("Install Location: "), constraints);
88
+                constraints.fill = constraints.HORIZONTAL;
82 89
 		constraints.gridx = 1;
83 90
 		add(location, constraints);
84 91
 		
85
-		constraints.gridwidth = 2;
86
-		constraints.gridx = 0;
87
-		constraints.gridy = 2;
88
-		add(new JLabel(" "), constraints);
92
+                constraints.gridwidth = 2;
89 93
 		constraints.gridy = 3;
90
-		shortcuts.setSelected(true);
94
+                constraints.gridx = 0;
95
+                constraints.insets = new Insets(SMALL_BORDER, 0, 0, 0);
91 96
 		add(shortcuts, constraints);
92
-
93
-		constraints.weighty = 1.0;
94
-		constraints.gridy = 4;
95
-		add(Box.createVerticalGlue(), constraints);
97
+                
98
+                constraints.gridy = 4;
99
+                constraints.weighty = 1.0;
100
+                constraints.fill = constraints.BOTH;
101
+                add(Box.createVerticalGlue(), constraints);
96 102
 	}
97 103
 	
98 104
 	/**

+ 5
- 16
src/com/dmdirc/installer/StepWelcome.java View File

@@ -23,14 +23,12 @@
23 23
 package com.dmdirc.installer;
24 24
 
25 25
 import com.dmdirc.ui.swing.dialogs.wizard.Step;
26
-import com.dmdirc.ui.swing.dialogs.wizard.WizardDialog;
27 26
 import static com.dmdirc.ui.swing.UIUtilities.LARGE_BORDER;
28 27
 import static com.dmdirc.ui.swing.UIUtilities.SMALL_BORDER;
29 28
 
30
-import java.awt.GridBagConstraints;
31
-import java.awt.GridBagLayout;
29
+import java.awt.BorderLayout;
30
+
32 31
 import javax.swing.BorderFactory;
33
-import javax.swing.Box;
34 32
 import javax.swing.JTextArea;
35 33
 
36 34
 /**
@@ -42,15 +40,14 @@ public final class StepWelcome extends Step {
42 40
 	 * structure is changed (or anything else that would prevent serialized
43 41
 	 * objects being unserialized with the new class).
44 42
 	 */
45
-	private static final long serialVersionUID = 1;
43
+	private static final long serialVersionUID = 2;
46 44
 	
47 45
 	/**
48 46
 	 * Creates a new instance of StepWelcome.
49 47
 	 */
50 48
 	public StepWelcome() {
51 49
 		super();
52
-		final GridBagConstraints constraints = new GridBagConstraints();
53
-		setLayout(new GridBagLayout());
50
+		setLayout(new BorderLayout());
54 51
 		setBorder(BorderFactory.createEmptyBorder(LARGE_BORDER, LARGE_BORDER, SMALL_BORDER, LARGE_BORDER));
55 52
 		
56 53
 		JTextArea infoLabel;
@@ -65,14 +62,6 @@ public final class StepWelcome extends Step {
65 62
 		infoLabel.setBackground(getBackground());
66 63
 		infoLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, SMALL_BORDER, 0));
67 64
 			
68
-		constraints.weightx = 1.0;
69
-		constraints.fill = constraints.BOTH;
70
-		constraints.gridx = 0;
71
-		constraints.gridy = 0;
72
-		add(infoLabel, constraints);
73
-
74
-		constraints.weighty = 1.0;
75
-		constraints.gridy = 4;
76
-		add(Box.createVerticalGlue(), constraints);
65
+		add(infoLabel, BorderLayout.CENTER);
77 66
 	}
78 67
 }

Loading…
Cancel
Save