コード例 #1
0
 def __init__(self,
              value=None,
              parent=None,
              which_child=None,
              left_child=None,
              right_child=None):
     Tree.__init__(self, value, left_child, right_child)
     self.set_parent(parent, which_child)
コード例 #2
0
ファイル: NavTree.py プロジェクト: Xplouder/PoC-Part2
    def __init__(self, value, children, parent=None):
        """
        Create a tree whose root has specific value (a string)
        children is a list of references to the roots of the children.
        parent (if specified) is a reference to the tree's parent node
        """

        Tree.__init__(self, value, children)
        self._parent = parent
        for child in self._children:
            child._parent = self
コード例 #3
0
ファイル: MultiSelectTree.py プロジェクト: immo/pyTOM
    def __init__(self, master, root_id, root_label='',
                 get_contents_callback=None, dist_x=15, dist_y=15,
                 text_offset=10, line_flag=1, expanded_icon=None,
                 collapsed_icon=None, regular_icon=None, plus_icon=None,
                 minus_icon=None, unchecked_icon=None, checked_icon=None,
                 greyed_checked_icon=None,node_class=MultiSelectNode, drop_callback=None,
                 node_select_callback=None,
                 *args, **kw_args):

        self.separater = ' -> '

        self.pos = None

        self.rootId = root_id
        self.realDistX = dist_x

        self.nodeSelectCallback = node_select_callback

        if checked_icon == None:
            self.checkedIcon=PhotoImage(file='checkedIcon.gif')
        else:
            self.checkedIcon=checked_icon
        if unchecked_icon == None:
            self.uncheckedIcon=PhotoImage(file='uncheckedIcon.gif')
        else:
            self.uncheckedIcon=unchecked_icon
        if greyed_checked_icon == None:
            self.greyedCheckedIcon=PhotoImage(file='greyedIcon.gif')
        else:
            self.greyedCheckedIcon=greyed_checked_icon

        if get_contents_callback == None:
            get_contents_callback = self._getContents

        savedNode = Struct()
        savedNode.name = self.rootId
        savedNode.expandable = True
        savedNode.fullPath = self.rootId
        savedNode.expanded = False
        savedNode.selected = False

        # This structure is used to remember selected nodes and their selected/expanded states
        self.savedNodesMap = {'': [savedNode], savedNode.fullPath: []}

        Tree.__init__(self, master, root_id, root_label,
                 get_contents_callback, dist_x * 2, dist_y,
                 text_offset, line_flag, expanded_icon,
                 collapsed_icon, regular_icon, plus_icon,
                 minus_icon, node_class, drop_callback,
                 *args, **kw_args)
コード例 #4
0
 def __init__(self, is_leaf: bool, data: tuple, df: pd.DataFrame):
     Tree.__init__(self, is_leaf, data)
     self.__df = df
コード例 #5
0
 def __init__(self, data, param):
     Tree.__init__(self, data, param)