3 import jalview.util.MessageManager;
5 import java.awt.BorderLayout;
6 import java.awt.event.ActionEvent;
7 import java.awt.event.ActionListener;
9 import javax.swing.BorderFactory;
10 import javax.swing.ButtonGroup;
11 import javax.swing.JButton;
12 import javax.swing.JCheckBox;
13 import javax.swing.JDialog;
14 import javax.swing.JLabel;
15 import javax.swing.JOptionPane;
16 import javax.swing.JPanel;
17 import javax.swing.JRadioButton;
19 public class HTMLOptions extends JPanel
23 public boolean cancelled = false;
32 } catch (Exception ex)
37 ButtonGroup bg = new ButtonGroup();
41 JOptionPane pane = new JOptionPane(null, JOptionPane.DEFAULT_OPTION,
42 JOptionPane.DEFAULT_OPTION, null, new Object[] { this });
44 dialog = pane.createDialog(Desktop.desktop, "HTML Rendering options");
45 dialog.setVisible(true);
49 private void jbInit() throws Exception
51 lineart.setFont(JvSwingUtils.getLabelFont());
52 lineart.setText(MessageManager.getString("label.lineart"));
53 text.setFont(JvSwingUtils.getLabelFont());
54 text.setText(MessageManager.getString("action.text"));
55 text.setSelected(true);
56 askAgain.setFont(JvSwingUtils.getLabelFont());
57 askAgain.setText(MessageManager.getString("label.dont_ask_me_again"));
58 ok.setText(MessageManager.getString("action.ok"));
59 ok.addActionListener(new ActionListener()
61 public void actionPerformed(ActionEvent e)
63 ok_actionPerformed(e);
66 cancel.setText(MessageManager.getString("action.cancel"));
67 cancel.addActionListener(new ActionListener()
69 public void actionPerformed(ActionEvent e)
71 cancel_actionPerformed(e);
74 jLabel1.setFont(JvSwingUtils.getLabelFont());
75 jLabel1.setText("Select HTML character rendering style");
76 this.setLayout(borderLayout1);
77 jPanel3.setBorder(BorderFactory.createEtchedBorder());
80 jPanel2.add(askAgain);
85 this.add(jPanel3, java.awt.BorderLayout.CENTER);
86 this.add(jPanel1, java.awt.BorderLayout.SOUTH);
89 JRadioButton lineart = new JRadioButton();
91 JRadioButton text = new JRadioButton();
93 JCheckBox askAgain = new JCheckBox();
95 JButton ok = new JButton();
97 JButton cancel = new JButton();
99 JPanel jPanel1 = new JPanel();
101 JLabel jLabel1 = new JLabel();
103 JPanel jPanel2 = new JPanel();
105 JPanel jPanel3 = new JPanel();
107 BorderLayout borderLayout1 = new BorderLayout();
109 public void ok_actionPerformed(ActionEvent e)
111 if (lineart.isSelected())
120 if (!askAgain.isSelected())
122 jalview.bin.Cache.applicationProperties.remove("HTML_RENDERING");
126 jalview.bin.Cache.setProperty("HTML_RENDERING", value);
129 dialog.setVisible(false);
132 public void cancel_actionPerformed(ActionEvent e)
135 dialog.setVisible(false);
138 public String getValue()