OptionsDialog.java
001 /*
002  *  Copyright (c) 1995-2012, The University of Sheffield. See the file
003  *  COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
004  *
005  *  This file is part of GATE (see http://gate.ac.uk/), and is free
006  *  software, licenced under the GNU Library General Public License,
007  *  Version 2, June 1991 (in the distribution as file licence.html,
008  *  and also available at http://gate.ac.uk/gate/licence.html).
009  *
010  *  Valentin Tablan 15/11/2001
011  *
012  *  $Id: OptionsDialog.java 18852 2015-08-05 05:10:24Z markagreenwood $
013  *
014  */
015 package gate.gui;
016 
017 import gate.Gate;
018 import gate.GateConstants;
019 import gate.swing.JFontChooser;
020 import gate.util.GateRuntimeException;
021 import gate.util.OptionsMap;
022 
023 import java.awt.Component;
024 import java.awt.Font;
025 import java.awt.Frame;
026 import java.awt.event.ActionEvent;
027 import java.awt.event.ActionListener;
028 import java.beans.PropertyChangeEvent;
029 import java.beans.PropertyChangeListener;
030 import java.util.ArrayList;
031 import java.util.Iterator;
032 import java.util.List;
033 
034 import javax.swing.AbstractAction;
035 import javax.swing.ActionMap;
036 import javax.swing.BorderFactory;
037 import javax.swing.Box;
038 import javax.swing.BoxLayout;
039 import javax.swing.ButtonGroup;
040 import javax.swing.InputMap;
041 import javax.swing.JButton;
042 import javax.swing.JCheckBox;
043 import javax.swing.JComboBox;
044 import javax.swing.JComponent;
045 import javax.swing.JDialog;
046 import javax.swing.JFrame;
047 import javax.swing.JPanel;
048 import javax.swing.JRadioButton;
049 import javax.swing.JTabbedPane;
050 import javax.swing.JTextField;
051 import javax.swing.KeyStroke;
052 import javax.swing.LookAndFeel;
053 import javax.swing.SwingUtilities;
054 import javax.swing.UIManager;
055 import javax.swing.plaf.FontUIResource;
056 
057 /**
058  * The options dialog for Gate.
059  */
060 @SuppressWarnings("serial")
061 public class OptionsDialog extends JDialog {
062   public OptionsDialog(Frame owner){
063     super(owner, "GATE Options"true);
064     MainFrame.getGuiRoots().add(this);
065   }
066 
067   protected void initLocalData(){
068     lookAndFeelClassName = userConfig.getString(GateConstants.LOOK_AND_FEEL);
069     textComponentsFont = userConfig.getFont(GateConstants.TEXT_COMPONENTS_FONT);
070     menusFont = userConfig.getFont(GateConstants.MENUS_FONT);
071     componentsFont = userConfig.getFont(GateConstants.OTHER_COMPONENTS_FONT);
072     dirtyGUI = false;
073   }
074 
075 
076   protected void initGuiComponents(){
077     getContentPane().removeAll();
078     mainTabbedPane = new JTabbedPane(JTabbedPane.TOP);
079     getContentPane().setLayout(new BoxLayout(getContentPane(),
080                                              BoxLayout.Y_AXIS));
081     getContentPane().add(mainTabbedPane);
082     Box vBox;
083     Box hBox;
084     Box hBox2;
085 
086     /*******************
087      * Appearance pane *
088      *******************/
089 
090     //the LNF combo
091     List<LNFData> supportedLNFs = new ArrayList<LNFData>();
092     LNFData currentLNF = null;
093     UIManager.LookAndFeelInfo[] lnfs = UIManager.getInstalledLookAndFeels();
094     for (UIManager.LookAndFeelInfo lnf : lnfs) {
095       try {
096         Class<?> lnfClass = Class.forName(lnf.getClassName());
097         if (((LookAndFeel) (lnfClass.newInstance())).isSupportedLookAndFeel()) {
098           if (lnf.getName().equals(UIManager.getLookAndFeel().getName())) {
099             supportedLNFs.add(currentLNF =
100               new LNFData(lnf.getClassName(), lnf.getName()));
101           else {
102             supportedLNFs.add(new LNFData(lnf.getClassName(), lnf.getName()));
103           }
104         }
105       catch (Exception e) {
106         e.printStackTrace();
107       }
108     }
109     lnfCombo = new JComboBox<LNFData>(supportedLNFs.toArray(new LNFData[supportedLNFs.size()]));
110     lnfCombo.setSelectedItem(currentLNF);
111     lnfCombo.setToolTipText("Be aware that only 'Metal' is fully tested.");
112 
113     fontBG = new ButtonGroup();
114     textBtn = new JRadioButton("Text components font");
115     textBtn.setActionCommand("text");
116     fontBG.add(textBtn);
117     menuBtn = new JRadioButton("Menu components font");
118     menuBtn.setActionCommand("menu");
119     fontBG.add(menuBtn);
120     otherCompsBtn = new JRadioButton("Other components font");
121     otherCompsBtn.setActionCommand("other");
122     fontBG.add(otherCompsBtn);
123 
124     JPanel appearanceBox = new JPanel();
125     appearanceBox.setLayout(new BoxLayout(appearanceBox, BoxLayout.Y_AXIS));
126     appearanceBox.setBorder(BorderFactory.createEmptyBorder(5555));
127 
128     appearanceBox.add(Box.createVerticalStrut(5));
129 
130     vBox = Box.createVerticalBox();
131     vBox.setBackground(getContentPane().getBackground());
132     vBox.setBorder(BorderFactory.createTitledBorder(" Look and Feel "));
133     vBox.add(Box.createVerticalStrut(5));
134       hBox = Box.createHorizontalBox();
135       hBox.add(Box.createHorizontalStrut(5));
136       hBox.add(lnfCombo);
137       hBox.add(Box.createHorizontalStrut(5));
138     vBox.add(hBox);
139     vBox.add(Box.createVerticalStrut(5));
140     appearanceBox.add(vBox);
141 
142     appearanceBox.add(Box.createVerticalStrut(5));
143 
144     hBox = Box.createHorizontalBox();
145     hBox.setBorder(BorderFactory.createTitledBorder(" Font options "));
146     hBox.add(Box.createHorizontalStrut(5));
147       vBox = Box.createVerticalBox();
148       vBox.add(textBtn);
149       vBox.add(Box.createVerticalStrut(5));
150       vBox.add(menuBtn);
151       vBox.add(Box.createVerticalStrut(5));
152       vBox.add(otherCompsBtn);
153       vBox.add(Box.createVerticalStrut(5));
154       vBox.add(Box.createVerticalGlue());
155     hBox.add(Box.createHorizontalStrut(5));
156     hBox.add(vBox);
157     fontChooser = new JFontChooser();
158     hBox.add(fontChooser);
159     hBox.add(Box.createHorizontalStrut(5));
160 
161     appearanceBox.add(hBox);
162 
163     mainTabbedPane.add("Appearance", appearanceBox);
164 
165     /*****************
166      * Advanced pane *
167      *****************/
168 
169     saveOptionsChk = new JCheckBox("Save options on exit",
170       userConfig.getBoolean(GateConstants.SAVE_OPTIONS_ON_EXIT));
171     saveOptionsChk.setToolTipText(
172       "Remembers the options set in this dialogue.");
173 
174     saveSessionChk = new JCheckBox("Save session on exit",
175       userConfig.getBoolean(GateConstants.SAVE_SESSION_ON_EXIT));
176     saveSessionChk.setToolTipText(
177       "Reloads the same resources in the tree on next start.");
178 
179     includeFeaturesOnPreserveFormatChk = new JCheckBox(
180       "Include annotation features for \"Save preserving format\"",
181       userConfig.getBoolean(
182         GateConstants.SAVE_FEATURES_WHEN_PRESERVING_FORMAT));
183 
184     addSpaceOnMarkupUnpackChk = new JCheckBox(
185       "Add space on markup unpack if needed"true);
186     addSpaceOnMarkupUnpackChk.setToolTipText(
187       "Adds a space instead of concatenate words separated by a XML tag");
188     if ( (userConfig.get(GateConstants
189       .DOCUMENT_ADD_SPACE_ON_UNPACK_FEATURE_NAME!= null)
190       && !userConfig.getBoolean(GateConstants
191       .DOCUMENT_ADD_SPACE_ON_UNPACK_FEATURE_NAME) )
192       addSpaceOnMarkupUnpackChk.setSelected(false);
193 
194     browserComboBox = new JComboBox<String>(new String[] {
195       "Default browser""Java""Custom"});
196     browserComboBox.setPrototypeDisplayValue("Default browser");
197     browserComboBox.setToolTipText(
198       "Use Java or Custom only if Default doesn't work.");
199     browserCommandLineTextField = new JTextField(15);
200     String commandLine =
201       userConfig.getString(MainFrame.class.getName()+".browsercommandline");
202     if(commandLine == null || commandLine.trim().length() == 0
203     || commandLine.equals("Set dynamically when you display help.")) {
204       // option not configured or empty or default browser
205       browserComboBox.setSelectedItem("Default browser");
206       browserCommandLineTextField.setEnabled(false);
207     }
208     else if(commandLine.equals("Internal Java browser.")) {
209       browserComboBox.setSelectedItem("Java");
210       browserCommandLineTextField.setEnabled(false);
211     }
212     else {
213       browserComboBox.setSelectedItem("Custom");
214     }
215     browserCommandLineTextField.setText((commandLine == null)?"":commandLine);
216 
217     treeSelectViewChk = new JCheckBox("Tree select view",
218       userConfig.getBoolean(MainFrame.class.getName()+".treeselectview"));
219     treeSelectViewChk.setToolTipText(
220       "Selection in left resources tree select the main view");
221 
222     viewSelectTreeChk = new JCheckBox("View select in tree",
223       userConfig.getBoolean(MainFrame.class.getName()+".viewselecttree"));
224     viewSelectTreeChk.setToolTipText(
225       "Selection of the main view select item in left resources tree");
226 
227     JPanel advancedBox =  new JPanel();
228     advancedBox.setLayout(new BoxLayout(advancedBox, BoxLayout.Y_AXIS));
229     advancedBox.setBorder(BorderFactory.createEmptyBorder(5555));
230 
231     advancedBox.add(Box.createVerticalStrut(5));
232 
233     hBox = Box.createHorizontalBox();
234     hBox.setBorder(BorderFactory.createTitledBorder(" Advanced features "));
235     hBox.add(Box.createHorizontalStrut(5));
236       vBox = Box.createVerticalBox();
237       vBox.add(includeFeaturesOnPreserveFormatChk);
238       vBox.add(Box.createVerticalStrut(5));
239       vBox.add(addSpaceOnMarkupUnpackChk);
240       vBox.add(Box.createVerticalStrut(5));
241     hBox.add(vBox);
242     hBox.add(Box.createHorizontalStrut(5));
243     hBox.add(Box.createHorizontalGlue());
244     advancedBox.add(hBox);
245 
246     advancedBox.add(Box.createVerticalStrut(5));
247 
248     hBox = Box.createHorizontalBox();
249     hBox.setBorder(BorderFactory.createTitledBorder(" Session persistence "));
250     hBox.add(Box.createHorizontalStrut(5));
251       hBox2 = Box.createHorizontalBox();
252       hBox2.add(saveOptionsChk);
253       hBox2.add(Box.createVerticalStrut(5));
254       hBox2.add(saveSessionChk);
255       hBox2.add(Box.createVerticalStrut(5));
256     hBox.add(hBox2);
257     hBox.add(Box.createHorizontalStrut(5));
258     hBox.add(Box.createHorizontalGlue());
259     advancedBox.add(hBox);
260 
261     advancedBox.add(Box.createVerticalStrut(5));
262 
263     hBox = Box.createHorizontalBox();
264     hBox.setBorder(BorderFactory.createTitledBorder(" Help browser "));
265     hBox.add(Box.createHorizontalStrut(5));
266       vBox = Box.createVerticalBox();
267       vBox.add(browserComboBox);
268       vBox.add(Box.createVerticalStrut(5));
269       vBox.add(browserCommandLineTextField);
270       vBox.add(Box.createVerticalStrut(5));
271     hBox.add(vBox);
272     hBox.add(Box.createHorizontalStrut(5));
273     advancedBox.add(hBox);
274 
275     hBox = Box.createHorizontalBox();
276     hBox.setBorder(BorderFactory.createTitledBorder(
277       " Link resources tree selection and the main view "));
278     hBox.add(Box.createHorizontalStrut(5));
279       hBox2 = Box.createHorizontalBox();
280       hBox2.add(treeSelectViewChk);
281       hBox2.add(Box.createVerticalStrut(5));
282       hBox2.add(viewSelectTreeChk);
283       hBox2.add(Box.createVerticalStrut(5));
284     hBox.add(hBox2);
285     hBox.add(Box.createHorizontalStrut(5));
286     hBox.add(Box.createHorizontalGlue());
287     advancedBox.add(hBox);
288 
289     mainTabbedPane.add("Advanced", advancedBox);
290 
291     /******************
292      * Dialog buttons *
293      ******************/
294 
295     Box buttonsBox = Box.createHorizontalBox();
296     okButton = new JButton(new OKAction());
297     buttonsBox.add(okButton);
298     buttonsBox.add(Box.createHorizontalStrut(10));
299     buttonsBox.add(cancelButton = new JButton(new CancelAction()));
300 
301     getContentPane().add(Box.createVerticalStrut(10));
302     getContentPane().add(buttonsBox);
303     getContentPane().add(Box.createVerticalStrut(10));
304 
305     getRootPane().setDefaultButton(okButton);
306   }
307 
308   protected void initListeners(){
309     lnfCombo.addActionListener(new ActionListener() {
310       @Override
311       public void actionPerformed(ActionEvent e) {
312         if(!lookAndFeelClassName.equals(
313            ((LNFData)lnfCombo.getSelectedItem()).className)
314           ){
315           dirtyGUI = true;
316           lookAndFeelClassName = ((LNFData)lnfCombo.getSelectedItem()).
317                                  className;
318         }
319       }
320     });
321 
322     fontChooser.addPropertyChangeListener(new PropertyChangeListener() {
323       @Override
324       public void propertyChange(PropertyChangeEvent e) {
325         if(e.getPropertyName().equals("fontValue")){
326           String selectedFont = fontBG.getSelection().getActionCommand();
327           if(selectedFont.equals("text")){
328             textComponentsFont = (Font)e.getNewValue();
329             dirtyGUI = true;
330           }else if(selectedFont.equals("menu")){
331             menusFont = (Font)e.getNewValue();
332             dirtyGUI = true;
333           }else if(selectedFont.equals("other")){
334             componentsFont = (Font)e.getNewValue();
335             dirtyGUI = true;
336           }
337         }
338       }
339     });
340 
341     textBtn.addActionListener(new ActionListener() {
342       @Override
343       public void actionPerformed(ActionEvent e) {
344         if(textBtn.isSelected()) selectedFontChanged();
345         selectedFontBtn = "text";
346         fontChooser.setFontValue(textComponentsFont);
347       }
348     });
349 
350     menuBtn.addActionListener(new ActionListener() {
351       @Override
352       public void actionPerformed(ActionEvent e) {
353         if(menuBtn.isSelected()) selectedFontChanged();
354         selectedFontBtn = "menu";
355         fontChooser.setFontValue(menusFont);
356       }
357     });
358 
359     otherCompsBtn.addActionListener(new ActionListener() {
360       @Override
361       public void actionPerformed(ActionEvent e) {
362         if(otherCompsBtn.isSelected()) selectedFontChanged();
363         selectedFontBtn = "other";
364         fontChooser.setFontValue(componentsFont);
365       }
366     });
367 
368     textBtn.setSelected(true);
369 
370     browserComboBox.addActionListener(new ActionListener() {
371       @Override
372       public void actionPerformed(ActionEvent e) {
373         if(browserComboBox.getSelectedItem() == null) {
374           return;
375         }
376         String item = (String)browserComboBox.getSelectedItem();
377         browserCommandLineTextField.setEnabled(item.equals("Custom"));
378         if(item.equals("Default browser")) {
379           browserCommandLineTextField.setText(
380             "Set dynamically when you display help.");
381         }
382         else if(item.equals("Java")) {
383           browserCommandLineTextField.setText("Internal Java browser.");
384         }
385         else if(item.equals("Custom")) {
386           browserCommandLineTextField.setText("firefox %file");
387         }
388       }
389     });
390 
391     // define keystrokes action bindings at the level of the main window
392     InputMap inputMap = ((JComponent)this.getContentPane())
393       .getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
394     ActionMap actionMap = ((JComponent)this.getContentPane()).getActionMap();
395     inputMap.put(KeyStroke.getKeyStroke("ENTER")"Apply");
396     actionMap.put("Apply"new OKAction());
397     inputMap.put(KeyStroke.getKeyStroke("ESCAPE")"Cancel");
398     actionMap.put("Cancel"new CancelAction());
399   }
400 
401   protected void selectedFontChanged(){
402     if(selectedFontBtn != null){
403       //save the old font
404       if(selectedFontBtn.equals("text")){
405         textComponentsFont = fontChooser.getFontValue();
406       }else if(selectedFontBtn.equals("menu")){
407         menusFont = fontChooser.getFontValue();
408       }else if(selectedFontBtn.equals("other")){
409         componentsFont = fontChooser.getFontValue();
410       }
411     }
412   }
413 
414   public void showDialog(){
415     initLocalData();
416     initGuiComponents();
417     initListeners();
418     textBtn.doClick();
419     
420     pack();
421     setLocationRelativeTo(getOwner());
422     setVisible(true);
423     selectedFontBtn = null;
424   }
425 
426   public static void main(String args[]){
427     try{
428       UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
429     }catch(Exception e){
430       e.printStackTrace();
431     }
432     final JFrame frame = new JFrame("Foo frame");
433     frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
434     JButton btn = new JButton("Show dialog");
435     btn.addActionListener(new ActionListener() {
436       @Override
437       public void actionPerformed(ActionEvent e) {
438         OptionsDialog dialog = new OptionsDialog(frame);
439         dialog.pack();
440         dialog.showDialog();
441       }
442     });
443     frame.getContentPane().add(btn);
444     frame.pack();
445     frame.setVisible(true);
446     System.out.println("Font: " + UIManager.getFont("Button.font"));
447   }// main
448 
449 
450   protected static void setUIDefaults(Object[] keys, Object value) {
451     for(int i = 0; i < keys.length; i++){
452       UIManager.put(keys[i], value);
453     }
454   }// setUIDefaults(Object[] keys, Object value)
455 
456   /**
457    * Updates the Swing defaults table with the provided font to be used for the
458    * text components
459    */
460   public static void setTextComponentsFont(Font font){
461     setUIDefaults(textComponentsKeys, new FontUIResource(font));
462     userConfig.put(GateConstants.TEXT_COMPONENTS_FONT, font);
463   }
464 
465   /**
466    * Updates the Swing defaults table with the provided font to be used for the
467    * menu components
468    */
469   public static void setMenuComponentsFont(Font font){
470     setUIDefaults(menuKeys, new FontUIResource(font));
471     userConfig.put(GateConstants.MENUS_FONT, font);
472   }
473 
474   /**
475    * Updates the Swing defaults table with the provided font to be used for
476    * various compoents that neither text or menu components
477    */
478   public static void setComponentsFont(Font font){
479     setUIDefaults(componentsKeys, new FontUIResource(font));
480     userConfig.put(GateConstants.OTHER_COMPONENTS_FONT, font);
481   }
482 
483   class OKAction extends AbstractAction{
484     OKAction(){
485       super("OK");
486     }
487 
488     @Override
489     public void actionPerformed(ActionEvent evt) {
490       if(dirtyGUI){
491         setMenuComponentsFont(menusFont);
492         setComponentsFont(componentsFont);
493         setTextComponentsFont(textComponentsFont);
494         userConfig.put(GateConstants.LOOK_AND_FEEL, lookAndFeelClassName);
495         try{
496           UIManager.setLookAndFeel(lookAndFeelClassName);
497         }catch(Exception e){
498           throw new GateRuntimeException(
499                   "Error while setting the look and feel", e);
500         }
501         Iterator<Component> rootsIter = MainFrame.getGuiRoots().iterator();
502         while(rootsIter.hasNext()){
503           try{
504             SwingUtilities.updateComponentTreeUI(rootsIter.next());
505           }catch(Exception e){
506             throw new GateRuntimeException(
507                     "Error while updating the graphical interface", e);
508           }            
509         }
510       }
511 
512       userConfig.put(GateConstants.SAVE_OPTIONS_ON_EXIT,
513         saveOptionsChk.isSelected());
514       userConfig.put(GateConstants.SAVE_SESSION_ON_EXIT,
515         saveSessionChk.isSelected());
516       userConfig.put(GateConstants.SAVE_FEATURES_WHEN_PRESERVING_FORMAT,
517         includeFeaturesOnPreserveFormatChk.isSelected());
518       userConfig.put(GateConstants.DOCUMENT_ADD_SPACE_ON_UNPACK_FEATURE_NAME,
519         addSpaceOnMarkupUnpackChk.isSelected());
520       userConfig.put(MainFrame.class.getName()+".browsercommandline",
521         browserCommandLineTextField.getText());
522       userConfig.put(MainFrame.class.getName()+".treeselectview",
523         treeSelectViewChk.isSelected());
524       userConfig.put(MainFrame.class.getName()+".viewselecttree",
525         viewSelectTreeChk.isSelected());
526       setVisible(false);
527     }// void actionPerformed(ActionEvent evt)
528   }
529 
530   protected class CancelAction extends AbstractAction {
531     public CancelAction(){
532       super("Cancel");
533     }
534     @Override
535     public void actionPerformed(ActionEvent evt){
536       setVisible(false);
537     }
538   }
539 
540   protected static class LNFData{
541     public LNFData(String className, String name){
542       this.className = className;
543       this.name = name;
544     }
545 
546     @Override
547     public String toString(){
548       return name;
549     }
550 
551     String className;
552     String name;
553   }
554 
555 
556   public static String[] menuKeys = new String[]{"CheckBoxMenuItem.acceleratorFont",
557                                           "CheckBoxMenuItem.font",
558                                           "Menu.acceleratorFont",
559                                           "Menu.font",
560                                           "MenuBar.font",
561                                           "MenuItem.acceleratorFont",
562                                           "MenuItem.font",
563                                           "RadioButtonMenuItem.acceleratorFont",
564                                           "RadioButtonMenuItem.font"};
565 
566   public static String[] componentsKeys =
567                              new String[]{"Button.font",
568                                           "CheckBox.font",
569                                           "ColorChooser.font",
570                                           "ComboBox.font",
571                                           "InternalFrame.titleFont",
572                                           "Label.font",
573                                           "List.font",
574                                           "OptionPane.font",
575                                           "Panel.font",
576                                           "PasswordField.font",
577                                           "PopupMenu.font",
578                                           "ProgressBar.font",
579                                           "RadioButton.font",
580                                           "ScrollPane.font",
581                                           "TabbedPane.font",
582                                           "Table.font",
583                                           "TableHeader.font",
584                                           "TextField.font",
585                                           "TitledBorder.font",
586                                           "ToggleButton.font",
587                                           "ToolBar.font",
588                                           "ToolTip.font",
589                                           "Tree.font",
590                                           "Viewport.font"};
591 
592   public static String[] textComponentsKeys =
593                              new String[]{"EditorPane.font",
594                                           "TextArea.font",
595                                           "TextPane.font"};
596 
597   /**
598    * The main tabbed pane
599    */
600   protected JTabbedPane mainTabbedPane;
601 
602   /**
603    * Radio button used to set the font for text components
604    */
605   protected JRadioButton textBtn;
606   
607   /**
608    * The OK button for the dialog. It's set as protected so it can be accessed
609    * by subclasses in other projects.
610    */
611   protected JButton okButton;
612   
613   /**
614    * The Cancel button for the dialog. It's set as protected so it can be 
615    * accessed by subclasses in other projects.
616    */
617   protected JButton cancelButton;
618 
619   /**
620    * which text is currently being edited; values are: "text", "menu", "other"
621    */
622   protected String selectedFontBtn = null;
623 
624   /**
625    * Radio button used to set the font for menu components
626    */
627   protected JRadioButton menuBtn;
628 
629   /**
630    * Radio button used to set the font for other components
631    */
632   protected JRadioButton otherCompsBtn;
633 
634   /**
635    * Button group for the font setting radio buttons
636    */
637   protected ButtonGroup fontBG;
638 
639   /**
640    * The font chooser used for selecting fonts
641    */
642   protected JFontChooser fontChooser;
643 
644   /**
645    * The "Save Options on close" checkbox
646    */
647   protected JCheckBox saveOptionsChk;
648 
649   /**
650    * The "Save Session on close" checkbox
651    */
652   protected JCheckBox saveSessionChk;
653 
654   /**
655    * The "Include Annotation Features in Save Preserving Format" checkbox
656    */
657   protected JCheckBox includeFeaturesOnPreserveFormatChk;
658 
659   /**
660    * The "Add extra space markup unpack if needed" checkbox
661    */
662   protected JCheckBox addSpaceOnMarkupUnpackChk;
663 
664   /**
665    * The name of the look and feel class
666    */
667   protected String lookAndFeelClassName;
668 
669   /**
670    * The font to be used for the menus; cached value for the one in the user
671    * config map.
672    */
673   protected Font menusFont;
674 
675   /**
676    * The font to be used for text components; cached value for the one in the
677    * user config map.
678    */
679   protected Font textComponentsFont;
680 
681   /**
682    * The font to be used for GUI components; cached value for the one in the
683    * user config map.
684    */
685   protected Font componentsFont;
686 
687   /**
688    * This flag becomes true when an GUI related option has been changed
689    */
690   protected boolean dirtyGUI;
691 
692   /**
693    * The combobox for the look and feel selection
694    */
695   protected JComboBox<LNFData> lnfCombo;
696 
697   /**
698    * List of browsers. Update the browserCommandLineTextField.
699    */
700   protected JComboBox<String> browserComboBox;
701 
702   /**
703    * Browser command line.
704    */
705   protected JTextField browserCommandLineTextField;
706 
707   protected JCheckBox treeSelectViewChk;
708 
709   protected JCheckBox viewSelectTreeChk;
710 
711   private static OptionsMap userConfig = Gate.getUserConfig();
712 }