-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHotDraw PERT Chart.pst
472 lines (387 loc) · 16.5 KB
/
HotDraw PERT Chart.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
<?xml version="1.0"?>
<st-source>
<!--
Name: HotDraw PERT Chart
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: 87408
DbUsername: niallr
DbVersion: 1.5
DevelopmentPrerequisites: #(#(#any 'HotDraw Framework' ''))
PackageName: HotDraw PERT Chart
Parcel: #('HotDraw PERT Chart')
ParcelName: HotDraw PERT Chart
PrerequisiteParcels: #(#('HotDraw Framework' ''))
PrintStringCache: (1.5,niallr)
Version: 1.5
Post-Load Block:
[:pkg | Refactory.HotDraw.PERTChart postLoadActionFor: pkg]
Date: 3:02:57 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:57</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>PERTChart</name>
<environment>Refactory.HotDraw</environment>
<super>Refactory.HotDraw.DrawingEditor</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-PERTChart</category>
<attributes>
<package>HotDraw PERT Chart</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.PERTChart</class-id>
<body>PERTChart is the DrawingEditor for the PERTChart application.
PERTChart open
</body>
</comment>
<class>
<name>PERTEventAppModel</name>
<environment>Refactory.HotDraw</environment>
<super>UI.ApplicationModel</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>durationHolder endDateHolder nameHolder incoming outgoing </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-PERTChart</category>
<attributes>
<package>HotDraw PERT Chart</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.PERTEventAppModel</class-id>
<body>PERTEventAppModel is an ApplicationModel that represents an individual event.
Instance Variables:
durationHolder <ValueHolder on: Number> how long does this event last
endDateHolder <ValueHolder on: Number> when do we end
incoming <Collection of: PERTEventAppModel> events that must occur before us
nameHolder <ValueHolder on: String> our name
outgoing <Collection of: PERTEventAppModel> events that occur after us
</body>
</comment>
<class>
<name>PERTEventFigure</name>
<environment>Refactory.HotDraw</environment>
<super>Refactory.HotDraw.ViewAdapterFigure</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>outgoing </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-PERTChart</category>
<attributes>
<package>HotDraw PERT Chart</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.PERTEventFigure</class-id>
<body>PERTEventFigure represents an event in the drawing. It simply adapts a PERTEventAppModel to the figure protocol.
Instance Variables:
outgoing <IdentityDictionary key: LineFigure value: PERTEventFigure> mapping of lines to the figure they connect, when a line is deleted we must update the figure its connected to
</body>
</comment>
<methods>
<class-id>Refactory.HotDraw.PERTChart</class-id> <category>drawing description</category>
<body package="HotDraw PERT Chart">toolNames
"Return the list of names for the tools."
^(super toolNames asOrderedCollection)
add: nil;
add: 'Pert Event Tool';
yourself</body>
</methods>
<methods>
<class-id>Refactory.HotDraw.PERTChart class</class-id> <category>resources</category>
<body package="HotDraw PERT Chart">pertEventIcon
^OpaqueImage figure: self pertEventIconImage shape: self pertEventIconMask</body>
</methods>
<methods>
<class-id>Refactory.HotDraw.PERTChart class</class-id> <category>parcel load/unload/save</category>
<body package="HotDraw PERT Chart">obsolete
[Tool reinitialize] on: Error do: [:ex | ex return: nil].
super obsolete</body>
<body package="HotDraw PERT Chart">postLoadActionFor: aParcel
Tool reinitialize</body>
</methods>
<methods>
<class-id>Refactory.HotDraw.PERTEventAppModel</class-id> <category>accessing</category>
<body package="HotDraw PERT Chart">addIncoming: aPertEventAppModel
aPertEventAppModel addDependent: self.
incoming add: aPertEventAppModel.
self updateEndDate</body>
<body package="HotDraw PERT Chart">connectTo: aPertEventAppModel
outgoing add: aPertEventAppModel.
aPertEventAppModel addIncoming: self</body>
<body package="HotDraw PERT Chart">disconnectFrom: aPertEventAppModel
outgoing remove: aPertEventAppModel ifAbsent: [].
aPertEventAppModel removeIncoming: self</body>
<body package="HotDraw PERT Chart">duration
^self durationHolder value</body>
<body package="HotDraw PERT Chart">endDate
^self endDateHolder value</body>
<body package="HotDraw PERT Chart">removeIncoming: aPertEventAppModel
aPertEventAppModel removeDependent: self.
incoming remove: aPertEventAppModel ifAbsent: [].
self updateEndDate</body>
<body package="HotDraw PERT Chart">startDate
^incoming inject: 0 into: [:sum :each | sum max: each endDate]</body>
</methods>
<methods>
<class-id>Refactory.HotDraw.PERTEventAppModel</class-id> <category>aspects</category>
<body package="HotDraw PERT Chart">durationHolder
"This method was generated by UIDefiner. Any edits made here
may be lost whenever methods are automatically defined. The
initialization provided below may have been preempted by an
initialize method."
^durationHolder isNil
ifTrue:
[durationHolder := 0 asValue]
ifFalse:
[durationHolder]</body>
<body package="HotDraw PERT Chart">endDateHolder
"This method was generated by UIDefiner. Any edits made here
may be lost whenever methods are automatically defined. The
initialization provided below may have been preempted by an
initialize method."
^endDateHolder isNil
ifTrue:
[endDateHolder := 0 asValue]
ifFalse:
[endDateHolder]</body>
<body package="HotDraw PERT Chart">nameHolder
"This method was generated by UIDefiner. Any edits made here
may be lost whenever methods are automatically defined. The
initialization provided below may have been preempted by an
initialize method."
^nameHolder isNil
ifTrue:
[nameHolder := String new asValue]
ifFalse:
[nameHolder]</body>
</methods>
<methods>
<class-id>Refactory.HotDraw.PERTEventAppModel</class-id> <category>initialize-release</category>
<body package="HotDraw PERT Chart">initialize
super initialize.
incoming := OrderedCollection new.
outgoing := OrderedCollection new.
self endDateHolder onChangeSend: #changed to: self.
self durationHolder onChangeSend: #updateEndDate to: self</body>
</methods>
<methods>
<class-id>Refactory.HotDraw.PERTEventAppModel</class-id> <category>changing</category>
<body package="HotDraw PERT Chart">update: anAspect with: anArg from: anObject
self updateEndDate</body>
<body package="HotDraw PERT Chart">updateEndDate
self endDateHolder value: self startDate + self duration</body>
</methods>
<methods>
<class-id>Refactory.HotDraw.PERTEventFigure</class-id> <category>changing</category>
<body package="HotDraw PERT Chart">deletionUpdateFrom: aFigure
model disconnectFrom: (outgoing at: aFigure ifAbsent: [^self]) model.
outgoing removeKey: aFigure.
super deletionUpdateFrom: aFigure</body>
</methods>
<methods>
<class-id>Refactory.HotDraw.PERTEventFigure</class-id> <category>connection</category>
<body package="HotDraw PERT Chart">canConnectFromFigure: aFigure
^self class == aFigure class</body>
<body package="HotDraw PERT Chart">canConnectToFigure: aFigure
self == aFigure ifTrue: [^false].
self class == aFigure class ifFalse: [^false].
^(aFigure isConnectedTo: self) not
and: [(self isConnectedTo: aFigure) not]</body>
<body package="HotDraw PERT Chart">connectFromPoint: myPoint to: aFigure at: figurePoint
| newFigure |
newFigure := super
connectFromPoint: myPoint
to: aFigure
at: figurePoint.
outgoing at: newFigure put: aFigure.
newFigure addDependent: self.
self model connectTo: aFigure model.
^newFigure</body>
</methods>
<methods>
<class-id>Refactory.HotDraw.PERTEventFigure</class-id> <category>testing</category>
<body package="HotDraw PERT Chart">isConnectedTo: aFigure
^self == aFigure
or: [outgoing contains: [:each | each isConnectedTo: aFigure]]</body>
</methods>
<methods>
<class-id>Refactory.HotDraw.PERTEventFigure</class-id> <category>initialize-release</category>
<body package="HotDraw PERT Chart">initialize
super initialize.
model := PERTEventAppModel new.
self view: (model allButOpenInterface: #windowSpec) window component
in: (0 @ 0 corner: 100 @ 90).
self opaque.
outgoing := IdentityDictionary new</body>
</methods>
<methods>
<class-id>Refactory.HotDraw.PERTEventFigure</class-id> <category>displaying</category>
<body package="HotDraw PERT Chart">displayFigureOn: aGraphicsContext
super displayFigureOn: aGraphicsContext copy.
aGraphicsContext
paint: self lineColor;
lineWidth: self lineWidth.
self bounds displayStrokedOn: aGraphicsContext</body>
</methods>
<methods>
<class-id>Refactory.HotDraw.PERTEventFigure</class-id> <category>accessing</category>
<body package="HotDraw PERT Chart">handles
| handles |
handles := OrderedCollection withAll: (TrackHandle allCornersOf: self).
handles add: (Handle connectionOn: self at: #rightCenter).
^handles</body>
</methods>
<methods>
<class-id>Refactory.HotDraw.Tool class</class-id> <category>tool states</category>
<body package="HotDraw PERT Chart">initializePERTTool
"This method was automatically generated by the HotDraw ToolStateMachineEditor.
To edit this method, evaluate the comment below"
"| states transitions stateTable |
states := ((OrderedCollection new) add: (ToolStateModel basicNew instVarAt: 1 put: nil; instVarAt: 2 put: 'Pert Event Tool'; instVarAt: 3 put: '[:tool :event | ]'; instVarAt: 4 put: (Point x: 183 y: 70); instVarAt: 5 put: false; instVarAt: 6 put: false; yourself); add: (ToolStateModel basicNew instVarAt: 1 put: nil; instVarAt: 2 put: 'Create Pert Figure'; instVarAt: 3 put: (Text string: '[:tool :event |
tool drawing add:
(PERTEventFigure createAt: (tool cursorPointFor: event))]' runs: (RunArray runs: #(94) values: #(nil))); instVarAt: 4 put: (Point x: 180 y: 180); instVarAt: 5 put: true; instVarAt: 6 put: false; yourself); yourself).
stateTable := Dictionary new.
states do: [:each | stateTable at: each name put: each].
transitions := OrderedCollection new.
transitions add: (ToolStateTransitionModel new from: (stateTable at: 'Pert Event Tool'); to: (stateTable at: 'Create Pert Figure'); type: (TransitionType basicNew instVarAt: 1 put: #redButtonPress; yourself); points: ((OrderedCollection new) add: (Point x: 232 y: 101); add: (Point x: 236 y: 180); yourself); yourself).
ToolStateMachineEditor openWithStates: states connections: transitions"
Tool states at: 'Pert Event Tool' put: (ToolState name: 'Pert Event Tool' command: [:tool :event | ]).
Tool states at: 'Create Pert Figure' put: (EndToolState name: 'Create Pert Figure' command: [:tool :event |
tool drawing add:
(PERTEventFigure createAt: (tool cursorPointFor: event))]).
(Tool stateFor: 'Pert Event Tool') redButtonPress: ((SimpleTransitionTable new) goto: (Tool stateFor: 'Create Pert Figure'); yourself).</body>
</methods>
<methods>
<class-id>Refactory.HotDraw.PERTChart class</class-id> <category>resources</category>
<body package="HotDraw PERT Chart">pertEventIconImage
"UIMaskEditor new openOnClass: self andSelector: #pertEventIconImage"
<resource: #image>
^CachedImage on: (Image extent: 16@16 depth: 1 bitsPerPixel: 1 palette: MonoMappedPalette blackWhite usingBits: #[255 255 0 0 255 255 0 0 255 255 0 0 255 255 0 0 128 1 0 0 191 253 0 0 160 125 0 0 191 253 0 0 160 69 0 0 191 253 0 0 160 69 0 0 191 253 0 0 128 1 0 0 255 255 0 0 255 255 0 0 255 255 0 0])</body>
<body package="HotDraw PERT Chart">pertEventIconMask
"UIMaskEditor new openOnClass: self andSelector: #pertEventIconMask"
<resource: #image>
^CachedImage on: (Image extent: 16@16 depth: 1 bitsPerPixel: 1 palette: CoveragePalette monoMaskPalette usingBits: #[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 254 0 0 127 254 0 0 127 254 0 0 127 254 0 0 127 254 0 0 127 254 0 0 127 254 0 0 127 254 0 0 127 254 0 0 0 0 0 0 0 0 0 0 0 0 0 0])</body>
</methods>
<methods>
<class-id>Refactory.HotDraw.PERTEventAppModel class</class-id> <category>interface specs</category>
<body package="HotDraw PERT Chart">windowSpec
"UIPainter new openOnClass: self andSelector: #windowSpec"
<resource: #canvas>
^#(#FullSpec
#window:
#(#WindowSpec
#label: 'Unlabeled Canvas'
#min: #(#Point 40 20 )
#bounds: #(#Rectangle 791 610 895 703 )
#colors:
#(#LookPreferences
#setBackgroundColor: #(#ColorValue 7700 7700 7700 ) )
#isEventDriven: true )
#component:
#(#SpecCollection
#collection: #(
#(#InputFieldSpec
#layout: #(#LayoutFrame 1 0 1 0 -1 1 29 0 )
#name: #nameHolder
#model: #nameHolder )
#(#LabelSpec
#layout: #(#Point 1 30 )
#label: 'Duration:' )
#(#LabelSpec
#layout: #(#Point 1 61 )
#label: 'End date:' )
#(#InputFieldSpec
#layout: #(#LayoutFrame 0 0.666666 31 0 -1 1 58 0 )
#name: #durationHolder
#model: #durationHolder
#alignment: #right
#type: #number )
#(#InputFieldSpec
#layout: #(#LayoutFrame 0 0.666666 60 0 -1 1 89 0 )
#name: #endDateHolder
#model: #endDateHolder
#alignment: #right
#isReadOnly: true
#type: #number ) ) ) )</body>
</methods>
<methods>
<class-id>Tools.VisualLauncher</class-id> <category>actions</category>
<body package="HotDraw PERT Chart">toolsHotDrawPERTChart
<menuItem: 'PERT Chart'
nameKey: nil
menu: #(#menuBar #tools #HotDraw)
position: 10.03>
(#{Refactory.HotDraw.PERTChart} valueOrDo: [^self]) open</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>ApplicationModel</name>
<environment>UI</environment>
<super>UI.Model</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>builder uiSession eventHandlers </inst-vars>
<class-inst-vars>savedWindowInformation </class-inst-vars>
<imports></imports>
<category>UIBuilder-Framework</category>
<attributes>
<package>UIBuilder-Framework</package>
</attributes>
</class>
<class>
<name>VisualLauncher</name>
<environment>Tools</environment>
<super>UI.ApplicationModel</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>menuBar toolBar textCollector toolDock </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>Tools-Misc</category>
<attributes>
<package>Tools-Misc</package>
</attributes>
</class>
<class>
<name>ViewAdapterFigure</name>
<environment>Refactory.HotDraw</environment>
<super>Refactory.HotDraw.Figure</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>component </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Figures</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<class>
<name>DrawingEditor</name>
<environment>Refactory.HotDraw</environment>
<super>UI.ApplicationModel</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>buttons drawing </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Framework</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
</st-source>