com.objex.panywhere
Class Subtext

java.lang.Object
  extended by com.objex.panywhere.Subtext
All Implemented Interfaces:
java.io.Serializable

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

This class defines an object that contains the subtext lines or items. A Subtext object contains one of more subtext items of type Subtext.SubtextItem. A Subtext.SubtextItem object corresponds to the SubtextLegendItem with the same order / line number. Note that this an auxilliary object used only for the display of subtext lines on the Pedigree. The storage and persistence of the actual data relating to the SubtextItem's in this object are stored as Data properties within the Individual object.

See Also:
SubtextLegendItem, Serialized Form

Nested Class Summary
static class Subtext.SubtextItem
          Represents a Subtext line or item.
 
Field Summary
static java.lang.String PROP_SAMPLE_PROPERTY
           
 
Constructor Summary
Subtext()
          Creates a new Subtext object for the display of iconsubtext lines
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void addSubtextItem(Subtext.SubtextItem aItem, int ai_line)
          Adds a new SubtextItem to the list of SubtextItems making up this Subtext object
 void clear()
          Clears the current subtext items
 Subtext.SubtextItem getItem(int ai_order)
           
 java.lang.String getSampleProperty()
           
 java.util.Map<java.lang.Integer,Subtext.SubtextItem> getSubtextItems()
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void removeSubtextItem(int ai_line)
          Removes the SubtextItem to at the specified item line
protected  void render(java.awt.Graphics2D g2d, DrawingContext dc, double indX, double indY, Chromosome aChromosome, SubtextLegend aLegend)
          Draws all the subtext lines making up this Subtext object.
 void setSampleProperty(java.lang.String value)
           
 void setSubtextItems(java.util.Map<java.lang.Integer,Subtext.SubtextItem> aSubtextItems)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_SAMPLE_PROPERTY

public static final java.lang.String PROP_SAMPLE_PROPERTY
See Also:
Constant Field Values
Constructor Detail

Subtext

public Subtext()
Creates a new Subtext object for the display of iconsubtext lines

Method Detail

getSampleProperty

public java.lang.String getSampleProperty()

setSampleProperty

public void setSampleProperty(java.lang.String value)

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)

addSubtextItem

public void addSubtextItem(Subtext.SubtextItem aItem,
                           int ai_line)
Adds a new SubtextItem to the list of SubtextItems making up this Subtext object

Parameters:
aItem - The new SubtextItem
ai_line - The line number for the new item. This determines where on the list this item will be drawn. The line number also corresponds to the order number within the subtext legend to which this item relates.

removeSubtextItem

public void removeSubtextItem(int ai_line)
Removes the SubtextItem to at the specified item line

Parameters:
ai_line - The line number for the item to be removed

render

protected void render(java.awt.Graphics2D g2d,
                      DrawingContext dc,
                      double indX,
                      double indY,
                      Chromosome aChromosome,
                      SubtextLegend aLegend)
Draws all the subtext lines making up this Subtext object. The order of rendering of items depends on the line number for each item. This method also draws any markers on chromosome "aChromosome".

Parameters:
g2d - The graphics context
dc - The drawing context
indX - The X-Coodirnate of the Individual whose subtext this is
indY - The Y-Coodirnate of the Individual whose subtext this is
aChromosome - The chromosome with markers to be displayed below the Individual's subtext
aLegend - The subtext legend from which subtext data order and properties will be derived. If this subtext only a subset of the subtext items that exist on the legend, black spaces are drawn in the place of those subtext elements that are non-existent.

getSubtextItems

public java.util.Map<java.lang.Integer,Subtext.SubtextItem> getSubtextItems()
Returns:
A Map of subtextitems that belong to this subtext

setSubtextItems

public void setSubtextItems(java.util.Map<java.lang.Integer,Subtext.SubtextItem> aSubtextItems)

clear

public void clear()
Clears the current subtext items


getItem

public Subtext.SubtextItem getItem(int ai_order)
Parameters:
ai_order - The line number/order for the SubtextItem to be returned
Returns:
The SubtextItem at the specified order. May return null if no item is found with speified order