当前位置: 首页>>代码示例>>Python>>正文


Python Tree.find_node_and_move_ms_location_from_node方法代码示例

本文整理汇总了Python中Tree.find_node_and_move_ms_location_from_node方法的典型用法代码示例。如果您正苦于以下问题:Python Tree.find_node_and_move_ms_location_from_node方法的具体用法?Python Tree.find_node_and_move_ms_location_from_node怎么用?Python Tree.find_node_and_move_ms_location_from_node使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tree的用法示例。


在下文中一共展示了Tree.find_node_and_move_ms_location_from_node方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: LocationManagementApp

# 需要导入模块: import Tree [as 别名]
# 或者: from Tree import find_node_and_move_ms_location_from_node [as 别名]

#.........这里部分代码省略.........
                    self.__lmaNames[i] = {}
                    self.__lmaNames[i][0] = Tkinter.Label(self, text = "LMA " + str(i+1) + " Name",
                                                          anchor = "w", fg = "white", bg = "blue")
                    self.__lmaNames[i][0].grid(column = 0 , row = i, columnspan = 2, sticky = 'EW')
                    self.__lmaNames[i][1] = {}
                    self.__lmaNames[i][1][0] = Tkinter.StringVar()
                    self.__lmaNames[i][1][0].set("Values")
                    self.__lmaNames[i][1][1] = Tkinter.Entry(self, textvariable = self.__lmaNames[i][1][0], width = 20)
                    self.__lmaNames[i][1][1].grid(column = 1, row = i, sticky = 'EW')

                self.____addLMA()

        except:
            self.__numLMA.set(1)

    ##################################################################################
    #
    #  Description: adds an lma
    #
    ##################################################################################
    def ____addLMA(self):
        for i in range(self.__numLMA.get()):
            self.__lmaNames[i][0].grid_forget()
            self.__lmaNames[i][1][1].grid_forget()

        self.__labels = LocationManagementLabels(self)
        self.__lmas = []
        self.__lmaNames[i][1][0].set("")
        self.__lmas.append(LocationManagemenEntry(self, self.__lmaNames[0][1][0].get(), i+2, -1, i==0))
        self.update()

    ##################################################################################
    #
    #  Description: Resets the trees
    #
    ##################################################################################
    def reset_trees(self):
        self.__canvas = CanvasApp(self, 6, 8)
        self.__tpa = Tree(PointerAlgorithm())
        self.__ms1 = MH(1)
        self.__ms2 = MH(2)

        fill_tree(self.__tpa, self.__canvas)

        self.__ms1.add_gui(self.__canvas.add_circle(0, 0, 0, fill="white", outline="black", width=2, name="MS 1"))
        self.__tpa.put_ms_into_node_name(self.__ms1, 7)
        self.__ms2.add_gui(self.__canvas.add_circle(0, 0, 0, fill="white", outline="black", width=2, name="MS 2"))
        self.__tpa.put_ms_into_node_name(self.__ms2, 18)

    ##################################################################################
    #
    #  Description: Token Ring Wait Time
    #
    ##################################################################################
    def token_ring_wait_time(self, wait_time):
        self.__tpa.set_token_ring_wait_time(wait_time)

    ##################################################################################
    #
    #  Description: Moves ms1 to name
    #
    ##################################################################################
    def move_ms1(self, name, inputs):
        self.__ms1.get_gui().clear_line()
        self.__ms2.get_gui().clear_line()
        self.__tpa.find_node_and_move_ms_location_from_node(self.__ms1, name)

    ##################################################################################
    #
    #  Description: Moves ms2 to name
    #
    ##################################################################################
    def move_ms2(self, name, inputs):
        self.__ms1.get_gui().clear_line()
        self.__ms2.get_gui().clear_line()
        self.__tpa.find_node_and_move_ms_location_from_node(self.__ms2, name)

    ##################################################################################
    #
    #  Description: calls ms1
    #
    ##################################################################################
    def call_ms1(self, inputs):
        #node_name = int(inputs["callms1fromnode"].get())

        self.__ms1.get_gui().clear_line()
        self.__ms2.get_gui().clear_line()

        # if node_name != self.__ms2.get_node().get_name():
        #     self.__tpa.remove_ms_from_tree(self.__ms2, self.__ms2.get_node())
        #     self.__tpa.put_ms_into_node_name(self.__ms2, node_name)
        if self.__tpa.query_ms_location_from_node(self.__ms1, self.__ms2.get_node()) is not None:
            self.__ms1.get_gui().search_line("green")
            self.__ms2.get_gui().search_line("green")

    def send_ms1_message(self, message):
        self.__ms2.send_message(self.__ms1, message)

    def send_ms2_message(self, message):
        self.__ms1.send_message(self.__ms2, message)
开发者ID:dntfg4,项目名称:MST6604,代码行数:104,代码来源:ProxyStrategyApp.py


注:本文中的Tree.find_node_and_move_ms_location_from_node方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。