home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
cadeditor.tcl
< prev
next >
Wrap
Text File
|
1997-03-07
|
3KB
|
124 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1996
#
# File: @(#)cadeditor.tcl /main/hindenburg/8
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)cadeditor.tcl /main/hindenburg/8 7 Mar 1997 Copyright 1996 Cayenne Software Inc.
# Start user added include file section
require cadpanel.tcl
# End user added include file section
require "diagramedi.tcl"
Class CADEditor : {DiagramEditor} {
constructor
method destructor
method diagramType
method systemVersion
method configVersion
method checkLocalModel
}
constructor CADEditor {class this name} {
set this [DiagramEditor::constructor $class $this $name]
# Start constructor user section
# take care of the cad-specific entries
$this specificMenuHdlr [CustEdMenuHandler new cad]
[$this specificMenuHdlr] setCurrentContext
set foldButton "[$this menuBar].options.menu.initialfold"
if [isCommand $foldButton] {
$foldButton state [m4_var get M4_initial_fold]
}
[$this options] syntaxEntries {class data process}
$this title "Class Association Diagram Editor"
set cadPanel [CADPanel new $this.c.r.panel]
$this panel [$cadPanel symbPanel]
[$this panel] initialize cad
[$this panel] selected Select
$this panel $cadPanel
CADArea new $this.c.r.cad -panX 0 -panY 0 \
-currentSymbol Select \
-doubleClicked "$this open"
$this editorArea $this.c.r.cad
[$this editorArea] setSize 600 400
[$this editorArea] possibleOperationsChanged \
"$this enDisableMenuEntries"
$cadPanel area [$this editorArea]
$this createEdAreaPopUpMenu
$this setWindowGeometry cad
# End constructor user section
return $this
}
method CADEditor::destructor {this} {
# Start destructor user section
$this saveFileHistory cad
$this saveWindowGeometry cad
[$this specificMenuHdlr] delete
# End destructor user section
$this DiagramEditor::destructor
}
method CADEditor::diagramType {this} {
return cad
}
method CADEditor::systemVersion {this {sv -}} {
if {$sv == "-"} {
return [$this DiagramEditor::systemVersion]
}
$this DiagramEditor::systemVersion $sv
[$this editorArea] systemVersion $sv
}
method CADEditor::configVersion {this {cv -}} {
if {$cv == "-"} {
return [$this DiagramEditor::configVersion]
}
$this DiagramEditor::configVersion $cv
[$this editorArea] configVersion $cv
}
method CADEditor::checkLocalModel {this} {
set area [$this editorArea]
# Get selected components. Throw away "hidden" components.
set args ""
global hiddenCompTypes
foreach comp [$area getSelectedComponents] {
if {![info exists hiddenCompTypes([$comp type])]} {
if {[$comp type] != "cad_class" &&
[$comp type] != "cad_container"} {
$this DiagramEditor::checkLocalModel
$area releaseSelectedComponents
return
}
set nameItem [$comp nameItem]
if {$nameItem != ""} {
append args "-S [$nameItem name].cdm "
}
}
}
if {$args == ""} {
set file [[$this fileVersion] file]
append args "-S [$file name].[$file type] "
}
append args "-f check.tcl"
set script "[quoteIf [m4_path_name bin otsh$EXE_EXT]] $args"
$this startCommand mtool $script "" "Starting 'Check'" {0 0} 0
$area releaseSelectedComponents
}
# Do not delete this line -- regeneration end marker