apollo.gui.genomemap
Class DrawableTierManager

java.lang.Object
  extended by apollo.gui.TierManager
      extended by apollo.gui.genomemap.DrawableTierManager
All Implemented Interfaces:
ControlledObjectI, DrawableTierManagerI, TierManagerI, java.io.Serializable
Direct Known Subclasses:
FeatureTierManager

public class DrawableTierManager
extends TierManager
implements DrawableTierManagerI

See Also:
Serialized Form

Field Summary
protected  java.util.Vector drawables
           
protected static org.apache.log4j.Logger logger
           
protected  java.util.Hashtable tierhash
           
protected  Transformer transformer
           
 
Fields inherited from class apollo.gui.TierManager
aggregateSizeChange, charHeight, controller, offsetPixelHeight, tierManagerListeners, tiers, view, viewHeight, visibleLimits
 
Fields inherited from interface apollo.gui.TierManagerI
Y_PIXELS_PER_FEATURE
 
Constructor Summary
DrawableTierManager()
           
 
Method Summary
 void clearFeatures()
          Clears features from tiers, and clear tiers
 void fillTiers()
           
 java.util.Vector getVisibleDrawables(int[] limits)
          int[] limits is an array of 2 ints corresponding to low and high limits Returns a Vector of Vectors, each Vector within the outer Vector contains DrawableSeqFeatures that are the visible Features for a given tier Each DrawableSeqFeature is assigned a tier index corresponding to vertical placement.
protected  void populateTier(Drawable dsf)
          Add a Feature to a tier with which it has no overlaps.
protected  void setDrawables(java.util.Vector drawables)
           
 void setTierData(java.lang.Object data)
           
 void setTransformer(Transformer transformer)
          This is needed so that the features (in DNA coord space) can be transformed into pixel space by the tiers to determing how much horizontal real estate they need
 
Methods inherited from class apollo.gui.TierManager
addTierManagerListener, decrementTierHeight, doLayoutTiers, fireTierManagerEvent, fireTierManagerEvent, getAggregateSizeChange, getController, getControllerWindow, getLowestVisible, getMaximumVisibleTransformCoord, getMaxTierUserHeight, getMaxUserCoord, getMaxVisibleTierNumber, getMinimumVisibleTransformCoord, getNumTiers, getNumVisible, getTier, getTierLabel, getTiers, getTotalHeight, getView, getViewHeight, getVisibleUserCoord, getYRange, ignoreScoreThresholds, incrementTierHeight, needsAutoRemoval, setAggregateSizeChange, setCharHeight, setController, setIgnoreScoreThresholds, setLowestVisible, setOffsetHeight, setView, setViewHeight, toTier, toUser, updateUserCoordBoundaries
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface apollo.gui.TierManagerI
decrementTierHeight, doLayoutTiers, fireTierManagerEvent, getAggregateSizeChange, getLowestVisible, getMaxTierUserHeight, getMaxUserCoord, getMaxVisibleTierNumber, getMinimumVisibleTransformCoord, getNumTiers, getNumVisible, getTier, getTiers, getTotalHeight, getView, getVisibleUserCoord, getYRange, incrementTierHeight, setAggregateSizeChange, setCharHeight, setIgnoreScoreThresholds, setLowestVisible, setView, setViewHeight, toTier, toUser
 
Methods inherited from interface apollo.gui.ControlledObjectI
getController, getControllerWindow, needsAutoRemoval, setController
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger

drawables

protected java.util.Vector drawables

tierhash

protected java.util.Hashtable tierhash

transformer

protected Transformer transformer
Constructor Detail

DrawableTierManager

public DrawableTierManager()
Method Detail

setTransformer

public void setTransformer(Transformer transformer)
This is needed so that the features (in DNA coord space) can be transformed into pixel space by the tiers to determing how much horizontal real estate they need


setTierData

public void setTierData(java.lang.Object data)
Specified by:
setTierData in interface TierManagerI
Specified by:
setTierData in class TierManager

fillTiers

public void fillTiers()
Specified by:
fillTiers in class TierManager

setDrawables

protected void setDrawables(java.util.Vector drawables)

populateTier

protected void populateTier(Drawable dsf)
Add a Feature to a tier with which it has no overlaps. This routine is called recursively with each of the tiers that this Feature can be be added to. If no non-overlapping tier is found a new tier is created and added to the newTiers Vector, and the Feature is added to this newly created tier. NOTE: This routine requires that the Features are delivered in sorted order on low. Put in call to Drawable.setTierIndex to set its tier and keep drawables in synch with tiers - this did not work - not sure why - so im using FeatureTierManager.synchDrawablesWithTiers to do the same task instead. This should be reexamined. This should be the place where the assignment happens but obviously I'm missing something.


clearFeatures

public void clearFeatures()
Clears features from tiers, and clear tiers


getVisibleDrawables

public java.util.Vector getVisibleDrawables(int[] limits)
int[] limits is an array of 2 ints corresponding to low and high limits Returns a Vector of Vectors, each Vector within the outer Vector contains DrawableSeqFeatures that are the visible Features for a given tier Each DrawableSeqFeature is assigned a tier index corresponding to vertical placement. All the DrawableSeqFeatures at the same vertical level have the same tier index. The tier indices can go higher than the total number of tiers. This happens when a given tier is hidden it obviously is not added to the returned Vector of visible features, but the number it wouldve been assigned is skipped and not reused for the next tier. The following note: NOTE: This routine requires that the features are in sorted order in the tiers (which they are in FeatureTiers). is once again true. There was an optimization that assumed the DSFs were sorted from low to high, so when it hit a DSF that was above the bounds (>limits[1]) it would stop looking at the rest of the DSFs in that "tier". There are 2 problems with the sorting assumption. 1) The reverse strand is sorted high to low (when expanded) This could be solved by reversing the order for reverse strand but more killer is: 2) When collapsed all the "subtiers" get jammed together sequentially and there is no ordering for a whole collapsed row. this could be solved by doing a sort of the collapsed row but it probably isnt worth it. So now it looks at all the features from a "subtier" It turns out there was just a sorting bug for collapsed tiers that is now fixed so the optimization can once again assume sorting and is reinstated.

Specified by:
getVisibleDrawables in interface DrawableTierManagerI