apollo.config
Class PropertyScheme

java.lang.Object
  extended by apollo.config.PropertyScheme
All Implemented Interfaces:
java.io.Serializable

public class PropertyScheme
extends java.lang.Object
implements java.io.Serializable

PropertyScheme is basically the java version of the tiers file. Changed from static/singleton to instance as we now have different instances of tiers for different data adapters Holds a list of TierProperties, TierProperties hold FeatureProperties Fires PropSchemeChangeEvent (to controller) when anything changes.

See Also:
Serialized Form

Field Summary
protected static org.apache.log4j.Logger logger
           
 
Constructor Summary
PropertyScheme()
          Parses tiers file returned by Config.getTiersFile(), which returns the current Style's tiers file.
PropertyScheme(java.lang.String tiersFile)
          Parses and creates prop scheme from tiers file passed in
 
Method Summary
 void addPropSchemeChangeListener(PropSchemeChangeListener pcl)
           
 void addTierType(TierProperty tierProp)
           
 FeatureProperty createDefaultFeatureProperty()
           
 void expandAllTiers(boolean state)
           
 void firePropSchemeChangeEvent()
           
 java.util.Vector getAllTiers()
           
 java.util.Enumeration getAnalNames()
           
 java.util.Vector getAnnotationFeatureProps()
          Moved from Style
 java.util.Vector getCopyOfTiers(java.util.Vector source)
           
 FeatureProperty getFeatureProperty(java.lang.String analysis_type)
          Returns the FeatureProperty associated with analysis_type.
 FeatureProperty getFeatureProperty(java.lang.String analysis_type, boolean createProperty)
          Returns the FeatureProperty associated with analysis_type.
 FeatureProperty getLinkedFeatProp(int i)
           
 int getLinkedFeatPropsSize()
           
 TierProperty getLinkedTierProp(int i)
           
 java.util.List getLinkedTierProps()
           
 java.util.List getSyntenyLinkedFeatProps()
          Retrieves all feature props that are synteny links At some point we may want to include species as a parameter and only retrieve links between specified species.
 int getTierInd(java.lang.String label)
           
 TierProperty getTierProperty(java.lang.String type)
           
 TierProperty getTierProperty(java.lang.String type, boolean dig)
          Returns the TierProperty associated with either label or analysis_type.
 java.util.Enumeration getTypes()
           
 boolean isAnnotationTier(java.lang.String tier)
          Returns true if this tiername contains annotations rather than results.
 boolean isTypeSyntenyLink(java.lang.String type)
          by type we mean apollo feature type not result/analysis type
static void main(java.lang.String[] Args)
           
 void moveTier(java.lang.String fromTier, java.lang.String toTier)
           
 void setAllTiersVisible(boolean state)
           
 void setDefaultFeatureProperty(FeatureProperty fp)
           
 int size()
           
 void write(java.io.File file)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger
Constructor Detail

PropertyScheme

public PropertyScheme()
               throws java.io.IOException,
                      java.io.FileNotFoundException
Parses tiers file returned by Config.getTiersFile(), which returns the current Style's tiers file.

Throws:
java.io.IOException
java.io.FileNotFoundException

PropertyScheme

public PropertyScheme(java.lang.String tiersFile)
               throws java.io.IOException,
                      java.io.FileNotFoundException
Parses and creates prop scheme from tiers file passed in

Throws:
java.io.IOException
java.io.FileNotFoundException
Method Detail

addPropSchemeChangeListener

public void addPropSchemeChangeListener(PropSchemeChangeListener pcl)

firePropSchemeChangeEvent

public void firePropSchemeChangeEvent()

size

public int size()

addTierType

public void addTierType(TierProperty tierProp)

expandAllTiers

public void expandAllTiers(boolean state)

setAllTiersVisible

public void setAllTiersVisible(boolean state)

moveTier

public void moveTier(java.lang.String fromTier,
                     java.lang.String toTier)

getTypes

public java.util.Enumeration getTypes()

getAnalNames

public java.util.Enumeration getAnalNames()

getFeatureProperty

public FeatureProperty getFeatureProperty(java.lang.String analysis_type,
                                          boolean createProperty)
Returns the FeatureProperty associated with analysis_type.

The FeatureProperty will be the registered property if type is known. Otherwise, if createProperty is true, it will create a new FeatureProperty object with the default values, otherwise it will return null.

Parameters:
type - the String type of a feature
createProperty - - whether to create a new property if not found
Returns:
the FeatureProperty object for that type, or null
Throws:
java.lang.NullPointerException - if type is null

getFeatureProperty

public FeatureProperty getFeatureProperty(java.lang.String analysis_type)
Returns the FeatureProperty associated with analysis_type.

The FeatureProperty will be the registered property if type is known, and null otherwise.

Parameters:
type - the String type of a feature
Returns:
the FeatureProperty object for that type, or null
Throws:
java.lang.NullPointerException - if type is null

getTierProperty

public TierProperty getTierProperty(java.lang.String type,
                                    boolean dig)
Returns the TierProperty associated with either label or analysis_type.

The FeatureProperty will be the registered property if type is known, and null otherwise.

Parameters:
type - the String type of a feature
Returns:
the FeatureProperty object for that type, or null
Throws:
java.lang.NullPointerException - if type is null

getTierProperty

public TierProperty getTierProperty(java.lang.String type)

getTierInd

public int getTierInd(java.lang.String label)

getAllTiers

public java.util.Vector getAllTiers()

getCopyOfTiers

public java.util.Vector getCopyOfTiers(java.util.Vector source)

setDefaultFeatureProperty

public void setDefaultFeatureProperty(FeatureProperty fp)

createDefaultFeatureProperty

public FeatureProperty createDefaultFeatureProperty()

getSyntenyLinkedFeatProps

public java.util.List getSyntenyLinkedFeatProps()
Retrieves all feature props that are synteny links At some point we may want to include species as a parameter and only retrieve links between specified species.


getLinkedFeatPropsSize

public int getLinkedFeatPropsSize()

getLinkedFeatProp

public FeatureProperty getLinkedFeatProp(int i)

isTypeSyntenyLink

public boolean isTypeSyntenyLink(java.lang.String type)
by type we mean apollo feature type not result/analysis type


getLinkedTierProps

public java.util.List getLinkedTierProps()

getLinkedTierProp

public TierProperty getLinkedTierProp(int i)

write

public void write(java.io.File file)
           throws java.io.IOException
Throws:
java.io.IOException

getAnnotationFeatureProps

public java.util.Vector getAnnotationFeatureProps()
Moved from Style


isAnnotationTier

public boolean isAnnotationTier(java.lang.String tier)
Returns true if this tiername contains annotations rather than results. We check this by looking in the vector of annotationFeatureProps, which was filled in by a previous call to getAnnotationFeatureProps. Note: this doesn't seem to actually get called! yes it does by FeatProp


main

public static void main(java.lang.String[] Args)
                 throws java.lang.Exception
Throws:
java.lang.Exception