home *** CD-ROM | disk | FTP | other *** search
/ PC World 1997 November / PCWorld_1997-11_cd.bin / software / programy / komix / DATA.Z / cadnassocc.tcl < prev    next >
Text File  |  1996-06-11  |  2KB  |  88 lines

  1. #---------------------------------------------------------------------------
  2. #
  3. #      (c)     Cadre Technologies Inc.    1996
  4. #
  5. #      File:           @(#)cadnassocc.tcl    /main/2
  6. #      Author:         <generated>
  7. #      Description:
  8. #---------------------------------------------------------------------------
  9. # SccsId = @(#)cadnassocc.tcl    /main/2   11 Jun 1996 Copyright 1996 Cadre Technologies Inc.
  10.  
  11. # Start user added include file section
  12. # End user added include file section
  13.  
  14. require "cadassocia.tcl"
  15.  
  16. Class CADNAssocConn : {CADAssociation} {
  17.     constructor
  18.     method destructor
  19.     method load
  20.     method getRoleLabel
  21.     method getRoleItem
  22.     method getRoleWorkItem
  23.     method role
  24.     method getPartnerNAssocConns
  25.     attribute class
  26.     attribute nAssocNode
  27. }
  28.  
  29. constructor CADNAssocConn {class this inModel} {
  30.     set this [CADAssociation::constructor $class $this $inModel]
  31.     # Start constructor user section
  32.     # End constructor user section
  33.     return $this
  34. }
  35.  
  36. method CADNAssocConn::destructor {this} {
  37.     # Start destructor user section
  38.     # End destructor user section
  39.     $this CADAssociation::destructor
  40. }
  41.  
  42. method CADNAssocConn::load {this} {
  43.     if {[$this loaded] == 1} {
  44.         return
  45.     }
  46.     $this loaded 1
  47.  
  48.     set fromNode [$this getFrom $OMT_CAD_CB_Class]
  49.     if {$fromNode == ""} {
  50.         $this nAssocNode [$this getFrom $OMT_CAD_NAssoc]
  51.         $this class [$this getTo $OMT_CAD_CB_Class]
  52.     } else {
  53.         $this nAssocNode [$this getTo $OMT_CAD_NAssoc]
  54.         $this class $fromNode
  55.     }
  56.     [$this nAssocNode] load
  57. }
  58.  
  59. method CADNAssocConn::getRoleLabel {this} {
  60.     return [$this getLabel 0 $LT_ROLE]
  61. }
  62.  
  63. method CADNAssocConn::getRoleItem {this} {
  64.     return [$this getItem 0 $LT_ROLE $IT_DATA]
  65. }
  66.  
  67. method CADNAssocConn::getRoleWorkItem {this} {
  68.     return [$this getWorkItem 0 $LT_ROLE $IT_DATA]
  69. }
  70.  
  71. method CADNAssocConn::role {this} {
  72.     set roleItem [$this getRoleItem]
  73.     if {[$roleItem isNil]} {
  74.         return ""
  75.     }
  76.     return [$roleItem name]
  77. }
  78.  
  79. method CADNAssocConn::getPartnerNAssocConns {this} {
  80.     set nAssocConns [[[$this nAssocNode] nAssocConnSet] contents]
  81.     set idx [lsearch -exact $nAssocConns $this]
  82.     set nAssocConns [lreplace $nAssocConns $idx $idx]
  83.     return $nAssocConns
  84. }
  85.  
  86. # Do not delete this line -- regeneration end marker
  87.  
  88.