JAL-1503 update version in GPL header
[jalview.git] / src / jalview / gui / OptsAndParamsPage.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1)
3  * Copyright (C) 2014 The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
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 of the License, or (at your option) any later version.
10  *  
11  * Jalview is distributed in the hope that it will be useful, but 
12  * WITHOUT ANY WARRANTY; without even the implied warranty 
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14  * PURPOSE.  See the GNU General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
17  * The Jalview Authors are detailed in the 'AUTHORS' file.
18  */
19 package jalview.gui;
20
21 import jalview.util.MessageManager;
22 import jalview.ws.params.ArgumentI;
23 import jalview.ws.params.OptionI;
24 import jalview.ws.params.ParameterI;
25 import jalview.ws.params.ValueConstrainI;
26 import jalview.ws.params.ValueConstrainI.ValueType;
27
28 import java.awt.BorderLayout;
29 import java.awt.Component;
30 import java.awt.Dimension;
31 import java.awt.Font;
32 import java.awt.GridLayout;
33 import java.awt.Rectangle;
34 import java.awt.event.ActionEvent;
35 import java.awt.event.ActionListener;
36 import java.awt.event.KeyEvent;
37 import java.awt.event.KeyListener;
38 import java.awt.event.MouseEvent;
39 import java.awt.event.MouseListener;
40 import java.net.URL;
41 import java.util.ArrayList;
42 import java.util.Hashtable;
43 import java.util.List;
44 import java.util.Map;
45
46 import javax.swing.JButton;
47 import javax.swing.JCheckBox;
48 import javax.swing.JComboBox;
49 import javax.swing.JComponent;
50 import javax.swing.JLabel;
51 import javax.swing.JMenuItem;
52 import javax.swing.JPanel;
53 import javax.swing.JPopupMenu;
54 import javax.swing.JScrollPane;
55 import javax.swing.JSlider;
56 import javax.swing.JTextArea;
57 import javax.swing.JTextField;
58 import javax.swing.border.TitledBorder;
59 import javax.swing.event.ChangeEvent;
60 import javax.swing.event.ChangeListener;
61
62 import net.miginfocom.swing.MigLayout;
63
64 /**
65  * GUI generator/manager for options and parameters. Originally abstracted from
66  * the WsJobParameters dialog box.
67  * 
68  * @author jprocter
69  * 
70  */
71 public class OptsAndParamsPage
72 {
73   /**
74    * compact or verbose style parameters
75    */
76   boolean compact = false;
77
78   public class OptionBox extends JPanel implements MouseListener,
79           ActionListener
80   {
81     JCheckBox enabled = new JCheckBox();
82
83     final URL finfo;
84
85     boolean hasLink = false;
86
87     boolean initEnabled = false;
88
89     String initVal = null;
90
91     OptionI option;
92
93     JLabel optlabel = new JLabel();
94
95     JComboBox val = new JComboBox();
96
97     public OptionBox(OptionI opt)
98     {
99       option = opt;
100       setLayout(new BorderLayout());
101       enabled.setSelected(opt.isRequired()); // TODO: lock required options
102       enabled.setFont(new Font("Verdana", Font.PLAIN, 11));
103       enabled.setText("");
104       enabled.setText(opt.getName());
105       enabled.addActionListener(this);
106       finfo = option.getFurtherDetails();
107       String desc = opt.getDescription();
108       if (finfo != null)
109       {
110         hasLink = true;
111
112         enabled.setToolTipText("<html>"
113                 + JvSwingUtils
114                         .wrapTooltip(((desc == null || desc.trim().length()==0) ? "see further details by right-clicking"
115                                 : desc)
116                                 + "<br><img src=\"" + linkImageURL + "\"/>")
117                 + "</html>");
118         enabled.addMouseListener(this);
119       }
120       else
121       {
122         if (desc != null && desc.trim().length()>0)
123         {
124           enabled.setToolTipText("<html>"
125                   + JvSwingUtils.wrapTooltip(opt.getDescription())
126                   + "</html>");
127         }
128       }
129       add(enabled, BorderLayout.NORTH);
130       for (Object str : opt.getPossibleValues())
131       {
132         val.addItem((String) str);
133       }
134       val.setSelectedItem((String) opt.getValue());
135       if (opt.getPossibleValues().size() > 1)
136       {
137         setLayout(new GridLayout(1, 2));
138         val.addActionListener(this);
139         add(val, BorderLayout.SOUTH);
140       }
141       // TODO: add actionListeners for popup (to open further info),
142       // and to update list of parameters if an option is enabled
143       // that takes a value. JBPNote: is this TODO still valid ?
144       setInitialValue();
145     }
146
147     public void actionPerformed(ActionEvent e)
148     {
149       if (e.getSource() != enabled)
150       {
151         enabled.setSelected(true);
152       }
153       checkIfModified();
154     }
155
156     private void checkIfModified()
157     {
158       boolean notmod = (initEnabled == enabled.isSelected());
159       if (enabled.isSelected())
160       {
161         if (initVal != null)
162         {
163           notmod &= initVal.equals(val.getSelectedItem());
164         }
165         else
166         {
167           // compare against default service setting
168           notmod &= option.getValue() == null
169                   || option.getValue().equals(val.getSelectedItem());
170         }
171       }
172       else
173       {
174         notmod &= (initVal != null) ? initVal.equals(val.getSelectedItem())
175                 : val.getSelectedItem() != initVal;
176       }
177       poparent.argSetModified(this, !notmod);
178     }
179
180     public OptionI getOptionIfEnabled()
181     {
182       if (!enabled.isSelected())
183       {
184         return null;
185       }
186       OptionI opt = option.copy();
187       if (opt.getPossibleValues() != null
188               && opt.getPossibleValues().size() == 1)
189       {
190         // Hack to make sure the default value for an enabled option with only
191         // one value is actually returned
192         opt.setValue(opt.getPossibleValues().get(0));
193       }
194       if (val.getSelectedItem() != null)
195       {
196         opt.setValue((String) val.getSelectedItem());
197       }
198       else
199       {
200         if (option.getValue() != null)
201         {
202           opt.setValue(option.getValue());
203         }
204       }
205       return opt;
206     }
207
208     public void mouseClicked(MouseEvent e)
209     {
210       if (javax.swing.SwingUtilities.isRightMouseButton(e))
211       {
212         showUrlPopUp(this, finfo.toString(), e.getX(), e.getY());
213       }
214     }
215
216     public void mouseEntered(MouseEvent e)
217     {
218       // TODO Auto-generated method stub
219
220     }
221
222     public void mouseExited(MouseEvent e)
223     {
224       // TODO Auto-generated method stub
225
226     }
227
228     public void mousePressed(MouseEvent e)
229     {
230       // TODO Auto-generated method stub
231
232     }
233
234     public void mouseReleased(MouseEvent e)
235     {
236       // TODO Auto-generated method stub
237
238     }
239
240
241     public void resetToDefault(boolean setDefaultParams)
242     {
243       enabled.setSelected(false);
244       if (option.isRequired() || (setDefaultParams && option.getValue()!=null))
245       {
246         // Apply default value
247         selectOption(option, option.getValue());
248       }
249     }
250
251     public void setInitialValue()
252     {
253       initEnabled = enabled.isSelected();
254       if (option.getPossibleValues() != null
255               && option.getPossibleValues().size() > 1)
256       {
257         initVal = (String) val.getSelectedItem();
258       }
259       else
260       {
261         initVal = (initEnabled) ? (String) val.getSelectedItem() : null;
262       }
263     }
264     
265   }
266
267   public class ParamBox extends JPanel implements ChangeListener,
268           ActionListener, MouseListener
269   {
270     boolean adjusting = false;
271
272     boolean choice = false;
273
274     JComboBox choicebox;
275
276     JPanel controlPanel = new JPanel();
277
278     boolean descisvisible = false;
279
280     JScrollPane descPanel = new JScrollPane();
281
282     final URL finfo;
283
284     boolean integ = false;
285
286     Object lastVal;
287
288     ParameterI parameter;
289
290     final OptsParametersContainerI pmdialogbox;
291
292     JPanel settingPanel = new JPanel();
293
294     JButton showDesc = new JButton();
295
296     JSlider slider = null;
297
298     JTextArea string = new JTextArea();
299
300     ValueConstrainI validator = null;
301
302     JTextField valueField = null;
303
304     public ParamBox(final OptsParametersContainerI pmlayout, ParameterI parm)
305     {
306       pmdialogbox = pmlayout;
307       finfo = parm.getFurtherDetails();
308       validator = parm.getValidValue();
309       parameter = parm;
310       if (validator != null)
311       {
312         integ = validator.getType() == ValueType.Integer;
313       }
314       else
315       {
316         if (parameter.getPossibleValues() != null)
317         {
318           choice = true;
319         }
320       }
321
322       if (!compact)
323       {
324         makeExpanderParam(parm);
325       }
326       else
327       {
328         makeCompactParam(parm);
329
330       }
331     }
332
333     private void makeCompactParam(ParameterI parm)
334     {
335       setLayout(new MigLayout("", "[][grow]"));
336
337       String ttipText = null;
338
339       controlPanel.setLayout(new BorderLayout());
340
341       if (parm.getDescription() != null
342               && parm.getDescription().trim().length() > 0)
343       {
344         // Only create description boxes if there actually is a description.
345         ttipText = ("<html>"
346                 + JvSwingUtils
347                         .wrapTooltip(parm.getDescription()
348                                 + (finfo != null ? "<br><img src=\""
349                                         + linkImageURL
350                                         + "\"/> Right click for further information."
351                                         : "")) + "</html>");
352       }
353
354       JvSwingUtils.mgAddtoLayout(this, ttipText,
355               new JLabel(parm.getName()), controlPanel, "");
356       updateControls(parm);
357       validate();
358     }
359
360     private void makeExpanderParam(ParameterI parm)
361     {
362       setPreferredSize(new Dimension(PARAM_WIDTH, PARAM_CLOSEDHEIGHT));
363       setBorder(new TitledBorder(parm.getName()));
364       setLayout(null);
365       showDesc.setFont(new Font("Verdana", Font.PLAIN, 6));
366       showDesc.setText("+");
367       string.setFont(new Font("Verdana", Font.PLAIN, 11));
368       string.setBackground(getBackground());
369
370       string.setEditable(false);
371       descPanel.getViewport().setView(string);
372
373       descPanel.setVisible(false);
374
375       JPanel firstrow = new JPanel();
376       firstrow.setLayout(null);
377       controlPanel.setLayout(new BorderLayout());
378       controlPanel.setBounds(new Rectangle(39, 10, PARAM_WIDTH - 70,
379               PARAM_CLOSEDHEIGHT - 50));
380       firstrow.add(controlPanel);
381       firstrow.setBounds(new Rectangle(10, 20, PARAM_WIDTH - 30,
382               PARAM_CLOSEDHEIGHT - 30));
383
384       final ParamBox me = this;
385
386       if (parm.getDescription() != null
387               && parm.getDescription().trim().length() > 0)
388       {
389         // Only create description boxes if there actually is a description.
390         if (finfo != null)
391         {
392           showDesc.setToolTipText("<html>"
393                   + JvSwingUtils
394                           .wrapTooltip("Click to show brief description<br><img src=\""
395                                   + linkImageURL
396                                   + "\"/> Right click for further information.")
397                   + "</html>");
398           showDesc.addMouseListener(this);
399         }
400         else
401         {
402           showDesc.setToolTipText("<html>"
403                   + JvSwingUtils
404                           .wrapTooltip("Click to show brief description.")
405                   + "</html>");
406         }
407         showDesc.addActionListener(new ActionListener()
408         {
409
410           public void actionPerformed(ActionEvent e)
411           {
412             descisvisible = !descisvisible;
413             descPanel.setVisible(descisvisible);
414             descPanel.getVerticalScrollBar().setValue(0);
415             me.setPreferredSize(new Dimension(PARAM_WIDTH,
416                     (descisvisible) ? PARAM_HEIGHT : PARAM_CLOSEDHEIGHT));
417             me.validate();
418             pmdialogbox.refreshParamLayout();
419           }
420         });
421         string.setWrapStyleWord(true);
422         string.setLineWrap(true);
423         string.setColumns(32);
424         string.setText(parm.getDescription());
425         showDesc.setBounds(new Rectangle(10, 10, 16, 16));
426         firstrow.add(showDesc);
427       }
428       add(firstrow);
429       validator = parm.getValidValue();
430       parameter = parm;
431       if (validator != null)
432       {
433         integ = validator.getType() == ValueType.Integer;
434       }
435       else
436       {
437         if (parameter.getPossibleValues() != null)
438         {
439           choice = true;
440         }
441       }
442       updateControls(parm);
443       descPanel.setBounds(new Rectangle(10, PARAM_CLOSEDHEIGHT,
444               PARAM_WIDTH - 20, PARAM_HEIGHT - PARAM_CLOSEDHEIGHT - 5));
445       add(descPanel);
446       validate();
447     }
448
449     public void actionPerformed(ActionEvent e)
450     {
451       if (adjusting)
452       {
453         return;
454       }
455       if (!choice)
456       {
457         updateSliderFromValueField();
458       }
459       checkIfModified();
460     }
461
462     private void checkIfModified()
463     {
464       Object cstate = updateSliderFromValueField();
465       boolean notmod = false;
466       if (cstate.getClass() == lastVal.getClass())
467       {
468         if (cstate instanceof int[])
469         {
470           notmod = (((int[]) cstate)[0] == ((int[]) lastVal)[0]);
471         }
472         else if (cstate instanceof float[])
473         {
474           notmod = (((float[]) cstate)[0] == ((float[]) lastVal)[0]);
475         }
476         else if (cstate instanceof String[])
477         {
478           notmod = (((String[]) cstate)[0].equals(((String[]) lastVal)[0]));
479         }
480       }
481       pmdialogbox.argSetModified(this, !notmod);
482     }
483
484     @Override
485     public int getBaseline(int width, int height)
486     {
487       return 0;
488     }
489
490     // from
491     // http://stackoverflow.com/questions/2743177/top-alignment-for-flowlayout
492     // helpful hint of using the Java 1.6 alignBaseLine property of FlowLayout
493     @Override
494     public Component.BaselineResizeBehavior getBaselineResizeBehavior()
495     {
496       return Component.BaselineResizeBehavior.CONSTANT_ASCENT;
497     }
498
499     public int getBoxHeight()
500     {
501       return (descisvisible ? PARAM_HEIGHT : PARAM_CLOSEDHEIGHT);
502     }
503
504     public ParameterI getParameter()
505     {
506       ParameterI prm = parameter.copy();
507       if (choice)
508       {
509         prm.setValue((String) choicebox.getSelectedItem());
510       }
511       else
512       {
513         prm.setValue(valueField.getText());
514       }
515       return prm;
516     }
517
518     public void init()
519     {
520       // reset the widget's initial value.
521       lastVal = null;
522     }
523
524     public void mouseClicked(MouseEvent e)
525     {
526       if (javax.swing.SwingUtilities.isRightMouseButton(e))
527       {
528         showUrlPopUp(this, finfo.toString(), e.getX(), e.getY());
529       }
530     }
531
532     public void mouseEntered(MouseEvent e)
533     {
534       // TODO Auto-generated method stub
535
536     }
537
538     public void mouseExited(MouseEvent e)
539     {
540       // TODO Auto-generated method stub
541
542     }
543
544     public void mousePressed(MouseEvent e)
545     {
546       // TODO Auto-generated method stub
547
548     }
549
550     public void mouseReleased(MouseEvent e)
551     {
552       // TODO Auto-generated method stub
553
554     }
555
556     public void stateChanged(ChangeEvent e)
557     {
558       if (!adjusting)
559       {
560         valueField.setText(""
561                 + ((integ) ? ("" + (int) slider.getValue())
562                         : ("" + (float) (slider.getValue() / 1000f))));
563         checkIfModified();
564       }
565
566     }
567
568     public void updateControls(ParameterI parm)
569     {
570       adjusting = true;
571       boolean init = (choicebox == null && valueField == null);
572       if (init)
573       {
574         if (choice)
575         {
576           choicebox = new JComboBox();
577           choicebox.addActionListener(this);
578           controlPanel.add(choicebox, BorderLayout.CENTER);
579         }
580         else
581         {
582           slider = new JSlider();
583           slider.addChangeListener(this);
584           valueField = new JTextField();
585           valueField.addActionListener(this);
586           valueField.addKeyListener(new KeyListener()
587           {
588
589             @Override
590             public void keyTyped(KeyEvent e)
591             {
592             }
593
594             @Override
595             public void keyReleased(KeyEvent e)
596             {
597               if (e.isActionKey())
598               {
599                 if (valueField.getText().trim().length() > 0)
600                 {
601                   actionPerformed(null);
602                 }
603               }
604             }
605
606             @Override
607             public void keyPressed(KeyEvent e)
608             {
609             }
610           });
611           valueField.setPreferredSize(new Dimension(60, 25));
612           controlPanel.add(slider, BorderLayout.WEST);
613           controlPanel.add(valueField, BorderLayout.EAST);
614
615         }
616       }
617
618       if (parm != null)
619       {
620         if (choice)
621         {
622           if (init)
623           {
624             List vals = parm.getPossibleValues();
625             for (Object val : vals)
626             {
627               choicebox.addItem(val);
628             }
629           }
630
631           if (parm.getValue() != null)
632           {
633             choicebox.setSelectedItem(parm.getValue());
634           }
635         }
636         else
637         {
638           valueField.setText(parm.getValue());
639         }
640       }
641       lastVal = updateSliderFromValueField();
642       adjusting = false;
643     }
644
645     public Object updateSliderFromValueField()
646     {
647       int iVal;
648       float fVal;
649       if (validator != null)
650       {
651         if (integ)
652         {
653           iVal = 0;
654           try
655           {
656             valueField.setText(valueField.getText().trim());
657             iVal = Integer.valueOf(valueField.getText());
658             if (validator.getMin() != null
659                     && validator.getMin().intValue() > iVal)
660             {
661               iVal = validator.getMin().intValue();
662               // TODO: provide visual indication that hard limit was reached for
663               // this parameter
664             }
665             if (validator.getMax() != null
666                     && validator.getMax().intValue() < iVal)
667             {
668               iVal = validator.getMax().intValue();
669               // TODO: provide visual indication that hard limit was reached for
670               // this parameter
671             }
672           } catch (Exception e)
673           {
674           }
675           ;
676           // update value field to reflect any bound checking we performed.
677           valueField.setText("" + iVal);
678           if (validator.getMin() != null && validator.getMax() != null)
679           {
680             slider.getModel().setRangeProperties(iVal, 1,
681                     validator.getMin().intValue(),
682                     validator.getMax().intValue()+1, true);
683           }
684           else
685           {
686             slider.setVisible(false);
687           }
688           return new int[]
689           { iVal };
690         }
691         else
692         {
693           fVal = 0f;
694           try
695           {
696             valueField.setText(valueField.getText().trim());
697             fVal = Float.valueOf(valueField.getText());
698             if (validator.getMin() != null
699                     && validator.getMin().floatValue() > fVal)
700             {
701               fVal = validator.getMin().floatValue();
702               // TODO: provide visual indication that hard limit was reached for
703               // this parameter
704               // update value field to reflect any bound checking we performed.
705               valueField.setText("" + fVal);
706             }
707             if (validator.getMax() != null
708                     && validator.getMax().floatValue() < fVal)
709             {
710               fVal = validator.getMax().floatValue();
711               // TODO: provide visual indication that hard limit was reached for
712               // this parameter
713               // update value field to reflect any bound checking we performed.
714               valueField.setText("" + fVal);
715             }
716           } catch (Exception e)
717           {
718           }
719           ;
720           if (validator.getMin() != null && validator.getMax() != null)
721           {
722             slider.getModel().setRangeProperties((int) (fVal * 1000f), 1,
723                     (int) (validator.getMin().floatValue() * 1000f),
724                     1+(int) (validator.getMax().floatValue() * 1000f), true);
725           }
726           else
727           {
728             slider.setVisible(false);
729           }
730           return new float[]
731           { fVal };
732         }
733       }
734       else
735       {
736         if (!choice)
737         {
738           slider.setVisible(false);
739           return new String[]
740           { valueField.getText().trim() };
741         }
742         else
743         {
744           return new String[]
745           { (String) choicebox.getSelectedItem() };
746         }
747       }
748
749     }
750   }
751
752   public static final int PARAM_WIDTH = 340;
753
754   public static final int PARAM_HEIGHT = 150;
755
756   public static final int PARAM_CLOSEDHEIGHT = 80;
757
758   public OptsAndParamsPage(OptsParametersContainerI paramContainer)
759   {
760     this(paramContainer, false);
761   }
762
763   public OptsAndParamsPage(OptsParametersContainerI paramContainer,
764           boolean compact)
765   {
766     poparent = paramContainer;
767     this.compact = compact;
768   }
769
770   public static void showUrlPopUp(JComponent invoker, final String finfo,
771           int x, int y)
772   {
773
774     JPopupMenu mnu = new JPopupMenu();
775     JMenuItem mitem = new JMenuItem(MessageManager.formatMessage("label.view_params", new String[]{finfo}));
776     mitem.addActionListener(new ActionListener()
777     {
778
779       @Override
780       public void actionPerformed(ActionEvent e)
781       {
782         Desktop.showUrl(finfo);
783
784       }
785     });
786     mnu.add(mitem);
787     mnu.show(invoker, x, y);
788   }
789
790   URL linkImageURL = getClass().getResource("/images/link.gif");
791
792   Map<String, OptionBox> optSet = new java.util.LinkedHashMap<String, OptionBox>();
793
794   Map<String, ParamBox> paramSet = new java.util.LinkedHashMap<String, ParamBox>();
795
796   public Map<String, OptionBox> getOptSet()
797   {
798     return optSet;
799   }
800
801   public void setOptSet(Map<String, OptionBox> optSet)
802   {
803     this.optSet = optSet;
804   }
805
806   public Map<String, ParamBox> getParamSet()
807   {
808     return paramSet;
809   }
810
811   public void setParamSet(Map<String, ParamBox> paramSet)
812   {
813     this.paramSet = paramSet;
814   }
815
816   OptsParametersContainerI poparent;
817
818   OptionBox addOption(OptionI opt)
819   {
820     OptionBox cb = optSet.get(opt.getName());
821     if (cb == null)
822     {
823       cb = new OptionBox(opt);
824       optSet.put(opt.getName(), cb);
825       // jobOptions.add(cb, FlowLayout.LEFT);
826     }
827     return cb;
828   }
829
830   ParamBox addParameter(ParameterI arg)
831   {
832     ParamBox pb = paramSet.get(arg.getName());
833     if (pb == null)
834     {
835       pb = new ParamBox(poparent, arg);
836       paramSet.put(arg.getName(), pb);
837       // paramList.add(pb);
838     }
839     pb.init();
840     // take the defaults from the parameter
841     pb.updateControls(arg);
842     return pb;
843   }
844
845   void selectOption(OptionI option, String string)
846   {
847     OptionBox cb = optSet.get(option.getName());
848     if (cb == null)
849     {
850       cb = addOption(option);
851     }
852     cb.enabled.setSelected(string != null); // initial state for an option.
853     if (string != null)
854     {
855       if (option.getPossibleValues().contains(string))
856       {
857         cb.val.setSelectedItem(string);
858       }
859       else
860       {
861         throw new Error("Invalid value " + string + " for option " + option);
862       }
863
864     }
865     if (option.isRequired() && !cb.enabled.isSelected())
866     {
867       // TODO: indicate paramset is not valid.. option needs to be selected!
868     }
869     cb.setInitialValue();
870   }
871
872   void setParameter(ParameterI arg)
873   {
874     ParamBox pb = paramSet.get(arg.getName());
875     if (pb == null)
876     {
877       addParameter(arg);
878     }
879     else
880     {
881       pb.updateControls(arg);
882     }
883
884   }
885
886   /**
887    * recover options and parameters from GUI
888    * 
889    * @return
890    */
891   public List<ArgumentI> getCurrentSettings()
892   {
893     List<ArgumentI> argSet = new ArrayList<ArgumentI>();
894     for (OptionBox opts : getOptSet().values())
895     {
896       OptionI opt = opts.getOptionIfEnabled();
897       if (opt != null)
898       {
899         argSet.add(opt);
900       }
901     }
902     for (ParamBox parambox : getParamSet().values())
903     {
904       ParameterI parm = parambox.getParameter();
905       if (parm != null)
906       {
907         argSet.add(parm);
908       }
909     }
910
911     return argSet;
912   }
913
914 }