From 6f3fc393f90ea0460caeca7e229e505741c51bd4 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Mon, 7 Feb 2005 17:09:19 +0000 Subject: [PATCH] Use Cache.getProperty --- src/jalview/gui/AlignFrame.java | 9 ++++----- src/jalview/gui/Desktop.java | 4 ++-- src/jalview/gui/TreePanel.java | 4 ++-- src/jalview/gui/UserDefinedColours.java | 8 ++++---- src/jalview/io/HTMLOutput.java | 4 ++-- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 1f6fabd..3211b03 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -32,26 +32,25 @@ public class AlignFrame extends GAlignFrame public AlignFrame(AlignmentI al) { super(); - - AlignmentUtil.addUniprotFeatures(al); - viewport = new AlignViewport(al,true,true,true,false); alignPanel = new AlignmentPanel(this, viewport); getContentPane().add(alignPanel, java.awt.BorderLayout.CENTER); fontNameMenuItem.setText(viewport.getFont().getName()); fontSizeMenuItem.setText(viewport.getFont().getSize()+""); + + AlignmentUtil.fetchSequenceFeatures(al, alignPanel); } protected void saveAs_actionPerformed(ActionEvent e) { - JFileChooser chooser = new JFileChooser(jalview.bin.Cache.LAST_DIRECTORY); + JFileChooser chooser = new JFileChooser(jalview.bin.Cache.getProperty("LAST_DIRECTORY")); chooser.setDialogTitle("Save Alignment to file - "+e.getActionCommand() +" format."); chooser.setToolTipText("Save"); int value = chooser.showSaveDialog(this); if(value == JFileChooser.APPROVE_OPTION) { String choice = chooser.getSelectedFile().getPath(); - jalview.bin.Cache.LAST_DIRECTORY = choice; + jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice); String output = FormatAdapter.get(e.getActionCommand(), viewport.getAlignment().getSequences()); try{ java.io.PrintWriter out = new java.io.PrintWriter( new java.io.FileWriter( choice ) ); diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index 2c475fa..b47ca4b 100755 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -125,14 +125,14 @@ public class Desktop extends jalview.jbgui.GDesktop public void inputLocalFileMenuItem_actionPerformed(ActionEvent e) { - JFileChooser chooser = new JFileChooser(jalview.bin.Cache.LAST_DIRECTORY); + JFileChooser chooser = new JFileChooser(jalview.bin.Cache.getProperty("LAST_DIRECTORY")); chooser.setDialogTitle("Open local file"); chooser.setToolTipText("Open"); int value = chooser.showOpenDialog(this); if(value == JFileChooser.APPROVE_OPTION) { String choice = chooser.getSelectedFile().getPath(); - jalview.bin.Cache.LAST_DIRECTORY = choice; + jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice); String format = IdentifyFile.Identify(choice, "File"); LoadFile(choice, "File", format); } diff --git a/src/jalview/gui/TreePanel.java b/src/jalview/gui/TreePanel.java index 9e9e70b..936eebe 100755 --- a/src/jalview/gui/TreePanel.java +++ b/src/jalview/gui/TreePanel.java @@ -231,14 +231,14 @@ public void propertiesInit() { { try{ - JFileChooser chooser = new JFileChooser(jalview.bin.Cache.LAST_DIRECTORY); + JFileChooser chooser = new JFileChooser(jalview.bin.Cache.getProperty("LAST_DIRECTORY")); chooser.setDialogTitle("Save Tree as postscript file"); chooser.setToolTipText("Save"); int value = chooser.showSaveDialog(this); if (value == JFileChooser.APPROVE_OPTION) { String choice = chooser.getSelectedFile().getPath(); - jalview.bin.Cache.LAST_DIRECTORY = choice; + jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice); bw = new PrintWriter(new FileWriter(choice)); getPostscript(bw); diff --git a/src/jalview/gui/UserDefinedColours.java b/src/jalview/gui/UserDefinedColours.java index fd9f1bc..1a3fa86 100755 --- a/src/jalview/gui/UserDefinedColours.java +++ b/src/jalview/gui/UserDefinedColours.java @@ -111,14 +111,14 @@ public class UserDefinedColours extends GUserDefinedColours implements ChangeLis protected void loadbutton_actionPerformed(ActionEvent e) { - JFileChooser chooser = new JFileChooser(jalview.bin.Cache.LAST_DIRECTORY); + JFileChooser chooser = new JFileChooser(jalview.bin.Cache.getProperty("LAST_DIRECTORY")); chooser.setDialogTitle("Load colour scheme"); chooser.setToolTipText("Load"); int value = chooser.showOpenDialog(this); if (value == JFileChooser.APPROVE_OPTION) { String choice = chooser.getSelectedFile().getPath(); - jalview.bin.Cache.LAST_DIRECTORY = choice; + jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice); try{ BufferedReader in = new BufferedReader(new FileReader(choice)); @@ -138,14 +138,14 @@ public class UserDefinedColours extends GUserDefinedColours implements ChangeLis protected void savebutton_actionPerformed(ActionEvent e) { - JFileChooser chooser = new JFileChooser(jalview.bin.Cache.LAST_DIRECTORY); + JFileChooser chooser = new JFileChooser(jalview.bin.Cache.getProperty("LAST_DIRECTORY")); chooser.setDialogTitle("Save colour scheme"); chooser.setToolTipText("Save"); int value = chooser.showSaveDialog(this); if (value == JFileChooser.APPROVE_OPTION) { String choice = chooser.getSelectedFile().getPath(); - jalview.bin.Cache.LAST_DIRECTORY = choice; + jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice); try{ PrintWriter out = new PrintWriter(new FileWriter(choice)); diff --git a/src/jalview/io/HTMLOutput.java b/src/jalview/io/HTMLOutput.java index b70ba68..d48c068 100755 --- a/src/jalview/io/HTMLOutput.java +++ b/src/jalview/io/HTMLOutput.java @@ -19,14 +19,14 @@ public class HTMLOutput { this.av = av; sr = new SequenceRenderer(av); - JFileChooser chooser = new JFileChooser(jalview.bin.Cache.LAST_DIRECTORY); + JFileChooser chooser = new JFileChooser(jalview.bin.Cache.getProperty("LAST_DIRECTORY")); chooser.setDialogTitle("Save as HTML"); chooser.setToolTipText("Save"); int value = chooser.showSaveDialog(null); if(value == JFileChooser.APPROVE_OPTION) { String choice = chooser.getSelectedFile().getPath(); - jalview.bin.Cache.LAST_DIRECTORY = choice; + jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice); try{ PrintWriter out = new java.io.PrintWriter(new java.io.FileWriter(choice)); out.println(""); -- 1.7.10.2