--- /dev/null
+package jalview.gui;\r
+\r
+import javax.swing.*;\r
+import java.awt.*;\r
+import java.awt.event.ActionListener;\r
+import java.awt.event.ActionEvent;\r
+\r
+public class EPSOptions\r
+ extends JPanel\r
+{\r
+ JDialog dialog;\r
+ boolean cancelled = false;\r
+ String value;\r
+\r
+ public EPSOptions()\r
+ {\r
+ try\r
+ {\r
+ jbInit();\r
+ }\r
+ catch (Exception ex)\r
+ {\r
+ ex.printStackTrace();\r
+ }\r
+\r
+ ButtonGroup bg = new ButtonGroup();\r
+ bg.add(lineart);\r
+ bg.add(text);\r
+\r
+ JOptionPane pane = new JOptionPane(null,\r
+ JOptionPane.DEFAULT_OPTION, JOptionPane.DEFAULT_OPTION,\r
+ null, new Object[]{this});\r
+\r
+ dialog = pane.createDialog(Desktop.desktop, "EPS Rendering options");\r
+ dialog.show();\r
+\r
+ }\r
+\r
+ private void jbInit()\r
+ throws Exception\r
+ {\r
+ lineart.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+ lineart.setSelected(true);\r
+ lineart.setText("Lineart");\r
+ text.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+ text.setText("Text");\r
+ askAgain.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+ askAgain.setText("Don\'t ask me again");\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
+ jLabel1.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+ jLabel1.setText("Select EPS Character rendering style");\r
+ this.setLayout(borderLayout1);\r
+ jPanel3.setBorder(BorderFactory.createEtchedBorder());\r
+ jPanel2.add(lineart);\r
+ jPanel2.add(text);\r
+ jPanel2.add(askAgain);\r
+ jPanel1.add(ok);\r
+ jPanel1.add(cancel);\r
+ jPanel3.add(jLabel1);\r
+ jPanel3.add(jPanel2);\r
+ this.add(jPanel3, java.awt.BorderLayout.CENTER);\r
+ this.add(jPanel1, java.awt.BorderLayout.SOUTH);\r
+ }\r
+\r
+ JRadioButton lineart = new JRadioButton();\r
+ JRadioButton text = new JRadioButton();\r
+ JCheckBox askAgain = new JCheckBox();\r
+ JButton ok = new JButton();\r
+ JButton cancel = new JButton();\r
+ JPanel jPanel1 = new JPanel();\r
+ JLabel jLabel1 = new JLabel();\r
+ JPanel jPanel2 = new JPanel();\r
+ JPanel jPanel3 = new JPanel();\r
+ BorderLayout borderLayout1 = new BorderLayout();\r
+\r
+ public void ok_actionPerformed(ActionEvent e)\r
+ {\r
+ if (lineart.isSelected())\r
+ value = "Lineart";\r
+ else\r
+ value = "Text";\r
+\r
+ if (!askAgain.isSelected())\r
+ {\r
+ jalview.bin.Cache.applicationProperties.remove("EPS_RENDERING");\r
+ }\r
+ else\r
+ {\r
+ jalview.bin.Cache.setProperty("EPS_RENDERING", value);\r
+ }\r
+\r
+ dialog.hide();\r
+ }\r
+\r
+ public void cancel_actionPerformed(ActionEvent e)\r
+ {\r
+ cancelled = true;\r
+ dialog.hide();\r
+ }\r
+\r
+ public String getValue()\r
+ {\r
+ return value;\r
+ }\r
+}\r
GridBagLayout gridBagLayout3 = new GridBagLayout();\r
protected JComboBox sortby = new JComboBox();\r
JLabel sortLabel = new JLabel();\r
+ JPanel jPanel2 = new JPanel();\r
+ GridLayout gridLayout2 = new GridLayout();\r
+ JLabel jLabel1 = new JLabel();\r
+ JPanel jPanel3 = new JPanel();\r
+ protected JComboBox epsRendering = new JComboBox();\r
/**\r
* Creates a new GPreferences object.\r
*/\r
quality.setHorizontalTextPosition(SwingConstants.LEFT);\r
quality.setSelected(true);\r
quality.setText("Quality");\r
- quality.setBounds(new Rectangle(248, 53, 81, 23));\r
- visualTab.setBorder(new TitledBorder("Open new alignment"));\r
- visualTab.setBounds(new Rectangle(9, 20, 442, 241));\r
- visualTab.setLayout(null);\r
+ visualTab.setBorder(new TitledBorder("Open new alignment"));\r
+ visualTab.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
+ fullID.setMargin(new Insets(4, 2, 2, 0));\r
+ fullID.setText("Full Sequence ID");\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
+ fullScreen.setMargin(new Insets(2, 2, 2, 0));\r
+ fullScreen.setText("Maximise Window");\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.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.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.setMargin(new Insets(2, 4, 2, 0));\r
+ annotations.setSelected(true);\r
annotations.setText("Show Annotations");\r
- annotations.setBounds(new Rectangle(10, 53, 128, 23));\r
- annotations.addActionListener(new ActionListener()\r
+ annotations.addActionListener(new ActionListener()\r
{\r
public void actionPerformed(ActionEvent e)\r
{\r
gapLabel.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
gapLabel.setHorizontalAlignment(SwingConstants.RIGHT);\r
gapLabel.setText("Gap Symbol");\r
- gapLabel.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
+ colour.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+ colour.setBounds(new Rectangle(154, 151, 154, 21));\r
colourLabel.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
colourLabel.setHorizontalAlignment(SwingConstants.RIGHT);\r
colourLabel.setText("Colour");\r
- colourLabel.setBounds(new Rectangle(60, 172, 58, 15));\r
- fontLabel.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+ fontLabel.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
fontLabel.setHorizontalAlignment(SwingConstants.RIGHT);\r
fontLabel.setText("Font");\r
- fontLabel.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
+ fontSizeCB.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+ fontSizeCB.setBounds(new Rectangle(322, 98, 49, 21));\r
fontStyleCB.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
- fontStyleCB.setBounds(new Rectangle(353, 109, 80, 21));\r
+ fontStyleCB.setBounds(new Rectangle(370, 98, 70, 21));\r
fontNameCB.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
- fontNameCB.setBounds(new Rectangle(121, 109, 183, 21));\r
+ fontNameCB.setBounds(new Rectangle(153, 98, 169, 21));\r
gapSymbolCB.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
- gapSymbolCB.setBounds(new Rectangle(121, 140, 67, 21));\r
+ gapSymbolCB.setBounds(new Rectangle(154, 125, 67, 21));\r
startupCheckbox.setText("Open file");\r
- startupCheckbox.setBounds(new Rectangle(4, 200, 115, 23));\r
- startupCheckbox.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\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(121, 200, 309, 20));\r
+ startupFileTextfield.setBounds(new Rectangle(154, 204, 285, 20));\r
startupFileTextfield.addMouseListener(new MouseAdapter()\r
{\r
public void mouseClicked(MouseEvent e)\r
jPanel1.setBorder(titledBorder1);\r
jPanel1.setLayout(gridBagLayout1);\r
sortby.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
- sortby.setBounds(new Rectangle(122, 232, 308, 21));\r
+ sortby.setBounds(new Rectangle(154, 178, 286, 21));\r
sortLabel.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
sortLabel.setHorizontalAlignment(SwingConstants.RIGHT);\r
sortLabel.setText("Sort by");\r
- sortLabel.setBounds(new Rectangle(53, 235, 64, 15));\r
- visualTab.add(annotations);\r
- visualTab.add(conservation);\r
- visualTab.add(quality);\r
- visualTab.add(fullID);\r
- visualTab.add(gapSymbolCB);\r
- visualTab.add(fontLabel);\r
- visualTab.add(fontNameCB);\r
- visualTab.add(colourLabel);\r
- visualTab.add(gapLabel);\r
+ jPanel2.setBounds(new Rectangle(7, 19, 141, 242));\r
+ jPanel2.setLayout(gridLayout2);\r
+ gridLayout2.setRows(9);\r
+ jLabel1.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+ jLabel1.setHorizontalAlignment(SwingConstants.RIGHT);\r
+ jLabel1.setText("EPS Rendering Style");\r
+ jPanel3.setBounds(new Rectangle(149, 42, 278, 26));\r
+ epsRendering.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+ epsRendering.setBounds(new Rectangle(154, 228, 286, 21));\r
+ jPanel2.add(fullScreen);\r
+ jPanel2.add(annotations);\r
+ jPanel2.add(fullID);\r
+ jPanel2.add(fontLabel);\r
+ jPanel2.add(gapLabel);\r
+ jPanel2.add(colourLabel);\r
+ jPanel2.add(sortLabel);\r
+ jPanel2.add(startupCheckbox);\r
+ jPanel2.add(jLabel1);\r
+ visualTab.add(jPanel3);\r
+ jPanel3.add(conservation);\r
+ jPanel3.add(quality);\r
+ jPanel3.add(identity);\r
+ visualTab.add(fontNameCB);\r
+ visualTab.add(fontSizeCB);\r
+ visualTab.add(fontStyleCB);\r
+ visualTab.add(gapSymbolCB);\r
visualTab.add(colour);\r
- visualTab.add(fontSizeCB);\r
- visualTab.add(fontStyleCB);\r
- visualTab.add(identity);\r
- visualTab.add(fullScreen);\r
- visualTab.add(startupCheckbox);\r
- visualTab.add(startupFileTextfield);\r
visualTab.add(sortby);\r
- visualTab.add(sortLabel);\r
-\r
- tabbedPane.add(visualTab, "Visual");\r
- tabbedPane.add(connectTab, "Connections");\r
+ visualTab.add(startupFileTextfield);\r
+ visualTab.add(epsRendering);\r
+ visualTab.add(jPanel2);\r
\r
linkPanel.add(editLinkButtons, BorderLayout.EAST);\r
editLinkButtons.add(newLink, null);\r
connectTab.add(defaultBrowser, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0\r
, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,\r
new Insets(15, 0, 0, 15), 307, 1));\r
+\r
jPanel1.add(useProxy, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0\r
, GridBagConstraints.WEST,\r
GridBagConstraints.NONE,\r
DefaultListCellRenderer dlcr = new DefaultListCellRenderer();\r
dlcr.setHorizontalAlignment(DefaultListCellRenderer.CENTER);\r
gapSymbolCB.setRenderer(dlcr);\r
+\r
+ tabbedPane.add(visualTab, "Visual");\r
+ tabbedPane.add(connectTab, "Connections");\r
}\r
\r
/**\r