home *** CD-ROM | disk | FTP | other *** search
/ PC World 1998 October / PCWorld_1998-10_cd.bin / software / prehled / komix / DATA.Z / locdialog.tcl < prev    next >
Text File  |  1997-08-01  |  5KB  |  158 lines

  1. #---------------------------------------------------------------------------
  2. #
  3. #      (c)     Cayenne Software Inc.    1997
  4. #
  5. #      File:           @(#)locdialog.tcl    /main/titanic/6
  6. #      Author:         <generated>
  7. #      Description:
  8. #---------------------------------------------------------------------------
  9. # SccsId = @(#)locdialog.tcl    /main/titanic/6   1 Aug 1997 Copyright 1997 Cayenne Software Inc.
  10.  
  11. # Start user added include file section
  12. # End user added include file section
  13.  
  14. require "definedial.tcl"
  15.  
  16. Class LocDialog : {DefineDialog} {
  17.     constructor
  18.     method destructor
  19.     method init
  20.     method initCompTypes
  21.     method load
  22.     method save
  23.     method clearInterface
  24.     method fromInterface
  25.     method toInterface
  26.     attribute lPage
  27.     attribute comps
  28.     attribute cadcomps
  29.     attribute codcomps
  30.     attribute ccdcomps
  31.     attribute dfdcomps
  32.     attribute etdcomps
  33.     attribute mgdcomps
  34.     attribute stdcomps
  35.     attribute ucdcomps
  36.     attribute phaseDDL
  37.     attribute fileDDL
  38.     attribute compDDL
  39.     attribute labelDDL
  40.     attribute condDDL
  41. }
  42.  
  43. constructor LocDialog {class this name} {
  44.     set this [DefineDialog::constructor $class $this $name]
  45.     # Start constructor user section
  46.     # End constructor user section
  47.     return $this
  48. }
  49.  
  50. method LocDialog::destructor {this} {
  51.     # Start destructor user section
  52.     # End destructor user section
  53.     $this DefineDialog::destructor
  54. }
  55.  
  56. method LocDialog::init {this} {
  57.  
  58.     set cadcomps {cad_class cad_container attribute method parameter
  59.               link_attrib nary_assoc generalization overlap_gen
  60.               association qualif_assoc nary_assoc_conn
  61.               aggregation qualif_aggr propagation}
  62.     set ccdcomps {ccd_class ccd_class_ref ccd_container
  63.               subject ccd_actor com_message}
  64.     set codcomps {cod_actor instance inst_attrib nary_link link aggr_link
  65.               qualif_link qualif_aggr_link nary_link_conn cod_message}
  66.     set dfdcomps {data_store data_proc dfd_actor
  67.               data_flow ctrl_flow update_flow}
  68.     set etdcomps {etd_object etd_initiator etd_event}
  69.     set mgdcomps {message_def}
  70.     set stdcomps {state_action activity state start_state final_state
  71.               super_state std_class transition event_msg}
  72.     set ucdcomps {use_case ucd_actor und_com_assoc dir_com_assoc}
  73.  
  74.     $this cadcomps "{} $cadcomps"
  75.     $this ccdcomps "{} $ccdcomps"
  76.     $this codcomps "{} $codcomps"
  77.     $this dfdcomps "{} $dfdcomps"
  78.     $this etdcomps "{} $etdcomps"
  79.     $this mgdcomps "{} $mgdcomps"
  80.     $this stdcomps "{} $stdcomps"
  81.     $this ucdcomps "{} $ucdcomps"
  82.     $this comps "{} $cadcomps $ccdcomps $codcomps $dfdcomps $etdcomps"
  83.     $this comps "[$this comps] $mgdcomps $stdcomps $ucdcomps"
  84.  
  85.     # read phases file
  86.     getPhases
  87.     set phaseList {{}}
  88.     foreach phase ${BrowserProcs::phases} {
  89.         set phaseType [lindex $phase 1]
  90.         lappend_unique phaseList "$phaseType"
  91.     }
  92.  
  93.     [$this phaseDDL] entrySet $phaseList
  94.     [$this fileDDL] entrySet "{} [lsort [BrowserProcs::graphTypes]]"
  95.     [$this fileDDL] selectionChanged "$this initCompTypes"
  96.     [$this labelDDL] entrySet \
  97.         {{} name qualifier role role_start role_end action event}
  98.     [$this condDDL] entrySet {{} KEY NO_KEY INITIATOR}
  99. }
  100.  
  101. method LocDialog::initCompTypes {this} {
  102.  
  103.     set comps [$this [[$this fileDDL] selected]comps]
  104.     [$this compDDL] entrySet $comps
  105.     [$this compDDL] selected [lindex $comps 0]
  106. }
  107.  
  108. method LocDialog::load {this object} {
  109.  
  110.     $this clearInterface
  111.     $this curObject $object
  112.     $this objName [$object name]
  113.     $this toInterface
  114.     $this popUp
  115. }
  116.  
  117. method LocDialog::save {this popDown} {
  118.  
  119.     $this fromInterface
  120.     [$this curObject] name [$this objName]
  121.     [$this curObject] updateView
  122.     [.main editorArea] isChanged 1
  123.     if {$popDown == 1} {
  124.         $this popDown
  125.     }
  126.     return 1
  127. }
  128.  
  129. method LocDialog::clearInterface {this} {
  130.  
  131.     [$this phaseDDL] selected [lindex [[$this phaseDDL] entrySet] 0]
  132.     [$this fileDDL] selected [lindex [[$this fileDDL] entrySet] 0]
  133.     [$this labelDDL] selected [lindex [[$this labelDDL] entrySet] 0]
  134.     [$this condDDL] selected [lindex [[$this condDDL] entrySet] 0]
  135. }
  136.  
  137. method LocDialog::fromInterface {this} {
  138.  
  139.     [$this curObject] phase [[$this phaseDDL] selected]
  140.     [$this curObject] fileType [[$this fileDDL] selected]
  141.     [$this curObject] componentType [[$this compDDL] selected]
  142.     [$this curObject] labelType [[$this labelDDL] selected]
  143.     [$this curObject] condition [[$this condDDL] selected]
  144.     return ""
  145. }
  146.  
  147. method LocDialog::toInterface {this} {
  148.  
  149.     [$this phaseDDL] selected [[$this curObject] phase]
  150.     [$this fileDDL] selected [[$this curObject] fileType]
  151.     [$this compDDL] selected [[$this curObject] componentType]
  152.     [$this labelDDL] selected [[$this curObject] labelType]
  153.     [$this condDDL] selected [[$this curObject] condition]
  154. }
  155.  
  156. # Do not delete this line -- regeneration end marker
  157.  
  158.