|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.objex.panywhere.SubtextLegend
public class SubtextLegend
SubtextLegend stores, manages and renders subtext legend items. A single line is drawn per generation for each subtext legend item contained in this legend. The subtext legend lines are drawn to the left and below
the left most person in each generation. Rendering subtext legend can be switched on or off by setting the ProgenyAnywhere.setShowSubtextLegend(Boolean) property.
| Nested Class Summary | |
|---|---|
static class |
SubtextLegend.SUBTEXT_LEGEND_ITEM_SET
|
| Field Summary | |
|---|---|
static java.lang.String |
PROP_SAMPLE_PROPERTY
|
static int |
SUPTEXT_Y_VALUE
The distance of the supertext line closest to the icon from the top left corner of the icon |
| Constructor Summary | |
|---|---|
SubtextLegend()
Creates a new SubtextLegend instance |
|
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
|
void |
addSubtextLegendItem(SubtextLegendItem a_item)
Add a new subtext legend item to the subtext legend. |
void |
addSubtextListener(SubtextListener listener)
Add the listener to receive subtext change events |
void |
clearLegend()
Clears the subtext legend, deleting all the items |
int |
count(SubtextLegend.SUBTEXT_LEGEND_ITEM_SET a_subtext_legend_set)
|
protected void |
fireSubtextLegendItemAdded(SubtextEvent evt)
Fires subtextLegendItemAdded(SubtextEvent) method to propagate the event generated when a new subtext legend item is added |
protected void |
fireSubtextLegendItemRemoved(SubtextEvent evt)
Fires subtextLegendItemRemoved(SubtextEvent) method of all SubtextListener's to propagate the event generated when a subtext legend item is removed |
double |
getHeight()
Returns the maximum height of the subtext legend. |
int |
getItemCount(SubtextLegend.SUBTEXT_LEGEND_ITEM_SET a_subtext_legend_set)
|
SubtextLegendItem |
getLegendItem(int ai_order)
|
java.util.List<SubtextLegendItem> |
getLegendItemsAfter(int ai_order)
|
java.util.List<SubtextLegendItem> |
getLegendItemsBefore(int ai_order)
|
java.lang.String |
getSampleProperty()
|
SubtextLegendItem |
getSubtextLegendItem(int ai_fieldid)
|
java.util.Map<java.lang.Integer,SubtextLegendItem> |
getSubtextLegendItems()
|
java.util.Map<java.lang.Integer,SubtextLegendItem> |
getSubtextLegendItems(SubtextLegend.SUBTEXT_LEGEND_ITEM_SET ab_subtext_set)
|
java.util.Iterator<SubtextLegendItem> |
getSubtextLegendIterator()
Return an iterable list of all subtext legend items in this subtext legend. |
java.util.Iterator<SubtextLegendItem> |
getSubtextLegendIterator(boolean ab_ordered,
SubtextLegend.SUBTEXT_LEGEND_ITEM_SET ab_subtext_set)
Return an iterable list of all subtext legend items in this subtext legend. |
double |
getWidth()
Returns the maximum width of the subtext legend. |
protected boolean |
hasSubtextItemsWidthMultiRows(SubtextLegendItem a_legend_item,
java.util.List<Subtext> a_subtext_items)
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
|
SubtextLegendItem |
removeSubtextLegendItem(int ai_fieldid)
Removes the subtext legend item for the specified fieldid |
SubtextLegendItem |
removeSubtextLegendItemAt(int ai_order)
emoves the subtext legend item whose order (SubtextLegendItem.getOrder()) or row number (SubtextLegendItem.getRow()) equals the specified order |
void |
removeSubtextListener(SubtextListener listener)
Remove the subtext legend listener |
void |
render(java.awt.Graphics2D g2d,
DrawingContext dc,
double ad_genY,
double ad_rightMargin,
MarkerLegend a_marker_legend,
java.util.List<Subtext> a_subtext_items_list)
Paints the subtext legend items and marker legend items below and to the left of the leftmost person in each generation |
protected void |
renderMarkerLegend(MarkerLegend a_marker_legend,
java.awt.Graphics2D g2d,
double starty,
DrawingContext dc,
double ad_rightMargin,
int ai_subtext_count)
Paints the marker legend items to the left of the leftmost person in each generation |
protected void |
renderSupertext(java.awt.Graphics2D g2d,
DrawingContext dc,
double ad_supertext_genY,
double ad_rightMargin)
Paints the subtext legend items and marker legend items below and to the left of the leftmost person in each generation |
void |
setHeight(double ai_height)
Sets the maximum height of the subtext legend. |
void |
setSampleProperty(java.lang.String value)
|
void |
setSubtextLegendItems(java.util.Map<java.lang.Integer,SubtextLegendItem> a_items)
Sets the new list of subtext legend Items |
void |
setWidth(double ai_width)
Sets the maximum width of the subtext legend. |
void |
updateMultiRowLegendItems(java.util.List<Subtext> a_subtext_items)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int SUPTEXT_Y_VALUE
public static final java.lang.String PROP_SAMPLE_PROPERTY
| Constructor Detail |
|---|
public SubtextLegend()
| 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 SubtextLegendItem getSubtextLegendItem(int ai_fieldid)
public SubtextLegendItem removeSubtextLegendItem(int ai_fieldid)
public SubtextLegendItem removeSubtextLegendItemAt(int ai_order)
ai_order - The line number in corresponding to the subtext legend item to be removed
public void addSubtextLegendItem(SubtextLegendItem a_item)
a_item - The subtext legend item to be added. Its fieldid property must be set before this operation is executed.public double getWidth()
public void setWidth(double ai_width)
ai_width - The new maximum width for the subtext legendpublic double getHeight()
public void setHeight(double ai_height)
ai_height - The new maximum height for the subtext legendpublic void clearLegend()
public int count(SubtextLegend.SUBTEXT_LEGEND_ITEM_SET a_subtext_legend_set)
a_subtext_legend_set - Defines which subset of the subtext legend to inspect or count. Use SUBTEXT_LEGEND_ITEM_SET.SUPERTEXT_ONLY to return or count only supertext items.
Use SUBTEXT_LEGEND_ITEM_SET.SUBTEXT_ONLY to return or count only subtext items.
Use SUBTEXT_LEGEND_ITEM_SET.ALL to return or count both supertext and subtext items.
public void render(java.awt.Graphics2D g2d,
DrawingContext dc,
double ad_genY,
double ad_rightMargin,
MarkerLegend a_marker_legend,
java.util.List<Subtext> a_subtext_items_list)
a_marker_legend - The marker legend if one exists. Marker legend items are always rendered below subtext legend items.g2d - The graphics contextdc - The drawing context with the control's specific rendering properties. Of particular importance is the Font used for rendering subtext
which is obtained from the "dc".ad_genY - The Y-Coordinate of the leftmost person in the generation for which this subtext legend is being drawnad_rightMargin - The X-Coordinate of the leftmost person within the generation for which this subtext legend is being drawn. The
subtext legend items will be rendered relative to this X-Coordinatea_subtext_items_list - The list of subtext items associated with this subtext legend
protected void renderSupertext(java.awt.Graphics2D g2d,
DrawingContext dc,
double ad_supertext_genY,
double ad_rightMargin)
g2d - The graphics contextdc - The drawing context with the control's specific rendering properties. Of particular importance is the Font used for rendering subtext
which is obtained from the "dc".ad_supertext_genY - The Y-Coordinate of the leftmost person in the generation for which this supertext legend is being drawnad_rightMargin - The X-Coordinate of the leftmost person within the generation for which this subtext legend is being drawn. The
subtext legend items will be rendered relative to this X-Coordinate
protected void renderMarkerLegend(MarkerLegend a_marker_legend,
java.awt.Graphics2D g2d,
double starty,
DrawingContext dc,
double ad_rightMargin,
int ai_subtext_count)
a_marker_legend - The marker legend with a list of all the markers in the haplotypeg2d - The Graphics contextstarty - The Y-Coordinate on which the first marker legend item is to be rendered. If no subtext legend items were drawn, this value will be equivalent to Pedigree.getSubtextyvalue()dc - The drawing context with the control's specific rendering properties. Of particular importance is the Font used for rendering subtext
which is obtained from the "dc".ad_rightMargin - The X-Coordinate of the leftmost person within the generation for which this subtext legend is being drawn. The
subtext legend items will be rendered relative to this X-Coordinateai_subtext_count - The number of subtext lines that were rendered before the marker legend is drawn. If no subtext legend items were drawn, this value will be zeropublic void addSubtextListener(SubtextListener listener)
listener - The new subtext listenerpublic void removeSubtextListener(SubtextListener listener)
listener - The SubtextListener to be removedprotected void fireSubtextLegendItemAdded(SubtextEvent evt)
evt - The subtext add eventprotected void fireSubtextLegendItemRemoved(SubtextEvent evt)
evt - The subtext add eventpublic java.util.Iterator<SubtextLegendItem> getSubtextLegendIterator()
public java.util.Iterator<SubtextLegendItem> getSubtextLegendIterator(boolean ab_ordered,
SubtextLegend.SUBTEXT_LEGEND_ITEM_SET ab_subtext_set)
ab_ordered - If TRUE then the list returned is ascending order of the order property of the subtext legend items.ab_subtext_set - The subset of legend items to be returned as defined by the enumpublic java.util.Map<java.lang.Integer,SubtextLegendItem> getSubtextLegendItems()
public java.util.Map<java.lang.Integer,SubtextLegendItem> getSubtextLegendItems(SubtextLegend.SUBTEXT_LEGEND_ITEM_SET ab_subtext_set)
ab_subtext_set - The subset of legend items to be returned as defined by the enum
public void setSubtextLegendItems(java.util.Map<java.lang.Integer,SubtextLegendItem> a_items)
a_items - The new map of subtext legend itemspublic int getItemCount(SubtextLegend.SUBTEXT_LEGEND_ITEM_SET a_subtext_legend_set)
a_subtext_legend_set - Defines which subset of the subtext legend to inspect or count. Use SUBTEXT_LEGEND_ITEM_SET.SUPERTEXT_ONLY to return or count only supertext items.
Use SUBTEXT_LEGEND_ITEM_SET.SUBTEXT_ONLY to return or count only subtext items.
Use SUBTEXT_LEGEND_ITEM_SET.ALL to return or count both supertext and subtext items.
count(SUBTEXT_LEGEND_ITEM_SET)public SubtextLegendItem getLegendItem(int ai_order)
ai_order - The line number/order for the subtext legend item to be returned
public java.util.List<SubtextLegendItem> getLegendItemsAfter(int ai_order)
ai_order - Subtext legend item width order property greater than ai_order will be returned
public java.util.List<SubtextLegendItem> getLegendItemsBefore(int ai_order)
public void updateMultiRowLegendItems(java.util.List<Subtext> a_subtext_items)
protected boolean hasSubtextItemsWidthMultiRows(SubtextLegendItem a_legend_item,
java.util.List<Subtext> a_subtext_items)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||