X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fjbgui%2FGPreferences.java;h=69c0f4d77a7b9dd9ef12f1edb4c8cb1d32715331;hb=1aa7a7bfe46e16a5125192933b8ba6ae4bc6c9bf;hp=7b2e5c441c02e60909a245b346222c5c5d96fc88;hpb=e3d37653250ad19df4c310f1fd6a50510467a764;p=jalview.git
diff --git a/src/jalview/jbgui/GPreferences.java b/src/jalview/jbgui/GPreferences.java
index 7b2e5c4..69c0f4d 100755
--- a/src/jalview/jbgui/GPreferences.java
+++ b/src/jalview/jbgui/GPreferences.java
@@ -1,150 +1,304 @@
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
- * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * This file is part of Jalview.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ * along with Jalview. If not, see .
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
*/
package jalview.jbgui;
-import java.awt.*;
-import java.awt.event.*;
-
-import javax.swing.*;
-import javax.swing.border.*;
-import javax.swing.event.*;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.GridLayout;
+import java.awt.Insets;
import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.FocusEvent;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.AbstractCellEditor;
+import javax.swing.BorderFactory;
+import javax.swing.BoxLayout;
+import javax.swing.ButtonGroup;
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
+import javax.swing.JFileChooser;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JPasswordField;
+import javax.swing.JRadioButton;
+import javax.swing.JScrollPane;
+import javax.swing.JSlider;
+import javax.swing.JSpinner;
+import javax.swing.JTabbedPane;
+import javax.swing.JTable;
+import javax.swing.JTextArea;
+import javax.swing.JTextField;
+import javax.swing.ListSelectionModel;
+import javax.swing.SpinnerModel;
+import javax.swing.SpinnerNumberModel;
+import javax.swing.SwingConstants;
+import javax.swing.border.Border;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.EtchedBorder;
+import javax.swing.border.TitledBorder;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
+import javax.swing.table.TableCellEditor;
+import javax.swing.table.TableCellRenderer;
+
+import jalview.bin.Cache;
+import jalview.bin.Console;
+import jalview.bin.MemorySetting;
+import jalview.fts.core.FTSDataColumnPreferences;
+import jalview.fts.core.FTSDataColumnPreferences.PreferenceSource;
+import jalview.fts.service.pdb.PDBFTSRestClient;
+import jalview.gui.Desktop;
+import jalview.gui.JalviewBooleanRadioButtons;
+import jalview.gui.JvOptionPane;
+import jalview.gui.JvSwingUtils;
+import jalview.gui.StructureViewer.ViewerType;
+import jalview.io.BackupFilenameParts;
+import jalview.io.BackupFiles;
+import jalview.io.BackupFilesPresetEntry;
+import jalview.io.IntKeyStringValueEntry;
+import jalview.util.MessageManager;
+import jalview.util.Platform;
+import jalview.util.StringUtils;
/**
- * DOCUMENT ME!
+ * Base class for the Preferences panel.
*
* @author $author$
* @version $Revision$
*/
public class GPreferences extends JPanel
{
- JTabbedPane tabbedPane = new JTabbedPane();
+ private static final Font LABEL_FONT = JvSwingUtils.getLabelFont();
- JButton ok = new JButton();
+ private static final Font LABEL_FONT_ITALIC = JvSwingUtils
+ .getLabelFont(false, true);
- JButton cancel = new JButton();
+ private static final Font LABEL_FONT_BOLD = JvSwingUtils
+ .getLabelFont(true, false);
- JPanel okCancelPanel = new JPanel();
+ /*
+ * Visual tab components
+ */
+ protected JCheckBox fullScreen = new JCheckBox();
- BorderLayout borderLayout1 = new BorderLayout();
+ protected JCheckBox openoverv = new JCheckBox();
- protected JCheckBox quality = new JCheckBox();
+ protected JCheckBox seqLimit = new JCheckBox();
- JPanel visualTab = new JPanel();
+ protected JCheckBox rightAlign = new JCheckBox();
- protected JCheckBox fullScreen = new JCheckBox();
+ protected JComboBox fontSizeCB = new JComboBox<>();
- protected JCheckBox conservation = new JCheckBox();
+ protected JComboBox fontStyleCB = new JComboBox<>();
- protected JCheckBox identity = new JCheckBox();
+ protected JComboBox fontNameCB = new JComboBox<>();
- protected JCheckBox annotations = new JCheckBox();
+ protected JCheckBox showOccupancy = new JCheckBox();
+
+ protected JCheckBox showUnconserved = new JCheckBox();
- JLabel gapLabel = new JLabel();
+ protected JCheckBox idItalics = new JCheckBox();
- protected JComboBox colour = new JComboBox();
+ protected JCheckBox smoothFont = new JCheckBox();
- JLabel colourLabel = new JLabel();
+ protected JCheckBox scaleProteinToCdna = new JCheckBox();
- JLabel fontLabel = new JLabel();
+ protected JComboBox gapSymbolCB = new JComboBox<>();
- protected JComboBox fontSizeCB = new JComboBox();
+ protected JCheckBox wrap = new JCheckBox();
- protected JComboBox fontStyleCB = new JComboBox();
+ protected JComboBox sortby = new JComboBox<>();
- protected JComboBox fontNameCB = new JComboBox();
+ protected JComboBox sortAnnBy = new JComboBox<>();
- protected JComboBox gapSymbolCB = new JComboBox();
+ protected JComboBox sortAutocalc = new JComboBox<>();
protected JCheckBox startupCheckbox = new JCheckBox();
protected JTextField startupFileTextfield = new JTextField();
- JPanel connectTab = new JPanel();
+ // below are in the 'second column'
+ protected JCheckBox annotations = new JCheckBox();
+
+ protected JCheckBox quality = new JCheckBox();
+
+ protected JCheckBox conservation = new JCheckBox();
+
+ protected JCheckBox identity = new JCheckBox();
+
+ protected JCheckBox showGroupConsensus = new JCheckBox();
+
+ protected JCheckBox showGroupConservation = new JCheckBox();
+
+ protected JCheckBox showConsensHistogram = new JCheckBox();
+
+ protected JCheckBox showConsensLogo = new JCheckBox();
+
+ protected JCheckBox showDbRefTooltip = new JCheckBox();
+
+ protected JCheckBox showNpTooltip = new JCheckBox();
+
+ /*
+ * Structure tab and components
+ */
+ protected JPanel structureTab;
+
+ protected JCheckBox structFromPdb = new JCheckBox();
+
+ protected JCheckBox addSecondaryStructure = new JCheckBox();
+
+ protected JCheckBox addTempFactor = new JCheckBox();
+
+ protected JComboBox structViewer = new JComboBox<>();
+
+ protected JLabel structureViewerPathLabel;
+
+ protected JTextField structureViewerPath = new JTextField();
+
+ protected ButtonGroup mappingMethod = new ButtonGroup();
+
+ protected JRadioButton siftsMapping = new JRadioButton();
+
+ protected JRadioButton nwMapping = new JRadioButton();
+
+ /*
+ * Colours tab components
+ */
+ protected JPanel minColour = new JPanel();
+
+ protected JPanel maxColour = new JPanel();
+
+ protected JComboBox protColour = new JComboBox<>();
+
+ protected JComboBox nucColour = new JComboBox<>();
+
+ /*
+ * Overview tab components
+ */
+ protected JPanel gapColour = new JPanel();
+
+ protected JPanel hiddenColour = new JPanel();
+
+ protected JCheckBox useLegacyGap;
+
+ protected JCheckBox showHiddenAtStart;
+
+ protected JLabel gapLabel;
+
+ /*
+ * Connections tab components
+ */
+ protected JPanel connectTab;
+
+ protected JTable linkUrlTable = new JTable();
- JLabel serverLabel = new JLabel();
+ protected JButton editLink = new JButton();
- protected JList linkURLList = new JList();
+ protected JButton deleteLink = new JButton();
- protected JTextField proxyServerTB = new JTextField();
+ protected JTextField filterTB = new JTextField();
- protected JTextField proxyPortTB = new JTextField();
+ protected JButton doReset = new JButton();
- JLabel portLabel = new JLabel();
+ protected JButton userOnly = new JButton();
- JLabel browserLabel = new JLabel();
+ protected JLabel httpLabel = new JLabel();
- protected JTextField defaultBrowser = new JTextField();
+ protected JLabel httpsLabel = new JLabel();
- JButton newLink = new JButton();
+ protected JLabel portLabel = new JLabel();
- JButton editLink = new JButton();
+ protected JLabel serverLabel = new JLabel();
- JButton deleteLink = new JButton();
+ protected JLabel portLabel2 = new JLabel();
- JScrollPane linkScrollPane = new JScrollPane();
+ protected JLabel serverLabel2 = new JLabel();
- JPanel linkPanel = new JPanel();
+ protected JLabel proxyAuthUsernameLabel = new JLabel();
- BorderLayout borderLayout2 = new BorderLayout();
+ protected JLabel proxyAuthPasswordLabel = new JLabel();
- JPanel editLinkButtons = new JPanel();
+ protected JLabel passwordNotStoredLabel = new JLabel();
- GridLayout gridLayout1 = new GridLayout();
+ protected JTextField proxyServerHttpTB = new JTextField();
- protected JList linkNameList = new JList();
+ protected JTextField proxyPortHttpTB = new JTextField();
- JPanel linkPanel2 = new JPanel();
+ protected JTextField proxyServerHttpsTB = new JTextField();
- BorderLayout borderLayout3 = new BorderLayout();
+ protected JTextField proxyPortHttpsTB = new JTextField();
- protected JCheckBox useProxy = new JCheckBox();
+ protected JCheckBox proxyAuth = new JCheckBox();
- JPanel jPanel1 = new JPanel();
+ protected JTextField proxyAuthUsernameTB = new JTextField();
- TitledBorder titledBorder1 = new TitledBorder("Proxy Server");
+ protected JPasswordField proxyAuthPasswordPB = new JPasswordField();
- TitledBorder titledBorder2 = new TitledBorder("File Output");
+ protected ButtonGroup proxyType = new ButtonGroup();
- GridBagLayout gridBagLayout2 = new GridBagLayout();
+ protected JRadioButton noProxy = new JRadioButton();
- GridBagLayout gridBagLayout1 = new GridBagLayout();
+ protected JRadioButton systemProxy = new JRadioButton();
- GridBagLayout gridBagLayout3 = new GridBagLayout();
+ protected JRadioButton customProxy = new JRadioButton();
- protected JComboBox sortby = new JComboBox();
+ protected JButton applyProxyButton = new JButton();
- JLabel sortLabel = new JLabel();
+ protected JCheckBox usagestats = new JCheckBox();
- JPanel jPanel2 = new JPanel();
+ protected JCheckBox questionnaire = new JCheckBox();
+
+ protected JCheckBox versioncheck = new JCheckBox();
- GridLayout gridLayout2 = new GridLayout();
+ /*
+ * Output tab components
+ */
+ protected JComboBox