|
||||||||
| 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
This class defines the objects to be displayed in the SubtextLegend. Each SubtextItem describes the display text, the fieldid
pointing to the Data item contained by an Individual object, and a list of conditions / where clauses that must be satisfied by an
Individual for this SubtextItem to be applied to that Individual's Subtext. If there are no conditions specified for this SubtextItem,
then the SubtextItem will necessarily be applied to the Individual so that the Data item whose fieldid is specified by the property SubtextItem.getFieldID()
will be displayed as the as the Icon subtext for that Individual. An example shown below describes how you link the SubtextLegendItem to the Individual's Data property.
In this example, a subtext line with text "Yes" must be displayed for all female Individuals and not for male Individuals. This subtext line must be displayed on the first line.
To achieve this we create a SubtextLegendItem as follows :-
SubtextLegend lLegend = pedigree.getSubtextLegend();
SubtextLegendItem lItem = new SubtextLegendItem();
lItem.setFieldid(1);
lItem.setOrder(1);
lItem.setLegendDisplayText("Female Patient");
lItem.addCondition(2, ComparableItems.EQUALS_OPERATOR, "0"); //only display where field with ID 2 is equal to zero (0)
lLegend.addSubtextLegendItem(lItem);
Now create the equivalent Data object for the SubtextLegendItem thus :-
Individual ind = new Individual();
Data lData = new Data();
lData.setFieldid(1);
lData.setValue("Yes"); //This will be displayed as subtext
ind.setData(lData);
lData = new Data();
lData.setFieldid(2);
lData.setValue("0"); //This will be used to determine Individual eligible to have subtext displayed
ind.setData(lData);
Note that the a fields with fieldid "1" and fieldid "2" may optionally be inserted into the control's data dictionary if there is a need to link the Data object above to some database field. To do so,
you would create a DatabaseTable object, a DatabaseField object (all typically imported by the application from a Database) as follows :-
DatabaseTable table = new DatabaseTable();
table.setTableid(1);
table.setTablename("people_basics"); //assume this field is in a database table called people_basics
DatabaseField field1 = new DatabaseField();
field1.setFieldid(1);
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);
DatabaseField field2 = new DatabaseField();
field2.setFieldid(2);
field2.setFieldname("Gender");
field2.setDatatype(DataType.TEXT_TYPE);
table.addField(field2);
Pedigree.getDatadictionary().setTable(table);
With the field added to the database as shown above, you could also create custom datasheets that may be used to edit Data objects contained by the Individual. Note that the key in all cases is "fieldid" which you can use
to obtain the Data from the Individual using Individual.getData(fieldid).
SubtextLegend,
Subtext,
Serialized Form| Field Summary | |
|---|---|
static java.lang.String |
PROP_SAMPLE_PROPERTY
|
| 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 | |
|---|---|
SubtextLegendItem()
Creates a new SubtextLegendItem |
|
| 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 listener)
|
java.util.List<LegendCondition> |
getConditions()
|
java.util.Iterator<LegendCondition> |
getConditionsIterator()
|
int |
getFieldid()
|
java.lang.String |
getLegendDisplayText()
|
int |
getOrder()
|
java.lang.String |
getSampleProperty()
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
|
void |
setConditions(java.util.List<LegendCondition> aSubtextconditions)
Sets the new Iterable list of subtext conditions |
void |
setFieldid(int ai_fieldid)
Sets the fieldid for the data item that this subtext item corresponds to. |
void |
setLegendDisplayText(java.lang.String legendDisplayText)
Sets the display text for the legend item. |
void |
setOrder(int ai_order)
Sets the order of display of this legend item within the subtext legend. |
void |
setSampleProperty(java.lang.String value)
|
| 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 java.util.List<LegendCondition> getConditions()
getConditions in interface ComparableItemspublic void setConditions(java.util.List<LegendCondition> aSubtextconditions)
setConditions in interface ComparableItemsaSubtextconditions - The new list of conidtionspublic java.lang.String getLegendDisplayText()
getLegendDisplayText in interface ComparableItemspublic void setLegendDisplayText(java.lang.String legendDisplayText)
setLegendDisplayText in interface ComparableItemspublic 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 item
public void addCondition(int ai_conditionfieldid,
java.lang.String as_operator,
java.lang.Object aCompareValue)
addCondition in interface ComparableItemsai_conditionfieldid - The field on which the condition is basedas_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_OPERATORaCompareValue - The value that the subject Individual's corresponding data field must satisfy in order for the
condition to be statisfied.public java.util.Iterator<LegendCondition> getConditionsIterator()
getConditionsIterator in interface ComparableItems
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||