-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHotDraw Framework.pst
6717 lines (5461 loc) · 269 KB
/
HotDraw 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
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
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0"?>
<st-source>
<!--
Name: HotDraw 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.
Comment: NAME HotDraw
AUTHOR [email protected]
FUNCTION Framework for stuctured drawing editors
KEYWORDS widget graphics
ST-VERSIONS VisualWorks
PREREQUISITES
THEN FILE IN
CONFLICTS WITH
DISTRIBUTION world
SUMMARY
This set of parcels contains HotDraw, a framework for structured, 2D drawing editors. It can/has been used to create many different editors from case tools to object inspectors. Open using the Launcher's Tools->HotDraw submenu.
More information on HotDraw can be found on the HotDraw home page
http://st-www.cs.uiuc.edu/users/brant/HotDraw/HotDraw.html
General questions about HotDraw can be directed to the HotDraw mailing list [email protected].
John Brant - 15-Sep-2001
Link updated by Alan Knight, 7-Oct-2005
Updated for VisualWorks 7.8 by Niall Ross and Travis Griggs, 3-Feb-2011
DbIdentifier: psql_public_cst_2007
DbTrace: 88187
DbUsername: niallr
DbVersion: 7.10.1 - 2
DevelopmentPrerequisites: #(#(#any 'Refactory-Namespace' ''))
PackageName: HotDraw Framework
Parcel: #('HotDraw Framework')
ParcelName: HotDraw Framework
PrerequisiteParcels: #(#('Refactory-Namespace' ''))
PrintStringCache: (7.10.1 - 2,niallr)
Version: 7.10.1 - 2
WarningSuppressionBlock: [:prerequisiteName|
'BOSS' = prerequisiteName
]
Post-Load Block:
[:pkg| Refactory.HotDraw.Drawing postLoadActionFor: pkg ]
Warning Suppression Block:
[:prerequisiteName|
'BOSS' = prerequisiteName
]
Date: 6:21:40 AM December 26, 2013
-->
<time-stamp>From VisualWorks®, Pre-Release 7.10.1 (oct13.1) of October 3, 2013 on December 26, 2013 at 6:21:40 AM</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>
<name-space>
<name>HotDraw</name>
<environment>Refactory</environment>
<private>false</private>
<imports>
private Smalltalk.*
</imports>
<category>HotDraw-Framework</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</name-space>
<class>
<name>Figure</name>
<environment>Refactory.HotDraw</environment>
<super>Graphics.VisualPart</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>dependents state attributes model bounds </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Framework</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<class>
<name>CompositeFigure</name>
<environment>Refactory.HotDraw</environment>
<super>Refactory.HotDraw.Figure</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>components </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Framework</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.CompositeFigure</class-id>
<body>CompositeFigure is a Figure that groups other figures into a single figure (composite pattern).
Instance Variables:
components <SequenceableCollection of: Figure> the figures I'm grouping
</body>
</comment>
<class>
<name>ToolbarController</name>
<environment>Refactory.HotDraw</environment>
<super>UI.Controller</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>pressing pressingItem </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Toolbar</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.ToolbarController</class-id>
<body>ToolbarController is the controller for the ToolbarView.
Instance Variables:
pressing <Boolean> are we pressing a button?
pressingItem <ButtonDescription | nil> the items we're pressing
</body>
</comment>
<class>
<name>BoundaryConstraint</name>
<environment>Refactory.HotDraw</environment>
<super>Core.Object</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>line isStart filledFigure isUpdating </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Constraints</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.BoundaryConstraint</class-id>
<body>BoundaryConstraint represents a constraint that is placed between a filled figure and a line figure. It computes the lines position so that it is attached to the edge of the filled figure. This constraint only works if the filled figure answers true when sent the containsPoint: message with the filled figures center.
Instance Variables:
filledFigure <Figure> the filled figure that answers true to "filledFigure containsPoint: filledFigure center"
isStart <Boolean> setting the start or stop point of the line
isUpdating <Boolean> are we currently setting the lines values (avoids infinite recursion)
line <PolylineFigure> the line that is attached</body>
</comment>
<class>
<name>Handle</name>
<environment>Refactory.HotDraw</environment>
<super>Refactory.HotDraw.Figure</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>owner toolState </inst-vars>
<class-inst-vars>image </class-inst-vars>
<imports></imports>
<category>HotDraw-Handles</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.Handle</class-id>
<body>Handle is a special figure that is displayed when another figure in the drawing is selected. Handles aren't permant figures, but are added and removed whenever another figure is selected/deselected. They are useful for defining special manipulation actions such as resizing, connecting figures, etc.
Instance Variables:
owner <Figure> the figure that we are for
toolState <EndToolState> whenever the tool presses us, goto this state
</body>
</comment>
<class>
<name>TrackHandle</name>
<environment>Refactory.HotDraw</environment>
<super>Refactory.HotDraw.Handle</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>moveBlock </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Handles</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.TrackHandle</class-id>
<body>TrackHandle is a handle that executes a block whenever the cursor is moved. When the mouse button is release, it quits its action.
Instance Variables:
moveBlock <BlockClosure> a block that is executed for each mouse position, it takes one argument (a Point object)
</body>
</comment>
<class>
<name>ButtonDescription</name>
<environment>Refactory.HotDraw</environment>
<super>Core.Object</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>icon enabled value </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Toolbar</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.ButtonDescription</class-id>
<body>ButtonDescription represents a button in the Toolbar. It contains both the icon that is displayed as well as its value.
Instance Variables:
enabled <Boolean> are we enabled, disabled buttons can be greyed out
icon <Image> our image to display
value <Object> some data that we represent (can be anything, it isn't interpreted by us)
</body>
</comment>
<class>
<name>CachedFigure</name>
<environment>Refactory.HotDraw</environment>
<super>Refactory.HotDraw.Figure</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>cache </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Figures</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.CachedFigure</class-id>
<body>CachedFigure is a figure that holds a pixmap of its display. It can be used for complicated figures to cache their display so that they display faster. However, as graphics cards become faster, this figure is less useful.
Subclasses must implement the following messages:
private
fillCache returns a pixmap of our contents
Instance Variables:
cache <Pixmap> what we display when we are drawn
</body>
</comment>
<class>
<name>IndexedTrackHandle</name>
<environment>Refactory.HotDraw</environment>
<super>Refactory.HotDraw.TrackHandle</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>index </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Handles</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.IndexedTrackHandle</class-id>
<body>IndexedTrackHandle is a TrackHandle that has a menu. This menu allows the user to remove points from the line that the handle is for.
Instance Variables:
index <Integer> the index of the point on the line that we're connected to
</body>
</comment>
<class>
<name>TransitionTable</name>
<environment>Refactory.HotDraw</environment>
<super>Core.Object</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Tools</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.TransitionTable</class-id>
<body>TransitionTable is an abstract class that represents a transition between two states. When sent the nextStateForTool:event: message, it returns the next state for that type of event. If there isn't a next state for that event, it returns nil.
Subclasses must implement the following messages:
accessing
goto: a default constructer method that makes it easier to create the transition tables independently
nextStateForTool:event: returns the next state for the event or nil if there isn't a next state for that event
</body>
</comment>
<class>
<name>SimpleTransitionTable</name>
<environment>Refactory.HotDraw</environment>
<super>Refactory.HotDraw.TransitionTable</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>nextState </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Tools</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.SimpleTransitionTable</class-id>
<body>SimpleTransitionTable is a transition table that always goes to another state no matter what the event is.
Instance Variables:
nextState <EndToolState> the next state to goto
</body>
</comment>
<class>
<name>EllipseFigure</name>
<environment>Refactory.HotDraw</environment>
<super>Refactory.HotDraw.Figure</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Figures</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.EllipseFigure</class-id>
<body>EllipseFigure is a figure that represents ellipses.</body>
</comment>
<class>
<name>ToolbarView</name>
<environment>Refactory.HotDraw</environment>
<super>UI.View</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>horizontal over selecting </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Toolbar</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.ToolbarView</class-id>
<body>ToolbarView is the view that displays the toolbar.
Instance Variables:
horizontal <Boolean> description of horizontal
over <ButtonDescription> the item the mouse cursor is over
selecting <ButtonDescription> the item we're tentatively selecting
</body>
</comment>
<class>
<name>RectangleFigure</name>
<environment>Refactory.HotDraw</environment>
<super>Refactory.HotDraw.Figure</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Figures</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.RectangleFigure</class-id>
<body>RectangleFigure is a figure that displays a rectangle.
</body>
</comment>
<class>
<name>TextFigure</name>
<environment>Refactory.HotDraw</environment>
<super>Refactory.HotDraw.Figure</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>paragraph selection </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Figures</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.TextFigure</class-id>
<body>TextFigure is a Figure that represents text.
Instance Variables:
paragraph <Paragraph> the text that is displayed
selection <Interval | nil> the selected text interval, when the figure is part of the drawing's selection, then this selection is also highlighted
Class Variables:
InsertionPoint <Image> an image of the ^ that is displayed at the insertion point.
</body>
</comment>
<class>
<name>EndToolState</name>
<environment>Refactory.HotDraw</environment>
<super>Core.Object</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>name command </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Tools</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.EndToolState</class-id>
<body>EndToolState is a state for tools. When this state is entered, the tool evaluates its command, and then returns to the initial state of the tool.
EndToolState is also the superclass of ToolState. While it might be better to have an abstract class that is the superclass for both these classes. The abstract class and EndToolState would be essentially the same. The only difference would be that EndToolState would have its isEndState return true.
Instance Variables:
command <BlockClosure> the command that is executed when we are entered, it takes two arguments, the tool and the event
name <String> our state name
</body>
</comment>
<class>
<name>RoundedRectangleFigure</name>
<environment>Refactory.HotDraw</environment>
<super>Refactory.HotDraw.RectangleFigure</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>inset </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Figures</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.RoundedRectangleFigure</class-id>
<body>RoundedRectangleFigure is a rectangle that has rounded corners.
Instance Variables:
inset <Point> the offset for the ellipse that draws the rounded corners (if greater than our extent // 2, then we are an ellipse)
</body>
</comment>
<class>
<name>PositionConstraint</name>
<environment>Refactory.HotDraw</environment>
<super>Core.Object</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>receiver position message isUpdating </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Constraints</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.PositionConstraint</class-id>
<body>PositionConstraint represents a constraint between a position (a message send) and a message (symbol) of a receiver (figure). Whenever either figure changes, the constraint is re-evaluated, and the receiver is moved to the position.
Instance Variables:
isUpdating <Boolean> are we currently updating the figure (avoid infinite recursion)
message <Symbol> the symbol that is performed on receiver to set its position
position <MessageSend> a message send that when evaluated, returns the new position for receiver
receiver <Figure> the figure to be constrained
</body>
</comment>
<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>
<comment>
<class-id>Refactory.HotDraw.ViewAdapterFigure</class-id>
<body>ViewAdapterFigure adapts VisualCompoents to the Figure protocol, allowing any VisualComponent to be inserted into a Drawing.
Instance Variables:
component <VisualComponent> the visual component that is adapted
</body>
</comment>
<class>
<name>DrawingController</name>
<environment>Refactory.HotDraw</environment>
<super>UI.Controller</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>tool </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Framework</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.DrawingController</class-id>
<body>DrawingController is a Controller for a Drawing view.
Instance Variables:
keyboardProcessor <KeyboardProcessor> the keyboard processor for our window
tool <Tool> the current tool selected
</body>
</comment>
<class>
<name>FigureTransitionTable</name>
<environment>Refactory.HotDraw</environment>
<super>Refactory.HotDraw.TransitionTable</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>figureLookupStates </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Tools</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.FigureTransitionTable</class-id>
<body>FigureTransitionTable is a transition table for mouse events. It checks what type of figure the mouse is over and then decides what is the next state.
Instance Variables:
figureLookupStates <Dictionary key: Figure class value: EndToolState> our table, if the figure's class is in the table, then we take it entry, otherwise we lookup its superclass
</body>
</comment>
<class>
<name>LineAnnotation</name>
<environment>Refactory.HotDraw</environment>
<super>Graphics.VisualPart</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>positionSymbol directionSymbol isFilled </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Figures</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.LineAnnotation</class-id>
<body>LineAnnotation is a visual component that when added to a LineFigure allows you draw special symbols on the end points of the line (e.g., arrows, circles, etc.).
Subclasses must implement the following messages:
private
graphic returns a Geometric object that can be displayed
Instance Variables:
directionSymbol <#startDirection | #stopDirection> a symbol that when performed on our container, returns a unit vector of our direction
isFilled <Boolean> are we filled?
positionSymbol <#startPoint | #stopPoint> where should we be displayed at (when performed on our container returns our position)
</body>
</comment>
<class>
<name>ArrowAnnotation</name>
<environment>Refactory.HotDraw</environment>
<super>Refactory.HotDraw.LineAnnotation</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>length width </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Figures</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.ArrowAnnotation</class-id>
<body>ArrowAnnotation is a line annotation that displays an arrow at the end of the line.
Instance Variables:
length <Integer> the length of the arrow
width <Integer> our width
</body>
</comment>
<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>
<comment>
<class-id>Refactory.HotDraw.Drawing</class-id>
<body>Drawing is a view that allows the user to interact with the figure. In addition to the composite figure behavior, it cooperates with a controller to allow the user to manipulate the figures.
Instance Variables:
controller <DrawingController> my controller
handles <SequenceableCollection of: Handle> handles that the user can interact with, only selections will have their handles displayed
selections <Collection of: Figure> the figures that are currently selected by the user. Selected figures may be treated differently by different tools
Class Variables:
CopiedFigures <Collection of: Figure> a collection of figures that were copied or cut from a drawing (for cut/paste operations)
</body>
</comment>
<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>
<comment>
<class-id>Refactory.HotDraw.DrawingEditor</class-id>
<body>DrawingEditor is the ApplicationModel for a Drawing.
Instance Variables:
buttons <SelectionInList of: ButtonDescription> the selection in list of all our tools
drawing <Drawing> our drawing
</body>
</comment>
<class>
<name>PolylineFigure</name>
<environment>Refactory.HotDraw</environment>
<super>Refactory.HotDraw.Figure</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>points </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Figures</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.PolylineFigure</class-id>
<body>PolylineFigure is a figure that is represented by a series of points. The default polyline figure just draws straight lines between these points, but other subclasses can draw curved lines through the points. If this figure is filled, then the start and end points should be the same.
Instance Variables:
points <SequenceableCollection of: Point> our points
</body>
</comment>
<class>
<name>SplineFigure</name>
<environment>Refactory.HotDraw</environment>
<super>Refactory.HotDraw.PolylineFigure</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>spline </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Figures</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.SplineFigure</class-id>
<body>SplineFigure is a figure that represents a spline.
Instance Variables:
spline <Spline> the geometric spline object
</body>
</comment>
<class>
<name>DiamondAnnotation</name>
<environment>Refactory.HotDraw</environment>
<super>Refactory.HotDraw.ArrowAnnotation</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Figures</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.DiamondAnnotation</class-id>
<body>DiamondAnnotation is a line annotation that displays a diamond shape at the end of line (similar to those in some case tool diagrams).</body>
</comment>
<class>
<name>CharacterTransitionTable</name>
<environment>Refactory.HotDraw</environment>
<super>Refactory.HotDraw.TransitionTable</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>characterMap </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Tools</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.CharacterTransitionTable</class-id>
<body>CharacterTransitionTable is a transition table for characters. It decides our next state by looking at a table of characters (or symbols for special keys -- #F1).
Instance Variables:
characterMap <SequenceableCollection of: (Association key: String value: EndToolState)> a mapping for characters to the next state
</body>
</comment>
<class>
<name>BezierFigure</name>
<environment>Refactory.HotDraw</environment>
<super>Refactory.HotDraw.PolylineFigure</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>bezier </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Figures</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.BezierFigure</class-id>
<body>BezierFigure represents a bezier curve.
Instance Variables:
bezier <Bezier> our curve
</body>
</comment>
<class>
<name>LineFigure</name>
<environment>Refactory.HotDraw</environment>
<super>Refactory.HotDraw.PolylineFigure</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>annotations </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Figures</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.LineFigure</class-id>
<body>LineFigure is a special PolylineFigure that can add annotations to its start and end points. These annotations can be arrows, circles, etc.
Instance Variables:
annotations <SequenceableCollection of: LineAnnotation> the annotations to display on our line
</body>
</comment>
<class>
<name>CircleAnnotation</name>
<environment>Refactory.HotDraw</environment>
<super>Refactory.HotDraw.LineAnnotation</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>radius </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Figures</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.CircleAnnotation</class-id>
<body>CircleAnnotation is a line annotation that displays a circle at the end of the line.
Instance Variables:
radius <Integer> the radius of the circle to display
</body>
</comment>
<class>
<name>ToolState</name>
<environment>Refactory.HotDraw</environment>
<super>Refactory.HotDraw.EndToolState</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>keyPress keyRelease mouseMove redButtonPress redButtonRelease yellowButtonPress yellowButtonRelease doubleClick immediate </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Tools</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.ToolState</class-id>
<body>ToolState is a state in a Tool's state machine. It inherits its action from its superclass, and has several transition tables. One for each type of event that can be processed.
Instance Variables:
doubleClick <TransitionTable> where to go to for a double click event
keyPress <TransitionTable> ...
keyRelease <TransitionTable>
mouseMove <TransitionTable>
redButtonPress <TransitionTable>
redButtonRelease <TransitionTable>
yellowButtonPress <TransitionTable>
yellowButtonRelease <TransitionTable>
</body>
</comment>
<class>
<name>Tool</name>
<environment>Refactory.HotDraw</environment>
<super>Core.Object</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>controller cursor currentState initialState passInputDown data figure </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Tools</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.Tool</class-id>
<body>Tool are used by drawings to manipulate the figures. They represent different strategies for manipulation. They contain a state diagram that describes their actions.
Instance Variables:
controller <DrawingController> the controller for the drawing
currentState <ToolState> the state we're currently in
cursor <Cursor> the cursor that should be displayed
data <Dictionary> data that can be passed from one state to another
figure <Figure> the figure that the current event is for (this is used for efficiency)
initialState <ToolState> the state that this tool initially starts in
passInputDown <Boolean> should we pass input through to subviews or consume it ourselves
Class Variables:
Debug <Boolean> when set to true, prints the state name to the transcript when it is enter
States <Dictionary key: String value: EndToolState> our collection of tool states
</body>
</comment>
<class>
<name>TentativePositionHandle</name>
<environment>Refactory.HotDraw</environment>
<super>Refactory.HotDraw.TrackHandle</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>index </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Handles</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.TentativePositionHandle</class-id>
<body>TentativePositionHandle is a special handle that allows the user to create a new point on the line. Normally it is displayed between two real points on the line.
Instance Variables:
index <Index> the index of the new point
</body>
</comment>
<class>
<name>ArcFigure</name>
<environment>Refactory.HotDraw</environment>
<super>Refactory.HotDraw.EllipseFigure</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>startAngle stopAngle </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>HotDraw-Figures</category>
<attributes>
<package>HotDraw Framework</package>
</attributes>
</class>
<comment>
<class-id>Refactory.HotDraw.ArcFigure</class-id>
<body>ArcFigure is a figure that represents an EllipticalArc.
Instance Variables: