This patch (committed) removes some redundant demo items and adds in the new SpinnerDemo as a menu / button bar option:

2006-02-28  David Gilbert  <[EMAIL PROTECTED]>

        * examples/gnu/classpath/examples/swing/Demo.java
        (mkMenuBar): Removed 'Toggles', 'Checkbox' and 'Radio' actions,
        connected 'Spinner' action to SpinnerDemo,
        (mkCheckbox): Removed,
        (mkRadio): Likewise,
        (mkSpinner): Likewise,
        (mkToggle): Likewise,
        (mkButtonBar): Removed 'Toggles', 'Checkbox' and 'Radio' actions,
        connected 'Spinner' action to SpinnerDemo.

Regards,

Dave
Index: examples/gnu/classpath/examples/swing/Demo.java
===================================================================
RCS file: 
/sources/classpath/classpath/examples/gnu/classpath/examples/swing/Demo.java,v
retrieving revision 1.32
diff -u -r1.32 Demo.java
--- examples/gnu/classpath/examples/swing/Demo.java     30 Jan 2006 22:05:08 
-0000      1.32
+++ examples/gnu/classpath/examples/swing/Demo.java     28 Feb 2006 22:13:27 
-0000
@@ -163,18 +163,6 @@
     new PopUpAction("Buttons",
                    (new ButtonDemo("Button Demo")).createContent(),
                    examples);
-    
-    new PopUpAction("Toggles",
-                   mkToggle("cool and refreshing"),
-                   examples);
-
-    new PopUpAction("Checkbox",
-                   mkCheckbox("ice cold"),
-                   examples);
-
-    new PopUpAction("Radio",
-                   mkRadio("delicious"),
-                   examples);
 
     new PopUpAction("Slider",
                    (new SliderDemo("Slider Demo")).createContent(),
@@ -214,8 +202,7 @@
                    examples);
 
     new PopUpAction("Spinner",
-                   mkSpinner(),
-                   examples);
+                   new SpinnerDemo("Spinner Demo").createContent(), examples);
 
     new PopUpAction("TextField",
                    (new TextFieldDemo("TextField Demo")).createContent(),
@@ -733,26 +720,6 @@
     SwingUtilities.invokeLater(new LaterMain());
   }
 
-  public static JCheckBox mkCheckbox(String label)
-  {
-    JCheckBox c = new JCheckBox(label);
-    c.setFont(new Font("Luxi", Font.PLAIN, 14));
-    return c;
-  }
-
-  public static JPanel mkRadio(String label)
-  {
-    JPanel p = new JPanel();
-    JRadioButton c = new JRadioButton(label);
-    JRadioButton d = new JRadioButton("not " + label);
-    ButtonGroup bg = new ButtonGroup();
-    bg.add(c);
-    bg.add(d);
-    p.add(c);
-    p.add(d);
-    return p;
-  }
-
   public static JList mkList(Object[] elts)
   {
     JList list = new JList(elts);
@@ -776,12 +743,6 @@
     return box;
   }
 
-  public static JSpinner mkSpinner()
-  {
-    JSpinner spinner = new JSpinner();
-    return spinner;
-  }
-
   public static JButton mkBigButton(String title)
   {
     JButton b = new JButton(title);
@@ -790,14 +751,6 @@
     return b;
   }
 
-  public static JToggleButton mkToggle(String title)
-  {
-    JToggleButton b = new JToggleButton(title);
-    b.setMargin(new Insets(5,5,5,5));
-    b.setFont(new Font("Luxi", Font.PLAIN, 14));
-    return b;    
-  }
-
   public static JPanel mkPanel(JComponent[] inners)
   {
     JPanel p = new JPanel();
@@ -1009,18 +962,6 @@
     new PopUpAction("Buttons",
                    (new ButtonDemo("Button Demo")).createContent(),
                    panel);
-    
-    new PopUpAction("Toggles",
-                   mkToggle("cool and refreshing"),
-                   panel);
-
-    new PopUpAction("Checkbox",
-                   mkCheckbox("ice cold"),
-                   panel);
-
-    new PopUpAction("Radio",
-                   mkRadio("delicious"),
-                   panel);
 
     new PopUpAction("Slider",
                    (new SliderDemo("Slider Demo")).createContent(),
@@ -1060,9 +1001,8 @@
                                         "indifferent"}),
                    panel);
 
-    new PopUpAction("Spinner",
-                   mkSpinner(),
-                   panel);
+    new PopUpAction("Spinner", 
+                   new SpinnerDemo("Spinner Demo").createContent(), panel);
 
     new PopUpAction("TextField",
                    (new TextFieldDemo("TextField Demo")).createContent(),

Reply via email to