home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
cbnaryasso.tcl
< prev
next >
Wrap
Text File
|
1996-05-29
|
4KB
|
131 lines
#---------------------------------------------------------------------------
#
# (c) Westmount Technology 1994
#
# File: @(#)cbnaryasso.tcl 1.6
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)cbnaryasso.tcl 1.6 03 Nov 1995 Copyright 1994 Westmount Technology
# Start user added include file section
require "cbpropname.tcl"
require "cbpropcomp.tcl"
require "cbproplabe.tcl"
require "cbpropitem.tcl"
# End user added include file section
require "cadnassocc.tcl"
require "cbassociat.tcl"
Class CBNaryAssoc : {CADNAssocConn CBAssociation} {
method destructor
constructor
method collectClasses
method collectWorkItems
method collectPropComps
method format
}
method CBNaryAssoc::destructor {this} {
# Start destructor user section
# End destructor user section
$this CADNAssocConn::destructor
$this CBAssociation::destructor
}
constructor CBNaryAssoc {class this inModel} {
set this [CADNAssocConn::constructor $class $this $inModel]
set this [CBAssociation::constructor $class $this $this]
return $this
}
method CBNaryAssoc::collectClasses {this classList} {
if {[[$this getClassBrowser] isInFlatViewMode]} {
$classList append [$this class]
}
foreach pNaryAssoc [$this getPartnerNAssocConns] {
$classList append [$pNaryAssoc class]
}
}
method CBNaryAssoc::collectWorkItems {this workItemList} {
if {[[$this getClassBrowser] isInFlatViewMode]} {
[$this class] collectWorkItems $workItemList
}
set workItem [[$this nAssocNode] getNameWorkItem]
if {![$workItem isNil]} {
$workItemList append $workItem
}
foreach pNaryAssoc [$this getPartnerNAssocConns] {
set workItem [$pNaryAssoc getRoleWorkItem]
if {![$workItem isNil]} {
$workItemList append $workItem
}
[$pNaryAssoc class] collectWorkItems $workItemList
}
}
method CBNaryAssoc::collectPropComps {this propCompList} {
if {[[$this getClassBrowser] isInFlatViewMode]} {
[$this class] collectPropComps $propCompList
}
set nAssocNode [$this nAssocNode]
$propCompList addComponent [lindex [$nAssocNode getComponents] 0] \
[$nAssocNode getNameLabel] [$nAssocNode getNameItem] \
[$nAssocNode getNameWorkItem]
foreach pNaryAssoc [$this getPartnerNAssocConns] {
# Partner role
$propCompList addComponent \
[lindex [$pNaryAssoc getComponents] 0] \
[$pNaryAssoc getRoleLabel] [$pNaryAssoc getRoleItem] \
[$pNaryAssoc getRoleWorkItem]
# Partner class
[$pNaryAssoc class] collectPropComps $propCompList
}
}
method CBNaryAssoc::format {this} {
set prefix ""
if {[[$this getClassBrowser] isInFlatViewMode]} {
set prefix "[[$this class] name]: "
}
set result "---[[$this nAssocNode] name]"
set firstPartner 1
foreach pNaryAssoc [$this getPartnerNAssocConns] {
if {$firstPartner} {
set firstPartner 0
} else {
set result "${result},"
}
set result "${result} "
set propVal [$pNaryAssoc getPropertyValue $COMP_START_MULT_KIND]
set result "${result}[CBAssociation::multKindToString $propVal]"
set result "${result}--"
# Partner role
set role [$pNaryAssoc role]
if {$role != ""} {
set result "${result}<$role>"
}
set result "${result}---"
# Partner name
set result "${result} [[$pNaryAssoc class] name]"
}
$this formattedText $result
return $prefix$result
}
# Do not delete this line -- regeneration end marker