home *** CD-ROM | disk | FTP | other *** search
/ PC World 1997 November / PCWorld_1997-11_cd.bin / software / programy / komix / DATA.Z / proploceda.tcl < prev    next >
Text File  |  1996-08-29  |  5KB  |  172 lines

  1. #---------------------------------------------------------------------------
  2. #
  3. #      (c)     Cadre Technologies Inc.    1996
  4. #
  5. #      File:           @(#)proploceda.tcl    /main/hindenburg/1
  6. #      Author:         <generated>
  7. #      Description:
  8. #---------------------------------------------------------------------------
  9. # SccsId = @(#)proploceda.tcl    /main/hindenburg/1   29 Aug 1996 Copyright 1996 Cadre Technologies Inc.
  10.  
  11. # Start user added include file section
  12. require "proplocobj.tcl"
  13. require "proplocdia.tcl"
  14. # End user added include file section
  15.  
  16. require "custdefsar.tcl"
  17.  
  18. Class PropLocEdArea : {CustDefsArea} {
  19.     constructor
  20.     method destructor
  21.     method read
  22.     method newObject
  23.     method createObject
  24.     method clearArea
  25.     method getLongName
  26.     method setLongName
  27.     method removeLongName
  28.     method getCntTypeSet
  29.     method setCntTypeSet
  30.     method removeCntTypeSet
  31.     attribute propLocDefiner
  32.     attribute longName
  33.     attribute cntTypeSet
  34. }
  35.  
  36. constructor PropLocEdArea {class this name} {
  37.     set this [CustDefsArea::constructor $class $this $name]
  38.     $this longName [Dictionary new]
  39.     $this cntTypeSet [Dictionary new]
  40.     # Start constructor user section
  41.     $this rowCount 12
  42.     $this columnCount 75
  43.     $this font "[m4_var get M4_font -context uce]"
  44.     $this destinationSet "PROPLOC dropEvent"
  45.     $this mode DETAIL
  46.     BrowsHeader new $this.short -label Name -width 17
  47.     BrowsHeader new $this.long -label {Long Name} -width 25
  48.     BrowsHeader new $this.cnt -label {Container Kind} -width 21
  49.     BrowsHeader new $this.cntType -label {Container Type} -width 15
  50.     BrowsHeader new $this.level -label Level -width 15
  51.     BrowsHeader new $this.phase -label {Phase Type} -width 15
  52.     BrowsHeader new $this.file -label {Diagram Type} -width  13
  53.     BrowsHeader new $this.comp -label {Component Type} -width 15
  54.     BrowsHeader new $this.label -label {Label Type} -width 11
  55.     BrowsHeader new $this.cond -label Condition -width 10
  56.     # End constructor user section
  57.     return $this
  58. }
  59.  
  60. method PropLocEdArea::destructor {this} {
  61.     # Start destructor user section
  62.     # End destructor user section
  63.     $this CustDefsArea::destructor
  64. }
  65.  
  66. method PropLocEdArea::read {this object type} {
  67.  
  68.     set locFileName [$this _curName]
  69.     set locFileType [$this _curType]
  70.     set nameLast [expr [string last locs $locFileName] - 1]
  71.     set typeLast [expr [string last locs $locFileType] - 1]
  72.     set defFileName [string range $locFileName 0 $nameLast]defs
  73.     set defFileType [string range $locFileType 0 $typeLast]defs
  74.  
  75.     foreach defLine [$this readConfig $object $defFileName $defFileType] {
  76.         $this setLongName "[lindex $defLine 0]" "[lindex $defLine 1]"
  77.     }
  78.  
  79.     foreach locLine [$this readConfig $object $locFileName $locFileType] {
  80.         set longName [$this getLongName [lindex $locLine 0]]
  81.         if {$longName == ""} {
  82.             set longName "[lindex $locLine 0]"
  83.         }
  84.         set types [$this getCntTypeSet [lindex $locLine 1]]
  85.         if {$types == ""} {
  86.             set types [lindex $locLine 2]
  87.         } else {
  88.             lappend_unique types [lindex $locLine 2]
  89.         }
  90.         $this setCntTypeSet [lindex $locLine 1] [lsort $types]
  91.         $this createObject "shortName      \"[lindex $locLine 0]\"
  92.                             longName      \"$longName\"
  93.                     cnt            \"[lindex $locLine 1]\"
  94.                     cntType      \"[lindex $locLine 2]\"
  95.                     phase      \"[lindex $locLine 3]\"
  96.                     fileType      \"[lindex $locLine 4]\"
  97.                     componentType \"[lindex $locLine 5]\"
  98.                     labelType      \"[lindex $locLine 6]\"
  99.                     condition      \"[lindex $locLine 7]\"" \
  100.                     $type
  101.     }
  102. }
  103.  
  104. method PropLocEdArea::newObject {this name {edit 0}} {
  105.  
  106.     $this isChanged 1
  107.  
  108.     set longName [$this getLongName $name]
  109.  
  110.     set obj [$this createObject "shortName    \"$name\"
  111.                 longName    \"$longName\"
  112.                 specLevel    \"[$this _level]\"" \
  113.                 [$this _level]]
  114.  
  115.     $this sortArea
  116.  
  117.     if $edit {
  118.         $obj open
  119.     }
  120. }
  121.  
  122. method PropLocEdArea::createObject {this objSpec level} {
  123.  
  124.     global classCount
  125.     set newIndex [llength [$this objectSet]]
  126.     set object [PropLocObject new $this.Object$classCount $objSpec]
  127.     $object index $newIndex
  128.     incr classCount
  129.  
  130.     $this adjustCreatedObject $object $level
  131.  
  132.     # update the object-details in the view
  133.     $object updateView
  134.  
  135.     return $object
  136. }
  137.  
  138. method PropLocEdArea::clearArea {this} {
  139.  
  140.     $this CustDefsArea::clearArea
  141.     foreach longName [[$this longName] names] {
  142.         $this removeLongName $longName
  143.     }
  144. }
  145.  
  146. # Do not delete this line -- regeneration end marker
  147.  
  148. method PropLocEdArea::getLongName {this shortName} {
  149.     return [[$this longName] set $shortName]
  150. }
  151.  
  152. method PropLocEdArea::setLongName {this shortName newLongName} {
  153.     [$this longName] set $shortName $newLongName
  154. }
  155.  
  156. method PropLocEdArea::removeLongName {this shortName} {
  157.     [$this longName] unset $shortName
  158. }
  159.  
  160. method PropLocEdArea::getCntTypeSet {this cntKind} {
  161.     return [[$this cntTypeSet] set $cntKind]
  162. }
  163.  
  164. method PropLocEdArea::setCntTypeSet {this cntKind newCntTypeSet} {
  165.     [$this cntTypeSet] set $cntKind $newCntTypeSet
  166. }
  167.  
  168. method PropLocEdArea::removeCntTypeSet {this cntKind} {
  169.     [$this cntTypeSet] unset $cntKind
  170. }
  171.  
  172.