X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fjbgui%2FGPreferences.java;h=1ca0802af1c1a2a8ef715df1ff8bd106cdcff761;hb=00bdf2548b9b26d3508a317b31f68e9a98a190f0;hp=f9b7ba9671073bbf3497981ee6b9877d95362690;hpb=b362e9af0d2183b719ec4c994b801ba1f49e4474;p=jalview.git
diff --git a/src/jalview/jbgui/GPreferences.java b/src/jalview/jbgui/GPreferences.java
index f9b7ba9..1ca0802 100755
--- a/src/jalview/jbgui/GPreferences.java
+++ b/src/jalview/jbgui/GPreferences.java
@@ -1,217 +1,1822 @@
-package jalview.jbgui;
-
-import javax.swing.*;
-import java.awt.*;
-import java.awt.event.ActionListener;
-import java.awt.event.ActionEvent;
-import javax.swing.border.TitledBorder;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-
-public class GPreferences
- extends JPanel
-{
- public GPreferences()
- {
- try
- {
- jbInit();
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
- }
-
- private void jbInit()
- throws Exception
- {
- this.setLayout(borderLayout1);
- ok.setText("OK");
- ok.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- ok_actionPerformed(e);
- }
- });
- cancel.setText("Cancel");
- cancel.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- cancel_actionPerformed(e);
- }
- });
- visual.setLayout(null);
- quality.setEnabled(false);
- quality.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
- quality.setHorizontalAlignment(SwingConstants.RIGHT);
- quality.setHorizontalTextPosition(SwingConstants.LEFT);
- quality.setSelected(true);
- quality.setText("Quality");
- quality.setBounds(new Rectangle(248, 53, 81, 23));
- jPanel2.setBorder(titledBorder1);
- jPanel2.setBounds(new Rectangle(9, 20, 442, 241));
- jPanel2.setLayout(null);
- fullID.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
- fullID.setHorizontalAlignment(SwingConstants.RIGHT);
- fullID.setHorizontalTextPosition(SwingConstants.LEFT);
- fullID.setText("Full Sequence ID");
- fullID.setBounds(new Rectangle(9, 78, 129, 23));
- fullScreen.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
- fullScreen.setHorizontalAlignment(SwingConstants.RIGHT);
- fullScreen.setHorizontalTextPosition(SwingConstants.LEFT);
- fullScreen.setText("Maximise Window");
- fullScreen.setBounds(new Rectangle(5, 29, 132, 23));
- conservation.setEnabled(false);
- conservation.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
- conservation.setHorizontalAlignment(SwingConstants.RIGHT);
- conservation.setHorizontalTextPosition(SwingConstants.LEFT);
- conservation.setSelected(true);
- conservation.setText("Conservation");
- conservation.setBounds(new Rectangle(137, 53, 113, 23));
- identity.setEnabled(false);
- identity.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
- identity.setHorizontalAlignment(SwingConstants.RIGHT);
- identity.setHorizontalTextPosition(SwingConstants.LEFT);
- identity.setSelected(true);
- identity.setText("Consensus");
- identity.setBounds(new Rectangle(326, 53, 99, 23));
- annotations.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
- annotations.setHorizontalAlignment(SwingConstants.RIGHT);
- annotations.setHorizontalTextPosition(SwingConstants.LEFT);
- annotations.setSelected(true);
- annotations.setText("Show Annotations");
- annotations.setBounds(new Rectangle(10, 53, 128, 23));
- annotations.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- annotations_actionPerformed(e);
- }
- });
- jLabel1.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
- jLabel1.setHorizontalAlignment(SwingConstants.RIGHT);
- jLabel1.setText("Gap Symbol");
- jLabel1.setBounds(new Rectangle(41, 142, 76, 15));
- colour.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
- colour.setBounds(new Rectangle(121, 168, 154, 21));
- jLabel2.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
- jLabel2.setHorizontalAlignment(SwingConstants.RIGHT);
- jLabel2.setText("Colour");
- jLabel2.setBounds(new Rectangle(60, 172, 58, 15));
- jLabel3.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
- jLabel3.setHorizontalAlignment(SwingConstants.RIGHT);
- jLabel3.setText("Font");
- jLabel3.setBounds(new Rectangle(83, 114, 34, 15));
- fontSizeCB.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
- fontSizeCB.setBounds(new Rectangle(304, 109, 49, 21));
- fontStyleCB.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
- fontStyleCB.setBounds(new Rectangle(353, 109, 80, 21));
- fontNameCB.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
- fontNameCB.setBounds(new Rectangle(121, 109, 183, 21));
- gapSymbolCB.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
- gapSymbolCB.setBounds(new Rectangle(121, 140, 67, 21));
- startupCheckbox.setText("Open file");
- startupCheckbox.setBounds(new Rectangle(4, 200, 115, 23));
- startupCheckbox.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- jCheckBox1_actionPerformed(e);
- }
- });
- startupCheckbox.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
- startupCheckbox.setHorizontalAlignment(SwingConstants.RIGHT);
- startupCheckbox.setHorizontalTextPosition(SwingConstants.LEFT);
- startupCheckbox.setSelected(true);
- startupFileTextfield.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
- startupFileTextfield.setBounds(new Rectangle(122, 202, 309, 20));
- startupFileTextfield.addMouseListener(new MouseAdapter()
- {
- public void mouseClicked(MouseEvent e)
- {
- startupFileTextfield_mouseClicked();
- }
- });
-
- jPanel2.add(annotations);
- jPanel2.add(conservation);
- jPanel2.add(quality);
- jPanel2.add(fullID);
- jPanel2.add(gapSymbolCB);
- jPanel2.add(jLabel1);
- jPanel2.add(fontNameCB);
- jPanel2.add(jLabel2);
- jPanel2.add(jLabel3);
- jPanel2.add(colour);
- jPanel2.add(fontSizeCB);
- jPanel2.add(fontStyleCB);
- jPanel2.add(identity);
- jPanel2.add(fullScreen);
- jPanel2.add(startupCheckbox);
- jPanel2.add(startupFileTextfield);
- jPanel1.add(ok);
- jPanel1.add(cancel);
- this.add(visaulTab, java.awt.BorderLayout.CENTER);
- visaulTab.add(visual, "visual");
- visual.add(jPanel2);
- this.add(jPanel1, java.awt.BorderLayout.SOUTH);
- DefaultListCellRenderer dlcr = new DefaultListCellRenderer();
- dlcr.setHorizontalAlignment(DefaultListCellRenderer.CENTER);
- gapSymbolCB.setRenderer(dlcr);
-
- }
-
- JTabbedPane visaulTab = new JTabbedPane();
- JPanel visual = new JPanel();
- JButton ok = new JButton();
- JButton cancel = new JButton();
- JPanel jPanel1 = new JPanel();
- BorderLayout borderLayout1 = new BorderLayout();
- protected JCheckBox quality = new JCheckBox();
- JPanel jPanel2 = new JPanel();
- TitledBorder titledBorder1 = new TitledBorder("Open new alignment");
- protected JCheckBox fullID = new JCheckBox();
- protected JCheckBox fullScreen = new JCheckBox();
- protected JCheckBox conservation = new JCheckBox();
- protected JCheckBox identity = new JCheckBox();
- protected JCheckBox annotations = new JCheckBox();
- JLabel jLabel1 = new JLabel();
- protected JComboBox colour = new JComboBox();
- JLabel jLabel2 = new JLabel();
- JLabel jLabel3 = new JLabel();
- protected JComboBox fontSizeCB = new JComboBox();
- protected JComboBox fontStyleCB = new JComboBox();
- protected JComboBox fontNameCB = new JComboBox();
- protected JComboBox gapSymbolCB = new JComboBox();
- protected JCheckBox startupCheckbox = new JCheckBox();
- protected JTextField startupFileTextfield = new JTextField();
- public void ok_actionPerformed(ActionEvent e)
- {
-
- }
-
- public void cancel_actionPerformed(ActionEvent e)
- {
-
- }
-
- public void annotations_actionPerformed(ActionEvent e)
- {
-
- }
-
- public void jCheckBox1_actionPerformed(ActionEvent e)
- {
-
- }
-
-
- public void startupFileTextfield_mouseClicked()
- {
-
- }
-
-}
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * 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 Jalview. If not, see .
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
+package jalview.jbgui;
+
+import jalview.fts.core.FTSDataColumnPreferences;
+import jalview.fts.core.FTSDataColumnPreferences.PreferenceSource;
+import jalview.fts.service.pdb.PDBFTSRestClient;
+import jalview.gui.JvSwingUtils;
+import jalview.gui.StructureViewer.ViewerType;
+import jalview.util.MessageManager;
+
+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.MouseAdapter;
+import java.awt.event.MouseEvent;
+
+import javax.swing.AbstractCellEditor;
+import javax.swing.BorderFactory;
+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.JRadioButton;
+import javax.swing.JScrollPane;
+import javax.swing.JTabbedPane;
+import javax.swing.JTable;
+import javax.swing.JTextField;
+import javax.swing.ListSelectionModel;
+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.table.TableCellEditor;
+import javax.swing.table.TableCellRenderer;
+
+/**
+ * Base class for the Preferences panel.
+ *
+ * @author $author$
+ * @version $Revision$
+ */
+public class GPreferences extends JPanel
+{
+ private static final Font LABEL_FONT = JvSwingUtils.getLabelFont();
+
+ private static final Font LABEL_FONT_ITALIC = JvSwingUtils
+ .getLabelFont(false, true);
+
+ /*
+ * Visual tab components
+ */
+ protected JCheckBox fullScreen = new JCheckBox();
+
+ protected JCheckBox openoverv = new JCheckBox();
+
+ protected JCheckBox seqLimit = new JCheckBox();
+
+ protected JCheckBox rightAlign = new JCheckBox();
+
+ protected JComboBox fontSizeCB = new JComboBox<>();
+
+ protected JComboBox fontStyleCB = new JComboBox<>();
+
+ protected JComboBox fontNameCB = new JComboBox<>();
+
+ protected JCheckBox showOccupancy = new JCheckBox();
+
+ protected JCheckBox showUnconserved = new JCheckBox();
+
+ protected JCheckBox idItalics = new JCheckBox();
+
+ protected JCheckBox smoothFont = new JCheckBox();
+
+ protected JCheckBox scaleProteinToCdna = new JCheckBox();
+
+ protected JComboBox gapSymbolCB = new JComboBox<>();
+
+ protected JCheckBox wrap = new JCheckBox();
+
+ protected JComboBox sortby = new JComboBox<>();
+
+ protected JComboBox sortAnnBy = new JComboBox<>();
+
+ protected JComboBox sortAutocalc = new JComboBox<>();
+
+ protected JCheckBox startupCheckbox = new JCheckBox();
+
+ protected JTextField startupFileTextfield = new JTextField();
+
+ // 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 useRnaView = new JCheckBox();
+
+ protected JCheckBox addSecondaryStructure = new JCheckBox();
+
+ protected JCheckBox addTempFactor = new JCheckBox();
+
+ protected JComboBox structViewer = new JComboBox<>();
+
+ protected JTextField chimeraPath = 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 JTable linkUrlTable = new JTable();
+
+ protected JButton editLink = new JButton();
+
+ protected JButton deleteLink = new JButton();
+
+ protected JTextField filterTB = new JTextField();
+
+ protected JButton doReset = new JButton();
+
+ protected JButton userOnly = new JButton();
+
+ protected JLabel portLabel = new JLabel();
+
+ protected JLabel serverLabel = new JLabel();
+
+ protected JTextField proxyServerTB = new JTextField();
+
+ protected JTextField proxyPortTB = new JTextField();
+
+ protected JTextField defaultBrowser = new JTextField();
+
+ protected JCheckBox useProxy = new JCheckBox();
+
+ protected JCheckBox usagestats = new JCheckBox();
+
+ protected JCheckBox questionnaire = new JCheckBox();
+
+ protected JCheckBox versioncheck = new JCheckBox();
+
+ /*
+ * Output tab components
+ */
+ protected JComboBox