com.objex.progeny.anywhere.data
Class MarkerLegend

java.lang.Object
  extended by com.objex.progeny.anywhere.data.MarkerLegend
All Implemented Interfaces:
java.io.Serializable

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

MarkerLegend stores and manages chromosome legend items. A chromosome legend item acts as key (on the marker legend) to a chromsome of the same properties in a person's genetic data.
A single line is drawn (just as subtext legend items) per generation for each marker in marker legend. The marker names are drawn to the left and below the left most person in each generation.
If there are subtext legend items, the marker names or marker legend items will be rendered below that last subtext line. Rendering markers or haplotypes can be switched on or off by setting the
ProgenyAnywhere.setShowHaplotypes(Boolean) property appropriately

See Also:
ChromosomeLegendItem, Serialized Form

Constructor Summary
MarkerLegend()
          Create new instance of MarkerLegend
 
Method Summary
 void addChromoLegendItem(ChromosomeLegendItem a_chromosome)
          Add a chromomsome legend item to the current list/map of items in this legend.
 void clear()
          Deletes all the chromosome legend items.
 java.util.Map<java.lang.Integer,ChromosomeLegendItem> getChromoItems()
           
 ChromosomeLegendItem getChromosomeItemForId(int ai_chromoid)
           
 ChromosomeLegendItem getChromosomeItemForName(java.lang.String as_chromoname)
           
 ChromosomeLegendItem getChromosomeLegendItem(int ai_marker_fieldid)
           
 int getItemCount()
           
 MarkerLegendItem getMarkerItem(int ai_fieldid)
           
 MarkerLegendItem getMarkerItem(java.lang.String as_name)
           
 java.util.Iterator<ChromosomeLegendItem> iterator()
           
 java.util.Iterator<MarkerLegendItem> iterator(boolean ab_chromosome_order)
           
 void setChromoItems(java.util.Map<java.lang.Integer,ChromosomeLegendItem> a_chromoItems)
          Sets a new map of chromosome legend items keyed by sequence ID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MarkerLegend

public MarkerLegend()
Create new instance of MarkerLegend

Method Detail

getChromosomeItemForId

public ChromosomeLegendItem getChromosomeItemForId(int ai_chromoid)
Parameters:
ai_chromoid - The ID of the chromosome that is linked to this chromosome legend item
Returns:
The chromosome legend item linked to the chromosome with similar ID. Null may be returned

getChromosomeLegendItem

public ChromosomeLegendItem getChromosomeLegendItem(int ai_marker_fieldid)
Parameters:
ai_marker_fieldid - The ID of the marker on a chromosome that is linked to the chromosome legend item to be retrieved
Returns:
The chromosome legend item linked to the chromosome that contains a marker with specified ID. Null may be returned

setChromoItems

public void setChromoItems(java.util.Map<java.lang.Integer,ChromosomeLegendItem> a_chromoItems)
Sets a new map of chromosome legend items keyed by sequence ID.

Parameters:
a_chromoItems - The new map of chromosome legend items keyed by sequence ID.

getChromoItems

public java.util.Map<java.lang.Integer,ChromosomeLegendItem> getChromoItems()
Returns:
A map of chromosome legend items keyed by sequence ID. Null may be returned

addChromoLegendItem

public void addChromoLegendItem(ChromosomeLegendItem a_chromosome)
Add a chromomsome legend item to the current list/map of items in this legend. The item will be added at the next available sequence number

Parameters:
a_chromosome - New chromosome legend item to be added

iterator

public java.util.Iterator<ChromosomeLegendItem> iterator()
Returns:
An iterator of the current chromosome legend items in marker sequence order

getItemCount

public int getItemCount()
Returns:
Number of marker legend items in this legend. If there are 10 chromosome legend items each with 5 marker legend items then 50 will be returned

iterator

public java.util.Iterator<MarkerLegendItem> iterator(boolean ab_chromosome_order)
Parameters:
ab_chromosome_order - If true then markers will be returned in chromosome order and then by marker sequence within a chromosome. Otherwise the order will be marker sequence regardless of what chromosome the marker is on.
Returns:
An Iterator of all marker legend items on all chromosome legend items in this legend .

getChromosomeItemForName

public ChromosomeLegendItem getChromosomeItemForName(java.lang.String as_chromoname)
Parameters:
as_chromoname - The name of the chromosome linked to the chromosome legend item to be retrieved.
Returns:
The chromosome legend item linked to a chromsome with specified name

getMarkerItem

public MarkerLegendItem getMarkerItem(java.lang.String as_name)
Parameters:
as_name - The name of the marker linked to this marker legend item to be returned
Returns:
The marker legend item linked to marker of the same name

getMarkerItem

public MarkerLegendItem getMarkerItem(int ai_fieldid)
Parameters:
ai_fieldid - The fieldid of the marker legend item to be returned.
Returns:
The marker legend item linked to a marker with the specified fieldid.

clear

public void clear()
Deletes all the chromosome legend items. Also resets the next available sequence.