com.objex.panywhere
Class LegendItem

java.lang.Object
  extended by com.objex.panywhere.LegendItem
All Implemented Interfaces:
ComparableItems, java.io.Serializable

public class LegendItem
extends java.lang.Object
implements java.io.Serializable, ComparableItems

A LegendItem in a Pedigree encapsulates the properties that describe the traits being tracked within that Pedigree. For example, if the Pedigree is used to track the existence of Cervical Cancer, a LegendItem object will be created with Cervical Cancer as the display text or description and with the quadrantOneColor property set to red. An Individual with Cervial Cancer will have a Symbol object that encapsulates the LegendItem just described. The relationship between a LegendItem object, a Symbol object and an Individual object can best be summarized as below :-

  1. A Pedigree has a Legend, which contains any number of LegendItems used to describe the various traits being tracked within the Pedigree.
  2. A LegendItem has among other properties, the display text, one or more conditions/where clauses that the Individual object must satisfy by way of containing data required, in order for the encoding information in a LegendItem to be applied to the Symbol for the Individual.
  3. A Symbol object, which is encapsulated within an Individual object, can have any number of LegendItems assigned to it depending on the conditions / where clauses specified for those LegendItems.


The icon for an Individual whose Symbol has certain LegendItems assigned to it can be recognized by the similaries in appearance of the Icon to ththe appearance of the LegendItem icon drawn on the Legend part of the Pedigree.

To put it another way, LegendItems describe the meaning of Symbols shown on the Icon of an Individual.

Starting with version 3.0, LegendItems are now linked to the custom data or other properties of an Individual through the conditions / where clauses specified for the LegendItem. A LegendItem can therefore only be applied to the Individual's Symbol IFF the conditions specified in the where clause of the LegendItem are fully satisfied by some property of the Individual owning that Symbol. The Individual has to contain custom data or other properties that match the where clause of the LegendItem.

See Also:
Symbol, Legend, LegendCondition, Serialized Form

Field Summary
 
Fields inherited from interface com.objex.panywhere.ComparableItems
AND_OPERATOR, EQUALS_OPERATOR, GREATER_THAN_OPERATOR, GREATER_THAN_OR_EQUAL_OPERATOR, ISNOTNULL_OPERATOR, ISNULL_OPERATOR, OR_OPERATOR, SMALLER_THAN_OPERATOR, SMALLER_THAN_OR_EQUAL_OPERATOR
 
Constructor Summary
LegendItem()
          Creates a new Legend item with null symbols
 
Method Summary
 void addCondition(int ai_conditionfieldid, java.lang.String as_operator, java.lang.Object aCompareValue)
          Adds a new Subtext condition that will determine whethere or not an Indvidual subject's subtext value should be deisplayed based on whether or not the data value in the specified field for this subtext item satisfies the specified condition.
 void addPropertyChangeListener(java.beans.PropertyChangeListener lstnr)
          Enables users of the Legend Bean to add property listeners
 void copyItem(LegendItem mCon)
          Copies the the encoding details from the specified Legend Item and encodes this Legend item with them.
 java.awt.Color getCenterCircleColor()
           
 java.awt.Paint getCenterCirclePaint()
          NOT USED
 java.awt.Color getCenterSquareColor()
           
 java.awt.Paint getCenterSquarePaint()
          NOT USED
 java.util.List<LegendCondition> getConditions()
           
 java.util.Iterator<LegendCondition> getConditionsIterator()
           
 java.lang.String getID()
           
 java.lang.String getLegendDisplayText()
           
 java.lang.String getLegendText()
           
 boolean getQuad1Dot()
           
 java.awt.Color getQuad1DotColor()
          Getter for property quad1DotColor.
 boolean getQuad2Dot()
           
 java.awt.Color getQuad2DotColor()
          Getter for property quad2DotColor.
 boolean getQuad3Dot()
           
 java.awt.Color getQuad3DotColor()
          Getter for property quad3DotColor.
 boolean getQuad4Dot()
           
 java.awt.Color getQuad4DotColor()
          Getter for property quad4DotColor.
 java.awt.Color getQuadFourColor()
           
 java.awt.Paint getQuadFourPaint()
          NOT USED
 java.awt.Color getQuadOneColor()
           
 java.awt.Paint getQuadOnePaint()
          NOT USED
 java.awt.Color getQuadThreeColor()
           
 java.awt.Paint getQuadThreePaint()
          NOT USED
 java.awt.Color getQuadTwoColor()
           
 java.awt.Paint getQuadTwoPaint()
          NOT USED
 double getX()
           
 double getY()
           
 boolean isHLine()
           
 boolean isQuestionMark()
           
 boolean isVLine()
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener lstnr)
          Enables users of the Legend Bean to add property listeners
protected  void render(double x, double y, java.awt.Graphics2D g2d)
          Paints an Icon and its description on the Pedigree surface
 void setCenterCircleColor(java.awt.Color qColor)
          Sets the color value for the centre circle of the symbol
 void setCenterCircleColor(int qColorRGB)
          Sets the RGB value for the color for the centre circle of the symbol
 void setCenterCirclePaint(java.awt.Paint qPaint)
          NOT USED
 void setCenterSquareColor(java.awt.Color qColor)
          Sets the color for the centre square of the symbol
 void setCenterSquareColor(int qColorRGB)
          Sets the RGB value for the color for the centre squqre of the symbol
 void setCenterSquarePaint(java.awt.Paint qPaint)
          NOT USED
 void setConditions(java.util.List<LegendCondition> aConditions)
          Sets the new Iterable list of subtext conditions
 void setHLine(boolean hline)
          Sets or unsets the vertical line flag for this symbol depending on the value of parameter passed.
 void setID(java.lang.String strCondition)
          Sets the Legend Item's ID
 void setLegendDisplayText(java.lang.String legendDisplayText)
          Sets the display text for the legend item.
 void setLegendText(java.lang.String text)
          Sets the Legend Item's text that describes what this legend the symbols it encapsulates mean.
 void setQuad1Dot(boolean qColor)
          Sets the symbol color for quadrant 1.
 void setQuad1DotColor(java.awt.Color aColor)
          Setter for property quad1DotColor.
 void setQuad2Dot(boolean qColor)
          Sets the symbol color for quadrant 2 dot.
 void setQuad2DotColor(java.awt.Color aColor)
          Setter for property quad2DotColor.
 void setQuad3Dot(boolean qColor)
          Sets the symbol color for quadrant 3 dot
 void setQuad3DotColor(java.awt.Color aColor)
          Setter for property quad3DotColor.
 void setQuad4Dot(boolean qColor)
          Sets the symbol color for quadrant 4 dot
 void setQuad4DotColor(java.awt.Color aColor)
          Setter for property quad4DotColor.
 void setQuadFourColor(java.awt.Color qColor)
          Sets the symbol color for quadrant 4
 void setQuadFourColor(int qColorRGB)
          Sets the RGB value for the color in Quadrant 4
 void setQuadFourPaint(java.awt.Paint qPaint)
          NOT USED
 void setQuadOneColor(java.awt.Color qColor)
          Sets the symbol color for quadrant 1
 void setQuadOneColor(int qColorRGB)
          Sets the RGB value for the color in Quadrant 1
 void setQuadOnePaint(java.awt.Paint qPaint)
          NOT USED
 void setQuadThreeColor(java.awt.Color qColor)
          Sets the symbol color for quadrant 3
 void setQuadThreeColor(int qColorRGB)
          Sets the RGB value for the color in Quadrant 3
 void setQuadThreePaint(java.awt.Paint qPaint)
          NOT USED
 void setQuadTwoColor(java.awt.Color qColor)
          Sets the symbol color for quadrant 2
 void setQuadTwoColor(int qColorRGB)
          Sets the RGB value for the color in Quadrant 2
 void setQuadTwoPaint(java.awt.Paint qPaint)
          NOT USED
 void setQuestionMark(boolean q)
          Sets the flag to show question mark symbol to true or false.
 void setVLine(boolean vline)
          Sets or unsets the vertical line flag for this symbol depending on the value of parameter passed.
 void setX(double xc)
          Sets the current legend symbol location X Coordinate
 void setY(double yc)
          Sets the current legend symbol location Y Coordinate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LegendItem

public LegendItem()
Creates a new Legend item with null symbols

Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener lstnr)
Enables users of the Legend Bean to add property listeners


removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener lstnr)
Enables users of the Legend Bean to add property listeners


getX

public double getX()
Returns:
The current legend symbol location X Coordinate

getY

public double getY()
Returns:
The current legend symbol location Y Coordinate

setX

public void setX(double xc)
Sets the current legend symbol location X Coordinate

Parameters:
xc - The value to set the location to

setY

public void setY(double yc)
Sets the current legend symbol location Y Coordinate

Parameters:
yc - The value to set the location to

getLegendText

public java.lang.String getLegendText()
Returns:
The Legend text for this legend Item / Symbol

setLegendText

public void setLegendText(java.lang.String text)
Sets the Legend Item's text that describes what this legend the symbols it encapsulates mean.

Parameters:
text - The new legend text

getID

public java.lang.String getID()
Returns:
The current legend ID

setID

public void setID(java.lang.String strCondition)
Sets the Legend Item's ID

Parameters:
strCondition - The new legendItem ID

getQuad1Dot

public boolean getQuad1Dot()
Returns:
True if quadrant 1 dot must be shown

setQuad1Dot

public void setQuad1Dot(boolean qColor)
Sets the symbol color for quadrant 1.

Parameters:
qColor - The new color for quadrant 1.

getQuad2Dot

public boolean getQuad2Dot()
Returns:
True if quadrant 2 dot must be shown

setQuad2Dot

public void setQuad2Dot(boolean qColor)
Sets the symbol color for quadrant 2 dot.

Parameters:
qColor - The new color for quadrant 2 dot.

getQuad3Dot

public boolean getQuad3Dot()
Returns:
True if quadrant 3 dot must be shown

setQuad3Dot

public void setQuad3Dot(boolean qColor)
Sets the symbol color for quadrant 3 dot

Parameters:
qColor - The new color for quadrant 3 dot.

getQuad4Dot

public boolean getQuad4Dot()
Returns:
True if quadrant 4 dot must be shown

setQuad4Dot

public void setQuad4Dot(boolean qColor)
Sets the symbol color for quadrant 4 dot

Parameters:
qColor - The new color for quadrant 4 dot

isVLine

public boolean isVLine()
Returns:
True if vertical line must be shown

setVLine

public void setVLine(boolean vline)
Sets or unsets the vertical line flag for this symbol depending on the value of parameter passed.

Parameters:
vline - Boolean indicating whether to set or unset the vertcial line flag

isQuestionMark

public boolean isQuestionMark()
Returns:
True If Question mark symbol is set and false otherwise

setQuestionMark

public void setQuestionMark(boolean q)
Sets the flag to show question mark symbol to true or false.

Parameters:
q - The value to set (True or False)

isHLine

public boolean isHLine()
Returns:
True if horizontal line must be shown

setHLine

public void setHLine(boolean hline)
Sets or unsets the vertical line flag for this symbol depending on the value of parameter passed.

Parameters:
hline - Boolean indicating whether to set or unset the h/zontal line flag

getQuadOneColor

public java.awt.Color getQuadOneColor()
Returns:
The current value of the Color for quadrant 1, null if no color is set

setQuadOneColor

public void setQuadOneColor(java.awt.Color qColor)
Sets the symbol color for quadrant 1

Parameters:
qColor - The new color for quadrant 1

getQuadOnePaint

public java.awt.Paint getQuadOnePaint()
NOT USED


setQuadOnePaint

public void setQuadOnePaint(java.awt.Paint qPaint)
NOT USED


getQuadTwoPaint

public java.awt.Paint getQuadTwoPaint()
NOT USED


setQuadTwoPaint

public void setQuadTwoPaint(java.awt.Paint qPaint)
NOT USED


getQuadThreePaint

public java.awt.Paint getQuadThreePaint()
NOT USED


setQuadThreePaint

public void setQuadThreePaint(java.awt.Paint qPaint)
NOT USED


getQuadFourPaint

public java.awt.Paint getQuadFourPaint()
NOT USED


setQuadFourPaint

public void setQuadFourPaint(java.awt.Paint qPaint)
NOT USED


getCenterCirclePaint

public java.awt.Paint getCenterCirclePaint()
NOT USED


setCenterCirclePaint

public void setCenterCirclePaint(java.awt.Paint qPaint)
NOT USED


getCenterSquarePaint

public java.awt.Paint getCenterSquarePaint()
NOT USED


setCenterSquarePaint

public void setCenterSquarePaint(java.awt.Paint qPaint)
NOT USED


setQuadOneColor

public void setQuadOneColor(int qColorRGB)
Sets the RGB value for the color in Quadrant 1

Parameters:
qColorRGB - The new RGB value

getQuadTwoColor

public java.awt.Color getQuadTwoColor()
Returns:
The current value of the Color for quadrant 2, null if no color is set

setQuadTwoColor

public void setQuadTwoColor(java.awt.Color qColor)
Sets the symbol color for quadrant 2

Parameters:
qColor - The new color for quadrant 2

setQuadTwoColor

public void setQuadTwoColor(int qColorRGB)
Sets the RGB value for the color in Quadrant 2

Parameters:
qColorRGB - The new RGB value

getQuadThreeColor

public java.awt.Color getQuadThreeColor()
Returns:
The current value of the Color for quadrant 3, null if no color is set

setQuadThreeColor

public void setQuadThreeColor(java.awt.Color qColor)
Sets the symbol color for quadrant 3

Parameters:
qColor - The new color for quadrant 3

setQuadThreeColor

public void setQuadThreeColor(int qColorRGB)
Sets the RGB value for the color in Quadrant 3

Parameters:
qColorRGB - The new RGB value

getQuadFourColor

public java.awt.Color getQuadFourColor()
Returns:
The current value of the Color for quadrant 4, null if no color is set

setQuadFourColor

public void setQuadFourColor(java.awt.Color qColor)
Sets the symbol color for quadrant 4

Parameters:
qColor - The new color for quadrant 4

setQuadFourColor

public void setQuadFourColor(int qColorRGB)
Sets the RGB value for the color in Quadrant 4

Parameters:
qColorRGB - The new RGB value

getCenterCircleColor

public java.awt.Color getCenterCircleColor()
Returns:
The current center Circle Color - null if no color is set

setCenterCircleColor

public void setCenterCircleColor(java.awt.Color qColor)
Sets the color value for the centre circle of the symbol

Parameters:
qColor - The new color value

setCenterCircleColor

public void setCenterCircleColor(int qColorRGB)
Sets the RGB value for the color for the centre circle of the symbol

Parameters:
qColorRGB - The new RGB value

getCenterSquareColor

public java.awt.Color getCenterSquareColor()
Returns:
The current center square color - null if no color is set

setCenterSquareColor

public void setCenterSquareColor(java.awt.Color qColor)
Sets the color for the centre square of the symbol

Parameters:
qColor - The new color value

setCenterSquareColor

public void setCenterSquareColor(int qColorRGB)
Sets the RGB value for the color for the centre squqre of the symbol

Parameters:
qColorRGB - The new RGB value

render

protected void render(double x,
                      double y,
                      java.awt.Graphics2D g2d)
Paints an Icon and its description on the Pedigree surface

Parameters:
x - The X coordinate of the LegendItem Icon on the Pedigree surface
y - The Y coordinate of the LegendItem Icon on the Pedigree surface
g2d - The graphics context / paint brush for drawing.

copyItem

public void copyItem(LegendItem mCon)
Copies the the encoding details from the specified Legend Item and encodes this Legend item with them. The ID and Legend Text are not cloned in this exercise.

Parameters:
mCon - The legend item from which the encoding data is to be copied

getQuad1DotColor

public java.awt.Color getQuad1DotColor()
Getter for property quad1DotColor.

Returns:
Value of property quad1DotColor.

setQuad1DotColor

public void setQuad1DotColor(java.awt.Color aColor)
Setter for property quad1DotColor.

Parameters:
aColor - New value of property quad1DotColor.

getQuad2DotColor

public java.awt.Color getQuad2DotColor()
Getter for property quad2DotColor.

Returns:
Value of property quad2DotColor.

setQuad2DotColor

public void setQuad2DotColor(java.awt.Color aColor)
Setter for property quad2DotColor.

Parameters:
aColor - New value of property quad2DotColor.

getQuad3DotColor

public java.awt.Color getQuad3DotColor()
Getter for property quad3DotColor.

Returns:
Value of property quad3DotColor.

setQuad3DotColor

public void setQuad3DotColor(java.awt.Color aColor)
Setter for property quad3DotColor.

Parameters:
aColor - New value of property quad3DotColor.

getQuad4DotColor

public java.awt.Color getQuad4DotColor()
Getter for property quad4DotColor.

Returns:
Value of property quad4DotColor.

setQuad4DotColor

public void setQuad4DotColor(java.awt.Color aColor)
Setter for property quad4DotColor.

Parameters:
aColor - New value of property quad4DotColor.

getConditions

public java.util.List<LegendCondition> getConditions()
Specified by:
getConditions in interface ComparableItems
Returns:
an Iterable list of subtext conditions or null if there are no conditions for this subtext

setConditions

public void setConditions(java.util.List<LegendCondition> aConditions)
Sets the new Iterable list of subtext conditions

Specified by:
setConditions in interface ComparableItems
Parameters:
aConditions - The new list of conditions

getLegendDisplayText

public java.lang.String getLegendDisplayText()
Specified by:
getLegendDisplayText in interface ComparableItems
Returns:
The display text for the legend item. This is what will be drawn on the left side of the subtext line

setLegendDisplayText

public void setLegendDisplayText(java.lang.String legendDisplayText)
Sets the display text for the legend item. This is what will be drawn on the left side of the subtext line

Specified by:
setLegendDisplayText in interface ComparableItems

addCondition

public void addCondition(int ai_conditionfieldid,
                         java.lang.String as_operator,
                         java.lang.Object aCompareValue)
Adds a new Subtext condition that will determine whethere or not an Indvidual subject's subtext value should be deisplayed based on whether or not the data value in the specified field for this subtext item satisfies the specified condition.

Specified by:
addCondition in interface ComparableItems
Parameters:
ai_conditionfieldid - The field on which the condition is based
as_operator - The comparison operator used. Possible values are ComparableItems.EQUALS_OPERATOR, ComparableItems.SMALLER_THAN_OPERATOR, ComparableItems.GREATER_THAN_OPERATOR, ComparableItems.GREATER_THAN_OR_EQUAL_OPERATOR, ComparableItems.SMALLER_THAN_OR_EQUAL_OPERATOR, ComparableItems.ISNULL_OPERATOR, ComparableItems.ISNOTNULL_OPERATOR
aCompareValue - The value that the subject Individual's corresponding data field must satisfy in order for the condition to be statisfied.

getConditionsIterator

public java.util.Iterator<LegendCondition> getConditionsIterator()
Specified by:
getConditionsIterator in interface ComparableItems
Returns:
An iterator for the subtext condition objects or null if this subtext item does not have any conditions.