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[]
45 dialog = pane.createDialog(Desktop.desktop, "HTML Rendering options");
46 dialog.setVisible(true);
50 private void jbInit() throws Exception
52 lineart.setFont(JvSwingUtils.getLabelFont());
53 lineart.setText(MessageManager.getString("label.lineart"));
54 text.setFont(JvSwingUtils.getLabelFont());
55 text.setText(MessageManager.getString("action.text"));
56 text.setSelected(true);
57 askAgain.setFont(JvSwingUtils.getLabelFont());
58 askAgain.setText(MessageManager.getString("label.dont_ask_me_again"));
59 ok.setText(MessageManager.getString("action.ok"));
60 ok.addActionListener(new ActionListener()
62 public void actionPerformed(ActionEvent e)
64 ok_actionPerformed(e);
67 cancel.setText(MessageManager.getString("action.cancel"));
68 cancel.addActionListener(new ActionListener()
70 public void actionPerformed(ActionEvent e)
72 cancel_actionPerformed(e);
75 jLabel1.setFont(JvSwingUtils.getLabelFont());
76 jLabel1.setText("Select HTML character rendering style");
77 this.setLayout(borderLayout1);
78 jPanel3.setBorder(BorderFactory.createEtchedBorder());
81 jPanel2.add(askAgain);
86 this.add(jPanel3, java.awt.BorderLayout.CENTER);
87 this.add(jPanel1, java.awt.BorderLayout.SOUTH);
90 JRadioButton lineart = new JRadioButton();
92 JRadioButton text = new JRadioButton();
94 JCheckBox askAgain = new JCheckBox();
96 JButton ok = new JButton();
98 JButton cancel = new JButton();
100 JPanel jPanel1 = new JPanel();
102 JLabel jLabel1 = new JLabel();
104 JPanel jPanel2 = new JPanel();
106 JPanel jPanel3 = new JPanel();
108 BorderLayout borderLayout1 = new BorderLayout();
110 public void ok_actionPerformed(ActionEvent e)
112 if (lineart.isSelected())
121 if (!askAgain.isSelected())
123 jalview.bin.Cache.applicationProperties.remove("HTML_RENDERING");
127 jalview.bin.Cache.setProperty("HTML_RENDERING", value);
130 dialog.setVisible(false);
133 public void cancel_actionPerformed(ActionEvent e)
136 dialog.setVisible(false);
139 public String getValue()