本文整理汇总了Python中Tree.put_ms_into_node_name方法的典型用法代码示例。如果您正苦于以下问题:Python Tree.put_ms_into_node_name方法的具体用法?Python Tree.put_ms_into_node_name怎么用?Python Tree.put_ms_into_node_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tree
的用法示例。
在下文中一共展示了Tree.put_ms_into_node_name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: LocationManagementApp
# 需要导入模块: import Tree [as 别名]
# 或者: from Tree import put_ms_into_node_name [as 别名]
class LocationManagementApp(Tkinter.Tk):
def __init__(self,parent):
Tkinter.Tk.__init__(self,parent)
self.__parent = parent
self.__tpa = None
self.__ms1 = None
self.__ms2 = None
self.__canvas = None
self.__initialize()
##################################################################################
#
# Description: Initializes
#
##################################################################################
def __initialize(self):
self.grid()
self.__numLMA = Tkinter.IntVar()
self.__numLMA.set(1)
self.__NumLMAsOnPressEnter()
self.reset_trees()
self.resizable(False, False)
self.columnconfigure(0, minsize = 250, weight=1)
self.update()
def clean(self):
self.__tpa.clean()
##################################################################################
#
# Description: Number of LMAs
#
##################################################################################
def __NumLMAsOnPressEnter(self):
try:
if self.__numLMA.get() > 0:
self.__lmaNames = {}
for i in range(self.__numLMA.get()):
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)
##################################################################################
#
#.........这里部分代码省略.........