本文整理匯總了Golang中github.com/axel-freesp/sge/interface/tree.TreeIf.Property方法的典型用法代碼示例。如果您正苦於以下問題:Golang TreeIf.Property方法的具體用法?Golang TreeIf.Property怎麽用?Golang TreeIf.Property使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/axel-freesp/sge/interface/tree.TreeIf
的用法示例。
在下文中一共展示了TreeIf.Property方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: AddToTree
func (p *port) AddToTree(tree tr.TreeIf, cursor tr.Cursor) {
var prop tr.Property
parentId := tree.Parent(cursor)
if tree.Property(parentId).IsReadOnly() {
prop = freesp.PropertyNew(false, false, false)
} else {
prop = freesp.PropertyNew(true, false, false)
}
var kind tr.Symbol
if p.Direction() == gr.InPort {
kind = tr.SymbolInputPort
} else {
kind = tr.SymbolOutputPort
}
err := tree.AddEntry(cursor, kind, p.Name(), p, prop)
if err != nil {
log.Fatalf("port.AddToTree: FilesTreeStore.AddEntry() failed: %s\n", err)
}
child := tree.Append(cursor)
t := p.SignalType()
t.AddToTree(tree, child)
for _, c := range p.Connections() {
child = tree.Append(cursor)
p.Connection(c).AddToTree(tree, child)
}
return
}
示例2: AddToTree
func (p *portType) AddToTree(tree tr.TreeIf, cursor tr.Cursor) {
var prop tr.Property
parentId := tree.Parent(cursor)
if tree.Property(parentId).IsReadOnly() {
prop = freesp.PropertyNew(false, false, false)
} else {
prop = freesp.PropertyNew(true, true, true)
}
var kind tr.Symbol
if p.Direction() == gr.InPort {
kind = tr.SymbolInputPortType
} else {
kind = tr.SymbolOutputPortType
}
err := tree.AddEntry(cursor, kind, p.Name(), p, prop)
if err != nil {
log.Fatal("bh.PortTypeIf.AddToTree: FilesTreeStore.AddEntry() failed: %s\n", err)
}
child := tree.Append(cursor)
p.SignalType().AddToTree(tree, child)
}
示例3: isParentReadOnly
func isParentReadOnly(tree tr.TreeIf, cursor tr.Cursor) bool {
parentId := tree.Parent(cursor)
return tree.Property(parentId).IsReadOnly()
}