\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
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
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
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
\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
{\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
\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
\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
\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
{\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