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