|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.objex.panywhere.SubtextLegendItem
public class SubtextLegendItem
SubtextLegendItem represents the legend text that is rendered to the left (and below) the icon of the leftmost person in each generation. There are two types of subtext legend items, those without conditions and those with conditions.
Subtext legend items with conditions are assigned only to persons with data that matches the conditions. Those without conditions will be assigned explicitly to a person. Once applied or assigned, any person with data that matches the condition
will have the subtext displayed. The example below shows how you link the SubtextLegendItem to the person's Data object to effect the subtext that will be displayed.
In this example, a subtext legend item with text "Female Patient" and a subtext line with text "Yes" must be displayed for all females in the pedigree. This subtext line must be displayed on the first line.
void conditionbasedSubtextExampleMethod() {
SubtextLegend l_subtext_legend = Pedigree.getSubtextLegend();
SubtextLegendItem l_subtext_item = new SubtextLegendItem();
int GENDER_FIELDID = 2;
int PERSON_ISFEMALE_FIELDID = 1;
int SUBTEXT_ITEM_LINE_NUMBER = 1;
String FEMALE_GENDER_VALUE = "0";
l_subtext_item.setFieldid(PERSON_ISFEMALE_FIELDID);
l_subtext_item.setOrder(SUBTEXT_ITEM_LINE_NUMBER);
l_subtext_item.setLegendDisplayText("Female Patient");
l_subtext_item.addCondition(GENDER_FIELDID, CompareOperator.QUERY_EQUALS, FEMALE_GENDER_VALUE); //only display persons with a data for fieldid = 2 and value for gender = "0"
l_subtext_legend.addSubtextLegendItem(l_subtext_item);
//Now create the equivalent Data object for the SubtextLegendItem thus :-
Individual ind = new Individual();
Data l_data = new Data();
l_data.setFieldid(PERSON_ISFEMALE_FIELDID);
l_data.setValue("Yes"); //This will be displayed as subtext
ind.setData(l_data);
l_data = new Data();
l_data.setFieldid(GENDER_FIELDID);
l_data.setValue(FEMALE_GENDER_VALUE); //This will be used to determine person's eligible to have subtext displayed
ind.setData(l_data);
}
You have to create data dictionary fields and tables to link the subtext fields with the data fields. ProgenyAnywhere has a local datadictionary where you can create these fields and tables as shown in the example below. Whats important
void createDatadictionaryTableForSubtext() {
DatabaseTable table = new DatabaseTable();
table.setTableid(1);
table.setTablename("subtext_table"); //assume this field is in a database table called subtext_table
int PERSON_ISFEMALE_FIELDID = 1;
DatabaseField field1 = new DatabaseField();
field1.setFieldid(PERSON_ISFEMALE_FIELDID);
field1.setFieldname("Female Patient"); //may be the actual fieldname for the Database from which this data was extracted
field1.setDatatype(DataType.TEXT_TYPE);
table.addField(field1);
int GENDER_FIELDID = 2;
DatabaseField field2 = new DatabaseField();
field2.setFieldid(GENDER_FIELDID);
field2.setFieldname("Gender");
field2.setDatatype(DataType.TEXT_TYPE);
table.addField(field2);
Pedigree.getDatadictionary().setTable(table);
}
SubtextLegend,
Subtext,
LegendCondition,
Serialized Form| Nested Class Summary | |
|---|---|
static class |
SubtextLegendItem.MultiColumnSubtextLegendItem
A subtext legend item for complex multi-column subtext items. |
| Field Summary | |
|---|---|
static java.lang.String |
PROP_SAMPLE_PROPERTY
|
| Constructor Summary | |
|---|---|
SubtextLegendItem()
Creates a new SubtextLegendItem |
|
| Method Summary | |
|---|---|
void |
addCondition(int ai_conditionfieldid,
CompareOperator a_operator,
java.lang.Object aCompareValue)
Adds a new legend condition to a comparable item. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
|
int |
getColumn()
|
java.util.List<LegendCondition> |
getConditions()
|
int |
getFieldid()
|
java.lang.String |
getLegendDisplayText()
|
int |
getOrder()
|
int |
getRow()
Returns the row number for this SubtextLegendItem. |
int |
getRowCount()
|
int |
getRrn()
|
java.lang.String |
getSampleProperty()
|
int |
getTableid()
|
boolean |
hasConditions()
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
|
void |
setColumn(int column)
Set the subtext column for SubtextLegendItems linked to complex multi-row (and usually multi-column) fields mostly used internally by Progeny. |
void |
setConditions(java.util.List<LegendCondition> a_subtextconditions)
Sets the new Iterable list of comparable item conditions |
void |
setFieldid(int ai_fieldid)
Sets the fieldid for the for this subtext legend item. |
void |
setLegendDisplayText(java.lang.String a_legendDisplayText)
Sets the display text for the comparable item. |
void |
setOrder(int ai_order)
Sets the order of display of this legend item within the subtext legend. |
void |
setRow(int row)
Set the row number. |
void |
setRowCount(int ai_rowCount)
Applies to flat text subtext lines that have \n delimiters effectively making them multi-line. |
void |
setRrn(int rrn)
Set the zero based row number for this legend item derived from table if indeed the item is related to a subrow within a table. |
void |
setSampleProperty(java.lang.String value)
|
void |
setTableid(int tableid)
Set the tableid for this subtext legenditem. |
java.util.Map<java.lang.Integer,java.util.Vector<LegendCondition>> |
toConditionsMap()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PROP_SAMPLE_PROPERTY
| Constructor Detail |
|---|
public SubtextLegendItem()
| Method Detail |
|---|
public java.lang.String getSampleProperty()
public void setSampleProperty(java.lang.String value)
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
public boolean hasConditions()
hasConditions in interface ComparableLegendItempublic java.util.List<LegendCondition> getConditions()
getConditions in interface ComparableLegendItempublic void setConditions(java.util.List<LegendCondition> a_subtextconditions)
ComparableLegendItem
setConditions in interface ComparableLegendItema_subtextconditions - The new list of conidtionspublic java.lang.String getLegendDisplayText()
getLegendDisplayText in interface ComparableLegendItempublic void setLegendDisplayText(java.lang.String a_legendDisplayText)
ComparableLegendItem
setLegendDisplayText in interface ComparableLegendItempublic int getOrder()
public void setOrder(int ai_order)
ai_order - The new field order for this subtext item. This determines where in the list of subtext items this item will be rendered
on the Pedigree surface. public int getFieldid()
public void setFieldid(int ai_fieldid)
ai_fieldid - The new fieldid for this subtext legend item
public void addCondition(int ai_conditionfieldid,
CompareOperator a_operator,
java.lang.Object aCompareValue)
ComparableLegendItem
addCondition in interface ComparableLegendItemai_conditionfieldid - The ID of the field on which the condition is baseda_operator - The comparison operator used. Possible values enum values of #CompareOperatoraCompareValue - The value that must be matched by a person's datapublic java.util.Map<java.lang.Integer,java.util.Vector<LegendCondition>> toConditionsMap()
toConditionsMap in interface ComparableLegendItempublic int getRow()
public void setRow(int row)
row - The row or line number on which the subtext linked to this legenditem must be rendered. Negative row values relate to supertextpublic int getColumn()
public void setColumn(int column)
column - The column on which the subtext linked to this legenditem must be rendered. If column is greater than one (1) then
the subtext must be drawn to the right of another subtext item with same row number and a smaller column number.public int getTableid()
public void setTableid(int tableid)
tableid - The new fieldid for the table or complex fieldpublic int getRrn()
public void setRrn(int rrn)
rrn - The zero based row number for this legend item derived from table if indeed the item is related to a subrow within a tablepublic int getRowCount()
public void setRowCount(int ai_rowCount)
ai_rowCount - The new maximum row count for this legend item.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||