uses jalviewfilechooser
authoramwaterhouse <Andrew Waterhouse>
Wed, 16 Mar 2005 14:53:03 +0000 (14:53 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 16 Mar 2005 14:53:03 +0000 (14:53 +0000)
src/jalview/gui/AlignFrame.java
src/jalview/gui/AlignmentPanel.java
src/jalview/gui/Desktop.java
src/jalview/gui/TreePanel.java
src/jalview/gui/UserDefinedColours.java
src/jalview/io/HTMLOutput.java

index c679559..9d7e2b7 100755 (executable)
@@ -63,12 +63,12 @@ public class AlignFrame extends GAlignFrame
 \r
   protected void saveAs_actionPerformed(ActionEvent e)\r
   {\r
-    JFileChooser chooser = new JFileChooser(jalview.bin.Cache.getProperty("LAST_DIRECTORY"));\r
+    JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache.getProperty("LAST_DIRECTORY"));\r
     chooser.setFileView(new JalviewFileView());\r
     chooser.setDialogTitle("Save Alignment to file - "+e.getActionCommand() +" format.");\r
     chooser.setToolTipText("Save");\r
     int value = chooser.showSaveDialog(this);\r
-    if(value == JFileChooser.APPROVE_OPTION)\r
+    if(value == JalviewFileChooser.APPROVE_OPTION)\r
     {\r
       String choice =  chooser.getSelectedFile().getPath();\r
       jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice);\r
index 296bb80..da68ab9 100755 (executable)
@@ -383,7 +383,7 @@ public class AlignmentPanel extends GAlignmentPanel implements AdjustmentListene
     Color currentTextColor=null;\r
     for(int i=startSeq; i<endSeq; i++)\r
     {\r
-      if (av.alignment.findGroup(av.getAlignment().getSequenceAt(i))==null)\r
+      if (av.getSelectionGroup()!=null && av.getSelectionGroup().sequences.contains(av.getAlignment().getSequenceAt(i)))\r
       {\r
         currentColor = Color.gray;\r
         currentTextColor = Color.black;\r
@@ -488,14 +488,14 @@ public class AlignmentPanel extends GAlignmentPanel implements AdjustmentListene
       catch (Exception ex)\r
       {}\r
 \r
-      javax.swing.JFileChooser chooser = new javax.swing.JFileChooser(jalview.bin.Cache.getProperty(\r
+      jalview.io.JalviewFileChooser chooser = new jalview.io.JalviewFileChooser(jalview.bin.Cache.getProperty(\r
           "LAST_DIRECTORY"));\r
       chooser.setFileView(new jalview.io.JalviewFileView());\r
       chooser.setDialogTitle("Create JPG image from alignment");\r
       chooser.setToolTipText("Save");\r
 \r
       int value = chooser.showSaveDialog(this);\r
-      if (value == javax.swing.JFileChooser.APPROVE_OPTION)\r
+      if (value == jalview.io.JalviewFileChooser.APPROVE_OPTION)\r
       {\r
 \r
         FileOutputStream out = new FileOutputStream(chooser.getSelectedFile());\r
index bfbdc1d..eaa2c5e 100755 (executable)
@@ -96,8 +96,8 @@ public void windowClosing(WindowEvent evt)
     catch (java.beans.PropertyVetoException e)\r
     {}\r
     frame.setResizable(true);\r
-    frame.setSize(845, 200);\r
-    frame.setLocation( (int)((getWidth()-845) /2), (int)((getHeight()-240) /2));\r
+    frame.setSize(750, 160);\r
+    frame.setLocation( (int)((getWidth()-750) /2), (int)((getHeight()-160) /2));\r
     frame.setClosable(false);\r
     frame.setIconifiable(false);\r
     frame.setMaximizable(false);\r
@@ -146,12 +146,12 @@ public void windowClosing(WindowEvent evt)
 \r
  public void inputLocalFileMenuItem_actionPerformed(ActionEvent e)\r
  {\r
-   JFileChooser chooser = new JFileChooser(jalview.bin.Cache.getProperty("LAST_DIRECTORY"));\r
+   JalviewFileChooser chooser = new JalviewFileChooser();\r
    chooser.setFileView(new JalviewFileView());\r
    chooser.setDialogTitle("Open local file");\r
    chooser.setToolTipText("Open");\r
    int value = chooser.showOpenDialog(this);\r
-   if(value == JFileChooser.APPROVE_OPTION)\r
+   if(value == JalviewFileChooser.APPROVE_OPTION)\r
    {\r
      String choice =  chooser.getSelectedFile().getPath();\r
      jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice);\r
index f723fdc..58c668f 100755 (executable)
@@ -234,11 +234,11 @@ public void propertiesInit() {
   {\r
 \r
     try{\r
-      JFileChooser chooser = new JFileChooser(jalview.bin.Cache.getProperty("LAST_DIRECTORY"));\r
+      JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache.getProperty("LAST_DIRECTORY"));\r
       chooser.setDialogTitle("Save Tree as postscript file");\r
       chooser.setToolTipText("Save");\r
       int value = chooser.showSaveDialog(this);\r
-      if (value == JFileChooser.APPROVE_OPTION)\r
+      if (value == JalviewFileChooser.APPROVE_OPTION)\r
       {\r
         String choice = chooser.getSelectedFile().getPath();\r
         jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice);\r
index a96cf52..6fed854 100755 (executable)
@@ -2,6 +2,7 @@ package jalview.gui;
 \r
 import jalview.jbgui.GUserDefinedColours;\r
 import jalview.datamodel.*;\r
+import jalview.io.*;\r
 import javax.swing.*;\r
 import java.awt.*;\r
 import java.awt.event.*;\r
@@ -123,12 +124,12 @@ public class UserDefinedColours extends GUserDefinedColours implements ChangeLis
 \r
   protected void loadbutton_actionPerformed(ActionEvent e)\r
   {\r
-    JFileChooser chooser = new JFileChooser(jalview.bin.Cache.getProperty("LAST_DIRECTORY"));\r
+    JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache.getProperty("LAST_DIRECTORY"));\r
     chooser.setFileView(new jalview.io.JalviewFileView());\r
     chooser.setDialogTitle("Load colour scheme");\r
     chooser.setToolTipText("Load");\r
     int value = chooser.showOpenDialog(this);\r
-    if (value == JFileChooser.APPROVE_OPTION)\r
+    if (value == JalviewFileChooser.APPROVE_OPTION)\r
     {\r
       String choice = chooser.getSelectedFile().getPath();\r
       jalview.bin.Cache.setProperty("LAST_DIRECTORY",  choice);\r
@@ -156,12 +157,12 @@ public class UserDefinedColours extends GUserDefinedColours implements ChangeLis
 \r
   protected void savebutton_actionPerformed(ActionEvent e)\r
   {\r
-    JFileChooser chooser = new JFileChooser(jalview.bin.Cache.getProperty("LAST_DIRECTORY"));\r
+    JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache.getProperty("LAST_DIRECTORY"));\r
     chooser.setFileView(new jalview.io.JalviewFileView());\r
     chooser.setDialogTitle("Save colour scheme");\r
     chooser.setToolTipText("Save");\r
     int value = chooser.showSaveDialog(this);\r
-    if (value == JFileChooser.APPROVE_OPTION)\r
+    if (value == JalviewFileChooser.APPROVE_OPTION)\r
     {\r
       String choice = chooser.getSelectedFile().getPath();\r
       jalview.bin.Cache.setProperty("USER_DEFINED_COLOUR", choice);\r
index 82b75a1..af894e0 100755 (executable)
@@ -19,12 +19,12 @@ public class HTMLOutput
   {\r
     this.av = av;\r
     sr = new SequenceRenderer(av);\r
-    JFileChooser chooser = new JFileChooser(jalview.bin.Cache.getProperty("LAST_DIRECTORY"));\r
+    JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache.getProperty("LAST_DIRECTORY"));\r
     chooser.setFileView(new JalviewFileView());\r
     chooser.setDialogTitle("Save as HTML");\r
     chooser.setToolTipText("Save");\r
     int value = chooser.showSaveDialog(null);\r
-    if(value == JFileChooser.APPROVE_OPTION)\r
+    if(value == JalviewFileChooser.APPROVE_OPTION)\r
     {\r
       String choice =  chooser.getSelectedFile().getPath();\r
       jalview.bin.Cache.setProperty("LAST_DIRECTORY",  choice);\r