-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileSelector.java
More file actions
77 lines (57 loc) · 1.64 KB
/
FileSelector.java
File metadata and controls
77 lines (57 loc) · 1.64 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
package atChat;
import java.io.File;
import javafx.scene.control.TreeItem;
import javafx.scene.image.Image;
public class FileSelector {
private static final Image checked = new Image("/atChat/resources/images/checkBox_checked.png");
private static final Image unChecked = new Image("/atChat/resources/images/checkBox.png");
private static final Image overwriteImage = new Image("/atChat/resources/images/file_overwrite.png");
private static final Image directoryImage = new Image("/atChat/resources/images/folder.png");
private boolean selected = true;
private final boolean isDir;
private final String path;
private final long size;
private final TreeItem<String> treeItem;
public FileSelector(String path, long size) {
this.path = path;
this.size = size;
isDir = (path.endsWith(File.separator));
treeItem = new TreeItem<String>(path);
}
public FileSelector(String path) {
this.path = path;
this.size = 0;
isDir = (path.endsWith(File.separator));
treeItem = null;
}
public boolean isDirectory() {
return isDir;
}
public String getPath() {
return path;
}
public boolean isSelected() {
return selected;
}
public void setSelected(boolean selected) {
this.selected = selected;
}
public Image getCheckedImage() {
return checked;
}
public Image getUnCheckedImage() {
return unChecked;
}
public Image getOverwriteImage() {
return overwriteImage;
}
public Image getDirImage() {
return directoryImage;
}
public TreeItem<String> getItem() {
return treeItem;
}
public long getSize() {
return size;
}
}