X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FPreferences.java;h=4c5e83fff7089666db814561a2e7417c79265945;hb=8edebdd9789b2d93fb8f9db24b8be2c1e6317690;hp=bdc83e58f589a12b5c6cf083c368100a8e10d7a3;hpb=e8479b912a9f5caf2e86d2dee10f153955522e33;p=jalview.git diff --git a/src/jalview/gui/Preferences.java b/src/jalview/gui/Preferences.java index bdc83e5..4c5e83f 100755 --- a/src/jalview/gui/Preferences.java +++ b/src/jalview/gui/Preferences.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2) - * Copyright (C) 2014 The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors * * This file is part of Jalview. * @@ -23,13 +23,16 @@ package jalview.gui; import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder; import jalview.bin.Cache; import jalview.gui.Help.HelpId; -import jalview.gui.StructureViewer.Viewer; +import jalview.gui.StructureViewer.ViewerType; import jalview.io.JalviewFileChooser; import jalview.io.JalviewFileView; +import jalview.io.PIRFile; import jalview.jbgui.GPreferences; import jalview.jbgui.GSequenceLink; import jalview.schemes.ColourSchemeProperty; +import jalview.util.BrowserLauncher; import jalview.util.MessageManager; +import jalview.util.Platform; import java.awt.BorderLayout; import java.awt.Color; @@ -61,6 +64,15 @@ import ext.edu.ucsf.rbvi.strucviz2.StructureManager; */ public class Preferences extends GPreferences { + public static final String ENABLE_SPLIT_FRAME = "ENABLE_SPLIT_FRAME"; + + public static final String SCALE_PROTEIN_TO_CDNA = "SCALE_PROTEIN_TO_CDNA"; + + public static final String DEFAULT_COLOUR = "DEFAULT_COLOUR"; + + public static final String DEFAULT_COLOUR_PROT = "DEFAULT_COLOUR_PROT"; + + public static final String DEFAULT_COLOUR_NUC = "DEFAULT_COLOUR_NUC"; public static final String ADD_TEMPFACT_ANN = "ADD_TEMPFACT_ANN"; @@ -165,11 +177,11 @@ public class Preferences extends GPreferences dasTab.add(dasSource, BorderLayout.CENTER); wsPrefs = new WsPreferences(); wsTab.add(wsPrefs, BorderLayout.CENTER); - int width = 500, height = 420; - if (new jalview.util.Platform().isAMac()) + int width = 500, height = 450; + if (Platform.isAMac()) { width = 570; - height = 460; + height = 480; } Desktop.addInternalFrame(frame, @@ -225,6 +237,8 @@ public class Preferences extends GPreferences + "")); smoothFont.setSelected(Cache.getDefault("ANTI_ALIAS", false)); + scaleProteinToCdna.setSelected(Cache.getDefault(SCALE_PROTEIN_TO_CDNA, + false)); idItalics.setSelected(Cache.getDefault("ID_ITALICS", true)); @@ -267,10 +281,14 @@ public class Preferences extends GPreferences */ for (int i = ColourSchemeProperty.FIRST_COLOUR; i <= ColourSchemeProperty.LAST_COLOUR; i++) { - colour.addItem(ColourSchemeProperty.getColourName(i)); + protColour.addItem(ColourSchemeProperty.getColourName(i)); + nucColour.addItem(ColourSchemeProperty.getColourName(i)); } - String string = Cache.getDefault("DEFAULT_COLOUR", "None"); - colour.setSelectedItem(string); + String oldProp = Cache.getDefault(DEFAULT_COLOUR, "None"); + String newProp = Cache.getDefault(DEFAULT_COLOUR_PROT, null); + protColour.setSelectedItem(newProp != null ? newProp : oldProp); + newProp = Cache.getDefault(DEFAULT_COLOUR_NUC, null); + nucColour.setSelectedItem(newProp != null ? newProp : oldProp); minColour.setBackground(Cache.getDefaultColour("ANNOTATIONCOLOUR_MIN", Color.orange)); maxColour.setBackground(Cache.getDefaultColour("ANNOTATIONCOLOUR_MAX", @@ -289,7 +307,7 @@ public class Preferences extends GPreferences addTempFactor.setSelected(Cache.getDefault(ADD_TEMPFACT_ANN, false)); addTempFactor.setEnabled(structSelected); structViewer.setSelectedItem(Cache.getDefault(STRUCTURE_DISPLAY, - Viewer.JMOL.name())); + ViewerType.JMOL.name())); chimeraPath.setText(Cache.getDefault(CHIMERA_PATH, "")); chimeraPath.addActionListener(new ActionListener() { @@ -420,6 +438,8 @@ public class Preferences extends GPreferences Boolean.toString(showConsensLogo.isSelected())); Cache.applicationProperties.setProperty("ANTI_ALIAS", Boolean.toString(smoothFont.isSelected())); + Cache.applicationProperties.setProperty(SCALE_PROTEIN_TO_CDNA, + Boolean.toString(scaleProteinToCdna.isSelected())); Cache.applicationProperties.setProperty("SHOW_NPFEATS_TOOLTIP", Boolean.toString(showNpTooltip.isSelected())); Cache.applicationProperties.setProperty("SHOW_DBREFS_TOOLTIP", @@ -452,7 +472,9 @@ public class Preferences extends GPreferences /* * Save Colours settings */ - Cache.applicationProperties.setProperty("DEFAULT_COLOUR", colour + Cache.applicationProperties.setProperty(DEFAULT_COLOUR_PROT, protColour + .getSelectedItem().toString()); + Cache.applicationProperties.setProperty(DEFAULT_COLOUR_NUC, nucColour .getSelectedItem().toString()); Cache.setColourProperty("ANNOTATIONCOLOUR_MIN", minColour.getBackground()); @@ -492,7 +514,7 @@ public class Preferences extends GPreferences */ Cache.setOrRemove("DEFAULT_BROWSER", defaultBrowser.getText()); - jalview.util.BrowserLauncher.resetBrowser(); + BrowserLauncher.resetBrowser(); if (nameLinks.size() > 0) { @@ -570,7 +592,7 @@ public class Preferences extends GPreferences Boolean.toString(pirjv.isSelected())); Cache.applicationProperties.setProperty("PIR_MODELLER", Boolean.toString(modellerOutput.isSelected())); - jalview.io.PIRFile.useModellerOutput = modellerOutput.isSelected(); + PIRFile.useModellerOutput = modellerOutput.isSelected(); Cache.applicationProperties.setProperty("FIGURE_AUTOIDWIDTH", Boolean.toString(autoIdWidth.isSelected())); @@ -628,12 +650,12 @@ public class Preferences extends GPreferences public void startupFileTextfield_mouseClicked() { JalviewFileChooser chooser = new JalviewFileChooser( - jalview.bin.Cache.getProperty("LAST_DIRECTORY"), + Cache.getProperty("LAST_DIRECTORY"), new String[] { "fa, fasta, fastq", "aln", "pfam", "msf", "pir", "blc", "jar" }, new String[] { "Fasta", "Clustal", "PFAM", "MSF", "PIR", "BLC", "Jalview" }, - jalview.bin.Cache.getProperty("DEFAULT_FILE_FORMAT")); + Cache.getProperty("DEFAULT_FILE_FORMAT")); chooser.setFileView(new JalviewFileView()); chooser.setDialogTitle(MessageManager.getString("label.select_startup_file")); @@ -641,7 +663,7 @@ public class Preferences extends GPreferences if (value == JalviewFileChooser.APPROVE_OPTION) { - jalview.bin.Cache.applicationProperties.setProperty( + Cache.applicationProperties.setProperty( "DEFAULT_FILE_FORMAT", chooser.getSelectedFormat()); startupFileTextfield.setText(chooser.getSelectedFile() .getAbsolutePath()); @@ -892,7 +914,7 @@ public class Preferences extends GPreferences @Override protected void structureViewer_actionPerformed(String selectedItem) { - if (!selectedItem.equals(Viewer.CHIMERA.name())) + if (!selectedItem.equals(ViewerType.CHIMERA.name())) { return; }