本文整理匯總了Golang中github.com/axel-freesp/sge/interface/tree.TreeIf.Append方法的典型用法代碼示例。如果您正苦於以下問題:Golang TreeIf.Append方法的具體用法?Golang TreeIf.Append怎麽用?Golang TreeIf.Append使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/axel-freesp/sge/interface/tree.TreeIf
的用法示例。
在下文中一共展示了TreeIf.Append方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: treeAddNewObject
func (p *port) treeAddNewObject(tree tr.TreeIf, cursor tr.Cursor, conn bh.ConnectionIf, otherPort bh.PortIf) (newCursor tr.Cursor) {
newCursor = tree.Insert(cursor)
conn.AddToTree(tree, newCursor)
contextCursor := tree.Parent(tree.Parent(cursor))
cCursor := tree.CursorAt(contextCursor, otherPort)
cChild := tree.Append(cCursor)
conn.AddToTree(tree, cChild)
return
}
示例3: AddToTree
func (p *process) AddToTree(tree tr.TreeIf, cursor tr.Cursor) {
prop := freesp.PropertyNew(true, true, true)
err := tree.AddEntry(cursor, tr.SymbolProcess, p.Name(), p, prop)
if err != nil {
log.Fatalf("process.AddToTree error: AddEntry failed: %s\n", err)
}
for _, c := range p.InChannels() {
child := tree.Append(cursor)
c.AddToTree(tree, child)
}
for _, c := range p.OutChannels() {
child := tree.Append(cursor)
c.AddToTree(tree, child)
}
}
示例4: AddToTree
func (l *library) AddToTree(tree tr.TreeIf, cursor tr.Cursor) {
prop := freesp.PropertyNew(true, false, false)
err := tree.AddEntry(cursor, tr.SymbolLibrary, l.Filename(), l, prop)
if err != nil {
log.Fatalf("bh.LibraryIf.AddToTree error: AddEntry failed: %s\n", err)
}
for _, t := range l.SignalTypes() {
child := tree.Append(cursor)
t.AddToTree(tree, child)
}
for _, t := range l.NodeTypes() {
child := tree.Append(cursor)
t.AddToTree(tree, child)
}
}
示例5: AddToTree
func (a *arch) AddToTree(tree tr.TreeIf, cursor tr.Cursor) {
//log.Printf("arch.AddToTree: %s\n", a.Name())
prop := freesp.PropertyNew(true, true, true)
err := tree.AddEntry(cursor, tr.SymbolArch, a.Name(), a, prop)
if err != nil {
log.Fatalf("arch.AddToTree error: AddEntry failed: %s", err)
}
for _, t := range a.IOTypes() {
child := tree.Append(cursor)
t.AddToTree(tree, child)
}
for _, p := range a.Processes() {
child := tree.Append(cursor)
p.AddToTree(tree, child)
}
}
示例6: 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)
}
示例7: AddToTree
func (t *nodeType) AddToTree(tree tr.TreeIf, cursor tr.Cursor) {
var prop tr.Property
parentId := tree.Parent(cursor)
parent := tree.Object(parentId)
switch parent.(type) {
case bh.LibraryIf:
prop = freesp.PropertyNew(true, true, true)
case bh.NodeIf:
prop = freesp.PropertyNew(false, false, false)
default:
log.Fatalf("nodeType.AddToTree error: invalid parent type %T\n", parent)
}
err := tree.AddEntry(cursor, tr.SymbolNodeType, t.TypeName(), t, prop)
if err != nil {
log.Fatalf("nodeType.AddToTree error: AddEntry failed: %s\n", err)
}
for _, impl := range t.Implementation() {
child := tree.Append(cursor)
impl.AddToTree(tree, child)
}
for _, pt := range t.InPorts() {
child := tree.Append(cursor)
pt.AddToTree(tree, child)
}
for _, pt := range t.OutPorts() {
child := tree.Append(cursor)
pt.AddToTree(tree, child)
}
}
示例8: AddToTree
func (n *node) AddToTree(tree tr.TreeIf, cursor tr.Cursor) {
var prop tr.Property
if isParentReadOnly(tree, cursor) {
prop = freesp.PropertyNew(false, false, false)
} else {
prop = freesp.PropertyNew(true, true, true)
}
var image tr.Symbol
if len(n.InPorts()) == 0 {
image = tr.SymbolInputNode
} else if len(n.OutPorts()) == 0 {
image = tr.SymbolOutputNode
} else {
image = tr.SymbolProcessingNode
}
err := tree.AddEntry(cursor, image, n.Name(), n, prop)
if err != nil {
log.Fatalf("node.AddToTree error: AddEntry failed: %s\n", err)
}
child := tree.Append(cursor)
n.ItsType().AddToTree(tree, child)
for _, p := range n.InPorts() {
child := tree.Append(cursor)
p.AddToTree(tree, child)
}
for _, p := range n.OutPorts() {
child := tree.Append(cursor)
p.AddToTree(tree, child)
}
}
示例9: AddToTree
func (t *signalGraphType) AddToTree(tree tr.TreeIf, cursor tr.Cursor) {
for _, n := range t.InputNodes() {
child := tree.Append(cursor)
n.AddToTree(tree, child)
}
for _, n := range t.OutputNodes() {
child := tree.Append(cursor)
n.AddToTree(tree, child)
}
for _, n := range t.ProcessingNodes() {
child := tree.Append(cursor)
n.AddToTree(tree, child)
}
}
示例10: AddToTree
func (m *mapping) AddToTree(tree tr.TreeIf, cursor tr.Cursor) {
var child tr.Cursor
err := tree.AddEntry(cursor, tr.SymbolMappings, m.Filename(), m, freesp.MayAddObject)
if err != nil {
log.Fatalf("mapping.AddToTree error: AddEntry failed: %s\n", err)
}
child = tree.Append(cursor)
m.graph.AddToTree(tree, child)
child = tree.Append(cursor)
m.platform.AddToTree(tree, child)
for _, nId := range m.MappedIds() {
log.Printf("mapping.AddToTree: id=%s\n", nId.String())
melem, ok := m.MappedElement(nId)
if !ok {
log.Fatal("mapping) AddToTree internal error: inconsistent maplist")
}
child = tree.Append(cursor)
melem.AddToTree(tree, child)
}
}