com.compomics.util.preferences
Class ModificationProfile

java.lang.Object
  extended by com.compomics.util.preferences.ModificationProfile
All Implemented Interfaces:
Serializable

public class ModificationProfile
extends Object
implements Serializable

This class stores the information about the modification preferences (colors, Names) used for the selected project.

Author:
Marc Vaudel
See Also:
Serialized Form

Constructor Summary
ModificationProfile()
          Constructor.
 
Method Summary
 void addFixedModification(PTM modification)
          Adds a fixed modification.
 void addVariableModification(PTM modification)
          Adds a variable modification.
 void compatibilityCheck()
          Checks the compatibility with older versions of the class and makes the necessary changes.
 Set<String> getBackedUpPtms()
          Returns the names of the backed-up PTMs
 Color getColor(String modification)
          Returns the color used to code the given modification.
 ArrayList<String> getFixedModifications()
          Returns the searched fixed modifications names
 PTM getPtm(String modName)
          Returns the back-ed up PTM with the given name
 HashMap<String,Color> getPtmColors()
          Returns a mapping of the expected modifications names to the colors used.
 String getShortName(String modification)
          Returns the short name of the given modification.
 ArrayList<String> getVariableModifications()
          Returns the expected variable modification names included in this profile.
 void setColor(String expectedModification, Color color)
          Sets a new color for the given expected modification.
 void setShortName(String expectedModification, String shortName)
          Sets a new short name for the given expected modification.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModificationProfile

public ModificationProfile()
Constructor.

Method Detail

getVariableModifications

public ArrayList<String> getVariableModifications()
Returns the expected variable modification names included in this profile.

Returns:
the expected variable modification names included in this profile

getFixedModifications

public ArrayList<String> getFixedModifications()
Returns the searched fixed modifications names

Returns:
the searched fixed modifications names

getShortName

public String getShortName(String modification)
Returns the short name of the given modification.

Parameters:
modification - the name of the expected modification
Returns:
the corresponding short name

getColor

public Color getColor(String modification)
Returns the color used to code the given modification.

Parameters:
modification - the name of the given expected modification
Returns:
the corresponding color

addVariableModification

public void addVariableModification(PTM modification)
Adds a variable modification. The modification name is added in the variable modifications names list and the modification is saved in the back-up. In case a modification with the same name was already used it will be silently overwritten.

Parameters:
modification - The modification to add

addFixedModification

public void addFixedModification(PTM modification)
Adds a fixed modification. The modification name is added in the fixed modifications names list and the modification is saved in the back-up. In case a modification with the same name was already used it will be silently overwritten.

Parameters:
modification - The modification to add

setShortName

public void setShortName(String expectedModification,
                         String shortName)
Sets a new short name for the given expected modification.

Parameters:
expectedModification - the name of the expected modification
shortName - the new short name

setColor

public void setColor(String expectedModification,
                     Color color)
Sets a new color for the given expected modification.

Parameters:
expectedModification - the name of the expected modification
color - the new color

getPtmColors

public HashMap<String,Color> getPtmColors()
Returns a mapping of the expected modifications names to the colors used.

Returns:
a mapping of the expected modifications names to the colors used

compatibilityCheck

public void compatibilityCheck()
Checks the compatibility with older versions of the class and makes the necessary changes.


getBackedUpPtms

public Set<String> getBackedUpPtms()
Returns the names of the backed-up PTMs

Returns:
the names of the backed-up PTMs

getPtm

public PTM getPtm(String modName)
Returns the back-ed up PTM with the given name

Parameters:
modName - the name of the PTM of interest
Returns:
the corresponding PTM. Null if not found.


Copyright © 2012. All Rights Reserved.