]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - apps/AntiTheft/java/BagPanel.java
comment updates
[tinyos-2.x.git] / apps / AntiTheft / java / BagPanel.java
index 20e340a372fabf10ce2bafa666134565b5b61d1f..4e2e3fe0b9bbd3bfc29da4a75951554f2124a115 100644 (file)
@@ -29,12 +29,19 @@ public class BagPanel extends JPanel {
     GridBagLayout bag;
     GridBagConstraints c;
 
+    /* Create a panel with a bag layout. Create some constraints are
+       users can modify prior to creating widgets - the current constraints
+       will be applied to all widgets created with makeXXX */
     public BagPanel() {
        bag = new GridBagLayout();
        setLayout(bag);
        c = new GridBagConstraints();
     }
 
+    /* The makeXXX methods create XXX widgets, apply the current constraints
+       to them, and add them to this panel. The widget is returned in case
+       the creator needs to hang on to it. */
+
     public JButton makeButton(String label, ActionListener action) {
        JButton button = new JButton();
         button.setText(label);
@@ -71,10 +78,11 @@ public class BagPanel extends JPanel {
        return tf;
     }
 
-    public void addSeparator(int axis) {
+    public JSeparator makeSeparator(int axis) {
        JSeparator sep = new JSeparator(axis);
        bag.setConstraints(sep, c);
        add(sep);
+       return sep;
     }
 
 }