home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1997
- #
- # File: @(#)msumlgener.tcl /main/hindenburg/9
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)msumlgener.tcl /main/hindenburg/9 30 May 1997 Copyright 1997 Cayenne Software Inc.
-
- # Start user added include file section
- # End user added include file section
-
- #require "msumleleme.tcl"
-
- Class MSUMLGeneralization : {MSUMLElement} {
- constructor
- method destructor
- method ot2ms
- method ms2ot
- method promoter
- method subType
- method superType
- attribute _subType
- attribute _superType
- attribute smGenNode
- }
-
- constructor MSUMLGeneralization {class this typeName smGenNode} {
- set this [MSUMLElement::constructor $class $this $typeName]
- $this smGenNode $smGenNode
- # Start constructor user section
- # End constructor user section
- return $this
- }
-
- method MSUMLGeneralization::destructor {this} {
- set ref [$this _subType]
- if {$ref != ""} {
- [$ref _generalizationSet] removeValue $this
- }
- set ref [$this _superType]
- if {$ref != ""} {
- [$ref _specializationSet] removeValue $this
- }
- # Start destructor user section
- # End destructor user section
- $this MSUMLElement::destructor
- }
-
- method MSUMLGeneralization::ot2ms {this package} {
- set superType [$this superType]
- set subType [$this subType]
-
- set genSmNode [$superType smClass]
- set specSmNode [$subType smClass]
-
- set genName [[$genSmNode getItem] name]
- set specName [[$specSmNode getItem] name]
-
- set uSuperType [$superType msUmlObject]
- set uSubType [$subType msUmlObject]
- $uSuperType setAsTo
- $uSubType setAsFrom
- global trans
- $trans begin
- set myGen [$package createGeneralization "$specName->$genName"]
- $trans commit
- #$this saveFreeTextProp $myGen [$workItem properties]
- return $myGen
- }
-
- method MSUMLGeneralization::ms2ot {this diag} {
- #do not define this class
- #set superClass [[$this superType] ms2ot $diag]
- #set subClass [[$this subType] ms2ot $diag]
-
- set superName [[$this superType] name]
- set superClass [$diag findClass $superName]
- if ![llength $superClass] {
- set superClass [$diag addClass $superName]
- $superClass setProp {is_folded} {1} comp
- }
-
- set subName [[$this subType] name]
- set subClass [$diag findClass $subName]
- if ![llength $subClass] {
- set subClass [$diag addClass $subName]
- $subClass setProp {is_folded} {1} comp
- }
-
- set overLap 0
- set myGen [$subClass addGeneralization $superClass $overLap]
- $this loadFreeTextProp $myGen
- return $myGen
- }
-
- method MSUMLGeneralization::promoter {this} {
- # this is called when importing from MS Repository
- $this MSUMLElement::promoter
- set superClass [$this getSuperTypeAsUML]
- MSUMLClass promote $superClass
- $this superType $superClass
- set subClass [$this getSubTypeAsUML]
- MSUMLClass promote $subClass
- $this subType $subClass
- }
-
- # Do not delete this line -- regeneration end marker
-
- method MSUMLGeneralization::subType {this args} {
- if {$args == ""} {
- return [$this _subType]
- }
- set ref [$this _subType]
- if {$ref != ""} {
- [$ref _generalizationSet] removeValue $this
- }
- set obj [lindex $args 0]
- if {$obj != ""} {
- [$obj _generalizationSet] append $this
- }
- $this _subType $obj
- }
-
- method MSUMLGeneralization::superType {this args} {
- if {$args == ""} {
- return [$this _superType]
- }
- set ref [$this _superType]
- if {$ref != ""} {
- [$ref _specializationSet] removeValue $this
- }
- set obj [lindex $args 0]
- if {$obj != ""} {
- [$obj _specializationSet] append $this
- }
- $this _superType $obj
- }
-
-