2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
23 import jalview.util.MessageManager;
25 import java.awt.BorderLayout;
26 import java.awt.event.ActionEvent;
27 import java.awt.event.ActionListener;
29 import javax.swing.BorderFactory;
30 import javax.swing.ButtonGroup;
31 import javax.swing.JButton;
32 import javax.swing.JCheckBox;
33 import javax.swing.JDialog;
34 import javax.swing.JLabel;
35 import javax.swing.JOptionPane;
36 import javax.swing.JPanel;
37 import javax.swing.JRadioButton;
39 public class EPSOptions extends JPanel
43 public boolean cancelled = false;
52 } catch (Exception ex)
57 ButtonGroup bg = new ButtonGroup();
61 JOptionPane pane = new JOptionPane(null, JvOptionPane.DEFAULT_OPTION,
62 JvOptionPane.DEFAULT_OPTION, null, new Object[] { this });
64 dialog = pane.createDialog(Desktop.desktop, "EPS Rendering options");
65 dialog.setVisible(true);
69 private void jbInit() throws Exception
71 lineart.setFont(JvSwingUtils.getLabelFont());
72 lineart.setText(MessageManager.getString("label.lineart"));
73 text.setFont(JvSwingUtils.getLabelFont());
74 text.setText(MessageManager.getString("action.text"));
75 text.setSelected(true);
76 askAgain.setFont(JvSwingUtils.getLabelFont());
77 askAgain.setText(MessageManager.getString("label.dont_ask_me_again"));
78 ok.setText(MessageManager.getString("action.ok"));
79 ok.addActionListener(new ActionListener()
82 public void actionPerformed(ActionEvent e)
84 ok_actionPerformed(e);
87 cancel.setText(MessageManager.getString("action.cancel"));
88 cancel.addActionListener(new ActionListener()
91 public void actionPerformed(ActionEvent e)
93 cancel_actionPerformed(e);
96 jLabel1.setFont(JvSwingUtils.getLabelFont());
97 jLabel1.setText(MessageManager
98 .getString("label.select_eps_character_rendering_style"));
99 this.setLayout(borderLayout1);
100 jPanel3.setBorder(BorderFactory.createEtchedBorder());
102 jPanel2.add(lineart);
103 jPanel2.add(askAgain);
106 jPanel3.add(jLabel1);
107 jPanel3.add(jPanel2);
108 this.add(jPanel3, java.awt.BorderLayout.CENTER);
109 this.add(jPanel1, java.awt.BorderLayout.SOUTH);
112 JRadioButton lineart = new JRadioButton();
114 JRadioButton text = new JRadioButton();
116 JCheckBox askAgain = new JCheckBox();
118 JButton ok = new JButton();
120 JButton cancel = new JButton();
122 JPanel jPanel1 = new JPanel();
124 JLabel jLabel1 = new JLabel();
126 JPanel jPanel2 = new JPanel();
128 JPanel jPanel3 = new JPanel();
130 BorderLayout borderLayout1 = new BorderLayout();
132 public void ok_actionPerformed(ActionEvent e)
134 if (lineart.isSelected())
143 if (!askAgain.isSelected())
145 jalview.bin.Cache.applicationProperties.remove("EPS_RENDERING");
149 jalview.bin.Cache.setProperty("EPS_RENDERING", value);
152 dialog.setVisible(false);
155 public void cancel_actionPerformed(ActionEvent e)
158 dialog.setVisible(false);
161 public String getValue()