示例#1
0
 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)
示例#2
0
 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)
示例#3
0
    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)
示例#4
0
    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)
示例#5
0
    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
示例#6
0
    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
示例#7
0
 def WasUopHighlighted(self, anno_string):
     return highlighting_utils.GetUopUid(
         anno_string) in self.__previously_highlighted_uops
示例#8
0
 def IsUopHighlighted(self, anno_string):
     return highlighting_utils.GetUopUid(
         anno_string) in self.__highlighted_uops
示例#9
0
 def WasUopHighlighted(self, uid):
     if isinstance(uid, str):
         return self.WasUopHighlighted(highlighting_utils.GetUopUid(uid))
     return uid in self.__previously_highlighted_uops
示例#10
0
 def IsUopHighlighted(self, uid):
     if isinstance(uid, str):
         return self.IsUopHighlighted(highlighting_utils.GetUopUid(uid))
     return uid in self.__highlighted_uops