home *** CD-ROM | disk | FTP | other *** search
/ PC World 1997 November / PCWorld_1997-11_cd.bin / software / programy / komix / DATA.Z / diagramsec.tcl < prev    next >
Text File  |  1996-07-16  |  3KB  |  106 lines

  1. #---------------------------------------------------------------------------
  2. #
  3. #      (c)     Westmount Technology    1994
  4. #
  5. #      File:           @(#)diagramsec.tcl    /main/hindenburg/1
  6. #      Author:         <generated>
  7. #      Description:
  8. #---------------------------------------------------------------------------
  9. # SccsId = @(#)diagramsec.tcl    /main/hindenburg/1   16 Jul 1996 Copyright 1994 Westmount Technology
  10.  
  11. # Start user added include file section
  12. # End user added include file section
  13.  
  14. require "filerefsec.tcl"
  15.  
  16. Class DiagramSection : {FileRefSection} {
  17.     constructor
  18.     method destructor
  19.     method promoter
  20.     method print
  21.     method preview
  22.     method updateDocDir
  23.     method docType
  24. }
  25.  
  26. constructor DiagramSection {class this name document} {
  27.     set this [FileRefSection::constructor $class $this $name $document]
  28.     # Start constructor user section
  29.     # End constructor user section
  30.     return $this
  31. }
  32.  
  33. method DiagramSection::destructor {this} {
  34.     # Start destructor user section
  35.     # End destructor user section
  36.     $this FileRefSection::destructor
  37. }
  38.  
  39. method DiagramSection::promoter {this document} {
  40.     $this FileRefSection::promoter $document
  41.  
  42.     $this operationClass import
  43. }
  44.  
  45. method DiagramSection::print {this} {
  46.  
  47.     # print the converted one
  48.     set cmd [list \
  49.         "[m4_var get M4_ps_printer] [$this docLocation]" \
  50.         [$this uiName] \
  51.     ]
  52.     $this execute "$cmd"
  53. }
  54.  
  55. method DiagramSection::preview {this} {
  56.  
  57.     # preview the converted one
  58.     set cmd [list \
  59.         "previewer [$this docType]Section" \
  60.         [$this docLocation] \
  61.         [$this uiName] \
  62.     ]
  63.     $this execute "$cmd" m4
  64. }
  65.  
  66. method DiagramSection::updateDocDir {this} {
  67.  
  68.     set fileV [$this referredFileVersion]
  69.     if [$fileV isNil] {
  70.         return 1
  71.     }
  72.  
  73.     # start Print::exportDiagram for this section and put the output
  74.     # file in docLocation (in [$this docType] format)
  75.     set fid [open [$this docLocation] w]
  76.     close $fid
  77.     set confV [[ClientContext::global] currentConfig]
  78.     set sysV [[$this referredSystem] selectedVersion $confV]
  79.  
  80.     require "print.tcl"
  81.     if [catch {Print::exportDiagram \
  82.             -file [$this docLocation] \
  83.             -type [string toupper [$this docType]] \
  84.             -configVersion $confV \
  85.             -systemVersion $sysV \
  86.             -orientation portrait \
  87.             -autoScale 1 \
  88.             -pageWidth 6.0625\
  89.             -pageHeight 7.0625\
  90.             $fileV} reason] {
  91.         wmtkerror "Export diagram failed: $reason"
  92.         return 0
  93.     }
  94.  
  95.     return 1
  96. }
  97.  
  98. method DiagramSection::docType {this} {
  99.  
  100.     # the type of this section in the document directory is Epsi
  101.     return Epsi
  102. }
  103.  
  104. # Do not delete this line -- regeneration end marker
  105.  
  106.