def HighlightUop(self, anno_string): ''' Highlight the uop with the given annotation string ''' uop_uid = highlighting_utils.GetUopUid(anno_string) if uop_uid is not None: self.__highlighted_uops.append(uop_uid)
def UnhighlightUop(self, anno_string): ''' Unhighlight the uop with the given annotation string ''' uop_uid = highlighting_utils.GetUopUid(anno_string) if uop_uid is not None: if uop_uid in self.__highlighted_uops: self.__highlighted_uops.remove(uop_uid) self.__previously_highlighted_uops.append(uop_uid)
def HighlightUop(self, uid): ''' Highlight the uop with the given annotation string ''' if isinstance(uid, str): self.HighlightUop(highlighting_utils.GetUopUid(uid)) if uid is not None: self.__highlighted_uops.add(uid)
def UnhighlightUop(self, uid): ''' Unhighlight the uop with the given annotation string ''' if isinstance(uid, str): self.UnhighlightUop(highlighting_utils.GetUopUid(uid)) if uid is not None: if uid in self.__highlighted_uops: self.__highlighted_uops.remove(uid) self.__previously_highlighted_uops.add(uid)
def AddColoredTransaction(self, annotation, content_type, color_basis_type, auto_color_basis): if len(self.__colored_transactions) > 10000: self.__colored_transactions.clear() string_to_display, brush = self.__renderer.parseAnnotationAndGetColor(annotation, content_type, color_basis_type, auto_color_basis) key = '%s:%s:%s:%s' % (annotation, color_basis_type, auto_color_basis, hash(content_type)) uop_uid = highlighting_utils.GetUopUid(annotation) if self.__context.IsUopUidHighlighted(uop_uid): highlighted = True else: highlighted = False self.__colored_transactions[key] = (string_to_display, brush, highlighted, uop_uid) return string_to_display, brush, highlighted
def AddColoredTransaction(self, annotation, content_type, color_basis_type, auto_color_basis, start_tick, element): if len(self.__colored_transactions) > 10000: self.__colored_transactions.clear() string_to_display, brush = self.__renderer.parseAnnotationAndGetColor(annotation, content_type, color_basis_type, auto_color_basis) key = '%s:%s:%s:%s' % (annotation, color_basis_type, auto_color_basis, hash(content_type)) uop_uid = highlighting_utils.GetUopUid(annotation) highlighted = self.__context.IsUopUidHighlighted(uop_uid) if element.HasProperty('LocationString'): search_result_hash = self.__context.SearchResultHash(start_tick, element.GetProperty('LocationString')) else: search_result_hash = None search_result = self.__context.IsSearchResult(search_result_hash) self.__colored_transactions[key] = (string_to_display, brush, highlighted, search_result, uop_uid, search_result_hash) return string_to_display, brush, highlighted, search_result
def WasUopHighlighted(self, anno_string): return highlighting_utils.GetUopUid( anno_string) in self.__previously_highlighted_uops
def IsUopHighlighted(self, anno_string): return highlighting_utils.GetUopUid( anno_string) in self.__highlighted_uops
def WasUopHighlighted(self, uid): if isinstance(uid, str): return self.WasUopHighlighted(highlighting_utils.GetUopUid(uid)) return uid in self.__previously_highlighted_uops
def IsUopHighlighted(self, uid): if isinstance(uid, str): return self.IsUopHighlighted(highlighting_utils.GetUopUid(uid)) return uid in self.__highlighted_uops