Skip to content

Commit aa5de07

Browse files
committed
1 parent c1e398e commit aa5de07

File tree

12 files changed

+209
-389
lines changed

12 files changed

+209
-389
lines changed

src/java/org/snapbackup/business/DataModel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ static void loadCmdLineData() {
471471
public static void doCmdLineList() {
472472
new UIProperties();
473473
UIProperties ui = UIProperties.current;
474-
List<String> names = DataModel.getProfilesNames();
474+
List<String> names = getProfilesNames();
475475
Logger.initOutput();
476476
Logger.logMsg(ui.headerCmdLine);
477477
Logger.logMsg(ui.profilesTitle + ": " + names.size());

src/java/org/snapbackup/business/ExportPrefs.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ public static String dataToXml (String data) {
4141
//">", "&gt;").replace(
4242
//"&", "&amp;").replace(
4343
SystemAttributes.userHomeDir, userHomeFolderMarker);
44-
}
44+
}
4545

4646
public class XmlFileFilter extends FileFilter {
4747
public boolean accept(File f) {
48-
return f.isDirectory() || f.getName().toLowerCase(Locale.ROOT).endsWith(ExportPrefs.xmlExtension);
48+
return f.isDirectory() || f.getName().toLowerCase(Locale.ROOT).endsWith(xmlExtension);
4949
}
5050
public String getDescription() {
5151
return "XML files";

src/java/org/snapbackup/ui/SnapBackupFrame.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public class SnapBackupFrame extends JFrame {
141141

142142
public SnapBackupFrame() {
143143
current = this; //todo: AssignmentToNonFinalStatic
144-
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
144+
setDefaultCloseOperation(EXIT_ON_CLOSE);
145145
//setTitle(UIProperties.appTitle);
146146
setTitle(ui.appTitle);
147147
configureContols();

src/java/org/snapbackup/ui/about/AboutDialog.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class AboutDialog extends JDialog {
5656

5757
public AboutDialog(Frame owner) {
5858
super(owner);
59-
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
59+
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
6060
setTitle(ui.aboutTitle + UIProperties.current.appTitle);
6161
configureContols();
6262
addContols();
@@ -74,7 +74,7 @@ void setupTranslatorsPanel() {
7474
for (String[] translator : translators) {
7575
if (count % 3 == 0) { //three names per line
7676
row = new JPanel(new FlowLayout(FlowLayout.LEADING, 0, 0));
77-
row.setAlignmentX(Component.LEFT_ALIGNMENT);
77+
row.setAlignmentX(LEFT_ALIGNMENT);
7878
row.setBackground(Color.white);
7979
row.add(count == 0 ? translatedBy : new JLabel(tab));
8080
translatorsPanel.add(row);
@@ -171,9 +171,9 @@ public void addContols() {
171171
aboutPanel.add(Box.createRigidArea(new Dimension(0, 10)));
172172
aboutPanel.add(closeButton);
173173
for (Component component : aboutPanel.getComponents())
174-
((JComponent)component).setAlignmentX(Component.LEFT_ALIGNMENT);
174+
((JComponent)component).setAlignmentX(LEFT_ALIGNMENT);
175175
//for (int count = 0; count < aboutPanel.getComponentCount(); count++)
176-
// ((JComponent)aboutPanel.getComponent(count)).setAlignmentX(Component.LEFT_ALIGNMENT);
176+
// ((JComponent)aboutPanel.getComponent(count)).setAlignmentX(LEFT_ALIGNMENT);
177177
getContentPane().add(logo, BorderLayout.LINE_START);
178178
getContentPane().add(aboutPanel, BorderLayout.CENTER);
179179
}

src/java/org/snapbackup/ui/backupprogress/BackupProgressDialog.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ public BackupProgressDialog(ZipEngine zipInst) {
5353
progressLabel.setBorder(BorderFactory.createEmptyBorder(20, 0, 2, 0));
5454
backupPB.setBorder(BorderFactory.createEmptyBorder(0, 30, 20, 30));
5555
memFreeLabel.setBorder(BorderFactory.createEmptyBorder(2, 0, 20, 0));
56-
progressLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
57-
backupPB.setAlignmentX(Component.CENTER_ALIGNMENT);
58-
memFreeLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
59-
cancelButton.setAlignmentX(Component.CENTER_ALIGNMENT);
56+
progressLabel.setAlignmentX(CENTER_ALIGNMENT);
57+
backupPB.setAlignmentX(CENTER_ALIGNMENT);
58+
memFreeLabel.setAlignmentX(CENTER_ALIGNMENT);
59+
cancelButton.setAlignmentX(CENTER_ALIGNMENT);
6060

6161
// Add Controls and Display
6262
JPanel backupProgressPanel = new JPanel();

src/java/org/snapbackup/ui/filter/FilterDialog.java

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
package org.snapbackup.ui.filter;
1212

13-
import java.awt.Component;
1413
import java.awt.Dimension;
1514
import java.awt.Frame;
1615
import java.awt.event.ActionEvent;
@@ -24,9 +23,9 @@
2423

2524
public class FilterDialog extends JDialog {
2625

27-
SnapBackupFrame f = SnapBackupFrame.current;
28-
String nullStr = SystemAttributes.nullStr;
29-
FilterUIProperties ui = new FilterUIProperties();
26+
SnapBackupFrame f = SnapBackupFrame.current;
27+
String nullStr = SystemAttributes.nullStr;
28+
FilterUIProperties ui = new FilterUIProperties();
3029

3130
// Define Controls
3231
JPanel filterPanel = new JPanel();
@@ -64,7 +63,7 @@ public class FilterDialog extends JDialog {
6463

6564
public FilterDialog(Frame owner) {
6665
super(owner);
67-
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
66+
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
6867
setTitle(ui.filterRuleTitle);
6968
configureContols();
7069
addContols();
@@ -86,19 +85,19 @@ void configureContols() {
8685
BorderFactory.createTitledBorder(ui.filterRuleIncludeTitle),
8786
BorderFactory.createEmptyBorder(0, 5, 5, 5)));
8887
includeDataPanel.setLayout(new BoxLayout(includeDataPanel, BoxLayout.LINE_AXIS));
89-
includeDataPanel.setAlignmentX(Component.LEFT_ALIGNMENT); //Why??? Swing deficiency
88+
includeDataPanel.setAlignmentX(LEFT_ALIGNMENT); //Why??? Swing deficiency
9089
excludePanel.setLayout(new BoxLayout(excludePanel, BoxLayout.PAGE_AXIS));
9190
excludePanel.setBorder(BorderFactory.createCompoundBorder(
9291
BorderFactory.createTitledBorder(ui.filterRuleExcludeTitle),
9392
BorderFactory.createEmptyBorder(0, 5, 5, 5)));
9493
excludeDataPanel.setLayout(new BoxLayout(excludeDataPanel, BoxLayout.LINE_AXIS));
95-
excludeDataPanel.setAlignmentX(Component.LEFT_ALIGNMENT); //Why??? Swing deficiency
94+
excludeDataPanel.setAlignmentX(LEFT_ALIGNMENT); //Why??? Swing deficiency
9695
excludeFoldersPanel.setLayout(new BoxLayout(excludeFoldersPanel, BoxLayout.LINE_AXIS));
97-
excludeFoldersPanel.setAlignmentX(Component.LEFT_ALIGNMENT); //Why??? Swing deficiency
96+
excludeFoldersPanel.setAlignmentX(LEFT_ALIGNMENT); //Why??? Swing deficiency
9897
excludeSizePanel.setLayout(new BoxLayout(excludeSizePanel, BoxLayout.LINE_AXIS));
99-
excludeSizePanel.setAlignmentX(Component.LEFT_ALIGNMENT); //Why??? Swing deficiency
98+
excludeSizePanel.setAlignmentX(LEFT_ALIGNMENT); //Why??? Swing deficiency
10099
buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.LINE_AXIS));
101-
buttonPanel.setAlignmentX(Component.LEFT_ALIGNMENT); //Why??? Swing deficiency
100+
buttonPanel.setAlignmentX(LEFT_ALIGNMENT); //Why??? Swing deficiency
102101
deleteButton.addActionListener(new ActionListener() {
103102
public void actionPerformed(ActionEvent e) { actionDelete(); } } );
104103
cancelButton.addActionListener(new ActionListener() {
@@ -109,10 +108,9 @@ void configureContols() {
109108
UIUtilities.makeBold(okButton);
110109
getRootPane().setDefaultButton(okButton);
111110
getRootPane().registerKeyboardAction(new ActionListener() {
112-
public void actionPerformed(ActionEvent e) {
113-
actionCancel(); } },
114-
KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
115-
JComponent.WHEN_IN_FOCUSED_WINDOW);
111+
public void actionPerformed(ActionEvent e) { actionCancel(); } },
112+
KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
113+
JComponent.WHEN_IN_FOCUSED_WINDOW);
116114
}
117115

118116
void addContols() {

src/java/org/snapbackup/ui/options/OptionsDialog.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
package org.snapbackup.ui.options;
1212

13-
import java.awt.Component;
1413
import java.awt.Dimension;
1514
import java.awt.Frame;
1615
import java.awt.event.ActionEvent;
@@ -34,7 +33,7 @@ String[] str2Array(String str) {
3433
}
3534

3635
// Define Options Controls
37-
String coreBackupName;
36+
String coreBackupName;
3837
OptionsUIProperties ui = new OptionsUIProperties();
3938

4039
JPanel optionsPanel = new JPanel();
@@ -91,7 +90,7 @@ String[] str2Array(String str) {
9190
public OptionsDialog(Frame owner, String backupName) {
9291
super(owner);
9392
coreBackupName = SystemAttributes.space + backupName;
94-
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
93+
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
9594
setTitle(ui.title);
9695
configureContols();
9796
addContols();
@@ -144,7 +143,7 @@ void configureContols() {
144143
BorderFactory.createEmptyBorder(0, 5, 5, 5)));
145144

146145
buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.LINE_AXIS));
147-
buttonPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
146+
buttonPanel.setAlignmentX(LEFT_ALIGNMENT);
148147
cancelButton.addActionListener(new ActionListener() {
149148
public void actionPerformed(ActionEvent e) { actionCancel(); } } );
150149
defaultsButton.addActionListener(new ActionListener() {

src/java/org/snapbackup/ui/prefexport/ExportDialog.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
package org.snapbackup.ui.prefexport;
1212

13-
import java.awt.Component;
1413
import java.awt.Dimension;
1514
import java.awt.Frame;
1615
import java.awt.event.ActionEvent;
@@ -46,7 +45,7 @@ public ExportDialog(Frame owner) {
4645
super(owner);
4746
AppProperties.addSupplimentalProperty(Export.prefSettingsFileName,
4847
new Export().defaultSettingsFileName);
49-
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
48+
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
5049
setTitle(ui.title);
5150
configureContols();
5251
addContols();
@@ -66,8 +65,8 @@ void configureContols() {
6665
BorderFactory.createTitledBorder(ui.locationTitle),
6766
BorderFactory.createEmptyBorder(0, 5, 5, 5)));
6867
locationInnerPanel.setLayout(new BoxLayout(locationInnerPanel, BoxLayout.LINE_AXIS));
69-
locationInnerPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
70-
locationPanel.setAlignmentY(Component.LEFT_ALIGNMENT);
68+
locationInnerPanel.setAlignmentX(LEFT_ALIGNMENT);
69+
locationPanel.setAlignmentY(LEFT_ALIGNMENT);
7170
locationTextField.setText(UserPreferences.readPref(Export.prefSettingsFileName));
7271
locationChooserButton.setToolTipText(ui.locationCmd);
7372
locationChooserButton.addActionListener(new ActionListener() {
@@ -76,7 +75,7 @@ void configureContols() {
7675
resetButton.addActionListener(new ActionListener() {
7776
public void actionPerformed(ActionEvent e) { actionReset(); } } );
7877
buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.LINE_AXIS));
79-
buttonPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
78+
buttonPanel.setAlignmentX(LEFT_ALIGNMENT);
8079
cancelButton.addActionListener(new ActionListener() {
8180
public void actionPerformed(ActionEvent e) { actionCancel(); } } );
8281
actionButton.addActionListener(new ActionListener() {

src/java/org/snapbackup/ui/prefimport/ImportDialog.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
package org.snapbackup.ui.prefimport;
1212

13-
import java.awt.Component;
1413
import java.awt.Dimension;
1514
import java.awt.Frame;
1615
import java.awt.event.ActionEvent;
@@ -49,7 +48,7 @@ public ImportDialog(Frame owner) {
4948
super(owner);
5049
AppProperties.addSupplimentalProperty(Export.prefSettingsFileName,
5150
new Export().defaultSettingsFileName);
52-
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
51+
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
5352
setTitle(ui.title);
5453
configureContols();
5554
addContols();
@@ -69,15 +68,15 @@ void configureContols() {
6968
BorderFactory.createTitledBorder(ui.locationTitle),
7069
BorderFactory.createEmptyBorder(0, 5, 5, 5)));
7170
locationInnerPanel.setLayout(new BoxLayout(locationInnerPanel, BoxLayout.LINE_AXIS));
72-
locationInnerPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
73-
locationPanel.setAlignmentY(Component.LEFT_ALIGNMENT);
71+
locationInnerPanel.setAlignmentX(LEFT_ALIGNMENT);
72+
locationPanel.setAlignmentY(LEFT_ALIGNMENT);
7473
locationTextField.setText(UserPreferences.readPref(Export.prefSettingsFileName));
7574
locationChooserButton.setToolTipText(ui.locationCmd);
7675
locationChooserButton.addActionListener(new ActionListener() {
7776
public void actionPerformed(ActionEvent e) { locationChooserButtonAction(e); }
7877
} );
7978
buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.LINE_AXIS));
80-
buttonPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
79+
buttonPanel.setAlignmentX(LEFT_ALIGNMENT);
8180
cancelButton.addActionListener(new ActionListener() {
8281
public void actionPerformed(ActionEvent e) { actionCancel(); } } );
8382
actionButton.addActionListener(new ActionListener() {

src/java/org/snapbackup/ui/userguide/UserGuideDialog.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
package org.snapbackup.ui.userguide;
1212

13-
import java.awt.Component;
1413
import java.awt.Dimension;
1514
import java.awt.Frame;
1615
import java.awt.Toolkit;
@@ -39,7 +38,7 @@ public class UserGuideDialog extends JDialog {
3938

4039
public UserGuideDialog(Frame owner) {
4140
super(owner);
42-
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
41+
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
4342
setTitle(ui.userGuideTitle);
4443
configureContols();
4544
addContols();
@@ -55,8 +54,8 @@ public void configureContols() {
5554
headerPanel.setLayout(new BoxLayout(headerPanel, BoxLayout.PAGE_AXIS));
5655
UIUtilities.makeBold(titleLabel);
5756
UIUtilities.bumpUpFontSize(titleLabel, 3);
58-
titleLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
59-
versionLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
57+
titleLabel.setAlignmentX(CENTER_ALIGNMENT);
58+
versionLabel.setAlignmentX(CENTER_ALIGNMENT);
6059
URL url = getClass().getResource(UserGuideUIProperties.userGuideURL);
6160
try {
6261
htmlEditorPane = new JEditorPane(url);

0 commit comments

Comments
 (0)