3bc99dd758f3f8c0d18ce3e68370f4efddae80a6
[jalview.git] / src / jalview / gui / OptsAndParamsPage.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
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 (valueField.getText().trim().length() > 0)
598               {
599                 actionPerformed(null);
600               }
601             }
602
603             @Override
604             public void keyPressed(KeyEvent e)
605             {
606             }
607           });
608           valueField.setPreferredSize(new Dimension(60, 25));
609           controlPanel.add(slider, BorderLayout.WEST);
610           controlPanel.add(valueField, BorderLayout.EAST);
611
612         }
613       }
614
615       if (parm != null)
616       {
617         if (choice)
618         {
619           if (init)
620           {
621             List vals = parm.getPossibleValues();
622             for (Object val : vals)
623             {
624               choicebox.addItem(val);
625             }
626           }
627
628           if (parm.getValue() != null)
629           {
630             choicebox.setSelectedItem(parm.getValue());
631           }
632         }
633         else
634         {
635           valueField.setText(parm.getValue());
636         }
637       }
638       lastVal = updateSliderFromValueField();
639       adjusting = false;
640     }
641
642     public Object updateSliderFromValueField()
643     {
644       int iVal;
645       float fVal;
646       if (validator != null)
647       {
648         if (integ)
649         {
650           iVal = 0;
651           try
652           {
653             valueField.setText(valueField.getText().trim());
654             iVal = Integer.valueOf(valueField.getText());
655             if (validator.getMin() != null
656                     && validator.getMin().intValue() > iVal)
657             {
658               iVal = validator.getMin().intValue();
659               // TODO: provide visual indication that hard limit was reached for
660               // this parameter
661             }
662             if (validator.getMax() != null
663                     && validator.getMax().intValue() < iVal)
664             {
665               iVal = validator.getMax().intValue();
666               // TODO: provide visual indication that hard limit was reached for
667               // this parameter
668             }
669           } catch (Exception e)
670           {
671           }
672           ;
673           // update value field to reflect any bound checking we performed.
674           valueField.setText("" + iVal);
675           if (validator.getMin() != null && validator.getMax() != null)
676           {
677             slider.getModel().setRangeProperties(iVal, 1,
678                     validator.getMin().intValue(),
679                     validator.getMax().intValue(), true);
680           }
681           else
682           {
683             slider.setVisible(false);
684           }
685           return new int[]
686           { iVal };
687         }
688         else
689         {
690           fVal = 0f;
691           try
692           {
693             valueField.setText(valueField.getText().trim());
694             fVal = Float.valueOf(valueField.getText());
695             if (validator.getMin() != null
696                     && validator.getMin().floatValue() > fVal)
697             {
698               fVal = validator.getMin().floatValue();
699               // TODO: provide visual indication that hard limit was reached for
700               // this parameter
701               // update value field to reflect any bound checking we performed.
702               valueField.setText("" + fVal);
703             }
704             if (validator.getMax() != null
705                     && validator.getMax().floatValue() < fVal)
706             {
707               fVal = validator.getMax().floatValue();
708               // TODO: provide visual indication that hard limit was reached for
709               // this parameter
710               // update value field to reflect any bound checking we performed.
711               valueField.setText("" + fVal);
712             }
713           } catch (Exception e)
714           {
715           }
716           ;
717           if (validator.getMin() != null && validator.getMax() != null)
718           {
719             slider.getModel().setRangeProperties((int) fVal * 1000, 1,
720                     (int) validator.getMin().floatValue() * 1000,
721                     (int) validator.getMax().floatValue() * 1000, true);
722           }
723           else
724           {
725             slider.setVisible(false);
726           }
727           return new float[]
728           { fVal };
729         }
730       }
731       else
732       {
733         if (!choice)
734         {
735           slider.setVisible(false);
736           return new String[]
737           { valueField.getText().trim() };
738         }
739         else
740         {
741           return new String[]
742           { (String) choicebox.getSelectedItem() };
743         }
744       }
745
746     }
747   }
748
749   public static final int PARAM_WIDTH = 340;
750
751   public static final int PARAM_HEIGHT = 150;
752
753   public static final int PARAM_CLOSEDHEIGHT = 80;
754
755   public OptsAndParamsPage(OptsParametersContainerI paramContainer)
756   {
757     this(paramContainer, false);
758   }
759
760   public OptsAndParamsPage(OptsParametersContainerI paramContainer,
761           boolean compact)
762   {
763     poparent = paramContainer;
764     this.compact = compact;
765   }
766
767   public static void showUrlPopUp(JComponent invoker, final String finfo,
768           int x, int y)
769   {
770
771     JPopupMenu mnu = new JPopupMenu();
772     JMenuItem mitem = new JMenuItem(MessageManager.formatMessage("label.view_params", new String[]{finfo}));
773     mitem.addActionListener(new ActionListener()
774     {
775
776       @Override
777       public void actionPerformed(ActionEvent e)
778       {
779         Desktop.showUrl(finfo);
780
781       }
782     });
783     mnu.add(mitem);
784     mnu.show(invoker, x, y);
785   }
786
787   URL linkImageURL = getClass().getResource("/images/link.gif");
788
789   Map<String, OptionBox> optSet = new java.util.LinkedHashMap<String, OptionBox>();
790
791   Map<String, ParamBox> paramSet = new java.util.LinkedHashMap<String, ParamBox>();
792
793   public Map<String, OptionBox> getOptSet()
794   {
795     return optSet;
796   }
797
798   public void setOptSet(Map<String, OptionBox> optSet)
799   {
800     this.optSet = optSet;
801   }
802
803   public Map<String, ParamBox> getParamSet()
804   {
805     return paramSet;
806   }
807
808   public void setParamSet(Map<String, ParamBox> paramSet)
809   {
810     this.paramSet = paramSet;
811   }
812
813   OptsParametersContainerI poparent;
814
815   OptionBox addOption(OptionI opt)
816   {
817     OptionBox cb = optSet.get(opt.getName());
818     if (cb == null)
819     {
820       cb = new OptionBox(opt);
821       optSet.put(opt.getName(), cb);
822       // jobOptions.add(cb, FlowLayout.LEFT);
823     }
824     return cb;
825   }
826
827   ParamBox addParameter(ParameterI arg)
828   {
829     ParamBox pb = paramSet.get(arg.getName());
830     if (pb == null)
831     {
832       pb = new ParamBox(poparent, arg);
833       paramSet.put(arg.getName(), pb);
834       // paramList.add(pb);
835     }
836     pb.init();
837     // take the defaults from the parameter
838     pb.updateControls(arg);
839     return pb;
840   }
841
842   void selectOption(OptionI option, String string)
843   {
844     OptionBox cb = optSet.get(option.getName());
845     if (cb == null)
846     {
847       cb = addOption(option);
848     }
849     cb.enabled.setSelected(string != null); // initial state for an option.
850     if (string != null)
851     {
852       if (option.getPossibleValues().contains(string))
853       {
854         cb.val.setSelectedItem(string);
855       }
856       else
857       {
858         throw new Error("Invalid value " + string + " for option " + option);
859       }
860
861     }
862     if (option.isRequired() && !cb.enabled.isSelected())
863     {
864       // TODO: indicate paramset is not valid.. option needs to be selected!
865     }
866     cb.setInitialValue();
867   }
868
869   void setParameter(ParameterI arg)
870   {
871     ParamBox pb = paramSet.get(arg.getName());
872     if (pb == null)
873     {
874       addParameter(arg);
875     }
876     else
877     {
878       pb.updateControls(arg);
879     }
880
881   }
882
883   /**
884    * recover options and parameters from GUI
885    * 
886    * @return
887    */
888   public List<ArgumentI> getCurrentSettings()
889   {
890     List<ArgumentI> argSet = new ArrayList<ArgumentI>();
891     for (OptionBox opts : getOptSet().values())
892     {
893       OptionI opt = opts.getOptionIfEnabled();
894       if (opt != null)
895       {
896         argSet.add(opt);
897       }
898     }
899     for (ParamBox parambox : getParamSet().values())
900     {
901       ParameterI parm = parambox.getParameter();
902       if (parm != null)
903       {
904         argSet.add(parm);
905       }
906     }
907
908     return argSet;
909   }
910
911 }