-
Notifications
You must be signed in to change notification settings - Fork 0
/
HotDraw Animation Framework.pst
131 lines (103 loc) · 4.86 KB
/
HotDraw Animation Framework.pst
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?xml version="1.0"?>
<st-source>
<!--
Name: HotDraw Animation Framework
Notice: Copyright 1993 - 2013 John Brant
This utility is made available to use under the MIT license, as detailed below.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
DbIdentifier: psql_public_cst_2007
DbTrace: 87404
DbUsername: niallr
DbVersion: 1.5
DevelopmentPrerequisites: #(#(#any 'HotDraw Framework' ''))
PackageName: HotDraw Animation Framework
Parcel: #('HotDraw Animation Framework')
ParcelName: HotDraw Animation Framework
PrerequisiteParcels: #(#('HotDraw Framework' ''))
PrintStringCache: (1.5,niallr)
Version: 1.5
Date: 3:02:47 PM April 5, 2013
-->
<time-stamp>From VisualWorks®, Pre-Release 7.10 (mar13.4) of 22 March 2013 on 5 April 2013 at 15:02:47</time-stamp>
<do-it>(Dialog confirm: 'You are filing-in a Parcel source file!\\While this is possible it will not have\the same effect as loading the parcel.\None of the Parcel''s prerequisites will\be loaded and none of its load actions\will be performed.\\Are you sure you want to file-in?' withCRs) ifFalse: [self error: 'Parcel file-in abandoned. Choose terminate or close.']</do-it>
<class>
<name>AnimatedDrawing</name>
<environment>Refactory.HotDraw</environment>
<super>Refactory.HotDraw.Drawing</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>animationProcess </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Animation</category>
<attributes>
<package>HotDraw Animation Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.AnimatedDrawing</class-id>
<body>AnimatedDrawing is a Drawing that can animate figure. To create an animated drawing, simply subclass this class, and override the #step method.
Instance Variables:
animationProcess <Process> the process that runs the animation (if it runs at a different priority than the UI process, then locking will be needed)
</body>
</comment>
<methods>
<class-id>Refactory.HotDraw.AnimatedDrawing</class-id> <category>accessing</category>
<body package="HotDraw Animation Framework">animationBlock
^
[| delay |
delay := Delay forMilliseconds: self delayTime.
[delay wait.
self canAnimate
ifTrue:
[self step.
self repairDamage]]
repeat]</body>
<body package="HotDraw Animation Framework">container: aVisualComponent
super container: aVisualComponent.
aVisualComponent isNil
ifTrue: [self stopAnimation]
ifFalse: [self startAnimation]</body>
<body package="HotDraw Animation Framework">delayTime
^10 "ms"</body>
<body package="HotDraw Animation Framework">startAnimation
animationProcess isNil
ifTrue: [animationProcess := self startAnimationProcess]</body>
<body package="HotDraw Animation Framework">startAnimationProcess
^self animationBlock fork</body>
<body package="HotDraw Animation Framework">step</body>
<body package="HotDraw Animation Framework">stopAnimation
animationProcess isNil ifTrue: [^self].
animationProcess terminate.
animationProcess := nil</body>
</methods>
<methods>
<class-id>Refactory.HotDraw.AnimatedDrawing</class-id> <category>testing</category>
<body package="HotDraw Animation Framework">canAnimate
^self controller currentTool isIdle</body>
</methods>
<methods>
<class-id>Refactory.HotDraw.AnimatedDrawing</class-id> <category>initialize-release</category>
<body package="HotDraw Animation Framework">release
self stopAnimation.
super release</body>
</methods>
<do-it>"Imported Classes:"</do-it>
<do-it>self error: 'Attempting to file-in parcel imports. Choose terminate or close'</do-it>
<class>
<name>Drawing</name>
<environment>Refactory.HotDraw</environment>
<super>Refactory.HotDraw.CompositeFigure</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>selections handles controller </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Framework</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
</st-source>