當前位置: 首頁>>代碼示例>>Golang>>正文


Golang platform.ArchIf類代碼示例

本文整理匯總了Golang中github.com/axel-freesp/sge/interface/platform.ArchIf的典型用法代碼示例。如果您正苦於以下問題:Golang ArchIf類的具體用法?Golang ArchIf怎麽用?Golang ArchIf使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ArchIf類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: focusArchFromUserObject

func (v *mappingView) focusArchFromUserObject(obj pf.ArchIf) (ret graph.ArchIf, ok bool) {
	var a graph.ArchIf
	for _, a = range v.arch {
		if obj.Name() == a.UserObj().Name() {
			ret = a
			ok = true
		} else {
			if a.Deselect() {
				v.repaintArch(a)
			}
		}
	}
	return
}
開發者ID:axel-freesp,項目名稱:sge,代碼行數:14,代碼來源:mappingview.go

示例2: channelGetIOTypeFromArch

func channelGetIOTypeFromArch(a pf.ArchIf, iotype string) (iot pf.IOTypeIf, err error) {
	var ok bool
	for _, iot = range a.IOTypes() {
		if iot.Name() == iotype {
			ok = true
			break
		}
	}
	if !ok {
		err = fmt.Errorf("createInChannelFromXml error: referenced ioType %s not found in arch %s.\n",
			iotype, a.Name())
	}
	return
}
開發者ID:axel-freesp,項目名稱:sge,代碼行數:14,代碼來源:channel.go

示例3: ArchMappingNew

func ArchMappingNew(userObj pf.ArchIf, nodes []NodeIf, mapping mp.MappingIf) *Arch {
	var processes []ProcessIf
	var Children []ContainerChild
	for _, up := range userObj.Processes() {
		var mappedNodes []NodeIf
		var mappedIds []bh.NodeIdIf
		for _, nId := range mapping.MappedIds() {
			m, ok := mapping.Mapped(nId.String())
			if ok && m == up {
				log.Printf("ArchMappingNew(p=%s): nId=%s", up.Name(), nId.String())
				n, ok := findNodeInTree(nodes, nId.String())
				if ok && !n.UserObj().Expanded() {
					mappedNodes = append(mappedNodes, n)
					mappedIds = append(mappedIds, nId)
				}
			}
		}
		p := ProcessMappingNew(mappedNodes, mappedIds, up)
		processes = append(processes, p)
		Children = append(Children, p)
	}
	config := DrawConfig{ColorInit(ColorOption(ArchNormal)),
		ColorInit(ColorOption(ArchHighlight)),
		ColorInit(ColorOption(ArchSelected)),
		ColorInit(ColorOption(BoxFrame)),
		ColorInit(ColorOption(Text)),
		image.Point{archPortOutBorder, archPortOutBorder}}
	cconfig := ContainerConfig{archPortWidth, archPortHeight, archMinWidth, archMinHeight}
	a := &Arch{ContainerInit(Children, config, userObj, cconfig), userObj,
		make(map[pf.ChannelIf]*ContainerPort), processes, gr.PositionModeMapping, mapping}
	a.init()
	/*
		for _, n := range nodes {
			melem, ok := mapping.MappedElement(n.UserObj())
			if !ok {
				log.Printf("ArchMappingNew warning: node %s not mapped.\n", n.Name())
				continue
			}
			n.SetPosition(melem.PathModePosition("", gr.PositionModeMapping))
		}
	*/
	a.initMappingPorts()
	return a
}
開發者ID:axel-freesp,項目名稱:sge,代碼行數:44,代碼來源:arch.go

示例4: ArchNew

func ArchNew(userObj pf.ArchIf) *Arch {
	var processes []ProcessIf
	var Children []ContainerChild
	for _, up := range userObj.Processes() {
		p := ProcessNew(up.ModePosition(gr.PositionModeNormal), up)
		processes = append(processes, p)
		Children = append(Children, p)
	}
	config := DrawConfig{ColorInit(ColorOption(ArchNormal)),
		ColorInit(ColorOption(ArchHighlight)),
		ColorInit(ColorOption(ArchSelected)),
		ColorInit(ColorOption(BoxFrame)),
		ColorInit(ColorOption(Text)),
		image.Point{archPortOutBorder, archPortOutBorder}}
	cconfig := ContainerConfig{archPortWidth, archPortHeight, archMinWidth, archMinHeight}
	a := &Arch{ContainerInit(Children, config, userObj, cconfig), userObj,
		make(map[pf.ChannelIf]*ContainerPort), processes, gr.PositionModeNormal, nil}
	a.init()
	a.initPorts()
	return a
}
開發者ID:axel-freesp,項目名稱:sge,代碼行數:21,代碼來源:arch.go

示例5: CreateXmlArch

func CreateXmlArch(a pf.ArchIf) *backend.XmlArch {
	ret := backend.XmlArchNew(a.Name())
	for _, t := range a.IOTypes() {
		ret.IOType = append(ret.IOType, *CreateXmlIOType(t))
	}
	for _, p := range a.Processes() {
		ret.Processes = append(ret.Processes, *CreateXmlProcess(p))
	}
	//ret.Entry = freesp.CreateXmlModePosition(a).Entry
	return ret
}
開發者ID:axel-freesp,項目名稱:sge,代碼行數:11,代碼來源:backendconversions.go

示例6: CreateXmlArchHint

func CreateXmlArchHint(a pf.ArchIf) (xmla *backend.XmlArchPosHint) {
	xmla = backend.XmlArchPosHintNew(a.Name())
	xmla.Entry = freesp.CreateXmlModePosition(a).Entry
	for _, p := range a.ArchPorts() {
		xmla.ArchPorts = append(xmla.ArchPorts, *CreateXmlArchPortHint(p))
	}
	for _, p := range a.Processes() {
		xmla.Processes = append(xmla.Processes, *CreateXmlProcessHint(p))
	}
	return
}
開發者ID:axel-freesp,項目名稱:sge,代碼行數:11,代碼來源:backendconversions.go


注:本文中的github.com/axel-freesp/sge/interface/platform.ArchIf類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。