3 import jalview.bin.Cache;
4 import jalview.util.MessageManager;
6 import java.awt.BorderLayout;
7 import java.awt.event.ActionEvent;
8 import java.awt.event.ActionListener;
10 import javax.swing.BorderFactory;
11 import javax.swing.ButtonGroup;
12 import javax.swing.JButton;
13 import javax.swing.JCheckBox;
14 import javax.swing.JDialog;
15 import javax.swing.JLabel;
16 import javax.swing.JOptionPane;
17 import javax.swing.JPanel;
18 import javax.swing.JRadioButton;
20 public class HTMLOptions extends JPanel
24 public boolean cancelled = false;
33 } catch (Exception ex)
38 ButtonGroup bg = new ButtonGroup();
42 JOptionPane pane = new JOptionPane(null, JOptionPane.DEFAULT_OPTION,
43 JOptionPane.DEFAULT_OPTION, null, new Object[]
46 dialog = pane.createDialog(Desktop.desktop, "HTML Rendering options");
47 dialog.setVisible(true);
51 private void jbInit() throws Exception
53 lineart.setFont(JvSwingUtils.getLabelFont());
54 lineart.setText(MessageManager.getString("label.lineart"));
55 text.setFont(JvSwingUtils.getLabelFont());
56 text.setText(MessageManager.getString("action.text"));
57 text.setSelected(true);
58 askAgain.setFont(JvSwingUtils.getLabelFont());
59 askAgain.setText(MessageManager.getString("label.dont_ask_me_again"));
60 ok.setText(MessageManager.getString("action.ok"));
61 ok.addActionListener(new ActionListener()
63 public void actionPerformed(ActionEvent e)
65 ok_actionPerformed(e);
68 cancel.setText(MessageManager.getString("action.cancel"));
69 cancel.addActionListener(new ActionListener()
71 public void actionPerformed(ActionEvent e)
73 cancel_actionPerformed(e);
76 jLabel1.setFont(JvSwingUtils.getLabelFont());
77 jLabel1.setText("Select HTML character rendering style");
78 this.setLayout(borderLayout1);
79 jPanel3.setBorder(BorderFactory.createEtchedBorder());
82 jPanel2.add(askAgain);
87 this.add(jPanel3, java.awt.BorderLayout.CENTER);
88 this.add(jPanel1, java.awt.BorderLayout.SOUTH);
91 JRadioButton lineart = new JRadioButton();
93 JRadioButton text = new JRadioButton();
95 JCheckBox askAgain = new JCheckBox();
97 JButton ok = new JButton();
99 JButton cancel = new JButton();
101 JPanel jPanel1 = new JPanel();
103 JLabel jLabel1 = new JLabel();
105 JPanel jPanel2 = new JPanel();
107 JPanel jPanel3 = new JPanel();
109 BorderLayout borderLayout1 = new BorderLayout();
111 public void ok_actionPerformed(ActionEvent e)
113 if (lineart.isSelected())
122 if (!askAgain.isSelected())
124 Cache.applicationProperties.remove("HTML_RENDERING");
128 Cache.setProperty("HTML_RENDERING", value);
131 dialog.setVisible(false);
134 public void cancel_actionPerformed(ActionEvent e)
137 dialog.setVisible(false);
140 public String getValue()