Search in sources :

Example 1 with HiddenParameter

use of net.sf.mzmine.parameters.parametertypes.HiddenParameter in project mzmine2 by mzmine.

the class ParameterSetupDialog method updateParameterSetFromComponents.

@SuppressWarnings({ "unchecked", "rawtypes" })
protected void updateParameterSetFromComponents() {
    for (Parameter<?> p : parameterSet.getParameters()) {
        if (!(p instanceof UserParameter) && !(p instanceof HiddenParameter))
            continue;
        UserParameter up;
        if (p instanceof UserParameter)
            up = (UserParameter) p;
        else
            up = (UserParameter) ((HiddenParameter) p).getEmbeddedParameter();
        JComponent component = parametersAndComponents.get(p.getName());
        // if a parameter is a HiddenParameter it does not necessarily have component
        if (component != null)
            up.setValueFromComponent(component);
    }
}
Also used : UserParameter(net.sf.mzmine.parameters.UserParameter) HiddenParameter(net.sf.mzmine.parameters.parametertypes.HiddenParameter) JComponent(javax.swing.JComponent)

Aggregations

JComponent (javax.swing.JComponent)1 UserParameter (net.sf.mzmine.parameters.UserParameter)1 HiddenParameter (net.sf.mzmine.parameters.parametertypes.HiddenParameter)1