better author extraction.
"
COPYRIGHT (c) 1997 by eXept Software AG
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
"
ApplicationModel subclass:#ToolApplicationModel
instanceVariableNames:'timeBlock'
classVariableNames:''
poolDictionaries:''
category:'Interface-Advanced-Tools'
!
ToolApplicationModel class instanceVariableNames:'history clipboard showHelp'
"
The following class instance variables are inherited by this class:
ApplicationModel - ClassResources
Model -
Object -
"
!
!ToolApplicationModel class methodsFor:'documentation'!
copyright
"
COPYRIGHT (c) 1997 by eXept Software AG
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
"
!
documentation
"
Standard framework for tools; provides hooks for history management,
showing help texts, about menu, help menu etc.
See concrete subclasses for examples.
[author:]
Thomas Zwick
"
!
history
"Created: / 10.1.1998 / 11:01:21 / tz"
"Modified: #menuAbout / 30.1.1998 / 00:03:11 / cg"
"Modified: #menuHelp / 30.1.1998 / 00:03:59 / cg"
"Modified: #menuSettings / 30.1.1998 / 00:04:14 / cg"
"Modified: #author / 1.2.1998 / 15:30:00 / cg"
"Modified: #author / 1.2.1998 / 15:35:48 / cg"
"Modified: #author / 1.2.1998 / 15:36:07 / cg"
"Modified: #openAboutThisApplication / 1.2.1998 / 15:38:38 / cg"
"Modified: #openAboutThisApplication / 1.2.1998 / 15:40:11 / cg"
"Created: #authorLinesForAboutBox / 1.2.1998 / 15:41:43 / cg"
"Modified: #openAboutThisApplication / 1.2.1998 / 15:42:11 / cg"
"Modified: #authorLinesForAboutBox / 1.2.1998 / 15:42:48 / cg"
"Modified: #authorLinesForAboutBox / 1.2.1998 / 15:44:36 / cg"
"Modified: #authorLinesForAboutBox / 1.2.1998 / 15:56:17 / cg"
"Deleted: #author / 1.2.1998 / 15:57:08 / cg"
"Modified: #authorLinesForAboutBox / 1.2.1998 / 15:57:27 / cg"
"Modified: #openAboutThisApplication / 1.2.1998 / 15:58:05 / cg"
"Modified: #authorLinesForAboutBox / 1.2.1998 / 15:59:11 / cg"
"Modified: #openAboutThisApplication / 1.2.1998 / 15:59:59 / cg"
! !
!ToolApplicationModel class methodsFor:'accessing'!
authorLinesForAboutBox
"extract the author(s) from the documentation method."
|firstClassWithDocumentation src s line lines|
firstClassWithDocumentation := self class withAllSuperclasses detect:[:metacls| metacls implements:#documentation].
firstClassWithDocumentation notNil ifTrue:[
(firstClassWithDocumentation inheritsFrom:ToolApplicationModel class) ifTrue:[
src := (firstClassWithDocumentation compiledMethodAt:#documentation) source.
src notNil ifTrue:[
s := src readStream.
s upToAll:'[author:]'.
s nextLine. "/ skip to end
line := s nextLine. "/ line after [author:]
lines := OrderedCollection new.
[line notNil and:[line notEmpty]] whileTrue:[
line := line trimBlanks.
line size > 1 ifTrue:[
lines add:line trimBlanks.
line := s nextLine.
] ifFalse:[
line := nil
]
].
^ lines.
]
]
].
^ #('unnown')
"Created: / 1.2.1998 / 15:41:43 / cg"
"Modified: / 1.2.1998 / 15:59:10 / cg"
!
label
|label|
label := ''.
self name do:
[:c|
c isUppercase ifTrue: [label := label, $ ].
label := label, c
].
^label trimBlanks
!
showHelp
^showHelp ? (showHelp := true)
!
showHelp: aBoolean
^showHelp := aBoolean
! !
!ToolApplicationModel class methodsFor:'clipboard'!
clipboard
^clipboard
!
clipboard: anEditObject
clipboard := anEditObject
! !
!ToolApplicationModel class methodsFor:'help specs'!
helpSpec
"return a dictionary filled with helpKey -> helptext associations.
These are used by the activeHelp tool."
"
UIHelpTool openOnClass:ToolApplicationModel
"
^ super helpSpec addPairsFrom:#(
#aboutSTX
'Opens an InfoBox about running ST/X.'
#aboutThisAppliaction
'Opens an InfoBox about release and author of current application.'
#fileExit
'Exits current application.'
#editCut
'Cuts selected item and place it to the clipboard.'
#editCopy
'Copies selected item to the clipboard.'
#editPaste
'Pastes contents of the clipboard.'
#editUndo
'Reverses the last action.'
#helpClassDocumentation
'Opens a HTML-browser with a class documentation for current application.'
#helpProgrammersGuide
'Opens a HTML-browser with a programmers guide.'
#helpShowHelp
'Toggles on/off displaying help texts.'
#helpTutorial
'Opens a HTML-browser with a tutorial for beginners.'
)
! !
!ToolApplicationModel class methodsFor:'history'!
getHistory
history isNil ifTrue: [history := OrderedCollection new].
^history
!
historyMaxSize
^10
! !
!ToolApplicationModel class methodsFor:'interface specs'!
windowSpecForCommit
"this window spec was automatically generated by the ST/X UIPainter"
"do not manually edit this - the painter/builder may not be able to
handle the specification if its corrupted."
"
UIPainter new openOnClass:ToolApplicationModel andSelector:#windowSpecForCommit
ToolApplicationModel new openInterface:#windowSpecForCommit
"
<resource: #canvas>
^
#(#FullSpec
#'window:'
#(#WindowSpec
#'name:' 'unnamed canvas'
#'layout:' #(#LayoutFrame 325 0 361 0 624 0 420 0)
#'label:' 'unnamed canvas'
#'min:' #(#Point 100 22)
#'max:' #(#Point 1152 900)
#'bounds:' #(#Rectangle 325 361 625 421)
#'usePreferredExtent:' false
)
#'component:'
#(#SpecCollection
#'collection:'
#(
#(#ActionButtonSpec
#'name:' 'cancelButton'
#'layout:' #(#LayoutFrame 5 0 0 0 -2 0.5 0 1)
#'label:' 'Cancel'
#'tabable:' true
#'model:' #cancel
#'enableChannel:' #valueOfEnablingCommitButtons
)
#(#ActionButtonSpec
#'name:' 'okButton'
#'layout:' #(#LayoutFrame 2 0.5 0 0.0 -5 1 0 1.0)
#'label:' 'OK'
#'tabable:' true
#'model:' #accept
#'enableChannel:' #valueOfEnablingCommitButtons
)
)
)
)
!
windowSpecForCommitWithoutChannels
"this window spec was automatically generated by the ST/X UIPainter"
"do not manually edit this - the painter/builder may not be able to
handle the specification if its corrupted."
"
UIPainter new openOnClass:ToolApplicationModel andSelector:#windowSpecForCommitWithoutChannels
ToolApplicationModel new openInterface:#windowSpecForCommitWithoutChannels
"
<resource: #canvas>
^
#(#FullSpec
#'window:'
#(#WindowSpec
#'name:' 'unnamed canvas'
#'layout:' #(#LayoutFrame 418 0 386 0 717 0 445 0)
#'label:' 'unnamed canvas'
#'min:' #(#Point 100 22)
#'max:' #(#Point 1152 900)
#'bounds:' #(#Rectangle 418 386 718 446)
#'usePreferredExtent:' false
)
#'component:'
#(#SpecCollection
#'collection:'
#(
#(#ActionButtonSpec
#'name:' 'cancelButton'
#'layout:' #(#LayoutFrame 5 0 0 0 -2 0.5 0 1)
#'label:' 'Cancel'
#'tabable:' true
#'model:' #cancel
)
#(#ActionButtonSpec
#'name:' 'okButton'
#'layout:' #(#LayoutFrame 2 0.5 0 0.0 -5 1 0 1.0)
#'label:' 'OK'
#'tabable:' true
#'model:' #accept
)
)
)
)
!
windowSpecForInfoBar
"this window spec was automatically generated by the ST/X UIPainter"
"do not manually edit this - the painter/builder may not be able to
handle the specification if its corrupted."
"
UIPainter new openOnClass:ToolApplicationModel andSelector:#windowSpecForInfoBar
ToolApplicationModel new openInterface:#windowSpecForInfoBar
"
<resource: #canvas>
^
#(#FullSpec
#'window:'
#(#WindowSpec
#'name:' 'Image Editor'
#'layout:' #(#LayoutFrame 260 0 429 0 759 0 774 0)
#'label:' 'Image Editor'
#'min:' #(#Point 400 320)
#'max:' #(#Point 1152 900)
#'bounds:' #(#Rectangle 260 429 760 775)
#'menu:' #menu
#'usePreferredExtent:' false
)
#'component:'
#(#SpecCollection
#'collection:'
#(
#(#LabelSpec
#'name:' 'infoLabel'
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
#'labelChannel:' #valueOfInfoLabel
#'level:' 1
#'adjust:' #left
)
)
)
)
!
windowSpecForInfoBarWithClock
"this window spec was automatically generated by the ST/X UIPainter"
"do not manually edit this - the painter/builder may not be able to
handle the specification if its corrupted."
"
UIPainter new openOnClass:ToolApplicationModel andSelector:#windowSpecForInfoBar
ToolApplicationModel new openInterface:#windowSpecForInfoBar
"
<resource: #canvas>
^
#(#FullSpec
#'window:'
#(#WindowSpec
#'name:' 'Image Editor'
#'layout:' #(#LayoutFrame 173 0 418 0 672 0 763 0)
#'label:' 'Image Editor'
#'min:' #(#Point 400 320)
#'max:' #(#Point 1152 900)
#'bounds:' #(#Rectangle 173 418 673 764)
#'menu:' #menu
#'usePreferredExtent:' false
)
#'component:'
#(#SpecCollection
#'collection:'
#(
#(#LabelSpec
#'name:' 'infoLabel'
#'layout:' #(#LayoutFrame 0 0 0 0.0 -80 1 0 1.0)
#'labelChannel:' #valueOfInfoLabel
#'level:' 1
#'adjust:' #left
)
#(#LabelSpec
#'name:' 'timeLabel'
#'layout:' #(#LayoutFrame -80 1 0 0.0 0 1.0 0 1.0)
#'labelChannel:' #valueOfTimeLabel
#'level:' 1
#'adjust:' #right
)
)
)
)
! !
!ToolApplicationModel class methodsFor:'menu specs'!
menuAbout
"this window spec was automatically generated by the ST/X MenuEditor"
"do not manually edit this - the builder may not be able to
handle the specification if its corrupted."
"
MenuEditor new openOnClass:ToolApplicationModel andSelector:#menuAbout
(Menu new fromLiteralArrayEncoding:(ToolApplicationModel menuAbout)) startUp
"
<resource: #menu>
^
#(#Menu
#(
#(#MenuItem
#'label:' 'About Smalltalk/X...'
#'translateLabel:' true
#'value:' #openAbout
#'activeHelpKey:' #aboutSTX
)
#(#MenuItem
#'label:' '-'
)
#(#MenuItem
#'label:' 'About This Application...'
#'translateLabel:' true
#'value:' #openAboutThisApplication
#'activeHelpKey:' #aboutThisAppliaction
)
) nil
nil
)
"Modified: / 30.1.1998 / 00:03:11 / cg"
!
menuHelp
"this window spec was automatically generated by the ST/X MenuEditor"
"do not manually edit this - the builder may not be able to
handle the specification if its corrupted."
"
MenuEditor new openOnClass:ToolApplicationModel andSelector:#menuHelp
(Menu new fromLiteralArrayEncoding:(ToolApplicationModel menuHelp)) startUp
"
<resource: #menu>
^
#(#Menu
#(
#(#MenuItem
#'label:' 'Tutorial'
#'translateLabel:' true
#'value:' #openTutorial
#'activeHelpKey:' #helpTutorial
)
#(#MenuItem
#'label:' 'Programmer''s Guide'
#'translateLabel:' true
#'value:' #openProgrammersGuide
#'activeHelpKey:' #helpProgrammersGuide
)
#(#MenuItem
#'label:' '-'
)
#(#MenuItem
#'label:' 'Class Documentation'
#'translateLabel:' true
#'value:' #openClassDocumentation
#'activeHelpKey:' #helpClassDocumentation
)
#(#MenuItem
#'label:' '-'
)
#(#MenuItem
#'label:' 'Show Help'
#'translateLabel:' true
#'value:' #'showHelp:'
#'activeHelpKey:' #helpShowHelp
#'indication:' #showHelp
)
) nil
nil
)
"Modified: / 30.1.1998 / 00:03:59 / cg"
!
menuSettings
"this window spec was automatically generated by the ST/X MenuEditor"
"do not manually edit this - the builder may not be able to
handle the specification if its corrupted."
"
MenuEditor new openOnClass:ToolApplicationModel andSelector:#menuSettings
(Menu new fromLiteralArrayEncoding:(ToolApplicationModel menuSettings)) startUp
"
<resource: #menu>
^
#(#Menu
#(
#(#MenuItem
#'label:' 'Language...'
#'translateLabel:' true
#'value:' #languageSetting
)
) nil
nil
)
"Modified: / 30.1.1998 / 00:04:14 / cg"
! !
!ToolApplicationModel class methodsFor:'resources'!
downIcon
"Generated by the Image Editor"
"
ImageEditor openOnClass:self andSelector:#downIcon
"
<resource: #image>
^Icon
constantNamed:#'ToolApplicationModel downIcon'
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUT@AUUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUT@*$AUPUT***%UPUU***UUPUUZ*)UUPUUV*%UUPUUU*UUUPUUUYUUUP'); colorMap:((OrderedCollection new add:(Color white); add:(Color black); add:(Color red:0.0 green:49.9962 blue:0.0); add:(Color red:100.0 green:0.0 blue:0.0); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@A?>@A?>@@?<@@_8@@O0@@G @@C@@'); yourself); yourself]!
downLeftIcon
"Generated by the Image Editor"
"
ImageEditor openOnClass:self andSelector:#downLeftIcon
"
<resource: #image>
^Icon
constantNamed:#'ToolApplicationModel downLeftIcon'
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUUUUUPUUUUU@@PUUUUUJ)PUUUUUJ)PUUUUUJ)PUUUUUJ)PUUUUUJ)PUUUUUJ)PUUUUUJ)PUUUUUJ)PUUAUUJ)PUT%UUJ)PUR%UUJ)PUJ$@@J)PT*****)PR*****)PV*****)PU*****)PUZ%UUUUPUV%UUUUPUU%UUUUPUUUUUUUP'); colorMap:((OrderedCollection new add:(Color white); add:(Color black); add:(Color red:0.0 green:49.9962 blue:0.0); add:(Color red:100.0 green:0.0 blue:0.0); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@G8@@G8@@G8@@G8@@G8@@G8@@G8@@G8@@G8@0G8A0G8C0G8G??8O??8_??8_??8O??8G??8C0@@A0@@@0@@'); yourself); yourself]!
downRightIcon
"Generated by the Image Editor"
"
ImageEditor openOnClass:self andSelector:#downRightIcon
"
<resource: #image>
^Icon
constantNamed:#'ToolApplicationModel downRightIcon'
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUUUUUPP@EUUUUPR*UUUUUPR*UUUUUPR*UUUUUPR*UUUUUPR*UUUUUPR*UUUUUPR*UUUUUPR*UUUUUPR*UUTEUPR*UUT!!UPR*UUT(UPR*P@@*EPR*****!!PR*****(PR*****)PR*****%PQUUUU*UPUUUUT)UPUUUUT%UPUUUUTUUP'); colorMap:((OrderedCollection new add:(Color white); add:(Color black); add:(Color red:0.0 green:49.9962 blue:0.0); add:(Color red:100.0 green:0.0 blue:0.0); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@_ @@_ @@_ @@_ @@_ @@_ @@_ @@_ @@_ @@_ L@_ N@_ O@_?? _??0_??8_??8_??0_?? @@O@@@N@@@L@'); yourself); yourself]!
fileOutIcon
"Generated by the Image Editor"
"
ImageEditor openOnClass:self andSelector:#fileOutIcon
"
<resource: #image>
^Icon
constantNamed:#'ToolApplicationModel fileOutIcon'
ifAbsentPut:[(Depth2Image new) width: 24; height: 24; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@B@@@@@@@B @@@@@@*(@@@@@BB @@@@@BB@@@@@@B@@@@@@@B@@@@@@@B@@@@@@@B@@@@@@@B@@@@@@@@@@@@@@@@@@@@@@@@@@@@D@@AQDEADQAAADDADQA@AD@ADQAAQDEADQAAADDADQAAA@@@PAAAAEE@@DA'); colorMap:((OrderedCollection new add:(Color black); add:(Color white); add:(Color red:0.0 green:49.9962 blue:0.0); add:(Color red:100.0 green:0.0 blue:0.0); yourself)); mask:((Depth1Image new) width: 24; height: 24; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@A@A.A%BDG2ADI%@$I@SDH@@@H@@@H@@@H@@@H@@@@@@@@@@@Z&KW_7_;[6_;[6_;_7_;[6_;[6L+I[@Q'); yourself); yourself]!
icon
^self stxIcon
!
leftDownIcon
"Generated by the Image Editor"
"
ImageEditor openOnClass:self andSelector:#leftDownIcon
"
<resource: #image>
^Icon
constantNamed:#'ToolApplicationModel leftDownIcon'
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUUUUUPU@@@@@@PUJ****)PUJ****)PUJ****)PUJ****)PUJ)UUUUPUJ)UUUUPUJ)UUUUPUJ)UUUUPUJ)UUUUPUJ)UUUUPUJ)UUUUPUJ)UUUUP@J*@UUUPJ**)UUUPR**%UUUPT**UUUUPUJ)UUUUPUR%UUUUPUTUUUUUPUUUUUUUP'); colorMap:((OrderedCollection new add:(Color white); add:(Color black); add:(Color red:0.0 green:49.9962 blue:0.0); add:(Color red:100.0 green:0.0 blue:0.0); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@G??8G??8G??8G??8G??8G??8G8@@G8@@G8@@G8@@G8@@G8@@G8@@??@@??@@_>@@O<@@G8@@C0@@A @@@@@@'); yourself); yourself]!
leftIcon
"Generated by the Image Editor"
"
ImageEditor openOnClass:self andSelector:#leftIcon
"
<resource: #image>
^Icon
constantNamed:#'ToolApplicationModel leftIcon'
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUUUUUPUUUUUUUPUUUUUUUPUUUUUUUPUUUUUUUPUTUUUUUPURUUUUUPUJUUUUUPT*P@@@@PR******PJ******PZ******PV******PU*UUUUUPUZUUUUUPUVUUUUUPUUUUUUUPUUUUUUUPUUUUUUUPUUUUUUUPUUUUUUUPUUUUUUUP'); colorMap:((OrderedCollection new add:(Color white); add:(Color black); add:(Color red:0.0 green:49.9962 blue:0.0); add:(Color red:100.0 green:0.0 blue:0.0); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@A @@C @@G @@O??<_??<???<???<_??<O??<G @@C @@A @@@@@@@@@@@@@@@@@@@@@@'); yourself); yourself]!
leftUpIcon
"Generated by the Image Editor"
"
ImageEditor openOnClass:self andSelector:#leftUpIcon
"
<resource: #image>
^Icon
constantNamed:#'ToolApplicationModel leftUpIcon'
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUUUUUPUTUUUUUPUR%UUUUPUJ)UUUUPT**UUUUPR**%UUUPJ**)UUUP%Z)UUUUPUJ)UUUUPUJ)UUUUPUJ)UUUUPUJ)UUUUPUJ)UUUUPUJ)UUUUPUJ)UUUUPUJ)@@@@PUJ****)PUJ****)PUJ****)PUJ****)PUEUUUUUPUUUUUUUP'); colorMap:((OrderedCollection new add:(Color white); add:(Color black); add:(Color red:0.0 green:49.9962 blue:0.0); add:(Color red:100.0 green:0.0 blue:0.0); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@A @@C0@@G8@@O<@@_>@@??@@??@@G8@@G8@@G8@@G8@@G8@@G8@@G8@@G??8G??8G??8G??8G??8G??8@@@@'); yourself); yourself]!
loadIcon
"Generated by the Image Editor"
"
ImageEditor openOnClass:self andSelector:#loadIcon
"
<resource: #image>
^Icon
constantNamed:#'ToolApplicationModel loadIcon'
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUUUUUPUUUUU?UPUUUUW*5PU???>*/PU:****)PUUUUUUZPP@@@@@EPS?????&PS?????%PS?????&PS?????%PT?????9PT?????9PT?????9PT?????9PT?????9PT?????9PUO????>PUO????>PUO????>PU:*****PUUUUUUUP'); colorMap:(((Array new:4) at:1 put:((Color white)); at:2 put:((Color black)); at:3 put:((Color grey:49.9962)); at:4 put:((Color grey:66.9978)); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@G@@@O G??8O??<O??<_??<???<???<???<???<???<_??<_??<_??<_??<_??<_??<O??<O??<O??<O??<O??<'); yourself); yourself]!
newIcon
"Generated by the Image Editor"
"
ImageEditor openOnClass:self andSelector:#newIcon
"
<resource: #image>
^Icon
constantNamed:#'ToolApplicationModel newIcon'
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@AUUUUP@@A????2@@A????2 @A????0@@A?????8@A?????8@A?????8@A?????8@A?????8@A?????8@A?????8@A?????8@A?????8@A?????8@A?????8@A?????8@A?????8@A?????8@A?????8@C*****(@@@@@@@@@'); colorMap:(((Array new:4) at:1 put:((Color black)); at:2 put:((Color white)); at:3 put:((Color grey:49.9962)); at:4 put:((Color grey:66.9978)); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'_?>@_??@_?? _??0_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8'); yourself); yourself]!
removeIcon
"Generated by the Image Editor"
"
ImageEditor openOnClass:self andSelector:#removeIcon
"
<resource: #image>
^Icon
constantNamed:#'ToolApplicationModel removeIcon'
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@BUUUUP@@B/???2@@B+???2 @A*???0@@A:/??*8@A>+?>+8@A?*?:/8@A?:/*?8@A?>*+?8@A??*/?8@A??*/?8@A?>*+?8@A?:/*?8@A?*?:/8@A>+?>+8@A:/??*8@A*???:(@B+???>(@B/????(@B*****(@@@@@@@@@'); colorMap:(((Array new:4) at:1 put:((Color black)); at:2 put:((Color white)); at:3 put:((Color grey:49.9962)); at:4 put:((Color grey:66.9978)); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'_?>@_??@_?? _??0_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8'); yourself); yourself]!
reviseAllButtonIcon
"Generated by the Image Editor"
"
ImageEditor openOnClass:self andSelector:#reviseAllButtonIcon
"
<resource: #image>
^Icon
constantNamed:#'ToolApplicationModel reviseAllButtonIcon'
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'EUUU@@@@UVUY@@@@UY?6@@@@UW0=@@@@UWO=AUUPUWO-@@@@UW>=AUUPEY?6A@@P@BUXUUTP@A @P@DP@IPEUUDP@F@D@ADP@%@DEADP@X@DPQDPBT@DPADPA @DDADPEP@DAADPFP@D@QEPAP@DPQD@@P@DEAT@@@@D@A@@@@@EUU@@'); colorMap:(((Array new:4) at:1 put:((Color white)); at:2 put:((Color black)); at:3 put:((Color grey:49.9962)); at:4 put:((Color grey:66.9978)); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@A>@@C?@@C?@@C?@@C?@@C?O<C?O<A>?<A ?<CC?<CC?<FC?<FC?<LC?<LC?<XC?<HC?<@C?0@C?0@C?@@C?@'); yourself); yourself]!
rightIcon
"Generated by the Image Editor"
"
ImageEditor openOnClass:self andSelector:#rightIcon
"
<resource: #image>
^Icon
constantNamed:#'ToolApplicationModel rightIcon'
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUUUUUPUUUUUUUPUUUUUUUPUUUUUUUPUUUUUUUPUUUUUEUPUUUUUIUPUUUUUJUP@@@@@J%PJ*****)PJ******PJ******PJ*****)PEUUUUZ%PUUUUUJUPUUUUUIUPUUUUUEUPUUUUUUUPUUUUUUUPUUUUUUUPUUUUUUUPUUUUUUUP'); colorMap:((OrderedCollection new add:(Color white); add:(Color black); add:(Color red:0.0 green:49.9962 blue:0.0); add:(Color red:100.0 green:0.0 blue:0.0); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@F@@@G@@@G ???0???8???<???<???8???0@@G @@G@@@F@@@@@@@@@@@@@@@@@@@@@'); yourself); yourself]!
saveIcon
"Generated by the Image Editor"
"
ImageEditor openOnClass:self andSelector:#saveIcon
"
<resource: #image>
^Icon
constantNamed:#'ToolApplicationModel saveIcon'
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'AL3L3L@PM3L3L0?PML3L3L=PM3L3L0=PML3L3L?PM3L3L0?PML3L3L?PM3L3L0?PML3L3L?PM3L3L0?PML3L3L?PM@@@@@?PO??????PO??????PO??????PO=UUUU?PO=???[?PO=5O?Z?PO=6O?Z?PO=6O?Z?PO=0O?Z?P5U***U5P'); colorMap:(((Array new:4) at:1 put:((Color white)); at:2 put:((Color black)); at:3 put:((Color grey:49.9962)); at:4 put:((Color grey:66.9978)); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???<???<???<???<???<???<???<???<???<???<???<???<???<???<???<???<???<???<???<???<???<???8'); yourself); yourself]
!
searchIcon
"Generated by the Image Editor"
"
ImageEditor openOnClass:self andSelector:#searchIcon
"
<resource: #image>
^Icon
constantNamed:#'ToolApplicationModel searchIcon'
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@CV*@MZ(@@@@@@@@@CV*@MZ(@CV*@MZ(@CV*@MZ(@CV*@MZ(@CV*@MZ(@CV*@MZ(@CV*JMZ(@CV(@AZ(@CV(6!!Z(@CV(@AZ(@CV*@MZ(@@@@@@@@@@MZ 5Z@@@@@@@@@@@A(@A(@@@@@@@@@@@M*@M*@@@@@@@@@@'); colorMap:((OrderedCollection new add:(Color black); add:(Color grey:74.5083); add:(Color grey:49.9962); add:(Color white); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@_<?8_<?8_<?8_<?8_<?8_<?8_<?8_<?8_??8_??8_??8_??8_??8_??8_??8G?? G?? C8_@C8_@G<? G<? '); yourself); yourself]!
startIcon
"Generated by the Image Editor"
"
ImageEditor openOnClass:self andSelector:#startIcon
"
<resource: #image>
^Icon
constantNamed:#'ToolApplicationModel startIcon'
ifAbsentPut:[(Depth4Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@N8@@@@@@@@@@@@N<^@@@@@@@@@@@@;.;.;.;.@@@@@@C/G @@@@8^@@@@@N<^@@@@@A@@@@@@;18@@@@@D@@@@@C.;.;.; @P@@@@@N<^@@@@@@@@@@@@;18@@@C!!G.@@@@C/G @@@@G>@@@@@N;.;.; @_8@@@@@;18@@@@A? @@@@C/G @@@@G>@@@@@N<^@@@@@_8@@@@@;.;.;.@A? @@@@C/G @@@@G>@@@@@N<^@@@@@_8@@@@@;18@@@@@@@@@@@C.; @@@@DQ@@@@C ; 8@@@A&X@@@C 8@8N@@@"H"@@@b'); colorMap:((OrderedCollection new add:(Color black); add:(Color white); add:(Color red:100.0 green:0.0 blue:0.0); add:(Color red:0.0 green:100.0 blue:0.0); add:(Color red:0.0 green:0.0 blue:100.0); add:(Color red:0.0 green:100.0 blue:100.0); add:(Color red:100.0 green:100.0 blue:0.0); add:(Color red:100.0 green:0.0 blue:100.0); add:(Color red:49.9962 green:0.0 blue:0.0); add:(Color red:0.0 green:49.9962 blue:0.0); add:(Color red:0.0 green:0.0 blue:49.9962); add:(Color red:0.0 green:49.9962 blue:49.9962); add:(Color red:49.9962 green:49.9962 blue:0.0); add:(Color red:49.9962 green:0.0 blue:49.9962); add:(Color grey:49.9962); add:(Color grey:66.9978); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@C@D@G D@G?<@G N@G N@G N@G?.@G N@G _@G _@G?_@G _@G _@G _@G?_@G ? G!!?0G!!?0G!!.PKQNPT(_@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a'); yourself); yourself]
!
stxIcon
"Generated by the Image Editor"
"
ImageEditor openOnClass:self andSelector:#stxIcon
"
<resource: #image>
^Icon
constantNamed:#'ToolApplicationModel stxIcon'
ifAbsentPut:[(Depth2Image new) width: 19; height: 19; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@L@@@@@@@@@@@@@@@T@@D@@AP@APP@AP@@@@@E@E@@@@EA@@@@@TT@C@@@U@@@@@AP@@@@@U@@@@@EA@@L@APA@@@@T@D@@@U@@@@@AT@@D@0@@@@@A@@@@@@@b'); colorMap:((OrderedCollection new add:(Color grey:9.41024); add:(Color red:0.0 green:80.7828 blue:18.8205); add:(Color black); add:(Color white); yourself)); yourself]!
upIcon
"Generated by the Image Editor"
"
ImageEditor openOnClass:self andSelector:#upIcon
"
<resource: #image>
^Icon
constantNamed:#'ToolApplicationModel upIcon'
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUQUUUPUUUJUUUPUUT*%UUPUUR*)UUPUUJ**UUPUT***%UPUTV*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUT*%UUPUUTUUUUP'); colorMap:((OrderedCollection new add:(Color white); add:(Color black); add:(Color red:0.0 green:49.9962 blue:0.0); add:(Color red:100.0 green:0.0 blue:0.0); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@C@@@G @@O0@@_8@@?<@A?>@A?>@@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@@O0@'); yourself); yourself]!
upRightIcon
"Generated by the Image Editor"
"
ImageEditor openOnClass:self andSelector:#upRightIcon
"
<resource: #image>
^Icon
constantNamed:#'ToolApplicationModel upRightIcon'
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUUTUUPUUUUT%UPUUUUT)UPP@@@@*UPR*****%PR*****)PR*****)PR*****%PR*UUU*UPR*UUT)UPR*UUT%UPR*UUTUUPR*UUUUUPR*UUUUUPR*UUUUUPR*UUUUUPR*UUUUUPR*UUUUUPR*UUUUUPR*UUUUUPQUUUUUUPUUUUUUUP'); colorMap:((OrderedCollection new add:(Color white); add:(Color black); add:(Color red:0.0 green:49.9962 blue:0.0); add:(Color red:100.0 green:0.0 blue:0.0); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@L@@@N@@@O@_?? _??0_??8_??8_??0_?? _ O@_ N@_ L@_ @@_ @@_ @@_ @@_ @@_ @@_ @@_ @@_ @@@@@@'); yourself); yourself]! !
!ToolApplicationModel class methodsFor:'startup / release'!
preSnapshot
clipboard := nil
!
uninitialize
showHelp := history := clipboard := nil
! !
!ToolApplicationModel methodsFor:'aspects'!
valueOfEnablingCommitButtons
|holder|
(holder := builder bindingAt:#valueOfEnablingCommitButtons) isNil ifTrue:[
builder aspectAt:#valueOfEnablingCommitButtons put:(holder := false asValue).
].
^ holder
!
valueOfHavingClipboard
|holder|
(holder := builder bindingAt:#valueOfHavingClipboard) isNil ifTrue:[
builder aspectAt:#valueOfHavingClipboard put:(holder := self class clipboard notNil asValue).
].
^ holder
!
valueOfInfoLabel
|holder|
(holder := builder bindingAt:#valueOfInfoLabel) isNil ifTrue:[
builder aspectAt:#valueOfInfoLabel put:(holder := ValueHolder new).
].
^ holder
!
valueOfTimeLabel
|holder|
(holder := builder bindingAt:#valueOfTimeLabel) isNil ifTrue:[
builder aspectAt:#valueOfTimeLabel put:(holder := ValueHolder new).
].
^ holder
! !
!ToolApplicationModel methodsFor:'clipboard'!
clipboard: anEditObject
self class clipboard: anEditObject.
self valueOfHavingClipboard value: anEditObject notNil
! !
!ToolApplicationModel methodsFor:'help'!
defaultInfoLabel
^''
!
openAbout
"show an about box"
|box|
box := AboutBox new.
box autoHideAfter:10 with:[].
box showAtCenter
!
openAboutThisApplication
"show an about this application box"
|rev box|
rev := ''.
self class revision notNil ifTrue: [rev := ' (rev: ', self class revision printString, ')'].
box := AboutBox title:
'\The application\\' withCRs
, (Text string: self class name emphasis: #bold), rev
, '\\has been designed and implemented by \' withCRs
, ((self class authorLinesForAboutBox collect:[:l | ' ' , l]) asStringWith:$\) withCRs
, '\\' withCRs.
box label:'About This Application'.
box autoHideAfter:10 with:[].
box showAtCenter.
"Modified: / 1.2.1998 / 15:59:58 / cg"
!
openClassDocumentation
Autoload autoloadFailedSignal handle:[:ex |
self warn:'autoload failed.
Check your source directory and/or
the abbreviation file for the classes (correct) shortened name.'.
ex return.
] do:[
|text v|
text := self class htmlDocumentation.
text notNil ifTrue:[
v := HTMLDocumentView
openFullOnText:text
inDirectory:(Smalltalk getSystemFileName:'doc/online/english/classDoc').
v nameSpaceForExecution: self class nameSpace.
]
]
!
openProgrammersGuide
|dir|
((dir := Smalltalk getSystemFileName: 'doc/online/english/programming/TOP.html') asFilename exists)
ifTrue:
[
^HTMLDocumentView openFullOnFile: dir
]
!
openTutorial
|dir|
((dir := Smalltalk getSystemFileName: 'doc/online/english/getstart/tutorial.html') asFilename exists)
ifTrue:
[
^HTMLDocumentView openFullOnFile: dir
]
!
showHelp
"Answer whether showing help is turned on/off"
|currentActiveHelp|
currentActiveHelp := ActiveHelp currentHelpListener.
^self class showHelp
and: [currentActiveHelp notNil and: [currentActiveHelp interestedIn: self builder window]]
!
showHelp: aValue
"toggle showing help"
(self class showHelp: aValue)
ifTrue: [ActiveHelp startFor: self]
ifFalse: [ActiveHelp stopFor: self. self valueOfInfoLabel value: self defaultInfoLabel]
!
showHelp:aHelpText for:view
"display aHelpText in the info label or if present detour to masterApplication."
self showHelp ifFalse: [^true].
self masterApplication notNil
ifTrue:
[
^masterApplication showHelp: aHelpText for:view
]
ifFalse:
[
aHelpText isNil
ifTrue: [self valueOfInfoLabel value: self defaultInfoLabel]
ifFalse: [self valueOfInfoLabel value: (aHelpText asString printString upTo: Character cr)].
^true
]
! !
!ToolApplicationModel methodsFor:'history'!
addToHistory: aHistoryEntry
aHistoryEntry key size = 0 ifTrue: [^nil].
self history remove: (self history detect: [:histEntry| histEntry key = aHistoryEntry key] ifNone: nil) ifAbsent: nil.
self history addFirst: aHistoryEntry.
[self history size > self class historyMaxSize] whileTrue: [self history removeLast]
!
emptyHistory
^self history removeAll
!
history
^self class getHistory
!
menuHistory
|menu a|
menu := Menu new receiver: self.
(self history collect: [:histEntry| histEntry value]) asSet asOrderedCollection do:
[:historyEntryType|
menu addItemGroup: ((a := self history select: [:histEntry| histEntry value = historyEntryType]) collect: [:histEntry| MenuItem new label: histEntry key printString; value: histEntry value; argument: histEntry key]).
].
menu addItem: (MenuItem new label: 'Empty History'; value: #emptyHistory).
^menu
!
removeFromHistory: aHistoryEntry
self history remove: (self history detect: [:histEntry| histEntry key = aHistoryEntry key] ifNone: nil) ifAbsent: nil.
[self history size > self class historyMaxSize] whileTrue: [self history removeLast]
! !
!ToolApplicationModel methodsFor:'queries'!
preferredExtent
"preferred extent of my window; top/main menu and top toolbar (named by 'menuToolbarView')
will be considered"
|window menu menuToolbarView preferredExtentOfWindow|
window := self builder window.
menu := window subViews first.
menuToolbarView := builder componentAt: #menuToolbarView.
preferredExtentOfWindow := window extent.
menu class = MenuPanel ifTrue: [preferredExtentOfWindow := preferredExtentOfWindow max: menu preferredExtent].
menuToolbarView notNil ifTrue: [preferredExtentOfWindow := preferredExtentOfWindow max: menuToolbarView preferredExtent].
^window minExtent max: (preferredExtentOfWindow min: window maxExtent)
! !
!ToolApplicationModel methodsFor:'startup / release'!
close
self uninitialize.
super close
!
closeRequest
self uninitialize.
super closeRequest
!
open
super open.
"/ self class allInstances size = 1
"/ ifTrue:
"/ [
"/ self class classResources: nil.
"/ self clipboard: nil
"/ ].
builder window label: self class label.
timeBlock := nil.
timeBlock := [self showTime].
self showTime.
"Modified: / 30.1.1998 / 16:02:51 / cg"
!
openInterface:aSymbol
self allButOpenInterface:aSymbol.
self builder window extent: self preferredExtent.
self openWindow.
^builder
!
postOpenWith:aBuilder
super postOpenWith:aBuilder.
timeBlock := nil.
timeBlock := [self showTime].
self showTime.
self class showHelp ifTrue: [ActiveHelp startFor: self].
self valueOfInfoLabel value: self defaultInfoLabel.
!
reOpen
self close.
self class open
!
removeAllTemporalViews
self builder namedComponents keys copy do:
[:comp|
(comp includesString: '_Temporal') ifTrue: [self builder namedComponents removeKey: comp]
]
!
restarted
self initialize
!
uninitialize
self showHelp ifTrue: [ActiveHelp stopFor: self].
Processor removeTimedBlock:timeBlock.
timeBlock := nil.
! !
!ToolApplicationModel methodsFor:'window events'!
showTime
|hours minutes suffix|
suffix := ' am '.
(hours := Time now hours) > 12 ifTrue: [hours := hours - 12].
Time now hours >= 12 ifTrue: [suffix := ' pm '].
(minutes := Time now minutes printString) size = 1 ifTrue: [minutes := '0', minutes printString].
self valueOfTimeLabel value: hours printString, ':', minutes, suffix.
Processor removeTimedBlock: timeBlock.
Processor addTimedBlock: timeBlock afterSeconds: 1
! !
!ToolApplicationModel class methodsFor:'documentation'!
version
^ '$Header: /cvs/stx/stx/libview2/ToolApplicationModel.st,v 1.27 1998-02-01 15:00:39 cg Exp $'
! !