2 * Jalview - A Sequence Alignment Editor and Viewer
\r
3 * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\r
5 * This program is free software; you can redistribute it and/or
\r
6 * modify it under the terms of the GNU General Public License
\r
7 * as published by the Free Software Foundation; either version 2
\r
8 * of the License, or (at your option) any later version.
\r
10 * This program is distributed in the hope that it will be useful,
\r
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 * GNU General Public License for more details.
\r
15 * You should have received a copy of the GNU General Public License
\r
16 * along with this program; if not, write to the Free Software
\r
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
\r
19 package jalview.gui;
\r
21 import javax.swing.*;
\r
23 import java.awt.event.ActionListener;
\r
24 import java.awt.event.ActionEvent;
\r
26 public class EPSOptions
\r
30 public boolean cancelled = false;
\r
39 catch (Exception ex)
\r
41 ex.printStackTrace();
\r
44 ButtonGroup bg = new ButtonGroup();
\r
48 JOptionPane pane = new JOptionPane(null,
\r
49 JOptionPane.DEFAULT_OPTION, JOptionPane.DEFAULT_OPTION,
\r
50 null, new Object[]{this});
\r
52 dialog = pane.createDialog(Desktop.desktop, "EPS Rendering options");
\r
53 dialog.setVisible(true);
\r
57 private void jbInit()
\r
60 lineart.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
61 lineart.setSelected(true);
\r
62 lineart.setText("Lineart");
\r
63 text.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
64 text.setText("Text");
\r
65 askAgain.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
66 askAgain.setText("Don\'t ask me again");
\r
68 ok.addActionListener(new ActionListener()
\r
70 public void actionPerformed(ActionEvent e)
\r
72 ok_actionPerformed(e);
\r
75 cancel.setText("Cancel");
\r
76 cancel.addActionListener(new ActionListener()
\r
78 public void actionPerformed(ActionEvent e)
\r
80 cancel_actionPerformed(e);
\r
83 jLabel1.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
84 jLabel1.setText("Select EPS character rendering style");
\r
85 this.setLayout(borderLayout1);
\r
86 jPanel3.setBorder(BorderFactory.createEtchedBorder());
\r
87 jPanel2.add(lineart);
\r
89 jPanel2.add(askAgain);
\r
91 jPanel1.add(cancel);
\r
92 jPanel3.add(jLabel1);
\r
93 jPanel3.add(jPanel2);
\r
94 this.add(jPanel3, java.awt.BorderLayout.CENTER);
\r
95 this.add(jPanel1, java.awt.BorderLayout.SOUTH);
\r
98 JRadioButton lineart = new JRadioButton();
\r
99 JRadioButton text = new JRadioButton();
\r
100 JCheckBox askAgain = new JCheckBox();
\r
101 JButton ok = new JButton();
\r
102 JButton cancel = new JButton();
\r
103 JPanel jPanel1 = new JPanel();
\r
104 JLabel jLabel1 = new JLabel();
\r
105 JPanel jPanel2 = new JPanel();
\r
106 JPanel jPanel3 = new JPanel();
\r
107 BorderLayout borderLayout1 = new BorderLayout();
\r
109 public void ok_actionPerformed(ActionEvent e)
\r
111 if (lineart.isSelected())
\r
116 if (!askAgain.isSelected())
\r
118 jalview.bin.Cache.applicationProperties.remove("EPS_RENDERING");
\r
122 jalview.bin.Cache.setProperty("EPS_RENDERING", value);
\r
125 dialog.setVisible(false);
\r
128 public void cancel_actionPerformed(ActionEvent e)
\r
131 dialog.setVisible(false);
\r
134 public String getValue()
\r