def adjust_version_colors(self, controller):
        """ adjust_version_colors(controller: VistrailController) -> None
        Based on the controller to set version colors
        
        """
        currentUser = controller.vistrail.getUser()
        ranks = {}
        ourMaxRank = 0
        otherMaxRank = 0
        am = controller.vistrail.actionMap
        for nodeId in sorted(self.versions.keys()):
            if nodeId!=0:
                nodeUser = am[nodeId].user
                if nodeUser==currentUser:
                    ranks[nodeId] = ourMaxRank
                    ourMaxRank += 1
                else:
                    ranks[nodeId] = otherMaxRank
                    otherMaxRank += 1
        for (nodeId, item) in self.versions.iteritems():
            if nodeId == 0:
                item.setGhosted(True)
                continue
            nodeUser = am[nodeId].user
            if controller.search and nodeId!=0:
                action = am[nodeId]
                if getattr(get_vistrails_configuration(), 'hideUpgrades',
                           True):
                    # Use upgraded version to match
                    action = am[controller.vistrail.get_upgrade(nodeId, False)]
                ghosted = not controller.search.match(controller, action)
            else:
                ghosted = False
                
            #item.setGhosted(ghosted) # we won't set it now so we can check if
                                      # the state changed in update_color
            if nodeUser==currentUser:
                max_rank = ourMaxRank
            else:
                max_rank = otherMaxRank
#             max_rank = ourMaxRank if nodeUser==currentUser else otherMaxRank
            configuration = get_vistrails_configuration()
            if configuration.check('customVersionColors'):
                custom_color = controller.vistrail.get_action_annotation(
                    nodeId,
                    custom_color_key)
                if custom_color is not None:
                    try:
                        custom_color = parse_custom_color(custom_color.value)
                    except __HOLE__, e:
                        debug.warning("Version %r has invalid color annotation "
                                      "(%s)" % (nodeId, e))
                        custom_color = None
            else:
                custom_color = None
            ####
            item.update_color(nodeUser==currentUser,
                              ranks[nodeId],
                              max_rank, ghosted, custom_color)
        for (version_from, version_to), link in self.edges.iteritems():
            if self.versions[version_from].ghosted and \
                    self.versions[version_to].ghosted:
                link.setGhosted(True)
            else:
                link.setGhosted(False)
dataset/ETHPy150Open VisTrails/VisTrails/vistrails/gui/version_view.py/QVersionTreeScene.adjust_version_colors