create changelog entry
[debian/openrocket] / core / src / net / sf / openrocket / gui / print / components / CheckBoxNode.java
1 /*
2  * CheckBoxNode.java
3  */
4 package net.sf.openrocket.gui.print.components;
5
6 /**
7  * A class that acts as the textual node of the check box within the JTree.
8  */
9 public class CheckBoxNode {
10
11     /**
12      * The text label of the check box.
13      */
14     String text;
15
16     /**
17      * State flag indicating if the check box has been selected.
18      */
19     boolean selected;
20
21     /**
22      * Constructor.
23      * 
24      * @param theText  the check box label
25      * @param isSelected  true if selected
26      */
27     public CheckBoxNode (String theText, boolean isSelected) {
28         text = theText;
29         selected = isSelected;
30     }
31
32     /**
33      * Get the current state of the check box.
34      * 
35      * @return true if selected
36      */
37     public boolean isSelected () {
38         return selected;
39     }
40
41     /**
42      * Set the current state of the check box.  Note: this just tracks the state - it 
43      * does NOT actually set the state of the check box.
44      * 
45      * @param isSelected  true if selected
46      */
47     public void setSelected (boolean isSelected) {
48         selected = isSelected;
49     }
50
51     /**
52      * Get the text of the label.
53      * 
54      * @return  the text of the label
55      */
56     public String getText () {
57         return text;
58     }
59
60     /**
61      * Set the text of the label of the check box.
62      * 
63      * @param theText  the text of the label
64      */
65     public void setText (String theText) {
66         text = theText;
67     }
68
69     /**
70      * If someone prints this object, the text label will be displayed.
71      * 
72      * @return  the text label
73      */
74     public String toString () {
75         return text;
76     }
77 }