2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
3 * Copyright (C) 2014 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.analysis.AnnotationSorter.SequenceAnnotationOrder;
24 import jalview.bin.Cache;
25 import jalview.io.JalviewFileChooser;
26 import jalview.io.JalviewFileView;
27 import jalview.jbgui.GPreferences;
28 import jalview.jbgui.GSequenceLink;
29 import jalview.schemes.ColourSchemeProperty;
30 import jalview.util.MessageManager;
32 import java.awt.BorderLayout;
33 import java.awt.Color;
34 import java.awt.Dimension;
36 import java.awt.event.ActionEvent;
37 import java.awt.event.MouseEvent;
38 import java.util.Collection;
39 import java.util.StringTokenizer;
40 import java.util.Vector;
42 import javax.swing.JColorChooser;
43 import javax.swing.JFileChooser;
44 import javax.swing.JInternalFrame;
45 import javax.swing.JOptionPane;
53 public class Preferences extends GPreferences
57 * Holds name and link separated with | character. Sequence ID must be
58 * $SEQUENCE_ID$ or $SEQUENCE_ID=/.possible | chars ./=$
60 public static Vector sequenceURLLinks;
63 * Holds name and link separated with | character. Sequence IDS and Sequences
64 * must be $SEQUENCEIDS$ or $SEQUENCEIDS=/.possible | chars ./=$ and
65 * $SEQUENCES$ or $SEQUENCES=/.possible | chars ./=$ and separation character
66 * for first and second token specified after a pipe character at end |,|.
67 * (TODO: proper escape for using | to separate ids or sequences
70 public static Vector groupURLLinks;
76 "EMBL-EBI Search|http://www.ebi.ac.uk/ebisearch/search.ebi?db=allebi&query=$SEQUENCE_ID$");
77 sequenceURLLinks = new Vector();
81 StringTokenizer st = new StringTokenizer(string, "|");
82 while (st.hasMoreElements())
84 String name = st.nextToken();
85 String url = st.nextToken();
86 // check for '|' within a regex
87 int rxstart = url.indexOf("$SEQUENCE_ID$");
88 while (rxstart == -1 && url.indexOf("/=$") == -1)
90 url = url + "|" + st.nextToken();
92 sequenceURLLinks.addElement(name + "|" + url);
94 } catch (Exception ex)
96 System.out.println(ex + "\nError parsing sequence links");
99 // upgrade old SRS link
100 int srsPos = sequenceURLLinks
101 .indexOf("SRS|http://srs.ebi.ac.uk/srsbin/cgi-bin/wgetz?-newId+(([uniprot-all:$SEQUENCE_ID$]))+-view+SwissEntry");
106 "EMBL-EBI Search|http://www.ebi.ac.uk/ebisearch/search.ebi?db=allebi&query=$SEQUENCE_ID$",
112 * TODO: reformulate groupURL encoding so two or more can be stored in the
113 * .properties file as '|' separated strings
116 groupURLLinks = new Vector();
119 Vector nameLinks, urlLinks;
121 JInternalFrame frame;
123 DasSourceBrowser dasSource;
125 private WsPreferences wsPrefs;
128 * Creates a new Preferences object.
133 frame = new JInternalFrame();
134 frame.setContentPane(this);
135 dasSource = new DasSourceBrowser();
136 dasPanel.add(dasSource, BorderLayout.CENTER);
137 wsPrefs = new WsPreferences();
138 wsPanel.add(wsPrefs, BorderLayout.CENTER);
139 int width = 500, height = 420;
140 if (new jalview.util.Platform().isAMac())
146 Desktop.addInternalFrame(frame,
147 MessageManager.getString("label.preferences"), width, height);
148 frame.setMinimumSize(new Dimension(width, height));
150 seqLimit.setSelected(Cache.getDefault("SHOW_JVSUFFIX", true));
151 rightAlign.setSelected(Cache.getDefault("RIGHT_ALIGN_IDS", false));
152 fullScreen.setSelected(Cache.getDefault("SHOW_FULLSCREEN", false));
153 annotations.setSelected(Cache.getDefault("SHOW_ANNOTATIONS", true));
155 conservation.setSelected(Cache.getDefault("SHOW_CONSERVATION", true));
156 quality.setSelected(Cache.getDefault("SHOW_QUALITY", true));
157 identity.setSelected(Cache.getDefault("SHOW_IDENTITY", true));
158 openoverv.setSelected(Cache.getDefault("SHOW_OVERVIEW", false));
160 .setSelected(Cache.getDefault("SHOW_UNCONSERVED", false));
161 showNpTooltip.setSelected(Cache
162 .getDefault("SHOW_NPFEATS_TOOLTIP", true));
163 showDbRefTooltip.setSelected(Cache.getDefault("SHOW_DBREFS_TOOLTIP",
165 sortByTree.setSelected(Cache.getDefault("SORT_BY_TREE", false));
166 for (int i = ColourSchemeProperty.FIRST_COLOUR; i <= ColourSchemeProperty.LAST_COLOUR; i++)
168 colour.addItem(ColourSchemeProperty.getColourName(i));
171 String string = Cache.getDefault("DEFAULT_COLOUR", "None");
173 colour.setSelectedItem(string);
176 * default min-max colours for annotation shading
178 minColour.setBackground(Cache.getDefaultColour("ANNOTATIONCOLOUR_MIN",
180 maxColour.setBackground(Cache.getDefaultColour("ANNOTATIONCOLOUR_MAX",
183 String[] fonts = java.awt.GraphicsEnvironment
184 .getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
186 for (int i = 0; i < fonts.length; i++)
188 fontNameCB.addItem(fonts[i]);
191 for (int i = 1; i < 31; i++)
193 fontSizeCB.addItem(i + "");
196 fontStyleCB.addItem("plain");
197 fontStyleCB.addItem("bold");
198 fontStyleCB.addItem("italic");
200 fontNameCB.setSelectedItem(Cache.getDefault("FONT_NAME", "SansSerif"));
201 fontSizeCB.setSelectedItem(Cache.getDefault("FONT_SIZE", "10"));
202 fontStyleCB.setSelectedItem(Cache.getDefault("FONT_STYLE", Font.PLAIN
205 smoothFont.setSelected(Cache.getDefault("ANTI_ALIAS", false));
207 idItalics.setSelected(Cache.getDefault("ID_ITALICS", true));
209 wrap.setSelected(Cache.getDefault("WRAP_ALIGNMENT", false));
211 gapSymbolCB.addItem("-");
212 gapSymbolCB.addItem(".");
214 gapSymbolCB.setSelectedItem(Cache.getDefault("GAP_SYMBOL", "-"));
217 .setSelected(Cache.getDefault("SHOW_STARTUP_FILE", true));
218 startupFileTextfield.setText(Cache.getDefault("STARTUP_FILE",
219 Cache.getDefault("www.jalview.org", "http://www.jalview.org")
220 + "/examples/exampleFile_2_3.jar"));
222 sortby.addItem("No sort");
223 sortby.addItem("Id");
224 sortby.addItem("Pairwise Identity");
225 sortby.setSelectedItem(Cache.getDefault("SORT_ALIGNMENT", "No sort"));
227 sortAnnBy.addItem(SequenceAnnotationOrder.NONE.toString());
229 .addItem(SequenceAnnotationOrder.SEQUENCE_AND_LABEL.toString());
231 .addItem(SequenceAnnotationOrder.LABEL_AND_SEQUENCE.toString());
232 SequenceAnnotationOrder savedSort = SequenceAnnotationOrder
233 .valueOf(Cache.getDefault(Cache.SORT_ANNOTATIONS,
234 SequenceAnnotationOrder.NONE.name()));
235 sortAnnBy.setSelectedItem(savedSort.toString());
237 sortAutocalc.addItem("Autocalculated first");
238 sortAutocalc.addItem("Autocalculated last");
240 final boolean showAbove = Cache.getDefault(Cache.SHOW_AUTOCALC_ABOVE,
242 sortAutocalc.setSelectedItem(showAbove ? sortAutocalc.getItemAt(0)
243 : sortAutocalc.getItemAt(1));
245 epsRendering.addItem(MessageManager.getString("label.prompt_each_time"));
246 epsRendering.addItem(MessageManager.getString("label.lineart"));
247 epsRendering.addItem(MessageManager.getString("action.text"));
248 epsRendering.setSelectedIndex(0);
249 autoIdWidth.setSelected(Cache.getDefault("FIGURE_AUTOIDWIDTH", false));
250 userIdWidth.setEnabled(autoIdWidth.isSelected());
251 userIdWidthlabel.setEnabled(autoIdWidth.isSelected());
252 Integer wi = Cache.getIntegerProperty("FIGURE_USERIDWIDTH");
253 userIdWidth.setText(wi == null ? "" : wi.toString());
254 blcjv.setSelected(Cache.getDefault("BLC_JVSUFFIX", true));
255 clustaljv.setSelected(Cache.getDefault("CLUSTAL_JVSUFFIX", true));
256 fastajv.setSelected(Cache.getDefault("FASTA_JVSUFFIX", true));
257 msfjv.setSelected(Cache.getDefault("MSF_JVSUFFIX", true));
258 pfamjv.setSelected(Cache.getDefault("PFAM_JVSUFFIX", true));
259 pileupjv.setSelected(Cache.getDefault("PILEUP_JVSUFFIX", true));
260 pirjv.setSelected(Cache.getDefault("PIR_JVSUFFIX", true));
262 modellerOutput.setSelected(Cache.getDefault("PIR_MODELLER", false));
264 autoCalculateConsCheck.setSelected(Cache.getDefault(
265 "AUTO_CALC_CONSENSUS", true));
266 showGroupConsensus.setSelected(Cache.getDefault("SHOW_GROUP_CONSENSUS",
268 showGroupConservation.setSelected(Cache.getDefault(
269 "SHOW_GROUP_CONSERVATION", false));
270 showConsensHistogram.setSelected(Cache.getDefault(
271 "SHOW_CONSENSUS_HISTOGRAM", true));
272 showConsensLogo.setSelected(Cache.getDefault("SHOW_CONSENSUS_LOGO",
275 padGaps.setSelected(Cache.getDefault("PAD_GAPS", false));
277 /***************************************************************************
280 nameLinks = new Vector();
281 urlLinks = new Vector();
282 for (int i = 0; i < sequenceURLLinks.size(); i++)
284 String link = sequenceURLLinks.elementAt(i).toString();
285 nameLinks.addElement(link.substring(0, link.indexOf("|")));
286 urlLinks.addElement(link.substring(link.indexOf("|") + 1));
291 useProxy.setSelected(Cache.getDefault("USE_PROXY", false));
292 proxyServerTB.setEnabled(useProxy.isSelected());
293 proxyPortTB.setEnabled(useProxy.isSelected());
294 proxyServerTB.setText(Cache.getDefault("PROXY_SERVER", ""));
295 proxyPortTB.setText(Cache.getDefault("PROXY_PORT", ""));
297 defaultBrowser.setText(Cache.getDefault("DEFAULT_BROWSER", ""));
299 usagestats.setSelected(Cache.getDefault("USAGESTATS", false));
301 .setSelected(Cache.getProperty("NOQUESTIONNAIRES") == null); // note
304 versioncheck.setSelected(Cache.getDefault("VERSION_CHECK", true)); // default
307 annotations_actionPerformed(null); // update the display of the annotation
312 } catch (Exception ex)
314 ex.printStackTrace();
325 public void ok_actionPerformed(ActionEvent e)
328 Cache.applicationProperties.setProperty("SHOW_JVSUFFIX",
329 Boolean.toString(seqLimit.isSelected()));
330 Cache.applicationProperties.setProperty("RIGHT_ALIGN_IDS",
331 Boolean.toString(rightAlign.isSelected()));
332 Cache.applicationProperties.setProperty("SHOW_FULLSCREEN",
333 Boolean.toString(fullScreen.isSelected()));
334 Cache.applicationProperties.setProperty("SHOW_OVERVIEW",
335 Boolean.toString(openoverv.isSelected()));
336 Cache.applicationProperties.setProperty("SHOW_ANNOTATIONS",
337 Boolean.toString(annotations.isSelected()));
338 Cache.applicationProperties.setProperty("SHOW_CONSERVATION",
339 Boolean.toString(conservation.isSelected()));
340 Cache.applicationProperties.setProperty("SHOW_QUALITY",
341 Boolean.toString(quality.isSelected()));
342 Cache.applicationProperties.setProperty("SHOW_IDENTITY",
343 Boolean.toString(identity.isSelected()));
345 Cache.applicationProperties.setProperty("DEFAULT_COLOUR", colour
346 .getSelectedItem().toString());
347 Cache.applicationProperties.setProperty("GAP_SYMBOL", gapSymbolCB
348 .getSelectedItem().toString());
350 Cache.applicationProperties.setProperty("FONT_NAME", fontNameCB
351 .getSelectedItem().toString());
352 Cache.applicationProperties.setProperty("FONT_STYLE", fontStyleCB
353 .getSelectedItem().toString());
354 Cache.applicationProperties.setProperty("FONT_SIZE", fontSizeCB
355 .getSelectedItem().toString());
357 Cache.applicationProperties.setProperty("ID_ITALICS",
358 Boolean.toString(idItalics.isSelected()));
359 Cache.applicationProperties.setProperty("SHOW_UNCONSERVED",
360 Boolean.toString(showUnconserved.isSelected()));
361 Cache.applicationProperties.setProperty("SHOW_GROUP_CONSENSUS",
362 Boolean.toString(showGroupConsensus.isSelected()));
363 Cache.applicationProperties.setProperty("SHOW_GROUP_CONSERVATION",
364 Boolean.toString(showGroupConservation.isSelected()));
365 Cache.applicationProperties.setProperty("SHOW_CONSENSUS_HISTOGRAM",
366 Boolean.toString(showConsensHistogram.isSelected()));
367 Cache.applicationProperties.setProperty("SHOW_CONSENSUS_LOGO",
368 Boolean.toString(showConsensLogo.isSelected()));
369 Cache.applicationProperties.setProperty("ANTI_ALIAS",
370 Boolean.toString(smoothFont.isSelected()));
371 Cache.applicationProperties.setProperty("SHOW_NPFEATS_TOOLTIP",
372 Boolean.toString(showNpTooltip.isSelected()));
373 Cache.applicationProperties.setProperty("SHOW_DBREFS_TOOLTIP",
374 Boolean.toString(showDbRefTooltip.isSelected()));
376 Cache.applicationProperties.setProperty("WRAP_ALIGNMENT",
377 Boolean.toString(wrap.isSelected()));
379 Cache.applicationProperties.setProperty("STARTUP_FILE",
380 startupFileTextfield.getText());
381 Cache.applicationProperties.setProperty("SHOW_STARTUP_FILE",
382 Boolean.toString(startupCheckbox.isSelected()));
384 Cache.applicationProperties.setProperty("SORT_ALIGNMENT", sortby
385 .getSelectedItem().toString());
387 // convert description of sort order to enum name for save
388 SequenceAnnotationOrder annSortOrder = SequenceAnnotationOrder
389 .forDescription(sortAnnBy.getSelectedItem().toString());
390 if (annSortOrder != null)
392 Cache.applicationProperties.setProperty(Cache.SORT_ANNOTATIONS,
393 annSortOrder.name());
396 final boolean showAutocalcFirst = sortAutocalc.getSelectedIndex() == 0;
397 Cache.applicationProperties.setProperty(Cache.SHOW_AUTOCALC_ABOVE,
398 Boolean.valueOf(showAutocalcFirst).toString());
400 Cache.setColourProperty("ANNOTATIONCOLOUR_MIN",
401 minColour.getBackground());
402 Cache.setColourProperty("ANNOTATIONCOLOUR_MAX",
403 maxColour.getBackground());
405 if (epsRendering.getSelectedItem().equals("Prompt each time"))
407 Cache.applicationProperties.remove("EPS_RENDERING");
411 Cache.applicationProperties.setProperty("EPS_RENDERING", epsRendering
412 .getSelectedItem().toString());
415 if (defaultBrowser.getText().trim().length() < 1)
417 Cache.applicationProperties.remove("DEFAULT_BROWSER");
421 Cache.applicationProperties.setProperty("DEFAULT_BROWSER",
422 defaultBrowser.getText());
425 jalview.util.BrowserLauncher.resetBrowser();
427 if (nameLinks.size() > 0)
429 StringBuffer links = new StringBuffer();
430 sequenceURLLinks = new Vector();
431 for (int i = 0; i < nameLinks.size(); i++)
433 sequenceURLLinks.addElement(nameLinks.elementAt(i) + "|"
434 + urlLinks.elementAt(i));
435 links.append(sequenceURLLinks.elementAt(i).toString());
439 links.setLength(links.length() - 1);
440 Cache.applicationProperties.setProperty("SEQUENCE_LINKS",
445 Cache.applicationProperties.remove("SEQUENCE_LINKS");
448 Cache.applicationProperties.setProperty("USE_PROXY",
449 Boolean.toString(useProxy.isSelected()));
451 if (proxyServerTB.getText().trim().length() < 1)
453 Cache.applicationProperties.remove("PROXY_SERVER");
457 Cache.applicationProperties.setProperty("PROXY_SERVER",
458 proxyServerTB.getText());
461 if (proxyPortTB.getText().trim().length() < 1)
463 Cache.applicationProperties.remove("PROXY_PORT");
467 Cache.applicationProperties.setProperty("PROXY_PORT",
468 proxyPortTB.getText());
471 if (useProxy.isSelected())
473 System.setProperty("http.proxyHost", proxyServerTB.getText());
474 System.setProperty("http.proxyPort", proxyPortTB.getText());
478 System.setProperty("http.proxyHost", "");
479 System.setProperty("http.proxyPort", "");
481 Cache.setProperty("VERSION_CHECK",
482 Boolean.toString(versioncheck.isSelected()));
483 if (Cache.getProperty("USAGESTATS") != null || usagestats.isSelected())
485 // default is false - we only set this if the user has actively agreed
486 Cache.setProperty("USAGESTATS",
487 Boolean.toString(usagestats.isSelected()));
489 if (!questionnaire.isSelected())
491 Cache.setProperty("NOQUESTIONNAIRES", "true");
495 // special - made easy to edit a property file to disable questionnaires
496 // by just adding the given line
497 Cache.removeProperty("NOQUESTIONNAIRES");
499 Cache.applicationProperties.setProperty("BLC_JVSUFFIX",
500 Boolean.toString(blcjv.isSelected()));
501 Cache.applicationProperties.setProperty("CLUSTAL_JVSUFFIX",
502 Boolean.toString(clustaljv.isSelected()));
503 Cache.applicationProperties.setProperty("FASTA_JVSUFFIX",
504 Boolean.toString(fastajv.isSelected()));
505 Cache.applicationProperties.setProperty("MSF_JVSUFFIX",
506 Boolean.toString(msfjv.isSelected()));
507 Cache.applicationProperties.setProperty("PFAM_JVSUFFIX",
508 Boolean.toString(pfamjv.isSelected()));
509 Cache.applicationProperties.setProperty("PILEUP_JVSUFFIX",
510 Boolean.toString(pileupjv.isSelected()));
511 Cache.applicationProperties.setProperty("PIR_JVSUFFIX",
512 Boolean.toString(pirjv.isSelected()));
513 Cache.applicationProperties.setProperty("PIR_MODELLER",
514 Boolean.toString(modellerOutput.isSelected()));
515 jalview.io.PIRFile.useModellerOutput = modellerOutput.isSelected();
517 Cache.applicationProperties.setProperty("FIGURE_AUTOIDWIDTH",
518 Boolean.toString(autoIdWidth.isSelected()));
519 userIdWidth_actionPerformed();
520 Cache.applicationProperties.setProperty("FIGURE_USERIDWIDTH",
521 userIdWidth.getText());
523 Cache.applicationProperties.setProperty("AUTO_CALC_CONSENSUS",
524 Boolean.toString(autoCalculateConsCheck.isSelected()));
525 Cache.applicationProperties.setProperty("SORT_BY_TREE",
526 Boolean.toString(sortByTree.isSelected()));
527 Cache.applicationProperties.setProperty("PAD_GAPS",
528 Boolean.toString(padGaps.isSelected()));
530 dasSource.saveProperties(Cache.applicationProperties);
531 wsPrefs.updateAndRefreshWsMenuConfig(false);
532 Cache.saveProperties();
535 frame.setClosed(true);
536 } catch (Exception ex)
544 public void startupFileTextfield_mouseClicked()
546 JalviewFileChooser chooser = new JalviewFileChooser(
547 jalview.bin.Cache.getProperty("LAST_DIRECTORY"),
549 { "fa, fasta, fastq", "aln", "pfam", "msf", "pir", "blc", "jar" },
551 { "Fasta", "Clustal", "PFAM", "MSF", "PIR", "BLC", "Jalview" },
552 jalview.bin.Cache.getProperty("DEFAULT_FILE_FORMAT"));
553 chooser.setFileView(new JalviewFileView());
554 chooser.setDialogTitle(MessageManager.getString("label.select_startup_file"));
556 int value = chooser.showOpenDialog(this);
558 if (value == JalviewFileChooser.APPROVE_OPTION)
560 jalview.bin.Cache.applicationProperties.setProperty(
561 "DEFAULT_FILE_FORMAT", chooser.getSelectedFormat());
562 startupFileTextfield.setText(chooser.getSelectedFile()
573 public void cancel_actionPerformed(ActionEvent e)
577 wsPrefs.updateWsMenuConfig(true);
578 wsPrefs.refreshWs_actionPerformed(e);
579 frame.setClosed(true);
580 } catch (Exception ex)
591 public void annotations_actionPerformed(ActionEvent e)
593 conservation.setEnabled(annotations.isSelected());
594 quality.setEnabled(annotations.isSelected());
595 identity.setEnabled(annotations.isSelected());
596 showGroupConsensus.setEnabled(annotations.isSelected());
597 showGroupConservation.setEnabled(annotations.isSelected());
598 showConsensHistogram.setEnabled(annotations.isSelected()
599 && (identity.isSelected() || showGroupConsensus.isSelected()));
600 showConsensLogo.setEnabled(annotations.isSelected()
601 && (identity.isSelected() || showGroupConsensus.isSelected()));
604 public void newLink_actionPerformed(ActionEvent e)
607 GSequenceLink link = new GSequenceLink();
608 boolean valid = false;
611 if (JOptionPane.showInternalConfirmDialog(Desktop.desktop, link,
612 MessageManager.getString("label.new_sequence_url_link"),
613 JOptionPane.OK_CANCEL_OPTION, -1, null) == JOptionPane.OK_OPTION)
615 if (link.checkValid())
617 nameLinks.addElement(link.getName());
618 urlLinks.addElement(link.getURL());
630 public void editLink_actionPerformed(ActionEvent e)
632 GSequenceLink link = new GSequenceLink();
634 int index = linkNameList.getSelectedIndex();
637 JOptionPane.showInternalMessageDialog(Desktop.desktop,
638 MessageManager.getString("label.no_link_selected"),
639 MessageManager.getString("label.no_link_selected"),
640 JOptionPane.WARNING_MESSAGE);
644 link.setName(nameLinks.elementAt(index).toString());
645 link.setURL(urlLinks.elementAt(index).toString());
647 boolean valid = false;
651 if (JOptionPane.showInternalConfirmDialog(Desktop.desktop, link,
652 MessageManager.getString("label.new_sequence_url_link"),
653 JOptionPane.OK_CANCEL_OPTION, -1, null) == JOptionPane.OK_OPTION)
655 if (link.checkValid())
657 nameLinks.setElementAt(link.getName(), index);
658 urlLinks.setElementAt(link.getURL(), index);
671 public void deleteLink_actionPerformed(ActionEvent e)
673 int index = linkNameList.getSelectedIndex();
676 JOptionPane.showInternalMessageDialog(Desktop.desktop,
677 MessageManager.getString("label.no_link_selected"),
678 MessageManager.getString("label.no_link_selected"),
679 JOptionPane.WARNING_MESSAGE);
682 nameLinks.removeElementAt(index);
683 urlLinks.removeElementAt(index);
687 void updateLinkData()
689 linkNameList.setListData(nameLinks);
690 linkURLList.setListData(urlLinks);
693 public void defaultBrowser_mouseClicked(MouseEvent e)
695 JFileChooser chooser = new JFileChooser(".");
696 chooser.setDialogTitle(MessageManager.getString("label.select_default_browser"));
698 int value = chooser.showOpenDialog(this);
700 if (value == JFileChooser.APPROVE_OPTION)
702 defaultBrowser.setText(chooser.getSelectedFile().getAbsolutePath());
711 * jalview.jbgui.GPreferences#showunconserved_actionPerformed(java.awt.event
714 protected void showunconserved_actionPerformed(ActionEvent e)
716 // TODO Auto-generated method stub
717 super.showunconserved_actionPerformed(e);
720 private void jbInit() throws Exception
724 public static Collection getGroupURLLinks()
726 return groupURLLinks;
729 public void minColour_actionPerformed()
731 Color col = JColorChooser.showDialog(this,
732 MessageManager.getString("label.select_colour_minimum_value"), minColour.getBackground());
735 minColour.setBackground(col);
740 public void maxColour_actionPerformed()
742 Color col = JColorChooser.showDialog(this,
743 MessageManager.getString("label.select_colour_maximum_value"), maxColour.getBackground());
746 maxColour.setBackground(col);
752 protected void userIdWidth_actionPerformed()
756 String val = userIdWidth.getText().trim();
757 if (val.length() > 0)
759 Integer iw = Integer.parseInt(val);
760 if (iw.intValue() < 12)
762 throw new NumberFormatException();
764 userIdWidth.setText(iw.toString());
766 } catch (NumberFormatException x)
769 .showInternalMessageDialog(
771 MessageManager.getString("warn.user_defined_width_requirements"),
772 MessageManager.getString("label.invalid_id_column_width"),
773 JOptionPane.WARNING_MESSAGE);
774 userIdWidth.setText("");
779 protected void autoIdWidth_actionPerformed()
781 userIdWidth.setEnabled(!autoIdWidth.isSelected());
782 userIdWidthlabel.setEnabled(!autoIdWidth.isSelected());