ArrowedSpline.st
author Claus Gittinger <cg@exept.de>
Sun, 26 May 1996 16:32:07 +0200
changeset 359 43a2b6857bc6
parent 331 9ad8e3f94da5
child 374 a77f804c605e
permissions -rw-r--r--
fixed bounds computation (care for arrows)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
328
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 1996 by Claus Gittinger
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
              All Rights Reserved
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
Spline subclass:#ArrowedSpline
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
	instanceVariableNames:'arrowHeadPositions arrowHeadLength arrowHeadAngle'
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	classVariableNames:''
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'Graphics-Geometry'
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!ArrowedSpline class methodsFor:'documentation'!
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
copyright
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
 COPYRIGHT (c) 1996 by Claus Gittinger
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
              All Rights Reserved
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
 This software is furnished under a license and may be used
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
 only in accordance with the terms of that license and with the
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 be provided or otherwise made available to, or used by, any
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 other person.  No title to or ownership of the software is
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 hereby transferred.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
!
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
documentation
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
    ArrowedSplines are like infilled splines, with arrowHeads.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
    [see also:]
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
        Polygon LineSegment Circle EllipticalArc 
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
        Rectangle Curve Arrow Spline
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
        GraphicsContext
331
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
    46
        StrokingWrapper FillingWrapper
328
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
    [author:]
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
        Claus Gittinger
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
!
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
examples
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
  arrowedspline:
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
                                                                        [exBegin]
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
    |v a|
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
    v := View extent:100@100.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
    a := ArrowedSpline controlPoints:
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
                (Array with:(20@20)
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
                       with:(80@80)
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
                       with:(20@80)).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
    v addComponent:((StrokingWrapper on:a) foregroundColor:Color red).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
    v open.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
                                                                        [exEnd]
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
  filled arrow:
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
                                                                        [exBegin]
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
    |v a|
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
    v := View extent:100@100.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
    a := ArrowedSpline controlPoints:
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
                (Array with:(20@20)
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
                       with:(80@80)
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
                       with:(20@50)
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
                       with:(90@10)).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
    v addComponent:((FillingWrapper on:a) foregroundColor:Color red).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
    v open.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
                                                                        [exEnd]
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
  more arrowHeads:
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
                                                                        [exBegin]
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
    |v a|
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
    v := View extent:100@100.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
    a := ArrowedSpline controlPoints:
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
                (Array with:(20@20)
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
                       with:(80@80)
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
                       with:(20@50)
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
                       with:(90@10)).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
    a arrowHeadPositions:#(1 4).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
    v addComponent:((FillingWrapper on:a) foregroundColor:Color red).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
    v open.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
                                                                        [exEnd]
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
  interactive:
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
                                                                        [exBegin]
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
    |v points eventCatcher|
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
    v := StandardSystemView extent:(450 @ 450).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
    v label:'ArrowedSpline Example - (click left/middle)'.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
    points := OrderedCollection new.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
    v openAndWait.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
    eventCatcher := Plug new.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
    eventCatcher respondTo:#handlesButtonPress:inView:
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
                      with:[:butt :view | true].
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
    eventCatcher respondTo:#buttonPress:x:y:view:
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
                      with:[:butt :x :y :view | 
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
                            v paint:(Color white).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
                            v fillCircle:(x @ y) radius:3.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
                            points add:(x @ y).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
                            (butt == 1 or:[butt == #select]) ifFalse:[
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
                                v paint:(Color white).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
                                v fillCircle:(x @ y) radius:3.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
329
1cff986b121c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   125
                                ((ArrowedSpline controlPoints:points)
1cff986b121c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   126
                                        arrowHeadPositions:(1 to:points size);
1cff986b121c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   127
                                        arrowHeadLength:15)
1cff986b121c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   128
                                        displayStrokedOn:v.
328
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
                                points := OrderedCollection new.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
                            ]
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
                           ].
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
    v delegate:(eventCatcher)
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
                                                                        [exEnd]
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
! !
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
!ArrowedSpline methodsFor:'accessing'!
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
arrowHeadAngle
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
    "return the arrowHeads angle, in degrees.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
     The default is defined in Arrow (150 degrees)"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
    arrowHeadAngle isNil ifTrue:[^ Arrow defaultAngle].
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
    ^ arrowHeadAngle
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
    "Created: 12.5.1996 / 23:13:27 / cg"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
    "Modified: 12.5.1996 / 23:14:15 / cg"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
!
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
arrowHeadAngle:angleInDegrees
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
    "set the arrowHeads angle, in degrees.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
     The default is defined in Arrow (150 degrees)"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
    arrowHeadAngle := angleInDegrees
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
    "Created: 12.5.1996 / 23:13:34 / cg"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
    "Modified: 12.5.1996 / 23:14:24 / cg"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
!
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
arrowHeadLength
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
    "return the arrowHeads length, in pixels.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
     The default is define in Arrow (8 pixels)"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
    arrowHeadLength isNil ifTrue:[^ Arrow defaultLength].
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
    ^ arrowHeadLength
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
    "Modified: 13.5.1996 / 00:44:30 / cg"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
!
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
arrowHeadLength:pixels
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
    "set the arrowHeads length, in pixels.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
     The default is defined in Arrow (8 pixels)"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
    arrowHeadLength := pixels
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
    "Created: 12.5.1996 / 23:15:34 / cg"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
!
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
arrowHeadPositions:collectionOfPositions
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
    "set the arrowHeads positions. Each collections element gives
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
     theindex of a controlPoint, on which an arrowHead is drawn.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
     The default is #(<controlPoints size>) i.e. a single arrowHead
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
     on the last controlPoint.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
     To have arrowHeads on all controlPoints, define arrowHeadPositions
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
     as (1 to:controlPoints size)"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
    arrowHeadPositions := collectionOfPositions
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
    "Modified: 12.5.1996 / 23:14:24 / cg"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
    "Created: 13.5.1996 / 00:47:23 / cg"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
! !
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
!ArrowedSpline methodsFor:'displaying'!
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
359
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   197
arrowPoints
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   198
    "helper: return a collection of arrow-points"
328
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
    |arrowHeadPoint len pos positions angle point grad xDis yDis
359
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   201
     savedLineStyle atn x1 x2 y1 y2 p1 p2 points i|
328
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
    positions := arrowHeadPositions.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
    positions isNil ifTrue:[
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
        positions := Array with:(controlPoints size).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
    ].
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
    len := arrowHeadLength.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
    len isNil ifTrue:[
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
        len := Arrow defaultLength
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
    ].
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
    angle := arrowHeadAngle.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
    angle isNil ifTrue:[
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
        angle := Arrow defaultAngle
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
    ].
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
    angle := angle degreesToRadians.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
359
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   219
    points := Array new:(positions size * 3).
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   220
    i := 1.
328
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
    positions do:[:index |
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
        | p deriv|
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   223
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
        p := controlPoints at:index.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
        deriv := (firstDerivative at:index).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
        deriv isNil ifTrue:[
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
            deriv := (controlPoints at:index) - (controlPoints at:index-1).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
        ].
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
        deriv x = 0
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
                    ifTrue: [grad := 9999999]
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
                    ifFalse: [grad := deriv y / deriv x].
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
        atn := grad arcTan.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
        x1 := len * (angle - atn) cos.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
        y1 := len * (angle - atn) sin.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
        x2 := len * (angle + atn) cos.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
        y2 := len * (angle + atn) sin.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
        deriv x = 0 ifTrue: [
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
            deriv y > 0 ifTrue: [
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
                p1 := x1 @ (0 - y1).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
                p2 := x2 @ (y2).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
            ] ifFalse: [
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
                p1 := 0 - x1 @ (y1).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
                p2 := 0 - x2 @ (0 - y2).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
            ]
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
        ] ifFalse: [
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
            deriv x > 0 ifTrue:[
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
                p1 := x1 @ (0 - y1).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
                p2 := x2 @ (y2).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
            ] ifFalse: [
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
                p1 := 0 - x1 @ (y1).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
                p2 := 0 - x2 @ (0 - y2)
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
            ]
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
        ].
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
359
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   260
        points at:i   put:p+p1.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   261
        points at:i+1 put:p.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   262
        points at:i+2 put:p+p2.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   263
        i := i + 3
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   264
    ].
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   265
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   266
    ^ points
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   267
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   268
    "Created: 13.5.1996 / 00:50:49 / cg"
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   269
    "Modified: 13.5.1996 / 00:52:17 / cg"
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   270
!
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   271
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   272
displayArrowsOn:aGC filled:filled
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   273
    "display the receiver in the graphicsContext, aGC"
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   274
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   275
    |arrowPoints savedLineStyle nP "{Class: SmallInteger }"
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   276
     p1 p p2|
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   277
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   278
    savedLineStyle := aGC lineStyle.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   279
    aGC lineStyle:#solid.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   280
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   281
    arrowPoints := self arrowPoints.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   282
    nP := arrowPoints size.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   283
    1 to:nP by:3 do:[:i |
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   284
        p1 := arrowPoints at:i.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   285
        p := arrowPoints at:i+1.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   286
        p2 := arrowPoints at:i+2.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   287
328
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
        filled ifTrue:[
359
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   289
            aGC fillPolygon:(Array with:p1 with:p with:p2).
328
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   290
        ] ifFalse:[
359
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   291
            aGC displayLineFrom:p to:p1.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   292
            aGC displayLineFrom:p to:p2.
328
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   293
        ].
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   294
    ].
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   295
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
    aGC lineStyle:savedLineStyle.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   297
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
    "Created: 13.5.1996 / 00:50:49 / cg"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   299
    "Modified: 13.5.1996 / 00:52:17 / cg"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   300
!
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   301
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
displayFilledOn:aGC
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   303
    "display the receiver in the graphicsContext, aGC"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   304
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   305
    super displayStrokedOn:aGC.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   306
    self displayArrowsOn:aGC filled:true
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   307
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   308
    "Created: 13.5.1996 / 00:51:14 / cg"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   309
!
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   310
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   311
displayStrokedOn:aGC
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   312
    "display the receiver in the graphicsContext, aGC"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   313
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   314
    super displayStrokedOn:aGC.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   315
    self displayArrowsOn:aGC filled:false
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   316
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   317
    "Created: 13.5.1996 / 00:51:14 / cg"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   318
    "Modified: 13.5.1996 / 00:52:34 / cg"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   319
! !
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   320
359
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   321
!ArrowedSpline methodsFor:'queries'!
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   322
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   323
bounds
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   324
    "return the smallest enclosing rectangle"
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   325
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   326
    |minX maxX minY maxY|
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   327
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   328
    minX := maxX := 0.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   329
    minY := maxY := 0.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   330
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   331
    self arrowPoints do:[:p |
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   332
        |x y|
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   333
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   334
        x := p x.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   335
        y := p y.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   336
        minX := minX min:x.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   337
        maxX := maxX max:x.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   338
        minY := minY min:y.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   339
        maxY := maxY max:y.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   340
    ].    
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   341
    ^ Rectangle left:minX right:maxX top:minY bottom:maxY
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   342
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   343
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   344
    "Created: 26.5.1996 / 13:06:48 / cg"
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   345
    "Modified: 26.5.1996 / 13:08:48 / cg"
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   346
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   347
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   348
! !
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   349
328
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   350
!ArrowedSpline class methodsFor:'documentation'!
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   351
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   352
version
359
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   353
    ^ '$Header: /cvs/stx/stx/libbasic2/ArrowedSpline.st,v 1.4 1996-05-26 14:32:07 cg Exp $'
328
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   354
! !