OSDN Git Service

Normalise whitespace in GNU Classpath.
[pf3gnuchains/gcc-fork.git] / libjava / classpath / examples / gnu / classpath / examples / swing / TreeDemo.java
index 8da3750..f8f7ae6 100644 (file)
@@ -72,13 +72,13 @@ public class TreeDemo
   }
 
   private void createContent()
-  {     
+  {
     // non-leafs
     DefaultMutableTreeNode root = new DefaultMutableTreeNode("Exotic Subsistence");
     DefaultMutableTreeNode fruit = new DefaultMutableTreeNode("Interesting Fruit");
     DefaultMutableTreeNode veg = new DefaultMutableTreeNode("Extraordinary Vegetables");
     DefaultMutableTreeNode liq = new DefaultMutableTreeNode("Peculiar Liquids");
-    
+
     // leafs
     DefaultMutableTreeNode f1 = new DefaultMutableTreeNode("Abiu");
     DefaultMutableTreeNode f2 = new DefaultMutableTreeNode("Bamboo Shoots");
@@ -88,7 +88,7 @@ public class TreeDemo
     DefaultMutableTreeNode f6 = new DefaultMutableTreeNode("Guava");
     DefaultMutableTreeNode f7 = new DefaultMutableTreeNode("Jakfruit");
     DefaultMutableTreeNode f8 = new DefaultMutableTreeNode("Quaribea");
-    
+
     DefaultMutableTreeNode v1 = new DefaultMutableTreeNode("Amaranth");
     DefaultMutableTreeNode v2 = new DefaultMutableTreeNode("Kiwano");
     DefaultMutableTreeNode v3 = new DefaultMutableTreeNode("Leeks");
@@ -96,7 +96,7 @@ public class TreeDemo
     DefaultMutableTreeNode v5 = new DefaultMutableTreeNode("Chayote");
     DefaultMutableTreeNode v6 = new DefaultMutableTreeNode("Jicama");
     DefaultMutableTreeNode v7 = new DefaultMutableTreeNode("Okra");
-    
+
     DefaultMutableTreeNode l1 = new DefaultMutableTreeNode("Alcoholic");
     DefaultMutableTreeNode l11 = new DefaultMutableTreeNode("Caipirinha");
     DefaultMutableTreeNode l21 = new DefaultMutableTreeNode("Mojito");
@@ -105,7 +105,7 @@ public class TreeDemo
     DefaultMutableTreeNode l5 = new DefaultMutableTreeNode("Non Alcoholic");
     DefaultMutableTreeNode l55 = new DefaultMutableTreeNode("Babaji");
     DefaultMutableTreeNode l65 = new DefaultMutableTreeNode("Chikita");
-    
+
     root.add(fruit);
     root.add(veg);
     root.add(liq);
@@ -140,7 +140,7 @@ public class TreeDemo
     selModel.setSelectionMode(
       DefaultTreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
     tree.setSelectionModel(selModel);
-    
+
     // buttons to add and delete
     JButton add = new JButton("add element");
     add.addActionListener(new ActionListener()
@@ -155,22 +155,22 @@ public class TreeDemo
                  DefaultMutableTreeNode n = (DefaultMutableTreeNode) p.
                                                   getLastPathComponent();
                  n.add(new DefaultMutableTreeNode("New Element"));
-                 
+
                  // The expansion state of the parent node does not change
                  // by default. We will expand it manually, to ensure that the
                  // added node is immediately visible.
                  tree.expandPath(p);
-                  
+
                  // Refresh the tree (.repaint would be not enough both in
                  // Classpath and Sun implementations).
-                 DefaultTreeModel model = (DefaultTreeModel) tree.getModel();                 
+                 DefaultTreeModel model = (DefaultTreeModel) tree.getModel();
                  model.reload(n);
                  break;
               }
            }
         }
       });
-    
+
     // Demonstration of the various selection modes
     final JCheckBox cbSingle = new JCheckBox("single selection");
     cbSingle.addActionListener(new ActionListener()
@@ -185,7 +185,7 @@ public class TreeDemo
             DefaultTreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
       }
       });
-    
+
     // Demonstration of the root visibility changes
     final JCheckBox cbRoot = new JCheckBox("root");
     cbRoot.addActionListener(new ActionListener()
@@ -196,7 +196,7 @@ public class TreeDemo
       }
       });
     cbRoot.setSelected(true);
-    
+
     // Demonstration of the tree selection listener.
     final JLabel choice = new JLabel("Make a choice");
     tree.getSelectionModel().addTreeSelectionListener(
@@ -206,18 +206,18 @@ public class TreeDemo
           {
             TreePath was = event.getOldLeadSelectionPath();
             TreePath now = event.getNewLeadSelectionPath();
-            String swas = 
+            String swas =
               was == null ? "none":was.getLastPathComponent().toString();
-            String snow = 
+            String snow =
               now == null ? "none":now.getLastPathComponent().toString();
             choice.setText("From "+swas+" to "+snow);
           }
         }
       );
-    
+
     setLayout(new BorderLayout());
-    
-    JPanel p2 = new JPanel(); 
+
+    JPanel p2 = new JPanel();
     p2.add(add);
     p2.add(cbSingle);
     p2.add(cbRoot);
@@ -258,7 +258,7 @@ public class TreeDemo
     add(choice, BorderLayout.SOUTH);
   }
 
-  public void actionPerformed(ActionEvent e) 
+  public void actionPerformed(ActionEvent e)
   {
     if (e.getActionCommand().equals("CLOSE"))
     {
@@ -268,7 +268,7 @@ public class TreeDemo
 
   /**
    * When the demo is run independently, the frame is displayed, so we should
-   * initialise the content panel (including the demo content and a close 
+   * initialise the content panel (including the demo content and a close
    * button).  But when the demo is run as part of the Swing activity board,
    * only the demo content panel is used, the frame itself is never displayed,
    * so we can avoid this step.