org.fhcrc.cpl.toolbox.proteomics.commandline.arguments
Class ModificationListArgumentDefinition

java.lang.Object
  extended by org.fhcrc.cpl.toolbox.commandline.arguments.BaseArgumentDefinitionImpl
      extended by org.fhcrc.cpl.toolbox.proteomics.commandline.arguments.ModificationListArgumentDefinition
All Implemented Interfaces:
CommandLineArgumentDefinition

public class ModificationListArgumentDefinition
extends BaseArgumentDefinitionImpl
implements CommandLineArgumentDefinition

Treats an argument as a comma-separated list of modifications. Each mod should have the format: [V] where V (case-insensitive) is an optional character indicating variable (default is static) for example: M16.5V means a variable modification on Methionine with deltamass 16.5


Field Summary
 
Fields inherited from class org.fhcrc.cpl.toolbox.commandline.arguments.BaseArgumentDefinitionImpl
mArgumentHelpText, mArgumentName, mDefaultValue, mDisplayName, mIsAdvanced, mRequired
 
Fields inherited from interface org.fhcrc.cpl.toolbox.commandline.arguments.CommandLineArgumentDefinition
UNNAMED_PARAMETER_VALUE_ARGUMENT, UNNAMED_PARAMETER_VALUE_SERIES_ARGUMENT
 
Constructor Summary
ModificationListArgumentDefinition(java.lang.String argumentName)
           
ModificationListArgumentDefinition(java.lang.String argumentName, boolean required, java.lang.String help)
           
ModificationListArgumentDefinition(java.lang.String argumentName, boolean required, java.lang.String help, MS2Modification[] defaultValue)
           
ModificationListArgumentDefinition(java.lang.String argumentName, java.lang.String help)
           
 
Method Summary
 javax.swing.JComponent addComponentsForGUI(java.awt.Container parent, javax.swing.JDialog parentDialog, java.lang.String defaultValue)
          Same as base method, but resize the text field
 MS2Modification[] convertArgumentValue(java.lang.String argumentValue)
          Try to match the argument against the set of allowed values, either with or without case-sensitivity
static MS2Modification createModificationFromString(java.lang.String modString)
           
 java.lang.String getDefaultValueAsString()
          Need to override default handling, since we're working with an array, here.
 java.lang.String getValueDescriptor()
          Return a String that will be used as a generic example for the value to be used for this argument, in auto-generated usage
static MS2Modification safeCreateModificationFromString(java.lang.String modString)
           
 
Methods inherited from class org.fhcrc.cpl.toolbox.commandline.arguments.BaseArgumentDefinitionImpl
addComponentsForGUISeries, getArgumentDisplayName, getArgumentName, getDefaultValue, getDisplayName, getHelpText, getValueFromGUIComponent, hasDefaultValue, isAdvanced, isRequired, setAdvanced, setArgumentDisplayName, setDefaultValue, setDisplayName, setHelpText, setRequired, valueToString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.fhcrc.cpl.toolbox.commandline.arguments.CommandLineArgumentDefinition
addComponentsForGUISeries, getArgumentDisplayName, getArgumentName, getDefaultValue, getHelpText, getValueFromGUIComponent, hasDefaultValue, isAdvanced, isRequired, setAdvanced, setArgumentDisplayName, setDefaultValue, setHelpText, setRequired, valueToString
 

Constructor Detail

ModificationListArgumentDefinition

public ModificationListArgumentDefinition(java.lang.String argumentName)

ModificationListArgumentDefinition

public ModificationListArgumentDefinition(java.lang.String argumentName,
                                          java.lang.String help)

ModificationListArgumentDefinition

public ModificationListArgumentDefinition(java.lang.String argumentName,
                                          boolean required,
                                          java.lang.String help)

ModificationListArgumentDefinition

public ModificationListArgumentDefinition(java.lang.String argumentName,
                                          boolean required,
                                          java.lang.String help,
                                          MS2Modification[] defaultValue)
Method Detail

convertArgumentValue

public MS2Modification[] convertArgumentValue(java.lang.String argumentValue)
                                       throws ArgumentValidationException
Try to match the argument against the set of allowed values, either with or without case-sensitivity

Specified by:
convertArgumentValue in interface CommandLineArgumentDefinition
Specified by:
convertArgumentValue in class BaseArgumentDefinitionImpl
Parameters:
argumentValue -
Returns:
the argument as a String
Throws:
ArgumentValidationException - if the argument doesn't validate

safeCreateModificationFromString

public static MS2Modification safeCreateModificationFromString(java.lang.String modString)

createModificationFromString

public static MS2Modification createModificationFromString(java.lang.String modString)
                                                    throws ArgumentValidationException
Throws:
ArgumentValidationException

getValueDescriptor

public java.lang.String getValueDescriptor()
Description copied from interface: CommandLineArgumentDefinition
Return a String that will be used as a generic example for the value to be used for this argument, in auto-generated usage

Specified by:
getValueDescriptor in interface CommandLineArgumentDefinition
Overrides:
getValueDescriptor in class BaseArgumentDefinitionImpl
Returns:

getDefaultValueAsString

public java.lang.String getDefaultValueAsString()
Need to override default handling, since we're working with an array, here.

Specified by:
getDefaultValueAsString in interface CommandLineArgumentDefinition
Overrides:
getDefaultValueAsString in class BaseArgumentDefinitionImpl
Returns:

addComponentsForGUI

public javax.swing.JComponent addComponentsForGUI(java.awt.Container parent,
                                                  javax.swing.JDialog parentDialog,
                                                  java.lang.String defaultValue)
Same as base method, but resize the text field

Specified by:
addComponentsForGUI in interface CommandLineArgumentDefinition
Overrides:
addComponentsForGUI in class BaseArgumentDefinitionImpl
Parameters:
parent -
parentDialog -
defaultValue -
Returns:


Fred Hutchinson Cancer Research Center