|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.objex.panywhere.LegendItem
public class LegendItem
A legend item stands for a specific genetic condition or trait that is being tracked within a pedigree. It is shown on the pedigree by square icon on the symbols legend. There are two types of legend items, those with conditions and those without any conditions associated with them
Legend items with conditions are assigned to a person only if the person's data matches the conditions defined in the legend item. Legend items with no conditions must be explicitly assigned to a person. No further checks are done when the user and/or programmer assigns a conditionless legend item
to a person. A person to whom a legend item has been assigned will have their icon's quadrants painted in the same way as the legend item's icon is painted in the symbols legend. Examples below show how to assign legend items to a person's symbol.
In this example, a symbol legend item quadrant 1 painted red and with text "Rectal Cancer" is painted on the pedigree symbols legend. The person's icon will also have quandrant 1 painted red to show that the person does have rectal cancer. There is no condition specified in the legend item.
void nonConditionBasedSymbolsLegendExample() {
String LEGEND_ITEM_ID = "1";
String LEGEND_ITEM_TEXT = "Rectal Cancer";
Pedigree l_pedigree = new Pedigree();
//create a new LegendItem and add it to the symbols legend
//Quadrant 1 color must be set to RED
Legend l_subtext_legend = l_pedigree.getLegend();
LegendItem l_legend_item = new LegendItem();
l_legend_item.setQuadOneColor(Color.red);
l_legend_item.setID(LEGEND_ITEM_ID);
l_legend_item.setLegendDisplayText(LEGEND_ITEM_TEXT);
l_subtext_legend.addLegendItem(LEGEND_ITEM_ID, l_legend_item);
//assign the legend item's quadrant settings and color to this person's symbol. No conditions apply
Individual l_person = new Individual();
l_pedigree.assignLegendItem(l_person, l_legend_item, false);
}
void conditionsBasedSymbolsLegendExample() {
String LEGEND_ITEM_ID = "1";
String LEGEND_ITEM_TEXT = "Female Individual";
Pedigree l_pedigree = new Pedigree();
int GENDER_FIELDID = 2;
String FEMALE_GENDER_VALUE = "0";
//create a new LegendItem and add it to the symbols legend
//Quadrant 1 color must be set to RED
Legend l_symbols_legend = l_pedigree.getLegend();
LegendItem l_legend_item = new LegendItem();
l_legend_item.setQuadOneColor(Color.red);
l_legend_item.setID(LEGEND_ITEM_ID);
l_legend_item.setLegendDisplayText(LEGEND_ITEM_TEXT);
l_legend_item.addCondition(GENDER_FIELDID, CompareOperator.QUERY_EQUALS, FEMALE_GENDER_VALUE);
l_symbols_legend.addLegendItem(LEGEND_ITEM_ID, l_legend_item);
//This person has the data that satisfies the condition defined in the legend item
Individual ind = l_pedigree.getFamily().getIndividual("1);
Data l_data = new Data();
l_data.setFieldid(GENDER_FIELDID);
l_data.setValue(FEMALE_GENDER_VALUE); //This will be used to determine person's eligibility to have subtext displayed
ind.setData(l_data);
//This person DOES NOT have the data that satisfies the condition defined in the legend item
String NONMATCHING_FEMALE_GENDER_VALUE = "10";
Individual ind2 = l_pedigree.getFamily().getIndividual("2);
Data l_data2 = new Data();
l_data2.setFieldid(GENDER_FIELDID);
l_data.setValue(NONMATCHING_FEMALE_GENDER_VALUE);
ind.setData(l_data);
}
The 1st person's icon will have quadrant 1 painted red to show that she is a female. The 1st quadrant of the 2nd person's icon will not be painted red because the data does not match the condition defined by the legend item.
Symbol,
Legend,
LegendCondition,
Serialized Form| Constructor Summary | |
|---|---|
LegendItem()
Creates a new Legend item with null symbols |
|
| Method Summary | |
|---|---|
void |
addCondition(int ai_conditionfieldid,
CompareOperator a_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 |
addCondition(int ai_tableid,
int ai_conditionfieldid,
CompareOperator a_operator,
java.lang.Object aCompareValue)
|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener lstnr)
|
void |
copyItem(LegendItem mCon)
Copies the the encoding details from the specified Legend Item and encodes this Legend item with them. |
void |
encodeQuadColor(long al_legend_quad_color)
Updates LegendItem's quadrant color codes decoding the Long Integer passed as parameter. |
java.awt.Color |
getCenterCircleColor()
|
java.awt.Paint |
getCenterCirclePaint()
Deprecated. |
java.awt.Color |
getCenterSquareColor()
|
java.awt.Paint |
getCenterSquarePaint()
Deprecated. |
java.util.List<LegendCondition> |
getConditions()
|
int |
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()
Deprecated. |
java.awt.Color |
getQuadOneColor()
|
java.awt.Paint |
getQuadOnePaint()
Deprecated. |
java.awt.Color |
getQuadThreeColor()
|
java.awt.Paint |
getQuadThreePaint()
Deprecated. |
java.awt.Color |
getQuadTwoColor()
|
java.awt.Paint |
getQuadTwoPaint()
Deprecated. |
double |
getX()
|
double |
getY()
|
boolean |
hasConditions()
|
boolean |
isHLine()
|
boolean |
isQuestionMark()
|
boolean |
isVisible()
|
boolean |
isVLine()
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener lstnr)
|
void |
render(double x,
double y,
double w,
double h,
java.awt.Graphics2D g2d)
Paints an Icon and its description on the Pedigree surface |
void |
render(double x,
double y,
double w,
double h,
java.awt.Graphics2D g2d,
boolean drawtext)
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 legend item |
void |
setCenterCircleColor(int qColorRGB)
Sets the RGB value for the color for the centre circle of the legend item |
void |
setCenterCirclePaint(java.awt.Paint qPaint)
Deprecated. |
void |
setCenterSquareColor(java.awt.Color qColor)
Sets the color for the centre square of the legend item |
void |
setCenterSquareColor(int qColorRGB)
Sets the RGB value for the color for the centre squqre of the legend item |
void |
setCenterSquarePaint(java.awt.Paint qPaint)
Deprecated. |
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 legend item depending on the value of parameter passed. |
void |
setID(int ai_id)
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 legend text for this legend Item. |
void |
setQuad1Dot(boolean qColor)
Sets the legend item color for quadrant 1. |
void |
setQuad1DotColor(java.awt.Color aColor)
Setter for property quad1DotColor. |
void |
setQuad2Dot(boolean qColor)
Sets the legend item color for quadrant 2 dot. |
void |
setQuad2DotColor(java.awt.Color aColor)
Setter for property quad2DotColor. |
void |
setQuad3Dot(boolean qColor)
Sets the legend item color for quadrant 3 dot |
void |
setQuad3DotColor(java.awt.Color aColor)
Setter for property quad3DotColor. |
void |
setQuad4Dot(boolean qColor)
Sets the legend item color for quadrant 4 dot |
void |
setQuad4DotColor(java.awt.Color aColor)
Setter for property quad4DotColor. |
protected void |
setQuadColor(int color,
LegendItem a_item,
int ai_quadno)
|
protected void |
setQuadColor(LegendItem a_item,
int ai_quadno,
java.awt.Color a_color)
|
void |
setQuadFourColor(java.awt.Color qColor)
Sets the legend item color for quadrant 4 |
void |
setQuadFourColor(int qColorRGB)
Sets the RGB value for the color in Quadrant 4 |
void |
setQuadFourPaint(java.awt.Paint qPaint)
Deprecated. |
void |
setQuadOneColor(java.awt.Color qColor)
Sets the legend item color for quadrant 1 |
void |
setQuadOneColor(int qColorRGB)
Sets the RGB value for the color in Quadrant 1 |
void |
setQuadOnePaint(java.awt.Paint qPaint)
Deprecated. |
void |
setQuadThreeColor(java.awt.Color qColor)
Sets the legend item color for quadrant 3 |
void |
setQuadThreeColor(int qColorRGB)
Sets the RGB value for the color in Quadrant 3 |
void |
setQuadThreePaint(java.awt.Paint qPaint)
Deprecated. |
void |
setQuadTwoColor(java.awt.Color qColor)
Sets the legend item color for quadrant 2 |
void |
setQuadTwoColor(int qColorRGB)
Sets the RGB value for the color in Quadrant 2 |
void |
setQuadTwoPaint(java.awt.Paint qPaint)
Deprecated. |
void |
setQuestionMark(boolean q)
Sets the flag to show question mark legend item to true or false. |
void |
setVisible(boolean visible)
Set the visible property. |
void |
setVLine(boolean vline)
Sets or unsets the vertical line flag for this legend item depending on the value of parameter passed. |
void |
setX(double xc)
Sets the current legend legend item location X Coordinate |
void |
setY(double yc)
Sets the current legend legend item location Y Coordinate |
java.util.Map<java.lang.Integer,java.util.Vector<LegendCondition>> |
toConditionsMap()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public LegendItem()
| Method Detail |
|---|
public void addPropertyChangeListener(java.beans.PropertyChangeListener lstnr)
public void removePropertyChangeListener(java.beans.PropertyChangeListener lstnr)
public double getX()
public double getY()
public void setX(double xc)
xc - The value to set the location topublic void setY(double yc)
yc - The value to set the location topublic java.lang.String getLegendText()
public void setLegendText(java.lang.String text)
text - The new legend textpublic int getID()
public void setID(int ai_id)
ai_id - The new legendItem IDpublic boolean getQuad1Dot()
public void setQuad1Dot(boolean qColor)
qColor - The new color for quadrant 1.public boolean getQuad2Dot()
public void setQuad2Dot(boolean qColor)
qColor - The new color for quadrant 2 dot.public boolean getQuad3Dot()
public void setQuad3Dot(boolean qColor)
qColor - The new color for quadrant 3 dot.public boolean getQuad4Dot()
public void setQuad4Dot(boolean qColor)
qColor - The new color for quadrant 4 dotpublic boolean isVLine()
public void setVLine(boolean vline)
vline - Boolean indicating whether to set or unset the vertcial line flagpublic boolean isQuestionMark()
public void setQuestionMark(boolean q)
q - The value to set (True or False)public boolean isHLine()
public void setHLine(boolean hline)
hline - Boolean indicating whether to set or unset the h/zontal line flagpublic java.awt.Color getQuadOneColor()
public void setQuadOneColor(java.awt.Color qColor)
qColor - The new color for quadrant 1public java.awt.Paint getQuadOnePaint()
public void setQuadOnePaint(java.awt.Paint qPaint)
public java.awt.Paint getQuadTwoPaint()
public void setQuadTwoPaint(java.awt.Paint qPaint)
public java.awt.Paint getQuadThreePaint()
public void setQuadThreePaint(java.awt.Paint qPaint)
public java.awt.Paint getQuadFourPaint()
public void setQuadFourPaint(java.awt.Paint qPaint)
public java.awt.Paint getCenterCirclePaint()
public void setCenterCirclePaint(java.awt.Paint qPaint)
public java.awt.Paint getCenterSquarePaint()
public void setCenterSquarePaint(java.awt.Paint qPaint)
public void setQuadOneColor(int qColorRGB)
qColorRGB - The new RGB valuepublic java.awt.Color getQuadTwoColor()
public void setQuadTwoColor(java.awt.Color qColor)
qColor - The new color for quadrant 2public void setQuadTwoColor(int qColorRGB)
qColorRGB - The new RGB valuepublic java.awt.Color getQuadThreeColor()
public void setQuadThreeColor(java.awt.Color qColor)
qColor - The new color for quadrant 3public void setQuadThreeColor(int qColorRGB)
qColorRGB - The new RGB valuepublic java.awt.Color getQuadFourColor()
public void setQuadFourColor(java.awt.Color qColor)
qColor - The new color for quadrant 4public void setQuadFourColor(int qColorRGB)
qColorRGB - The new RGB valuepublic java.awt.Color getCenterCircleColor()
public void setCenterCircleColor(java.awt.Color qColor)
qColor - The new color valuepublic void setCenterCircleColor(int qColorRGB)
qColorRGB - The new RGB valuepublic java.awt.Color getCenterSquareColor()
public void setCenterSquareColor(java.awt.Color qColor)
qColor - The new color valuepublic void setCenterSquareColor(int qColorRGB)
qColorRGB - The new RGB value
public void render(double x,
double y,
double w,
double h,
java.awt.Graphics2D g2d)
x - The X coordinate of the LegendItem Icon on the Pedigree surfacey - The Y coordinate of the LegendItem Icon on the Pedigree surfaceg2d - The graphics context / paint brush for drawing.public void copyItem(LegendItem mCon)
mCon - The legend item from which the encoding data is to be copiedpublic java.awt.Color getQuad1DotColor()
public void setQuad1DotColor(java.awt.Color aColor)
aColor - New value of property quad1DotColor.public java.awt.Color getQuad2DotColor()
public void setQuad2DotColor(java.awt.Color aColor)
aColor - New value of property quad2DotColor.public java.awt.Color getQuad3DotColor()
public void setQuad3DotColor(java.awt.Color aColor)
aColor - New value of property quad3DotColor.public java.awt.Color getQuad4DotColor()
public void setQuad4DotColor(java.awt.Color aColor)
aColor - New value of property quad4DotColor.public java.util.List<LegendCondition> getConditions()
getConditions in interface ComparableLegendItempublic void setConditions(java.util.List<LegendCondition> aConditions)
setConditions in interface ComparableLegendItemaConditions - The new list of conditionspublic java.lang.String getLegendDisplayText()
getLegendDisplayText in interface ComparableLegendItempublic void setLegendDisplayText(java.lang.String legendDisplayText)
setLegendDisplayText in interface ComparableLegendItem
public void addCondition(int ai_conditionfieldid,
CompareOperator a_operator,
java.lang.Object aCompareValue)
addCondition in interface ComparableLegendItemai_conditionfieldid - The field on which the condition is baseda_operator - The comparison operator used.aCompareValue - The value that the subject Individual's corresponding data field must satisfy in order for the
condition to be statisfied.
public void addCondition(int ai_tableid,
int ai_conditionfieldid,
CompareOperator a_operator,
java.lang.Object aCompareValue)
public java.util.Map<java.lang.Integer,java.util.Vector<LegendCondition>> toConditionsMap()
toConditionsMap in interface ComparableLegendItem
protected void setQuadColor(LegendItem a_item,
int ai_quadno,
java.awt.Color a_color)
protected void setQuadColor(int color,
LegendItem a_item,
int ai_quadno)
public void encodeQuadColor(long al_legend_quad_color)
| BITS | ITEM | VALUE |
| ---- | --------------- | ----------------- |
| 1-3 | Quadrant 1 color | See �colors� below |
| 4-6 | Quadrant 2 color | See �colors� below |
| 7-9 | Quadrant 3 color | See �colors� below |
| 10-12 | Quadrant 4 color | See �colors� below |
| 13-15 | Center circle color | See �colors� below |
| 16-18 | Center square color | See �colors� below |
| 19 | Show quadrant 1 | 1=show 0=hide |
| 20 | Show quadrant 2 | 1=show 0=hide |
| 21 | Show quadrant 3 | 1=show 0=hide |
| 22 | Show quadrant 4 | 1=show 0=hide |
| 23 | Show circle | 1=show 0=hide |
| 24 | Show square | 1=show 0=hide |
| 25 | Show horizontal line | 1=show 0=hide |
| 26 | Show vertical line | 1=show 0=hide |
| 27 | Show quadrant1 dot | 1=show 0=hide |
| 28 | Show quadrant2 dot | 1=show 0=hide |
| 29 | Show quadrant3 dot | 1=show 0=hide |
| 30 | Show quadrant4 dot | 1=show 0=hide |
| Value | Color |
| ----- | ----- |
| 0 | black |
| 1 | blue |
| 2 | yellow |
| 3 | green |
| 4 | red |
| 5 | gray |
| 6 | cyan |
| 7 | magenta |
al_legend_quad_color - A 32 bit integer which can be decoded as above.public boolean isVisible()
public void setVisible(boolean visible)
visible - TRUE if the item is to be displayed on the symbols legend.public boolean hasConditions()
hasConditions in interface ComparableLegendItem
public void render(double x,
double y,
double w,
double h,
java.awt.Graphics2D g2d,
boolean drawtext)
x - The X coordinate of the LegendItem Icon on the Pedigree surfacey - The Y coordinate of the LegendItem Icon on the Pedigree surfaceg2d - The graphics context / paint brush for drawing.drawtext - If true then the legend text will be drawn otherwise just the iconpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||