apollo.gui
Class TierManager

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

public abstract class TierManager
extends java.lang.Object
implements TierManagerI

The base abstract TierManager class to organise a set of data into several tiers. Uses longs for tier numbers, this could probably be changed to ints(?)

See Also:
Serialized Form

Field Summary
protected  int aggregateSizeChange
           
protected  int charHeight
           
protected  Controller controller
           
protected static org.apache.log4j.Logger logger
           
protected  int offsetPixelHeight
           
protected  java.util.Vector tierManagerListeners
           
protected  java.util.Vector tiers
          Vector of Tiers (FeatureTiers for FeatureTierManager) This is not set in this class, a subclass has to set this and there is no set method(perhaps there should be) only way to set is to use the variable itself.
protected  ViewI view
           
protected  int viewHeight
           
protected  int[] visibleLimits
           
 
Fields inherited from interface apollo.gui.TierManagerI
Y_PIXELS_PER_FEATURE
 
Constructor Summary
TierManager()
           
 
Method Summary
 void addTierManagerListener(TierManagerListener l)
           
 void decrementTierHeight()
           
 void doLayoutTiers()
           
abstract  void fillTiers()
           
 void fireTierManagerEvent(int type)
           
 void fireTierManagerEvent(TierManagerEvent evt)
           
 int getAggregateSizeChange()
           
 Controller getController()
          Gets the Controller for the object
 java.lang.Object getControllerWindow()
          Even though TierManagers are not gui they are gui-associated with its view.
 int getLowestVisible()
           
 int getMaximumVisibleTransformCoord(int min)
           
 long getMaxTierUserHeight()
           
 long getMaxUserCoord()
           
 int getMaxVisibleTierNumber()
          Returns the maximum visible tier number - The highest tier number can be greater than the number of tiers.
 int getMinimumVisibleTransformCoord()
           
 int getNumTiers()
           
 int getNumVisible()
           
 Tier getTier(int i)
           
 java.lang.String getTierLabel(int tierNum)
           
 java.util.Vector getTiers()
           
 int getTotalHeight()
           
 ViewI getView()
           
 int getViewHeight()
           
 long getVisibleUserCoord()
           
 int[] getYRange()
           
 boolean ignoreScoreThresholds()
           
 void incrementTierHeight()
           
 boolean needsAutoRemoval()
          Remove as listener from controller when window closes.
 void setAggregateSizeChange(int change)
           
 void setCharHeight(int height)
           
 void setController(Controller c)
          Sets the Controller for the object
 void setIgnoreScoreThresholds(boolean ignore)
          If ignore is true, will not consider score thresholds in populating the tier.
 void setLowestVisible(int lowest)
           
 void setOffsetHeight(int height)
          Offset in pixels before first tier
abstract  void setTierData(java.lang.Object data)
           
 void setView(ViewI v)
           
 void setViewHeight(int height)
          Height in pixels of area to display tiers in
 long toTier(long userCoord)
          Convert from user coords to tier number
 int toUser(int tierNum)
           
 void updateUserCoordBoundaries()
           
 
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

tiers

protected java.util.Vector tiers
Vector of Tiers (FeatureTiers for FeatureTierManager) This is not set in this class, a subclass has to set this and there is no set method(perhaps there should be) only way to set is to use the variable itself.


visibleLimits

protected int[] visibleLimits

viewHeight

protected int viewHeight

offsetPixelHeight

protected int offsetPixelHeight

aggregateSizeChange

protected int aggregateSizeChange

charHeight

protected int charHeight

view

protected ViewI view

controller

protected Controller controller

tierManagerListeners

protected java.util.Vector tierManagerListeners
Constructor Detail

TierManager

public TierManager()
Method Detail

doLayoutTiers

public void doLayoutTiers()
Specified by:
doLayoutTiers in interface TierManagerI

setCharHeight

public void setCharHeight(int height)
Specified by:
setCharHeight in interface TierManagerI

updateUserCoordBoundaries

public void updateUserCoordBoundaries()

fillTiers

public abstract void fillTiers()

setTierData

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

getTiers

public java.util.Vector getTiers()
Specified by:
getTiers in interface TierManagerI

getTier

public Tier getTier(int i)
Specified by:
getTier in interface TierManagerI

getNumTiers

public int getNumTiers()
Specified by:
getNumTiers in interface TierManagerI

getLowestVisible

public int getLowestVisible()
Specified by:
getLowestVisible in interface TierManagerI

setLowestVisible

public void setLowestVisible(int lowest)
Specified by:
setLowestVisible in interface TierManagerI

getNumVisible

public int getNumVisible()
Specified by:
getNumVisible in interface TierManagerI

getMaxVisibleTierNumber

public int getMaxVisibleTierNumber()
Returns the maximum visible tier number - The highest tier number can be greater than the number of tiers. This is handy for tracking visible tiers (eg masking optimization)

Specified by:
getMaxVisibleTierNumber in interface TierManagerI

getMaximumVisibleTransformCoord

public int getMaximumVisibleTransformCoord(int min)

getMinimumVisibleTransformCoord

public int getMinimumVisibleTransformCoord()
Specified by:
getMinimumVisibleTransformCoord in interface TierManagerI

incrementTierHeight

public void incrementTierHeight()
Specified by:
incrementTierHeight in interface TierManagerI

decrementTierHeight

public void decrementTierHeight()
Specified by:
decrementTierHeight in interface TierManagerI

setAggregateSizeChange

public void setAggregateSizeChange(int change)
Specified by:
setAggregateSizeChange in interface TierManagerI

getAggregateSizeChange

public int getAggregateSizeChange()
Specified by:
getAggregateSizeChange in interface TierManagerI

setOffsetHeight

public void setOffsetHeight(int height)
Offset in pixels before first tier


setViewHeight

public void setViewHeight(int height)
Height in pixels of area to display tiers in

Specified by:
setViewHeight in interface TierManagerI

getViewHeight

public int getViewHeight()

toTier

public long toTier(long userCoord)
Convert from user coords to tier number

Specified by:
toTier in interface TierManagerI

getTotalHeight

public int getTotalHeight()
Specified by:
getTotalHeight in interface TierManagerI

getMaxTierUserHeight

public long getMaxTierUserHeight()
Specified by:
getMaxTierUserHeight in interface TierManagerI

getMaxUserCoord

public long getMaxUserCoord()
Specified by:
getMaxUserCoord in interface TierManagerI

getVisibleUserCoord

public long getVisibleUserCoord()
Specified by:
getVisibleUserCoord in interface TierManagerI

toUser

public int toUser(int tierNum)
Specified by:
toUser in interface TierManagerI

addTierManagerListener

public void addTierManagerListener(TierManagerListener l)

fireTierManagerEvent

public void fireTierManagerEvent(TierManagerEvent evt)

fireTierManagerEvent

public void fireTierManagerEvent(int type)
Specified by:
fireTierManagerEvent in interface TierManagerI

setController

public void setController(Controller c)
Description copied from interface: ControlledObjectI
Sets the Controller for the object

Specified by:
setController in interface ControlledObjectI

getController

public Controller getController()
Description copied from interface: ControlledObjectI
Gets the Controller for the object

Specified by:
getController in interface ControlledObjectI

getControllerWindow

public java.lang.Object getControllerWindow()
Even though TierManagers are not gui they are gui-associated with its view. Thus when the ancestor window of the view (ApolloFrame) closes, TierManager gets removed as listener to its controller. Presently this is irrelevant because if ApolloFrame is closing apollo exits, so removing listener doesnt matter

Specified by:
getControllerWindow in interface ControlledObjectI

needsAutoRemoval

public boolean needsAutoRemoval()
Remove as listener from controller when window closes.

Specified by:
needsAutoRemoval in interface ControlledObjectI

setView

public void setView(ViewI v)
Specified by:
setView in interface TierManagerI

getView

public ViewI getView()
Specified by:
getView in interface TierManagerI

getYRange

public int[] getYRange()
Specified by:
getYRange in interface TierManagerI

setIgnoreScoreThresholds

public void setIgnoreScoreThresholds(boolean ignore)
If ignore is true, will not consider score thresholds in populating the tier. This is needed for drag view where it is possible to drag a feature that has a score under threshold, but since it has siblings(in feat set) above threshold it gets displayed. Since only items that have somehow gotten through the threshold (either by self score or siblings) can be displayed and thus dragged, theres no need to do the score threshold again anyways.

Specified by:
setIgnoreScoreThresholds in interface TierManagerI

ignoreScoreThresholds

public boolean ignoreScoreThresholds()

getTierLabel

public java.lang.String getTierLabel(int tierNum)