JalviewFileChooser back to original; synth. ref fixed in j2sClazz.js
authorhansonr <hansonr@STO24954W.ad.stolaf.edu>
Thu, 20 Dec 2018 12:10:52 +0000 (06:10 -0600)
committerhansonr <hansonr@STO24954W.ad.stolaf.edu>
Thu, 20 Dec 2018 12:10:52 +0000 (06:10 -0600)
src/jalview/io/JalviewFileChooser.java
swingjs/SwingJS-site.zip
swingjs/timestamp
swingjs/ver/3.2.4/SwingJS-site.zip
swingjs/ver/3.2.4/timestamp

index 9667d7f..c275ef0 100755 (executable)
@@ -126,7 +126,7 @@ public class JalviewFileChooser extends JFileChooser implements DialogRunnerI,
   public JalviewFileChooser(String dir)
   {
     super(safePath(dir));
-    setAccessory(new RecentlyOpened(this));
+    setAccessory(new RecentlyOpened());
   }
 
   public JalviewFileChooser(String dir, String[] suffix, String[] desc,
@@ -238,7 +238,7 @@ public class JalviewFileChooser extends JFileChooser implements DialogRunnerI,
       setFileFilter(chosen);
     }
 
-    setAccessory(new RecentlyOpened(this));
+    setAccessory(new RecentlyOpened());
   }
 
   @Override
@@ -423,6 +423,78 @@ public class JalviewFileChooser extends JFileChooser implements DialogRunnerI,
     }
   }
 
+  class RecentlyOpened extends JPanel
+  {
+    private static final long serialVersionUID = 1L;
+    JList<String> list;
+
+    RecentlyOpened()
+    {
+      setPreferredSize(new Dimension(300,100));
+      String historyItems = Cache.getProperty("RECENT_FILE");
+      StringTokenizer st;
+      Vector<String> recent = new Vector<>();
+
+      if (historyItems != null)
+      {
+        st = new StringTokenizer(historyItems, "\t");
+
+        while (st.hasMoreTokens())
+        {
+          recent.addElement(st.nextToken());
+        }
+      }
+
+      list = new JList<>(recent);
+  
+      DefaultListCellRenderer dlcr = new DefaultListCellRenderer();
+//      dlcr.setHorizontalAlignment(DefaultListCellRenderer.RIGHT);
+      list.setCellRenderer(dlcr);
+
+      list.addMouseListener(new MouseAdapter()
+      {
+        @Override
+        public void mousePressed(MouseEvent evt)
+        {
+          recentListSelectionChanged(list.getSelectedValue());
+        }
+      });
+
+      this.setBorder(new javax.swing.border.TitledBorder(
+              MessageManager.getString("label.recently_opened")));
+
+      final JScrollPane scroller = new JScrollPane(list);
+
+      SpringLayout layout = new SpringLayout();
+      layout.putConstraint(SpringLayout.WEST, scroller, 5,
+              SpringLayout.WEST, this);
+      layout.putConstraint(SpringLayout.NORTH, scroller, 5,
+              SpringLayout.NORTH, this);
+
+      if (Platform.isAMac())
+      {
+        scroller.setPreferredSize(new Dimension(500, 100));
+      }
+      else
+      {
+        scroller.setPreferredSize(new Dimension(530, 200));
+      }
+
+      this.add(scroller);
+
+      javax.swing.SwingUtilities.invokeLater(new Runnable()
+      {
+        @Override
+        public void run()
+        {
+          scroller.getHorizontalScrollBar()
+                  .setValue(scroller.getHorizontalScrollBar().getMaximum());
+        }
+      });
+
+    }
+
+  }
 
   @Override
   public DialogRunnerI setResponseHandler(Object response, Runnable action)
@@ -470,78 +542,3 @@ public class JalviewFileChooser extends JFileChooser implements DialogRunnerI,
     }
   }
 }
-
-class RecentlyOpened extends JPanel
-{
-  private static final long serialVersionUID = 1L;
-  JList<String> list;
-  private JalviewFileChooser chooser;
-
-  RecentlyOpened(JalviewFileChooser chooser) 
-  {
-       this.chooser = chooser;
-    setPreferredSize(new Dimension(300,100));
-    String historyItems = Cache.getProperty("RECENT_FILE");
-    StringTokenizer st;
-    Vector<String> recent = new Vector<>();
-
-    if (historyItems != null)
-    {
-      st = new StringTokenizer(historyItems, "\t");
-
-      while (st.hasMoreTokens())
-      {
-        recent.addElement(st.nextToken());
-      }
-    }
-
-    list = new JList<>(recent);
-
-    DefaultListCellRenderer dlcr = new DefaultListCellRenderer();
-//    dlcr.setHorizontalAlignment(DefaultListCellRenderer.RIGHT);
-    list.setCellRenderer(dlcr);
-
-    list.addMouseListener(new MouseAdapter()
-    {
-      @Override
-      public void mousePressed(MouseEvent evt)
-      {
-        chooser.recentListSelectionChanged(list.getSelectedValue());
-      }
-    });
-
-    this.setBorder(new javax.swing.border.TitledBorder(
-            MessageManager.getString("label.recently_opened")));
-
-    final JScrollPane scroller = new JScrollPane(list);
-
-    SpringLayout layout = new SpringLayout();
-    layout.putConstraint(SpringLayout.WEST, scroller, 5,
-            SpringLayout.WEST, this);
-    layout.putConstraint(SpringLayout.NORTH, scroller, 5,
-            SpringLayout.NORTH, this);
-
-    if (Platform.isAMac())
-    {
-      scroller.setPreferredSize(new Dimension(500, 100));
-    }
-    else
-    {
-      scroller.setPreferredSize(new Dimension(530, 200));
-    }
-
-    this.add(scroller);
-
-    javax.swing.SwingUtilities.invokeLater(new Runnable()
-    {
-      @Override
-      public void run()
-      {
-        scroller.getHorizontalScrollBar()
-                .setValue(scroller.getHorizontalScrollBar().getMaximum());
-      }
-    });
-
-  }
-
-}
index 18c3244..cda8f81 100644 (file)
Binary files a/swingjs/SwingJS-site.zip and b/swingjs/SwingJS-site.zip differ
index e84618b..2635141 100644 (file)
@@ -1 +1 @@
-20181220041423 
+20181220060627 
index 18c3244..cda8f81 100644 (file)
Binary files a/swingjs/ver/3.2.4/SwingJS-site.zip and b/swingjs/ver/3.2.4/SwingJS-site.zip differ
index e84618b..2635141 100644 (file)
@@ -1 +1 @@
-20181220041423 
+20181220060627