-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathSettingsFileData.java
More file actions
83 lines (63 loc) · 1.75 KB
/
SettingsFileData.java
File metadata and controls
83 lines (63 loc) · 1.75 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package PamController;
import java.io.File;
import java.io.Serializable;
import java.util.ArrayList;
/*
* Class containing data first read in on Pamguard start up
* which will tell us where settings were last stored and
* what to do - just load default, or pop up options list
*/
public class SettingsFileData implements Serializable, Cloneable {
static final long serialVersionUID = 1;
public boolean showFileList = true;
protected int maxFiles = 20;
public ArrayList<File> recentFiles = new ArrayList<File>();
protected boolean showTipAtStartup = true;
private double scalingFactor = 1.0;
private Boolean checkLogFileErrors = true;
public SettingsFileData() {
// recentFiles.add(new File(defaultFile));
}
public void setFirstFile(File firstFile) {
recentFiles.remove(firstFile);
recentFiles.add(0, firstFile);
}
public void trimList() {
int l;
maxFiles = Math.max(maxFiles, 1);
while ((l = recentFiles.size()) > maxFiles) {
recentFiles.remove(l-1);
}
}
public File getFirstFile() {
if (recentFiles.size() < 1) return null;
return recentFiles.get(0);
}
public double getScalingFactor() {
return scalingFactor;
}
public void setScalingFactor(double scalingFactor) {
this.scalingFactor = scalingFactor;
}
@Override
public SettingsFileData clone() {
try {
SettingsFileData set = (SettingsFileData) super.clone();
set.showFileList=true;
return set;
}
catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return null;
}
public boolean getCheckLogFileErrors() {
if (checkLogFileErrors == null) {
checkLogFileErrors = true;
}
return checkLogFileErrors;
}
public void setCheckLogFileErrors(boolean checkLogFileErrors) {
this.checkLogFileErrors = checkLogFileErrors;
}
}