-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCheckBoxNode.java
More file actions
53 lines (46 loc) · 1.28 KB
/
Copy pathCheckBoxNode.java
File metadata and controls
53 lines (46 loc) · 1.28 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
package com.cs2212;
/**
* A node that represents a node in a tree view that has a checkbox associated with it for the sidebar.
* @author sophi
*/
public class CheckBoxNode {
private String text;
private boolean selected;
/**
* Constructs a new checkbox node with the given text and selection status.
* @param text the text to be displayed for this node
* @param selected the initial selection status for this node
*/
public CheckBoxNode(String text, boolean selected) {
this.text = text;
this.selected = selected;
}
/**
* Returns the text displayed for this node.
* @return the text displayed for this node
*/
public String getText() {
return text;
}
/**
* Sets the text displayed for this node.
* @param text the new text to be displayed for this node
*/
public void setText(String text) {
this.text = text;
}
/**
* Returns the selection status of this node.
* @return the selection status of this node
*/
public boolean isSelected() {
return selected;
}
/**
* Sets the selection status of this node.
* @param selected the new selection status for this node
*/
public void setSelected(boolean selected) {
this.selected = selected;
}
}