ArrowedSpline.st
author Claus Gittinger <cg@exept.de>
Sat, 02 May 2020 21:40:13 +0200
changeset 5476 7355a4b11cb6
parent 2154 0c5cc2edf99c
permissions -rw-r--r--
#FEATURE by cg class: Socket class added: #newTCPclientToHost:port:domain:domainOrder:withTimeout: changed: #newTCPclientToHost:port:domain:withTimeout:
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
"
1303
6ca5f36cdc63 category
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
    12
"{ Package: 'stx:libbasic2' }"
6ca5f36cdc63 category
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
    13
328
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:''
1303
6ca5f36cdc63 category
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
    18
	category:'Graphics-Geometry-Objects'
328
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
examples
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
  arrowedspline:
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
                                                                        [exBegin]
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
    |v a|
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
    v := View extent:100@100.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
    a := ArrowedSpline controlPoints:
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
                (Array with:(20@20)
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
                       with:(80@80)
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
                       with:(20@80)).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
    v addComponent:((StrokingWrapper on:a) foregroundColor:Color red).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
    v open.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
                                                                        [exEnd]
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
  filled arrow:
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
                                                                        [exBegin]
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
    |v a|
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
    v := View extent:100@100.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
    a := ArrowedSpline controlPoints:
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
                (Array with:(20@20)
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
                       with:(80@80)
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
                       with:(20@50)
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
                       with:(90@10)).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
    v addComponent:((FillingWrapper on:a) foregroundColor:Color red).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
    v open.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
                                                                        [exEnd]
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
  more arrowHeads:
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
                                                                        [exBegin]
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
    |v a|
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
    v := View extent:100@100.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
    a := ArrowedSpline controlPoints:
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
                (Array with:(20@20)
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
                       with:(80@80)
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
                       with:(20@50)
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
                       with:(90@10)).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
    a arrowHeadPositions:#(1 4).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
    v addComponent:((FillingWrapper on:a) foregroundColor:Color red).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
    v open.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
                                                                        [exEnd]
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
  interactive:
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
                                                                        [exBegin]
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
    |v points eventCatcher|
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
    v := StandardSystemView extent:(450 @ 450).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
    v label:'ArrowedSpline Example - (click left/middle)'.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
    points := OrderedCollection new.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
    v openAndWait.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
    eventCatcher := Plug new.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
    eventCatcher respondTo:#handlesButtonPress:inView:
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
                      with:[:butt :view | true].
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
    eventCatcher respondTo:#buttonPress:x:y:view:
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
                      with:[:butt :x :y :view | 
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
                            v paint:(Color white).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
                            v fillCircle:(x @ y) radius:3.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
                            points add:(x @ y).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
                            (butt == 1 or:[butt == #select]) ifFalse:[
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
                                v paint:(Color white).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
                                v fillCircle:(x @ y) radius:3.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
329
1cff986b121c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   124
                                ((ArrowedSpline controlPoints:points)
1cff986b121c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   125
                                        arrowHeadPositions:(1 to:points size);
1cff986b121c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   126
                                        arrowHeadLength:15)
1cff986b121c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   127
                                        displayStrokedOn:v.
328
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
                                points := OrderedCollection new.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
                            ]
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
    v delegate:(eventCatcher)
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
                                                                        [exEnd]
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
"
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
!ArrowedSpline methodsFor:'accessing'!
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
arrowHeadAngle
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
    "return the arrowHeads angle, in degrees.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
     The default is defined in Arrow (150 degrees)"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
    arrowHeadAngle isNil ifTrue:[^ Arrow defaultAngle].
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
    ^ arrowHeadAngle
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
    "Created: 12.5.1996 / 23:13:27 / cg"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
    "Modified: 12.5.1996 / 23:14:15 / cg"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
!
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
arrowHeadAngle:angleInDegrees
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
    "set the arrowHeads angle, in degrees.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
     The default is defined in Arrow (150 degrees)"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
    arrowHeadAngle := angleInDegrees
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
    "Created: 12.5.1996 / 23:13:34 / cg"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
    "Modified: 12.5.1996 / 23:14:24 / cg"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
!
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
arrowHeadLength
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
    "return the arrowHeads length, in pixels.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
     The default is define in Arrow (8 pixels)"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
    arrowHeadLength isNil ifTrue:[^ Arrow defaultLength].
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
    ^ arrowHeadLength
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
    "Modified: 13.5.1996 / 00:44:30 / cg"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
!
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
arrowHeadLength:pixels
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
    "set the arrowHeads length, in pixels.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
     The default is defined in Arrow (8 pixels)"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
    arrowHeadLength := pixels
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
    "Created: 12.5.1996 / 23:15:34 / cg"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
!
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
arrowHeadPositions:collectionOfPositions
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
    "set the arrowHeads positions. Each collections element gives
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
     theindex of a controlPoint, on which an arrowHead is drawn.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
     The default is #(<controlPoints size>) i.e. a single arrowHead
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
     on the last controlPoint.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
     To have arrowHeads on all controlPoints, define arrowHeadPositions
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
     as (1 to:controlPoints size)"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
    arrowHeadPositions := collectionOfPositions
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
    "Modified: 12.5.1996 / 23:14:24 / cg"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
    "Created: 13.5.1996 / 00:47:23 / cg"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
! !
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
!ArrowedSpline methodsFor:'displaying'!
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
359
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   196
arrowPoints
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   197
    "helper: return a collection of arrow-points"
328
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
    |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
   200
     savedLineStyle atn x1 x2 y1 y2 p1 p2 points i|
328
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
389
49811300b9d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 374
diff changeset
   202
    firstDerivative isNil ifTrue:[
49811300b9d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 374
diff changeset
   203
        self computeLineSegments
49811300b9d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 374
diff changeset
   204
    ].
49811300b9d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 374
diff changeset
   205
328
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
    positions := arrowHeadPositions.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
    positions isNil ifTrue:[
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
        positions := Array with:(controlPoints size).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
    ].
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
    len := arrowHeadLength.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
    len isNil ifTrue:[
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
        len := Arrow defaultLength
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
    ].
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
    angle := arrowHeadAngle.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
    angle isNil ifTrue:[
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
        angle := Arrow defaultAngle
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
    ].
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   220
    angle := angle degreesToRadians.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
359
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   222
    points := Array new:(positions size * 3).
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   223
    i := 1.
328
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
    positions do:[:index |
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
        | p deriv|
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
        p := controlPoints at:index.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
        deriv := (firstDerivative at:index).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
        deriv isNil ifTrue:[
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
            deriv := (controlPoints at:index) - (controlPoints at:index-1).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
        ].
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
        deriv x = 0
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
                    ifTrue: [grad := 9999999]
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
                    ifFalse: [grad := deriv y / deriv x].
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
        atn := grad arcTan.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
        x1 := len * (angle - atn) cos.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
        y1 := 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
        x2 := len * (angle + atn) cos.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
        y2 := len * (angle + atn) sin.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
        deriv x = 0 ifTrue: [
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
            deriv y > 0 ifTrue: [
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
                p1 := x1 @ (0 - y1).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
                p2 := x2 @ (y2).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
            ] ifFalse: [
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
                p1 := 0 - x1 @ (y1).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
                p2 := 0 - x2 @ (0 - y2).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
            ]
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
        ] ifFalse: [
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
            deriv x > 0 ifTrue:[
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
                p1 := x1 @ (0 - y1).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
                p2 := x2 @ (y2).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
            ] ifFalse: [
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
                p1 := 0 - x1 @ (y1).
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
                p2 := 0 - x2 @ (0 - y2)
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   260
            ]
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   261
        ].
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   262
359
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   263
        points at:i   put:p+p1.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   264
        points at:i+1 put:p.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   265
        points at:i+2 put:p+p2.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   266
        i := i + 3
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
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   269
    ^ points
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
    "Created: 13.5.1996 / 00:50:49 / cg"
389
49811300b9d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 374
diff changeset
   272
    "Modified: 5.6.1996 / 20:29:17 / cg"
359
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   273
!
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
displayArrowsOn:aGC filled:filled
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   276
    "display the receiver in the graphicsContext, aGC"
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
    |arrowPoints savedLineStyle nP "{Class: SmallInteger }"
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   279
     p1 p p2|
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
    savedLineStyle := aGC lineStyle.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   282
    aGC lineStyle:#solid.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   283
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   284
    arrowPoints := self arrowPoints.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   285
    nP := arrowPoints size.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   286
    1 to:nP by:3 do:[:i |
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   287
        p1 := arrowPoints at:i.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   288
        p := arrowPoints at:i+1.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   289
        p2 := arrowPoints at:i+2.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   290
328
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   291
        filled ifTrue:[
359
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   292
            aGC fillPolygon:(Array with:p1 with:p with:p2).
328
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   293
        ] ifFalse:[
359
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   294
            aGC displayLineFrom:p to:p1.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   295
            aGC displayLineFrom:p to:p2.
328
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
        ].
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   297
    ].
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   299
    aGC lineStyle:savedLineStyle.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   300
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   301
    "Created: 13.5.1996 / 00:50:49 / cg"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
    "Modified: 13.5.1996 / 00:52:17 / cg"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   303
!
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   304
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   305
displayFilledOn:aGC
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   306
    "display the receiver in the graphicsContext, aGC"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   307
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   308
    super displayStrokedOn:aGC.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   309
    self displayArrowsOn:aGC filled:true
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   310
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   311
    "Created: 13.5.1996 / 00:51:14 / cg"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   312
!
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   313
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   314
displayStrokedOn:aGC
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   315
    "display the receiver in the graphicsContext, aGC"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   316
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   317
    super displayStrokedOn:aGC.
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   318
    self displayArrowsOn:aGC filled:false
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   319
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   320
    "Created: 13.5.1996 / 00:51:14 / cg"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   321
    "Modified: 13.5.1996 / 00:52:34 / cg"
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   322
! !
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   323
359
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   324
!ArrowedSpline methodsFor:'queries'!
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   325
490
ef43c7a69346 added dummy Scale & InverseScale classVars.
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   326
computeBounds
359
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   327
    "return the smallest enclosing rectangle"
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   328
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   329
    |minX maxX minY maxY|
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
    minX := maxX := 0.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   332
    minY := maxY := 0.
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
    self arrowPoints do:[:p |
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   335
        |x y|
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   336
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   337
        x := p x.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   338
        y := p y.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   339
        minX := minX min:x.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   340
        maxX := maxX max:x.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   341
        minY := minY min:y.
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   342
        maxY := maxY max:y.
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
    ^ 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
   345
43a2b6857bc6 fixed bounds computation (care for arrows)
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   346
    "Modified: 26.5.1996 / 13:08:48 / cg"
490
ef43c7a69346 added dummy Scale & InverseScale classVars.
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   347
    "Created: 12.2.1997 / 11:42:41 / cg"
359
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
2154
0c5cc2edf99c category changes
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   350
!ArrowedSpline methodsFor:'testing'!
0c5cc2edf99c category changes
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   351
0c5cc2edf99c category changes
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   352
canBeFilled
0c5cc2edf99c category changes
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   353
    "return true, if the receiver can be drawn as a filled geometric.
0c5cc2edf99c category changes
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   354
     Always true here. Notice, that only the arrowHeads are filled."
0c5cc2edf99c category changes
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   355
0c5cc2edf99c category changes
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   356
    ^ true
0c5cc2edf99c category changes
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   357
0c5cc2edf99c category changes
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   358
! !
0c5cc2edf99c category changes
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   359
328
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   360
!ArrowedSpline class methodsFor:'documentation'!
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   361
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   362
version
2154
0c5cc2edf99c category changes
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   363
    ^ '$Header: /cvs/stx/stx/libbasic2/ArrowedSpline.st,v 1.10 2009-06-06 10:12:15 cg Exp $'
328
70e08b3162b0 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   364
! !