diff --git a/src/include/ZMap/zmapWindow.h b/src/include/ZMap/zmapWindow.h index e6dd8ef31edb5e2b1d2ed424748816ce593e0b68..8283a366785a58fec84d341dad733171de6605d9 100755 --- a/src/include/ZMap/zmapWindow.h +++ b/src/include/ZMap/zmapWindow.h @@ -26,9 +26,9 @@ * window displaying genome data. * * HISTORY: - * Last edited: Mar 7 13:52 2007 (edgrif) + * Last edited: Mar 13 17:12 2007 (edgrif) * Created: Thu Jul 24 15:21:56 2003 (edgrif) - * CVS info: $Id: zmapWindow.h,v 1.81 2007-03-07 13:59:48 edgrif Exp $ + * CVS info: $Id: zmapWindow.h,v 1.82 2007-03-14 08:44:59 edgrif Exp $ *------------------------------------------------------------------- */ #ifndef ZMAP_WINDOW_H @@ -98,6 +98,10 @@ typedef struct means its added to the list of highlighted items. */ + gboolean highlight_same_names ; /* TRUE means highlight all other + features with the same name in the + same feature set. */ + ZMapFeatureDescStruct feature_desc ; /* Text descriptions of selected feature. */ char *secondary_text ; /* Simple string description. */ @@ -299,7 +303,8 @@ gboolean zMapWindowMaxWindowPos(ZMapWindow window, double *x1_out, double *y1_out, double *x2_out, double *y2_out) ; gboolean zMapWindowScrollToItem(ZMapWindow window, FooCanvasItem *feature_item) ; -void zMapWindowHighlightObject(ZMapWindow window, FooCanvasItem *feature, gboolean replace_highlight_item) ; +void zMapWindowHighlightObject(ZMapWindow window, FooCanvasItem *feature, + gboolean replace_highlight_item, gboolean highlight_same_names) ; void zMapWindowHighlightObjects(ZMapWindow window, ZMapFeatureContext context, gboolean multiple_select); void zMapWindowHighlightFocusItems(ZMapWindow window) ; void zMapWindowUnHighlightFocusItems(ZMapWindow window) ; diff --git a/src/zmapView/zmapView.c b/src/zmapView/zmapView.c index 2b076e8d3b79985b6fee508f1cf872f4aaf46b0b..868cd10cc5c109bce75e6b1126920ce17cc5828a 100755 --- a/src/zmapView/zmapView.c +++ b/src/zmapView/zmapView.c @@ -25,9 +25,9 @@ * Description: * Exported functions: See ZMap/zmapView.h * HISTORY: - * Last edited: Mar 12 12:28 2007 (edgrif) + * Last edited: Mar 13 17:22 2007 (edgrif) * Created: Thu May 13 15:28:26 2004 (edgrif) - * CVS info: $Id: zmapView.c,v 1.109 2007-03-12 12:28:41 edgrif Exp $ + * CVS info: $Id: zmapView.c,v 1.110 2007-03-14 08:44:26 edgrif Exp $ *------------------------------------------------------------------- */ @@ -1123,7 +1123,9 @@ static void viewSelectCB(ZMapWindow window, void *caller_data, void *window_data view_window = list_item->data ; if ((item = zMapWindowFindFeatureItemByItem(view_window->window, window_select->highlight_item))) - zMapWindowHighlightObject(view_window->window, item, window_select->replace_highlight_item) ; + zMapWindowHighlightObject(view_window->window, item, + window_select->replace_highlight_item, + window_select->highlight_same_names) ; } while ((list_item = g_list_next(list_item))) ; } diff --git a/src/zmapWindow/zmapWindow.c b/src/zmapWindow/zmapWindow.c index f45ac0d4d68a277ba213d54b15119c36406fbdae..f2a7c28d2815e37a74b9e4d1a1ea53b9c2e84f00 100755 --- a/src/zmapWindow/zmapWindow.c +++ b/src/zmapWindow/zmapWindow.c @@ -26,9 +26,9 @@ * * Exported functions: See ZMap/zmapWindow.h * HISTORY: - * Last edited: Mar 9 08:37 2007 (rds) + * Last edited: Mar 13 17:25 2007 (edgrif) * Created: Thu Jul 24 14:36:27 2003 (edgrif) - * CVS info: $Id: zmapWindow.c,v 1.182 2007-03-09 08:40:43 rds Exp $ + * CVS info: $Id: zmapWindow.c,v 1.183 2007-03-14 08:44:26 edgrif Exp $ *------------------------------------------------------------------- */ @@ -583,7 +583,7 @@ void zMapWindowFeatureRedraw(ZMapWindow window, ZMapFeatureContext feature_conte /* I think its ok to do this here ? this blanks out the info panel, we could hold on to the * originally highlighted feature...but only if its still visible if it ends up on the * reverse strand...for now we just blank it.... */ - zMapWindowUpdateInfoPanel(window, NULL, NULL, NULL, TRUE) ; + zMapWindowUpdateInfoPanel(window, NULL, NULL, NULL, TRUE, FALSE) ; adjust = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(window->scrolled_window)) ; @@ -1111,7 +1111,8 @@ void zmapWindowScrollRegionTool(ZMapWindow window, * */ void zMapWindowUpdateInfoPanel(ZMapWindow window, ZMapFeature feature_arg, FooCanvasItem *item, - FooCanvasItem *highlight_item, gboolean replace_highlight_item) + FooCanvasItem *highlight_item, + gboolean replace_highlight_item, gboolean highlight_same_names) { ZMapWindowItemFeatureType type ; ZMapFeature feature = NULL; @@ -1223,6 +1224,8 @@ void zMapWindowUpdateInfoPanel(ZMapWindow window, ZMapFeature feature_arg, select.replace_highlight_item = replace_highlight_item ; + select.highlight_same_names = highlight_same_names ; + /* We've set up the select data so now callback to the layer above with this data. */ (*(window->caller_cbs->select))(window, window->app_data, (void *)&select) ; @@ -3513,7 +3516,7 @@ static void jumpFeature(ZMapWindow window, guint keyval) focus_item = (FooCanvasItem *)(feature_ptr->data) ; - zmapWindowHighlightObject(window, focus_item, TRUE) ; + zmapWindowHighlightObject(window, focus_item, TRUE, FALSE) ; #ifdef ED_G_NEVER_INCLUDE_THIS_CODE @@ -3741,7 +3744,7 @@ static void unhideItemsCB(gpointer data, gpointer user_data) foo_canvas_item_show(item) ; - zmapWindowHighlightObject(window, item, FALSE) ; + zmapWindowHighlightObject(window, item, FALSE, TRUE) ; return ; diff --git a/src/zmapWindow/zmapWindowItem.c b/src/zmapWindow/zmapWindowItem.c index 037c6a4e2f48a9a47655254d66fe57aae73e1d5d..d6afb40b1e25fd27b45ac48a1de362230f0a1b8f 100755 --- a/src/zmapWindow/zmapWindowItem.c +++ b/src/zmapWindow/zmapWindowItem.c @@ -26,9 +26,9 @@ * * Exported functions: See zmapWindow_P.h * HISTORY: - * Last edited: Mar 5 15:02 2007 (rds) + * Last edited: Mar 13 17:25 2007 (edgrif) * Created: Thu Sep 8 10:37:24 2005 (edgrif) - * CVS info: $Id: zmapWindowItem.c,v 1.69 2007-03-06 08:49:23 rds Exp $ + * CVS info: $Id: zmapWindowItem.c,v 1.70 2007-03-14 08:44:45 edgrif Exp $ *------------------------------------------------------------------- */ @@ -396,9 +396,10 @@ void zmapWindowItemTextHighlightSetFullText(ZMapWindowItemHighlighter select_con /* Highlight a feature or list of related features (e.g. all hits for same query sequence). * * */ -void zMapWindowHighlightObject(ZMapWindow window, FooCanvasItem *item, gboolean replace_highlight_item) +void zMapWindowHighlightObject(ZMapWindow window, FooCanvasItem *item, + gboolean replace_highlight_item, gboolean highlight_same_names) { - zmapWindowHighlightObject(window, item, replace_highlight_item) ; + zmapWindowHighlightObject(window, item, replace_highlight_item, highlight_same_names) ; return ; } @@ -455,7 +456,8 @@ static ZMapFeatureContextExecuteStatus highlight_feature(GQuark key, gpointer da if((feature_item = zmapWindowFToIFindItemChild(highlight_data->window->context_to_item, feature_in->strand, ZMAPFRAME_NONE, feature_in, span->x1, span->x2))) - zmapWindowHighlightObject(highlight_data->window, feature_item, replace_highlight); + zmapWindowHighlightObject(highlight_data->window, feature_item, + replace_highlight, TRUE) ; } for(i = 0; i < feature_in->feature.transcript.introns->len; i++) { @@ -464,14 +466,15 @@ static ZMapFeatureContextExecuteStatus highlight_feature(GQuark key, gpointer da if((feature_item = zmapWindowFToIFindItemChild(highlight_data->window->context_to_item, feature_in->strand, ZMAPFRAME_NONE, feature_in, span->x1, span->x2))) - zmapWindowHighlightObject(highlight_data->window, feature_item, replace_highlight); + zmapWindowHighlightObject(highlight_data->window, feature_item, + replace_highlight, TRUE); } replace_highlight = !(highlight_data->multiple_select); } else /* we need to highlight the full feature */ - zmapWindowHighlightObject(highlight_data->window, feature_item, replace_highlight); + zmapWindowHighlightObject(highlight_data->window, feature_item, replace_highlight, TRUE); if(replace_highlight) highlight_data->highlighted = 0; @@ -500,7 +503,8 @@ void zMapWindowHighlightObjects(ZMapWindow window, ZMapFeatureContext context, g return ; } -void zmapWindowHighlightObject(ZMapWindow window, FooCanvasItem *item, gboolean replace_highlight_item) +void zmapWindowHighlightObject(ZMapWindow window, FooCanvasItem *item, + gboolean replace_highlight_item, gboolean highlight_same_names) { ZMapFeature feature ; ZMapWindowItemFeatureType item_feature_type ; @@ -510,8 +514,7 @@ void zmapWindowHighlightObject(ZMapWindow window, FooCanvasItem *item, gboolean /* Retrieve the feature item info from the canvas item. */ feature = g_object_get_data(G_OBJECT(item), ITEM_FEATURE_DATA); zMapAssert(feature) ; - item_feature_type = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(item), - ITEM_FEATURE_TYPE)) ; + item_feature_type = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(item), ITEM_FEATURE_TYPE)) ; /* If any other feature(s) is currently in focus, revert it to its std colours */ @@ -524,20 +527,25 @@ void zmapWindowHighlightObject(ZMapWindow window, FooCanvasItem *item, gboolean { case ZMAPFEATURE_ALIGNMENT: { - char *set_strand, *set_frame ; + if (highlight_same_names) + { + char *set_strand, *set_frame ; - set_strand = set_frame = "*" ; + set_strand = set_frame = "*" ; - set_items = zmapWindowFToIFindSameNameItems(window->context_to_item, set_strand, set_frame, feature) ; + set_items = zmapWindowFToIFindSameNameItems(window->context_to_item, set_strand, set_frame, feature) ; #ifdef ED_G_NEVER_INCLUDE_THIS_CODE - if (set_items) - zmapWindowFToIPrintList(set_items) ; + if (set_items) + zmapWindowFToIPrintList(set_items) ; #endif /* ED_G_NEVER_INCLUDE_THIS_CODE */ - zmapWindowFocusAddItems(window->focus, set_items); + zmapWindowFocusAddItems(window->focus, set_items); - zmapWindowFocusSetHotItem(window->focus, item) ; + zmapWindowFocusSetHotItem(window->focus, item) ; + } + else + zmapWindowFocusAddItem(window->focus, item); break ; } @@ -1220,7 +1228,7 @@ void zMapWindowMoveItem(ZMapWindow window, ZMapFeature origFeature, foo_canvas_item_set(item, "y1", top, "y2", bottom, NULL); } - zMapWindowUpdateInfoPanel(window, modFeature, item, NULL, TRUE) ; + zMapWindowUpdateInfoPanel(window, modFeature, item, NULL, TRUE, TRUE) ; } return; } diff --git a/src/zmapWindow/zmapWindowList.c b/src/zmapWindow/zmapWindowList.c index 5e2f7254f0daafbac2b3c83a80611173112721ff..1ce4aa6022c9dce8b7b1828aeae419ae8a2c91db 100755 --- a/src/zmapWindow/zmapWindowList.c +++ b/src/zmapWindow/zmapWindowList.c @@ -27,9 +27,9 @@ * * Exported functions: * HISTORY: - * Last edited: Mar 12 13:08 2007 (edgrif) + * Last edited: Mar 13 17:24 2007 (edgrif) * Created: Thu Sep 16 10:17 2004 (rnc) - * CVS info: $Id: zmapWindowList.c,v 1.57 2007-03-12 16:24:59 edgrif Exp $ + * CVS info: $Id: zmapWindowList.c,v 1.58 2007-03-14 08:44:45 edgrif Exp $ *------------------------------------------------------------------- */ @@ -395,8 +395,8 @@ static gboolean selectionFuncCB(GtkTreeSelection *selection, else zmapWindowItemCentreOnItem(window, item, FALSE, FALSE) ; - zMapWindowHighlightObject(window, item, TRUE); - zMapWindowUpdateInfoPanel(window, feature, item, NULL, TRUE); + zMapWindowHighlightObject(window, item, TRUE, TRUE) ; + zMapWindowUpdateInfoPanel(window, feature, item, NULL, TRUE, TRUE); } } diff --git a/src/zmapWindow/zmapWindow_P.h b/src/zmapWindow/zmapWindow_P.h index 38e6b992283e515f17aef82ed001f2ccd1c0bb13..217e3cfbb01dc28b88d74b3c34e3f2339135440b 100755 --- a/src/zmapWindow/zmapWindow_P.h +++ b/src/zmapWindow/zmapWindow_P.h @@ -26,9 +26,9 @@ * Description: Defines internal interfaces/data structures of zMapWindow. * * HISTORY: - * Last edited: Mar 12 15:16 2007 (edgrif) + * Last edited: Mar 13 17:22 2007 (edgrif) * Created: Fri Aug 1 16:45:58 2003 (edgrif) - * CVS info: $Id: zmapWindow_P.h,v 1.174 2007-03-12 16:24:59 edgrif Exp $ + * CVS info: $Id: zmapWindow_P.h,v 1.175 2007-03-14 08:44:08 edgrif Exp $ *------------------------------------------------------------------- */ #ifndef ZMAP_WINDOW_P_H @@ -797,7 +797,8 @@ void zMapWindowMoveSubFeatures(ZMapWindow window, gboolean isExon); void zMapWindowUpdateInfoPanel(ZMapWindow window, ZMapFeature feature, - FooCanvasItem *item, FooCanvasItem *highlight_item, gboolean replace_highlight_item) ; + FooCanvasItem *item, FooCanvasItem *highlight_item, + gboolean replace_highlight_item, gboolean highlight_same_names) ; void zmapWindowDrawZoom(ZMapWindow window) ; @@ -984,7 +985,8 @@ void zmapWindowFocusItemAreaDestroy(ZMapWindowFocusItemArea item_area); GList *zmapWindowItemListToFeatureList(GList *item_list); -void zmapWindowHighlightObject(ZMapWindow window, FooCanvasItem *item, gboolean replace_highlight_item) ; +void zmapWindowHighlightObject(ZMapWindow window, FooCanvasItem *item, + gboolean replace_highlight_item, gboolean highlight_same_names) ; void zmapHighlightColumn(ZMapWindow window, FooCanvasGroup *column) ; void zmapUnHighlightColumn(ZMapWindow window, FooCanvasGroup *column) ;