本文整理匯總了Golang中github.com/axel-freesp/sge/views/graph.ArchIf.SelectProcess方法的典型用法代碼示例。如果您正苦於以下問題:Golang ArchIf.SelectProcess方法的具體用法?Golang ArchIf.SelectProcess怎麽用?Golang ArchIf.SelectProcess使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/axel-freesp/sge/views/graph.ArchIf
的用法示例。
在下文中一共展示了ArchIf.SelectProcess方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Select
func (v *mappingView) Select(obj interface{}) {
switch obj.(type) {
case pf.ArchIf:
arch := obj.(pf.ArchIf)
a, ok := v.focusArchFromUserObject(arch)
if ok {
v.selectArch(a)
}
case pf.ProcessIf:
pr := obj.(pf.ProcessIf)
a, ok := v.focusArchFromUserObject(pr.Arch())
if ok {
a.SelectProcess(pr)
v.repaintArch(a)
}
case pf.ChannelIf:
ch := obj.(pf.ChannelIf)
a, ok := v.focusArchFromUserObject(ch.Process().Arch())
if ok {
a.SelectChannel(ch)
v.repaintArch(a)
}
case mp.MappedElementIf:
melem := obj.(mp.MappedElementIf)
p, isMapped := melem.Process()
var pr graph.ProcessIf
var a graph.ArchIf
if !isMapped {
pr = v.unmapped
} else {
var ok bool
a, ok = v.focusArchFromUserObject(p.Arch())
if !ok {
log.Printf("mappingView.Select error: arch %s not found\n", a.Name())
return
}
pr = a.SelectProcess(p)
if pr == nil {
log.Printf("mappingView.Select error: process %v not found\n", p)
return
}
}
pr.(*graph.ProcessMapping).SelectNode(melem.NodeId(), melem.NodeId())
if isMapped {
v.repaintArch(a)
} else {
v.repaintUnmapped(v.unmapped)
}
default:
}
}