+/*\r
+* Jalview - A Sequence Alignment Editor and Viewer\r
+* Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
+*\r
+* This program is free software; you can redistribute it and/or\r
+* modify it under the terms of the GNU General Public License\r
+* as published by the Free Software Foundation; either version 2\r
+* of the License, or (at your option) any later version.\r
+*\r
+* This program is distributed in the hope that it will be useful,\r
+* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+* GNU General Public License for more details.\r
+*\r
+* You should have received a copy of the GNU General Public License\r
+* along with this program; if not, write to the Free Software\r
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA\r
+*/\r
package jalview.jbgui;\r
\r
-import javax.swing.*;\r
import java.awt.*;\r
-import java.awt.event.ActionListener;\r
import java.awt.event.ActionEvent;\r
+import java.awt.event.ActionListener;\r
+import java.awt.event.MouseAdapter;\r
+import java.awt.event.MouseEvent;\r
+\r
+import javax.swing.*;\r
import javax.swing.border.TitledBorder;\r
\r
-public class GPreferences\r
- extends JPanel\r
-{\r
- public GPreferences()\r
- {\r
- try\r
- {\r
- jbInit();\r
- }\r
- catch (Exception ex)\r
- {\r
- ex.printStackTrace();\r
- }\r
- }\r
\r
- private void jbInit()\r
- throws Exception\r
- {\r
- this.setLayout(borderLayout1);\r
- ok.setText("OK");\r
- ok.addActionListener(new ActionListener()\r
- {\r
- public void actionPerformed(ActionEvent e)\r
- {\r
- ok_actionPerformed(e);\r
- }\r
- });\r
- cancel.setText("Cancel");\r
- cancel.addActionListener(new ActionListener()\r
- {\r
- public void actionPerformed(ActionEvent e)\r
- {\r
- cancel_actionPerformed(e);\r
- }\r
- });\r
- visual.setLayout(null);\r
- quality.setEnabled(false);\r
- quality.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
- quality.setHorizontalAlignment(SwingConstants.RIGHT);\r
- quality.setHorizontalTextPosition(SwingConstants.LEFT);\r
- quality.setSelected(true);\r
- quality.setText("Quality");\r
- quality.setBounds(new Rectangle(248, 53, 81, 23));\r
- jPanel2.setBorder(titledBorder1);\r
- jPanel2.setBounds(new Rectangle(9, 20, 442, 206));\r
- jPanel2.setLayout(null);\r
- fullID.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
- fullID.setHorizontalAlignment(SwingConstants.RIGHT);\r
- fullID.setHorizontalTextPosition(SwingConstants.LEFT);\r
- fullID.setText("Full Sequence ID");\r
- fullID.setBounds(new Rectangle(9, 78, 129, 23));\r
- fullScreen.setHorizontalAlignment(SwingConstants.RIGHT);\r
- fullScreen.setHorizontalTextPosition(SwingConstants.LEFT);\r
- fullScreen.setText("Full Screen");\r
- fullScreen.setBounds(new Rectangle(31, 28, 107, 23));\r
- conservation.setEnabled(false);\r
- conservation.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
- conservation.setHorizontalAlignment(SwingConstants.RIGHT);\r
- conservation.setHorizontalTextPosition(SwingConstants.LEFT);\r
- conservation.setSelected(true);\r
- conservation.setText("Conservation");\r
- conservation.setBounds(new Rectangle(137, 53, 113, 23));\r
- identity.setEnabled(false);\r
- identity.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
- identity.setHorizontalAlignment(SwingConstants.RIGHT);\r
- identity.setHorizontalTextPosition(SwingConstants.LEFT);\r
- identity.setSelected(true);\r
- identity.setText("% Identity");\r
- identity.setBounds(new Rectangle(326, 53, 99, 23));\r
- annotations.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
- annotations.setHorizontalAlignment(SwingConstants.RIGHT);\r
- annotations.setHorizontalTextPosition(SwingConstants.LEFT);\r
- annotations.setSelected(true);\r
- annotations.setText("Show Annotations");\r
- annotations.setBounds(new Rectangle(10, 53, 128, 23));\r
- annotations.addActionListener(new ActionListener()\r
- {\r
- public void actionPerformed(ActionEvent e)\r
- {\r
- annotations_actionPerformed(e);\r
- }\r
- });\r
- jLabel1.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
- jLabel1.setHorizontalAlignment(SwingConstants.RIGHT);\r
- jLabel1.setText("Gap Symbol");\r
- jLabel1.setBounds(new Rectangle(41, 142, 76, 15));\r
- colour.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
- colour.setBounds(new Rectangle(121, 168, 154, 21));\r
- jLabel2.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
- jLabel2.setHorizontalAlignment(SwingConstants.RIGHT);\r
- jLabel2.setText("Colour");\r
- jLabel2.setBounds(new Rectangle(60, 172, 58, 15));\r
- jLabel3.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
- jLabel3.setHorizontalAlignment(SwingConstants.RIGHT);\r
- jLabel3.setText("Font");\r
- jLabel3.setBounds(new Rectangle(83, 114, 34, 15));\r
- fontSize.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
- fontSize.setBounds(new Rectangle(304, 109, 49, 21));\r
- fontStyle.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
- fontStyle.setBounds(new Rectangle(353, 109, 80, 21));\r
- fontName.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
- fontName.setBounds(new Rectangle(121, 109, 183, 21));\r
- gapSymbol.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
- gapSymbol.setBounds(new Rectangle(121, 140, 67, 21));\r
- jPanel2.add(annotations);\r
- jPanel2.add(fullScreen);\r
- jPanel2.add(conservation);\r
- jPanel2.add(quality);\r
- jPanel2.add(fullID);\r
- jPanel2.add(gapSymbol);\r
- jPanel2.add(jLabel1);\r
- jPanel2.add(fontName);\r
- jPanel2.add(jLabel2);\r
- jPanel2.add(jLabel3);\r
- jPanel2.add(colour);\r
- jPanel2.add(fontSize);\r
- jPanel2.add(fontStyle);\r
- jPanel2.add(identity);\r
- jPanel1.add(ok);\r
- jPanel1.add(cancel);\r
- this.add(visaulTab, java.awt.BorderLayout.CENTER);\r
- visaulTab.add(visual, "visual");\r
- visual.add(jPanel2);\r
- this.add(jPanel1, java.awt.BorderLayout.SOUTH);\r
+public class GPreferences extends JPanel {\r
+ JTabbedPane visaulTab = new JTabbedPane();\r
+ JPanel visual = new JPanel();\r
+ JButton ok = new JButton();\r
+ JButton cancel = new JButton();\r
+ JPanel jPanel1 = new JPanel();\r
+ BorderLayout borderLayout1 = new BorderLayout();\r
+ protected JCheckBox quality = new JCheckBox();\r
+ JPanel jPanel2 = new JPanel();\r
+ TitledBorder titledBorder1 = new TitledBorder("Open new alignment");\r
+ protected JCheckBox fullID = new JCheckBox();\r
+ protected JCheckBox fullScreen = new JCheckBox();\r
+ protected JCheckBox conservation = new JCheckBox();\r
+ protected JCheckBox identity = new JCheckBox();\r
+ protected JCheckBox annotations = new JCheckBox();\r
+ JLabel jLabel1 = new JLabel();\r
+ protected JComboBox colour = new JComboBox();\r
+ JLabel jLabel2 = new JLabel();\r
+ JLabel jLabel3 = new JLabel();\r
+ protected JComboBox fontSizeCB = new JComboBox();\r
+ protected JComboBox fontStyleCB = new JComboBox();\r
+ protected JComboBox fontNameCB = new JComboBox();\r
+ protected JComboBox gapSymbolCB = new JComboBox();\r
+ protected JCheckBox startupCheckbox = new JCheckBox();\r
+ protected JTextField startupFileTextfield = new JTextField();\r
\r
- DefaultListCellRenderer dlcr = new DefaultListCellRenderer();\r
- dlcr.setHorizontalAlignment(DefaultListCellRenderer.CENTER);\r
- gapSymbol.setRenderer(dlcr);\r
+ public GPreferences() {\r
+ try {\r
+ jbInit();\r
+ } catch (Exception ex) {\r
+ ex.printStackTrace();\r
+ }\r
+ }\r
\r
- }\r
+ private void jbInit() throws Exception {\r
+ this.setLayout(borderLayout1);\r
+ ok.setText("OK");\r
+ ok.addActionListener(new ActionListener() {\r
+ public void actionPerformed(ActionEvent e) {\r
+ ok_actionPerformed(e);\r
+ }\r
+ });\r
+ cancel.setText("Cancel");\r
+ cancel.addActionListener(new ActionListener() {\r
+ public void actionPerformed(ActionEvent e) {\r
+ cancel_actionPerformed(e);\r
+ }\r
+ });\r
+ visual.setLayout(null);\r
+ quality.setEnabled(false);\r
+ quality.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+ quality.setHorizontalAlignment(SwingConstants.RIGHT);\r
+ quality.setHorizontalTextPosition(SwingConstants.LEFT);\r
+ quality.setSelected(true);\r
+ quality.setText("Quality");\r
+ quality.setBounds(new Rectangle(248, 53, 81, 23));\r
+ jPanel2.setBorder(titledBorder1);\r
+ jPanel2.setBounds(new Rectangle(9, 20, 442, 241));\r
+ jPanel2.setLayout(null);\r
+ fullID.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+ fullID.setHorizontalAlignment(SwingConstants.RIGHT);\r
+ fullID.setHorizontalTextPosition(SwingConstants.LEFT);\r
+ fullID.setText("Full Sequence ID");\r
+ fullID.setBounds(new Rectangle(9, 78, 129, 23));\r
+ fullScreen.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+ fullScreen.setHorizontalAlignment(SwingConstants.RIGHT);\r
+ fullScreen.setHorizontalTextPosition(SwingConstants.LEFT);\r
+ fullScreen.setText("Maximise Window");\r
+ fullScreen.setBounds(new Rectangle(5, 29, 132, 23));\r
+ conservation.setEnabled(false);\r
+ conservation.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+ conservation.setHorizontalAlignment(SwingConstants.RIGHT);\r
+ conservation.setHorizontalTextPosition(SwingConstants.LEFT);\r
+ conservation.setSelected(true);\r
+ conservation.setText("Conservation");\r
+ conservation.setBounds(new Rectangle(137, 53, 113, 23));\r
+ identity.setEnabled(false);\r
+ identity.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+ identity.setHorizontalAlignment(SwingConstants.RIGHT);\r
+ identity.setHorizontalTextPosition(SwingConstants.LEFT);\r
+ identity.setSelected(true);\r
+ identity.setText("Consensus");\r
+ identity.setBounds(new Rectangle(326, 53, 99, 23));\r
+ annotations.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+ annotations.setHorizontalAlignment(SwingConstants.RIGHT);\r
+ annotations.setHorizontalTextPosition(SwingConstants.LEFT);\r
+ annotations.setSelected(true);\r
+ annotations.setText("Show Annotations");\r
+ annotations.setBounds(new Rectangle(10, 53, 128, 23));\r
+ annotations.addActionListener(new ActionListener() {\r
+ public void actionPerformed(ActionEvent e) {\r
+ annotations_actionPerformed(e);\r
+ }\r
+ });\r
+ jLabel1.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+ jLabel1.setHorizontalAlignment(SwingConstants.RIGHT);\r
+ jLabel1.setText("Gap Symbol");\r
+ jLabel1.setBounds(new Rectangle(41, 142, 76, 15));\r
+ colour.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+ colour.setBounds(new Rectangle(121, 168, 154, 21));\r
+ jLabel2.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+ jLabel2.setHorizontalAlignment(SwingConstants.RIGHT);\r
+ jLabel2.setText("Colour");\r
+ jLabel2.setBounds(new Rectangle(60, 172, 58, 15));\r
+ jLabel3.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+ jLabel3.setHorizontalAlignment(SwingConstants.RIGHT);\r
+ jLabel3.setText("Font");\r
+ jLabel3.setBounds(new Rectangle(83, 114, 34, 15));\r
+ fontSizeCB.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+ fontSizeCB.setBounds(new Rectangle(304, 109, 49, 21));\r
+ fontStyleCB.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+ fontStyleCB.setBounds(new Rectangle(353, 109, 80, 21));\r
+ fontNameCB.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+ fontNameCB.setBounds(new Rectangle(121, 109, 183, 21));\r
+ gapSymbolCB.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+ gapSymbolCB.setBounds(new Rectangle(121, 140, 67, 21));\r
+ startupCheckbox.setText("Open file");\r
+ startupCheckbox.setBounds(new Rectangle(4, 200, 115, 23));\r
+ startupCheckbox.addActionListener(new ActionListener() {\r
+ public void actionPerformed(ActionEvent e) {\r
+ jCheckBox1_actionPerformed(e);\r
+ }\r
+ });\r
+ startupCheckbox.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+ startupCheckbox.setHorizontalAlignment(SwingConstants.RIGHT);\r
+ startupCheckbox.setHorizontalTextPosition(SwingConstants.LEFT);\r
+ startupCheckbox.setSelected(true);\r
+ startupFileTextfield.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+ startupFileTextfield.setBounds(new Rectangle(122, 202, 309, 20));\r
+ startupFileTextfield.addMouseListener(new MouseAdapter() {\r
+ public void mouseClicked(MouseEvent e) {\r
+ if(e.getClickCount()>1)\r
+ startupFileTextfield_mouseClicked();\r
+ }\r
+ });\r
\r
- JTabbedPane visaulTab = new JTabbedPane();\r
- JPanel visual = new JPanel();\r
- JButton ok = new JButton();\r
- JButton cancel = new JButton();\r
- JPanel jPanel1 = new JPanel();\r
- BorderLayout borderLayout1 = new BorderLayout();\r
- protected JCheckBox quality = new JCheckBox();\r
- JPanel jPanel2 = new JPanel();\r
- TitledBorder titledBorder1 = new TitledBorder("Open new alignment");\r
- protected JCheckBox fullID = new JCheckBox();\r
- protected JCheckBox fullScreen = new JCheckBox();\r
- protected JCheckBox conservation = new JCheckBox();\r
- protected JCheckBox identity = new JCheckBox();\r
- protected JCheckBox annotations = new JCheckBox();\r
- JLabel jLabel1 = new JLabel();\r
- protected JComboBox colour = new JComboBox();\r
- JLabel jLabel2 = new JLabel();\r
- JLabel jLabel3 = new JLabel();\r
- protected JComboBox fontSize = new JComboBox();\r
- protected JComboBox fontStyle = new JComboBox();\r
- protected JComboBox fontName = new JComboBox();\r
- protected JComboBox gapSymbol = new JComboBox();\r
- public void ok_actionPerformed(ActionEvent e)\r
- {\r
+ jPanel2.add(annotations);\r
+ jPanel2.add(conservation);\r
+ jPanel2.add(quality);\r
+ jPanel2.add(fullID);\r
+ jPanel2.add(gapSymbolCB);\r
+ jPanel2.add(jLabel1);\r
+ jPanel2.add(fontNameCB);\r
+ jPanel2.add(jLabel2);\r
+ jPanel2.add(jLabel3);\r
+ jPanel2.add(colour);\r
+ jPanel2.add(fontSizeCB);\r
+ jPanel2.add(fontStyleCB);\r
+ jPanel2.add(identity);\r
+ jPanel2.add(fullScreen);\r
+ jPanel2.add(startupCheckbox);\r
+ jPanel2.add(startupFileTextfield);\r
+ jPanel1.add(ok);\r
+ jPanel1.add(cancel);\r
+ this.add(visaulTab, java.awt.BorderLayout.CENTER);\r
+ visaulTab.add(visual, "visual");\r
+ visual.add(jPanel2);\r
+ this.add(jPanel1, java.awt.BorderLayout.SOUTH);\r
\r
- }\r
+ DefaultListCellRenderer dlcr = new DefaultListCellRenderer();\r
+ dlcr.setHorizontalAlignment(DefaultListCellRenderer.CENTER);\r
+ gapSymbolCB.setRenderer(dlcr);\r
+ }\r
\r
- public void cancel_actionPerformed(ActionEvent e)\r
- {\r
+ public void ok_actionPerformed(ActionEvent e) {\r
+ }\r
\r
- }\r
+ public void cancel_actionPerformed(ActionEvent e) {\r
+ }\r
\r
- public void annotations_actionPerformed(ActionEvent e)\r
- {\r
+ public void annotations_actionPerformed(ActionEvent e) {\r
+ }\r
\r
- }\r
+ public void jCheckBox1_actionPerformed(ActionEvent e) {\r
+ }\r
\r
+ public void startupFileTextfield_mouseClicked() {\r
+ }\r
}\r