mesquite.cont.lib
Class ContinuousHistory

java.lang.Object
  extended by mesquite.lib.characters.CharacterStates
      extended by mesquite.cont.lib.ContinuousStates
          extended by mesquite.cont.lib.ContinuousDistribution
              extended by mesquite.cont.lib.ContinuousAdjustable
                  extended by mesquite.cont.lib.ContinuousHistory
All Implemented Interfaces:
ItemContainer, AdjustableDistribution, CharacterDistribution, CharacterHistory, CharacterStatesHolder, Listable, Renamable, WithStringDetails

public class ContinuousHistory
extends ContinuousAdjustable
implements CharacterHistory

Contains an array of continuous character states for one character, at each of the taxa or nodes. See notes under ContinuousData regarding items


Field Summary
 
Fields inherited from class mesquite.cont.lib.ContinuousAdjustable
firstItem, items, numNodes
 
Fields inherited from class mesquite.lib.characters.CharacterStates
characterNumber, data, totalCreated
 
Constructor Summary
ContinuousHistory(Taxa taxa, int numNodes, ContinuousData data)
           
 
Method Summary
 CharacterHistory adjustSize(Tree tree)
          This readjust procedure can be called to readjust the size of storage of states of a character for nodes.
 CharacterHistory clone(CharacterHistory s)
          clones given CharacterHistory.
 int getColorsAtNode(int node, ColorDistribution colors, MesquiteColorTable stateColors, boolean showWeights)
          Places into Color array the colors at the node, and returns the number of colors.
 ColorEventVector getColorSequenceAtNode(int node, MesquiteColorTable stateColors)
          returns the vector of ColorEvents in order, e.g.
 int getColorsOfState(CharacterState state, ColorDistribution colors, MesquiteColorTable colorTable)
          places into the already instantiated ColorDistribution the colors corresponding to the CharacterState, and returns the number of colors.
 MesquiteColorTable getColorTable(MesquiteColorTable colorTable)
           
 int getLegendStates(java.awt.Color[] cs, java.lang.String[] stateNames, java.awt.Point[] tableMappings, MesquiteColorTable stateColors)
          gets colors and statesnames of states in reconstruction.
 CharacterDistribution getObservedStates()
          Returns the states in the terminal taxa (used if History is reconstruction)
 CharacterDistribution getStatesAtTips(Tree tree)
          Returns a new object indicating the states at the tips (used whether or not History is reconstruction)
 void prepareColors(Tree tree, int drawnRoot)
          Must be called before a tree is shaded.
 void setObservedStates(CharacterDistribution observed)
          Sets the states in the terminal taxa (used if History is reconstruction)
 
Methods inherited from class mesquite.cont.lib.ContinuousAdjustable
addItem, addItem, adjustSize, deassignStates, establishItem, establishItem, getItem, getItemName, getItemNumber, getItemReference, getItemReference, getNumItems, getNumNodes, getNumTaxa, getState, getState, removeItem, setCharacterState, setItemReference, setItems, setItems, setItemsAs, setState, setState, tradeStatesBetweenTaxa
 
Methods inherited from class mesquite.cont.lib.ContinuousDistribution
adjustHistorySize, getAdjustableClone, hasInapplicable, hasInapplicable, hasMissing, hasMissing, isConstant, isConstant
 
Methods inherited from class mesquite.cont.lib.ContinuousStates
firstIsGreater, getCharacterDataClass, getCharacterState, getCharacterState, getDataTypeName, getDefaultModel, getStateClass, isInapplicable, isUnassigned, isUncertain, logStates, statesEqual, toString, userQueryItem
 
Methods inherited from class mesquite.lib.characters.CharacterStates
checkIllegalNode, getName, getParentCharacter, getParentData, getTaxa, makeCharacterState, setName, setParentCharacter, setParentData, setTaxa, toExternal, toInternal, toStringWithDetails
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface mesquite.lib.characters.AdjustableDistribution
adjustSize, deassignStates, setCharacterState, setParentCharacter, setParentData, tradeStatesBetweenTaxa
 
Methods inherited from interface mesquite.lib.characters.CharacterStatesHolder
firstIsGreater, getCharacterDataClass, getCharacterState, getCharacterState, getDefaultModel, getNumNodes, getNumTaxa, getParentCharacter, getParentData, getStateClass, getTaxa, isInapplicable, isUnassigned, isUncertain, logStates, statesEqual, toString, toStringWithDetails
 
Methods inherited from interface mesquite.lib.Listable
getName
 
Methods inherited from interface mesquite.lib.Renamable
setName
 

Constructor Detail

ContinuousHistory

public ContinuousHistory(Taxa taxa,
                         int numNodes,
                         ContinuousData data)
Method Detail

clone

public CharacterHistory clone(CharacterHistory s)
Description copied from interface: CharacterHistory
clones given CharacterHistory. May be used to generate a similar object without reference to subclass

Specified by:
clone in interface CharacterHistory

getStatesAtTips

public CharacterDistribution getStatesAtTips(Tree tree)
Returns a new object indicating the states at the tips (used whether or not History is reconstruction)

Specified by:
getStatesAtTips in interface CharacterHistory

getObservedStates

public CharacterDistribution getObservedStates()
Returns the states in the terminal taxa (used if History is reconstruction)

Specified by:
getObservedStates in interface CharacterHistory

setObservedStates

public void setObservedStates(CharacterDistribution observed)
Sets the states in the terminal taxa (used if History is reconstruction)

Specified by:
setObservedStates in interface CharacterHistory

adjustSize

public CharacterHistory adjustSize(Tree tree)
This readjust procedure can be called to readjust the size of storage of states of a character for nodes.

Specified by:
adjustSize in interface CharacterHistory

prepareColors

public void prepareColors(Tree tree,
                          int drawnRoot)
Must be called before a tree is shaded. Goes through all nodes to find states present, to set minima and maxima.

Specified by:
prepareColors in interface CharacterHistory

getColorsOfState

public int getColorsOfState(CharacterState state,
                            ColorDistribution colors,
                            MesquiteColorTable colorTable)
places into the already instantiated ColorDistribution the colors corresponding to the CharacterState, and returns the number of colors. Uses default colors. Mode is MesquiteColorTable.GRAYSCALE, COLORS, COLORS_NO_BW, or DEFAULT (default depends on subclass)

Specified by:
getColorsOfState in interface CharacterHistory

getColorTable

public MesquiteColorTable getColorTable(MesquiteColorTable colorTable)
Specified by:
getColorTable in interface CharacterHistory

getColorsAtNode

public int getColorsAtNode(int node,
                           ColorDistribution colors,
                           MesquiteColorTable stateColors,
                           boolean showWeights)
Places into Color array the colors at the node, and returns the number of colors. Uses passed stateColors as color key. If null is passed, uses color system of parent data (using maxState of this StsOfCharcter) or, if there is not parent data object, the default colors.

Specified by:
getColorsAtNode in interface CharacterHistory

getColorSequenceAtNode

public ColorEventVector getColorSequenceAtNode(int node,
                                               MesquiteColorTable stateColors)
returns the vector of ColorEvents in order, e.g. for stochastic character mapping. Return null if none. Not yet supported for ContinuousHistory

Specified by:
getColorSequenceAtNode in interface CharacterHistory

getLegendStates

public int getLegendStates(java.awt.Color[] cs,
                           java.lang.String[] stateNames,
                           java.awt.Point[] tableMappings,
                           MesquiteColorTable stateColors)
Description copied from interface: CharacterHistory
gets colors and statesnames of states in reconstruction. For continuous types may break down into ranges of states Mode is MesquiteColorTable.GRAYSCALE, COLORS, COLORS_NO_BW, or DEFAULT (default depends on subclass)* public int getLegendStates(Color[] cs, String[] stateNames, int mode); /** gets colors and statesnames of states in reconstruction. For continuous types may break down into ranges of states.

Specified by:
getLegendStates in interface CharacterHistory