home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
cbclass.tcl
< prev
next >
Wrap
Text File
|
1997-08-29
|
4KB
|
165 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)cbclass.tcl /main/titanic/3
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)cbclass.tcl /main/titanic/3 29 Aug 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
require "cbattribut.tcl"
require "cbmethod.tcl"
require "cbpropcomp.tcl"
require "cbproplabe.tcl"
require "cbpropitem.tcl"
# End user added include file section
require "cadclass.tcl"
require "cbtlentry.tcl"
Class CBClass : {CADClass CBTLEntry} {
method destructor
constructor
method createFeature
method compareName
method is
method isCurrentOpenedClass
method doOpen
method open
method editCAD
method getCBClass
method collectClasses
method collectWorkItems
method collectPropComps
method format
}
method CBClass::destructor {this} {
# Start destructor user section
# End destructor user section
$this CADClass::destructor
$this CBTLEntry::destructor
}
constructor CBClass {class this inModel} {
set this [CADClass::constructor $class $this $inModel]
set this [CBTLEntry::constructor $class $this $this]
return $this
}
method CBClass::createFeature {this row} {
if {[$row type] == $CDM_ATTR} {
return [CBAttribute new $this $row]
}
if {[$row type] == $CDM_METHOD} {
return [CBMethod new $this $row]
}
return ""
}
method CBClass::compareName {this other} {
if {[m4_var get M4_sort_case_sensitive] == "1"} {
return [string compare [$this name] [$other name]]
} else {
set lowerName [string tolower [$this name]]
set lowerOtherName [string tolower [$other name]]
return [string compare $lowerName $lowerOtherName]
}
}
method CBClass::is {this other} {
if {$this == $other} {
return 1
}
return 0
}
method CBClass::isCurrentOpenedClass {this} {
set currentOpenedClass [[$this getClassBrowser] currentOpenedClass]
if {$currentOpenedClass == "" } {
return 0
}
return [$this is $currentOpenedClass]
}
method CBClass::doOpen {this} {
set classBrowser [$this getClassBrowser]
wmtkmessage "Opening class '[$this name]' ..."
$classBrowser currentOpenedClass $this
$classBrowser updateTitle $this
$classBrowser updateWmtAreaClass $this
$classBrowser addFileHistory $this
$this load
[$classBrowser superClassTL] updateView $this
[$classBrowser subClassTL] updateView $this
[$classBrowser featureTL] updateView $this
[$classBrowser assocTL] updateView $this
[$classBrowser classTL] selectEntry $this
$classBrowser selTextListChanged [$classBrowser classTL]
wmtkmessage ""
}
method CBClass::open {this} {
if {[$this isCurrentOpenedClass]} {
return
}
set classBrowser [$this getClassBrowser]
set currentOpenedClass [$classBrowser currentOpenedClass]
if {$currentOpenedClass != ""} {
[$classBrowser openHistory] push $currentOpenedClass
}
$this doOpen
}
method CBClass::editCAD {this} {
set nameItem [$this getNameItem]
if {[$nameItem isNil]} {
return ""
}
set systemV [$this getDefiningSystemVersion]
[[$this getClassBrowser] startEditCADHandler] handle $systemV $nameItem
}
method CBClass::getCBClass {this} {
return $this
}
method CBClass::collectClasses {this classList} {
$classList append $this
}
method CBClass::collectWorkItems {this workItemList} {
set workItem [$this getNameWorkItem]
if {![$workItem isNil]} {
$workItemList append $workItem
}
}
method CBClass::collectPropComps {this propCompList} {
# A CBClass can have more than 1 component: take the first one.
set comps [$this getComponents]
if {[llength $comps] == 0} {
return
}
$propCompList addComponent [lindex $comps 0] [$this getNameLabel] \
[$this getNameItem] [$this getNameWorkItem]
}
method CBClass::format {this} {
if {[$this formattedText] != ""} {
return [$this formattedText]
}
$this formattedText [$this name]
return [$this formattedText]
}
# Do not delete this line -- regeneration end marker