Arrow.st
author Stefan Vogel <sv@exept.de>
Wed, 21 Nov 2007 18:24:07 +0100
changeset 1917 61c602336f3d
parent 1626 8a0e7e7151b9
child 1930 935b2870be2e
permissions -rw-r--r--
Clean up code and document differences between #add: and #addLast:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
318
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 1996 by Claus Gittinger
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
              All Rights Reserved
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
455
9789991dd799 do not draw the line in the filled part
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
    12
979
df76c50c02ac comment
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
    13
"{ Package: 'stx:libbasic2' }"
df76c50c02ac comment
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
    14
318
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
LineSegment subclass:#Arrow
728
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
    16
	instanceVariableNames:'arrowHeadPosition arrowHeadLength arrowHeadAngle arrowHeadClosed'
318
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	classVariableNames:'DefaultLength DefaultAngle'
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	poolDictionaries:''
1303
6ca5f36cdc63 category
Claus Gittinger <cg@exept.de>
parents: 979
diff changeset
    19
	category:'Graphics-Geometry-Objects'
318
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
!
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
!Arrow class methodsFor:'documentation'!
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
copyright
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
"
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
 COPYRIGHT (c) 1996 by Claus Gittinger
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
              All Rights Reserved
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
 This software is furnished under a license and may be used
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 only in accordance with the terms of that license and with the
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 inclusion of the above copyright notice.   This software may not
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 be provided or otherwise made available to, or used by, any
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 other person.  No title to or ownership of the software is
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 hereby transferred.
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
"
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
!
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
documentation
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
"
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
    Arrows are just what the name says - a directed LineSegment, which
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
    draws itself with an arrowHead. The position of the arrowhead can
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
    be set to be anywhere along the lineSegement (default is at the end).
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
323
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
    44
    Arrows can be drawn stroked or filled - when filled, only the arrowHead
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
    45
    is filled.
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
    46
318
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    [author:]
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
        Claus Gittinger
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    [see also:]
320
14e3290c1c0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 318
diff changeset
    51
        Rectangle Polygon EllipticalArc Circle Spline Curve Point 
331
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
    52
        LineSegment ArrowedSpline 
318
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
        GraphicsContext
331
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
    54
        StrokingWrapper FillingWrapper
318
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
"
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
!
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
examples
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
"
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
  low level use:
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
                                                                        [exBegin]
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
    |v a|
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
    v := (View extent:100@100) openAndWait.
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
    a := Arrow from:10@10 to:90@90. 
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
    v paint:Color red.
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
    a displayStrokedOn:v.
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
    a start:90@10 end:10@90.
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
    v paint:Color blue.
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
    a displayStrokedOn:v.
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
                                                                        [exEnd]
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
728
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
    76
  with closed arrowHead:
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
    77
                                                                        [exBegin]
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
    78
    |v a|
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
    79
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
    80
    v := (View extent:100@100) openAndWait.
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
    81
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
    82
    a := Arrow from:10@10 to:90@90. 
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
    83
    a arrowHeadClosed:true.
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
    84
    v paint:Color red.
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
    85
    a displayStrokedOn:v.
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
    86
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
    87
    a start:90@10 end:10@90.
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
    88
    v paint:Color blue.
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
    89
    a displayStrokedOn:v.
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
    90
                                                                        [exEnd]
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
    91
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
    92
  with longer closed arrowHead:
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
    93
                                                                        [exBegin]
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
    94
    |v a|
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
    95
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
    96
    v := (View extent:100@100) openAndWait.
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
    97
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
    98
    a := Arrow from:10@10 to:90@90. 
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
    99
    a arrowHeadClosed:true.
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   100
    a arrowHeadLength:16.
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   101
    v paint:Color red.
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   102
    a displayStrokedOn:v.
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   103
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   104
    a start:90@10 end:10@90.
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   105
    v paint:Color blue.
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   106
    a displayStrokedOn:v.
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   107
                                                                        [exEnd]
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   108
325
f4835579dc09 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 324
diff changeset
   109
  as component (automatic redraw):
f4835579dc09 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 324
diff changeset
   110
                                                                        [exBegin]
f4835579dc09 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 324
diff changeset
   111
    |v a|
f4835579dc09 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 324
diff changeset
   112
f4835579dc09 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 324
diff changeset
   113
    v := View extent:100@100.
f4835579dc09 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 324
diff changeset
   114
f4835579dc09 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 324
diff changeset
   115
    a := Arrow from:50@50 to:10@10. 
f4835579dc09 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 324
diff changeset
   116
    v addComponent:(StrokingWrapper on:a).
f4835579dc09 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 324
diff changeset
   117
f4835579dc09 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 324
diff changeset
   118
    a := Arrow from:50@50 to:90@10. 
f4835579dc09 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 324
diff changeset
   119
    v addComponent:(StrokingWrapper on:a).
f4835579dc09 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 324
diff changeset
   120
f4835579dc09 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 324
diff changeset
   121
    a := Arrow from:50@50 to:10@90. 
f4835579dc09 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 324
diff changeset
   122
    v addComponent:(StrokingWrapper on:a).
f4835579dc09 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 324
diff changeset
   123
f4835579dc09 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 324
diff changeset
   124
    a := Arrow from:50@50 to:90@90. 
f4835579dc09 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 324
diff changeset
   125
    v addComponent:(StrokingWrapper on:a).
f4835579dc09 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 324
diff changeset
   126
f4835579dc09 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 324
diff changeset
   127
    v open
f4835579dc09 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 324
diff changeset
   128
                                                                        [exEnd]
f4835579dc09 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 324
diff changeset
   129
f4835579dc09 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 324
diff changeset
   130
  as component filled vs. stroked:
323
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   131
                                                                        [exBegin]
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   132
    |v a|
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   133
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   134
    v := View extent:100@100.
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   135
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   136
    a := Arrow from:10@10 to:90@10. 
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   137
    v addComponent:(StrokingWrapper on:a).
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   138
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   139
    a := Arrow from:90@20 to:10@20. 
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   140
    v addComponent:(StrokingWrapper on:a).
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   141
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   142
    a := Arrow from:10@50 to:90@50. 
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   143
    v addComponent:(FillingWrapper on:a).
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   144
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   145
    a := Arrow from:90@60 to:10@60. 
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   146
    v addComponent:(FillingWrapper on:a).
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   147
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   148
    v open
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   149
                                                                        [exEnd]
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   150
324
1a318dec0fd7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 323
diff changeset
   151
  as component (varying lineStyles):
318
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
                                                                        [exBegin]
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
    |v a|
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
    v := View extent:100@100.
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
    a := Arrow from:10@10 to:90@90. 
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
    v addComponent:(StrokingWrapper on:a).
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
    a := Arrow from:10@10 to:90@10.
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
    a arrowHeadPosition:0.5.
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
    v addComponent:(StrokingWrapper on:a).
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
    a := Arrow from:90@10 to:10@90. 
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
    v addComponent:((StrokingWrapper on:a) foregroundColor:(Color red)).
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
    a := Arrow from:10@50 to:90@50. 
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
    a arrowHeadLength:20; arrowHeadAngle:130.
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
    v addComponent:((StrokingWrapper on:a) 
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
                        lineWidth:5;
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
                        foregroundColor:(Color red)).
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
    a := Arrow from:50@90 to:50@10. 
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
    a arrowHeadLength:10; arrowHeadAngle:170.
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
    v addComponent:((StrokingWrapper on:a) 
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
                        lineWidth:2;
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
                        lineStyle:#dashed;
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
                        foregroundColor:(Color red);
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
                        backgroundColor:(Color yellow)).
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
    v open.
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
                                                                        [exEnd]
321
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   185
  varying the position:
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   186
                                                                        [exBegin]
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   187
    |v a|
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   188
323
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   189
    v := View extent:200@100.
321
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   190
323
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   191
    a := Arrow from:10@10 to:90@10. 
321
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   192
    a arrowHeadPosition:0.
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   193
    v addComponent:(StrokingWrapper on:a).
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   194
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   195
    a := Arrow from:10@30 to:90@30. 
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   196
    a arrowHeadPosition:(1/3).
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   197
    v addComponent:(StrokingWrapper on:a).
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   198
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   199
    a := Arrow from:10@40 to:90@40. 
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   200
    a arrowHeadPosition:0.5.
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   201
    v addComponent:(StrokingWrapper on:a).
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   202
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   203
    a := Arrow from:10@50 to:90@50. 
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   204
    a arrowHeadPosition:(2/3).
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   205
    v addComponent:(StrokingWrapper on:a).
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   206
323
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   207
    a := Arrow from:10@70 to:90@70. 
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   208
    v addComponent:(StrokingWrapper on:a).
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   209
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   210
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   211
    a := Arrow from:100@10 to:150@90.
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   212
    a arrowHeadPosition:(1/3).
326
2be7d1d78659 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
   213
    v addComponent:(FillingWrapper on:a).
323
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   214
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   215
    a := Arrow from:110@10 to:160@90.
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   216
    a arrowHeadPosition:(2/3).
326
2be7d1d78659 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
   217
    v addComponent:(FillingWrapper on:a).
323
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   218
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   219
    a := Arrow from:120@10 to:170@90.
326
2be7d1d78659 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
   220
    v addComponent:(FillingWrapper on:a).
321
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   221
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   222
    v open.
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   223
                                                                        [exEnd]
318
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
"
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
! !
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
!Arrow class methodsFor:'initialization'!
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
initialize
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
    DefaultAngle := 150.
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
    DefaultLength := 8
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
    "
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
     Arrow initialize
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
    "
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
! !
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
321
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   238
!Arrow class methodsFor:'accessing defaults'!
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   239
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   240
defaultAngle
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   241
    ^ DefaultAngle
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   242
!
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   243
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   244
defaultLength
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   245
    ^ DefaultLength
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   246
! !
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   247
318
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
!Arrow methodsFor:'accessing'!
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
arrowHeadAngle
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
    "return the arrowHeads angle, in degrees.
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
     The default is 150 degrees"
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
    arrowHeadAngle isNil ifTrue:[^ DefaultAngle].
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
    ^ arrowHeadAngle
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
    "Modified: 12.5.1996 / 22:48:29 / cg"
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
    "Created: 12.5.1996 / 22:56:36 / cg"
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
!
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   260
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   261
arrowHeadAngle:angleInDegrees
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   262
    "set the arrowHeads angle, in degrees.
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   263
     The default is 150 degrees"
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   265
    arrowHeadAngle := angleInDegrees
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   266
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   267
    "Modified: 12.5.1996 / 22:48:29 / cg"
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
    "Created: 12.5.1996 / 22:57:47 / cg"
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   269
!
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   270
728
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   271
arrowHeadClosed
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   272
    "return the arrowHeadClosed flag; if true, the arrowHead is drawn
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   273
     as a closed polygon; if false (the default), the arrowHead is drawn open.
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   274
     This only affects non-filled drawing."
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   275
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   276
    ^ arrowHeadClosed ? false
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   277
!
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   278
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   279
arrowHeadClosed:aBoolean
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   280
    "set the arrowHeadClosed flag; if true, the arrowHead is drawn
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   281
     as a closed polygon; if false (the default), the arrowHead is drawn open.
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   282
     This only affects non-filled drawing."
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   283
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   284
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   285
    arrowHeadClosed := aBoolean.
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   286
!
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   287
318
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
arrowHeadLength
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   289
    "return the arrowHeads length, in pixels.
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   290
     The default is 8 pixels"
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   291
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   292
    arrowHeadPosition isNil ifTrue:[^ DefaultLength].
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   293
    ^ arrowHeadLength
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   294
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   295
    "Created: 12.5.1996 / 22:47:32 / cg"
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
    "Modified: 12.5.1996 / 22:57:27 / cg"
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   297
!
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   299
arrowHeadLength:pixels
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   300
    "set the arrowHeads length, in pixels.
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   301
     The default is 8 pixels"
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   303
    arrowHeadLength := pixels
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   304
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   305
    "Created: 12.5.1996 / 22:47:48 / cg"
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   306
    "Modified: 12.5.1996 / 23:01:20 / cg"
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   307
!
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   308
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   309
arrowHeadPosition
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   310
    "return the arrowHeads position, as a fraction of the overall length;
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   311
     0 is at the beginning, 1 is at the end, 0.5 is in the center."
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   312
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   313
    arrowHeadPosition isNil ifTrue:[^ 1].
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   314
    ^ arrowHeadPosition
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   315
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   316
    "Created: 12.5.1996 / 22:46:21 / cg"
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   317
    "Modified: 12.5.1996 / 22:57:55 / cg"
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   318
!
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   319
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   320
arrowHeadPosition:aFractionOfTheLinesLength
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   321
    "set the arrowHeads position, as a fraction of the overall length;
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   322
     0 is at the beginning, 1 is at the end, 0.5 is in the center."
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   323
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   324
    arrowHeadPosition := aFractionOfTheLinesLength
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   325
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   326
    "Created: 12.5.1996 / 22:46:54 / cg"
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   327
    "Modified: 12.5.1996 / 23:01:09 / cg"
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   328
! !
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   329
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   330
!Arrow methodsFor:'displaying'!
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   331
729
bd9dfb8c9b17 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 728
diff changeset
   332
arrowPointsFor:sP and:eP
bd9dfb8c9b17 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 728
diff changeset
   333
    "return the arrowPoints for an arrow from sP to eP in a collection"
318
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   334
333
785f0e48fdb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   335
    |arrowHeadPoint len pos angle point grad x1 y1 x2 y2
729
bd9dfb8c9b17 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 728
diff changeset
   336
     savedLineStyle atn p1 p2 deriv dX dY|
318
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   337
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   338
    arrowHeadPosition isNil ifTrue:[
321
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   339
        pos := 1
318
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   340
    ] ifFalse:[
321
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   341
        pos := arrowHeadPosition max:0.0001.
318
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   342
    ].
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   343
729
bd9dfb8c9b17 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 728
diff changeset
   344
    arrowHeadPoint := sP + ((eP - sP) * pos).
321
49c7fd30093c kludge for position of 0
Claus Gittinger <cg@exept.de>
parents: 320
diff changeset
   345
318
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   346
    len := arrowHeadLength.
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   347
    len isNil ifTrue:[
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   348
        len := DefaultLength
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   349
    ].
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   350
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   351
    angle := arrowHeadAngle.
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   352
    angle isNil ifTrue:[
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   353
        angle := DefaultAngle
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   354
    ].
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   355
    angle := angle degreesToRadians.
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   356
729
bd9dfb8c9b17 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 728
diff changeset
   357
    deriv := arrowHeadPoint - sP.
333
785f0e48fdb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   358
    dX := deriv x.
785f0e48fdb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   359
    dY := deriv y.
785f0e48fdb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   360
785f0e48fdb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   361
    dX = 0 ifTrue: [
785f0e48fdb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   362
        grad := 99999999.9
785f0e48fdb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   363
    ] ifFalse: [
785f0e48fdb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   364
        grad := dY / dX
785f0e48fdb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   365
    ].
322
38c88d4b3976 avoid calling arcTan too often
Claus Gittinger <cg@exept.de>
parents: 321
diff changeset
   366
38c88d4b3976 avoid calling arcTan too often
Claus Gittinger <cg@exept.de>
parents: 321
diff changeset
   367
    atn := grad arcTan.
333
785f0e48fdb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   368
    x1 := len * (angle - atn) cos.
785f0e48fdb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   369
    y1 := len * (angle - atn) sin.
318
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   370
333
785f0e48fdb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   371
    x2 := len * (angle + atn) cos.
785f0e48fdb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   372
    y2 := len * (angle + atn) sin.
318
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   373
333
785f0e48fdb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   374
    dX = 0 ifTrue:[
785f0e48fdb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   375
        dY > 0 ifTrue:[
785f0e48fdb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   376
            p1 := (dX + x1) @ (dY - y1).
785f0e48fdb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   377
            p2 := (dX + x2) @ (dY + y2).
785f0e48fdb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   378
        ] ifFalse:[
785f0e48fdb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   379
            p1 := (dX - x1) @ (dY + y1).
785f0e48fdb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   380
            p2 := (dX - x2) @ (dY - y2).
785f0e48fdb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   381
        ]
785f0e48fdb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   382
    ] ifFalse:[
785f0e48fdb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   383
        dX > 0 ifTrue:[
785f0e48fdb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   384
            p1 := (dX + x1) @ (dY - y1).
785f0e48fdb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   385
            p2 := (dX + x2) @ (dY + y2).
785f0e48fdb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   386
        ] ifFalse:[
785f0e48fdb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   387
            p1 := (dX - x1) @ (dY + y1).
785f0e48fdb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   388
            p2 := (dX - x2) @ (dY - y2).
785f0e48fdb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   389
        ]
785f0e48fdb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   390
    ].
318
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   391
729
bd9dfb8c9b17 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 728
diff changeset
   392
    p1 := sP + p1.
bd9dfb8c9b17 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 728
diff changeset
   393
    p2 := sP + p2.
323
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   394
729
bd9dfb8c9b17 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 728
diff changeset
   395
    ^ Array with:p1 with:arrowHeadPoint with:p2.
354
909581778d57 checkin from browser
ca
parents: 333
diff changeset
   396
909581778d57 checkin from browser
ca
parents: 333
diff changeset
   397
    "Created: 12.5.1996 / 23:54:35 / cg"
909581778d57 checkin from browser
ca
parents: 333
diff changeset
   398
    "Modified: 13.5.1996 / 20:55:51 / cg"
909581778d57 checkin from browser
ca
parents: 333
diff changeset
   399
!
909581778d57 checkin from browser
ca
parents: 333
diff changeset
   400
387
bcd98f85086f dont draw the line twice
Claus Gittinger <cg@exept.de>
parents: 374
diff changeset
   401
displayFilledOn:aGC
bcd98f85086f dont draw the line twice
Claus Gittinger <cg@exept.de>
parents: 374
diff changeset
   402
    "display the receiver in the graphicsContext, aGC"
bcd98f85086f dont draw the line twice
Claus Gittinger <cg@exept.de>
parents: 374
diff changeset
   403
bcd98f85086f dont draw the line twice
Claus Gittinger <cg@exept.de>
parents: 374
diff changeset
   404
    self displayOn:aGC filled:true
bcd98f85086f dont draw the line twice
Claus Gittinger <cg@exept.de>
parents: 374
diff changeset
   405
979
df76c50c02ac comment
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   406
    "
df76c50c02ac comment
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   407
     |v|
df76c50c02ac comment
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   408
df76c50c02ac comment
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   409
     v := View new openAndWait.
df76c50c02ac comment
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   410
df76c50c02ac comment
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   411
     (Arrow from:10@10 to:50@50) displayFilledOn:v
df76c50c02ac comment
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   412
    "
df76c50c02ac comment
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   413
387
bcd98f85086f dont draw the line twice
Claus Gittinger <cg@exept.de>
parents: 374
diff changeset
   414
    "Created: 12.5.1996 / 23:58:42 / cg"
bcd98f85086f dont draw the line twice
Claus Gittinger <cg@exept.de>
parents: 374
diff changeset
   415
    "Modified: 4.6.1996 / 18:25:11 / cg"
bcd98f85086f dont draw the line twice
Claus Gittinger <cg@exept.de>
parents: 374
diff changeset
   416
!
bcd98f85086f dont draw the line twice
Claus Gittinger <cg@exept.de>
parents: 374
diff changeset
   417
bcd98f85086f dont draw the line twice
Claus Gittinger <cg@exept.de>
parents: 374
diff changeset
   418
displayOn:aGC filled:filled
354
909581778d57 checkin from browser
ca
parents: 333
diff changeset
   419
    "display the receivers arrow in the graphicsContext, aGC"
909581778d57 checkin from browser
ca
parents: 333
diff changeset
   420
1626
8a0e7e7151b9 do not round here (transformation could be nonNil)
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   421
    |arrowHeadPoint savedLineStyle p1 p2 p3 arrowPoints middle oldCap|
354
909581778d57 checkin from browser
ca
parents: 333
diff changeset
   422
909581778d57 checkin from browser
ca
parents: 333
diff changeset
   423
    savedLineStyle := aGC lineStyle.
909581778d57 checkin from browser
ca
parents: 333
diff changeset
   424
    aGC lineStyle:#solid.
909581778d57 checkin from browser
ca
parents: 333
diff changeset
   425
1626
8a0e7e7151b9 do not round here (transformation could be nonNil)
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   426
    arrowPoints := self arrowPointsFor:startPoint and:endPoint.
354
909581778d57 checkin from browser
ca
parents: 333
diff changeset
   427
1626
8a0e7e7151b9 do not round here (transformation could be nonNil)
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   428
    p1 := arrowPoints at:1.
8a0e7e7151b9 do not round here (transformation could be nonNil)
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   429
    arrowHeadPoint := arrowPoints at:2.
8a0e7e7151b9 do not round here (transformation could be nonNil)
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   430
    p2 := arrowPoints at:3.
354
909581778d57 checkin from browser
ca
parents: 333
diff changeset
   431
323
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   432
    filled ifFalse:[
728
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   433
        arrowHeadClosed == true ifTrue:[
1626
8a0e7e7151b9 do not round here (transformation could be nonNil)
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   434
            middle := ((p1 + p2) / 2).
729
bd9dfb8c9b17 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 728
diff changeset
   435
            aGC displayLineFrom:startPoint to:middle.
728
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   436
            aGC displayLineFrom:arrowHeadPoint to:p1.
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   437
            aGC displayLineFrom:arrowHeadPoint to:p2.
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   438
            aGC displayLineFrom:p1 to:p2.
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   439
        ] ifFalse:[
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   440
            aGC displayLineFrom:startPoint to:endPoint.
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   441
            aGC displayLineFrom:arrowHeadPoint to:p1.
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   442
            aGC displayLineFrom:arrowHeadPoint to:p2.
c7a227ec2897 added optional closed arrowHead.
Claus Gittinger <cg@exept.de>
parents: 490
diff changeset
   443
        ]
323
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   444
    ] ifTrue:[
1626
8a0e7e7151b9 do not round here (transformation could be nonNil)
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   445
        middle := ((p1 + p2) / 2).
455
9789991dd799 do not draw the line in the filled part
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   446
        oldCap := aGC capStyle.
9789991dd799 do not draw the line in the filled part
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   447
        aGC capStyle:#notLast.
9789991dd799 do not draw the line in the filled part
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   448
        aGC displayLineFrom:startPoint to:middle.
323
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   449
        aGC fillPolygon:(Array with:p1 with:arrowHeadPoint with:p2).
455
9789991dd799 do not draw the line in the filled part
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   450
        aGC capStyle:oldCap.
323
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   451
    ].
318
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   452
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   453
    aGC lineStyle:savedLineStyle.
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   454
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   455
    "
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   456
     |v|
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   457
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   458
     v := View new openAndWait.
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   459
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   460
     (Arrow from:10@10 to:50@50) displayStrokedOn:v
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   461
    "
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   462
387
bcd98f85086f dont draw the line twice
Claus Gittinger <cg@exept.de>
parents: 374
diff changeset
   463
    "Modified: 4.6.1996 / 18:24:53 / cg"
bcd98f85086f dont draw the line twice
Claus Gittinger <cg@exept.de>
parents: 374
diff changeset
   464
    "Created: 4.6.1996 / 18:25:15 / cg"
323
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   465
!
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   466
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   467
displayStrokedOn:aGC
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   468
    "display the receiver in the graphicsContext, aGC"
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   469
387
bcd98f85086f dont draw the line twice
Claus Gittinger <cg@exept.de>
parents: 374
diff changeset
   470
    self displayOn:aGC filled:false
323
125bc8f428a4 added filled arrows
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   471
979
df76c50c02ac comment
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   472
    "
df76c50c02ac comment
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   473
     |v|
df76c50c02ac comment
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   474
df76c50c02ac comment
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   475
     v := View new openAndWait.
df76c50c02ac comment
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   476
df76c50c02ac comment
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   477
     (Arrow from:10@10 to:50@50) displayStrokedOn:v
df76c50c02ac comment
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   478
    "
df76c50c02ac comment
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   479
387
bcd98f85086f dont draw the line twice
Claus Gittinger <cg@exept.de>
parents: 374
diff changeset
   480
    "Modified: 4.6.1996 / 18:25:07 / cg"
318
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   481
! !
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   482
357
9b43dacb35d1 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 354
diff changeset
   483
!Arrow methodsFor:'queries'!
9b43dacb35d1 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 354
diff changeset
   484
490
ef43c7a69346 added dummy Scale & InverseScale classVars.
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   485
canBeFilled
ef43c7a69346 added dummy Scale & InverseScale classVars.
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   486
    "return true, if the receiver can be drawn as a filled geometric.
ef43c7a69346 added dummy Scale & InverseScale classVars.
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   487
     Always true here. Notice, that Arrows only fill the arrowHeads."
ef43c7a69346 added dummy Scale & InverseScale classVars.
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   488
ef43c7a69346 added dummy Scale & InverseScale classVars.
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   489
    ^ true
ef43c7a69346 added dummy Scale & InverseScale classVars.
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   490
ef43c7a69346 added dummy Scale & InverseScale classVars.
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   491
!
ef43c7a69346 added dummy Scale & InverseScale classVars.
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   492
ef43c7a69346 added dummy Scale & InverseScale classVars.
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   493
computeBounds
357
9b43dacb35d1 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 354
diff changeset
   494
    "return the smallest enclosing rectangle"
9b43dacb35d1 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 354
diff changeset
   495
358
cdc2277521ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
   496
    |x y minX maxX minY maxY|
357
9b43dacb35d1 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 354
diff changeset
   497
9b43dacb35d1 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 354
diff changeset
   498
    minX := maxX := startPoint x.
9b43dacb35d1 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 354
diff changeset
   499
    x := endPoint x.
9b43dacb35d1 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 354
diff changeset
   500
    minX := minX min:x.
9b43dacb35d1 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 354
diff changeset
   501
    maxX := maxX max:x.
9b43dacb35d1 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 354
diff changeset
   502
9b43dacb35d1 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 354
diff changeset
   503
    minY := maxY := startPoint y.
9b43dacb35d1 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 354
diff changeset
   504
    y := endPoint y.
9b43dacb35d1 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 354
diff changeset
   505
    minY := minY min:y.
9b43dacb35d1 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 354
diff changeset
   506
    maxY := maxY max:y.
9b43dacb35d1 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 354
diff changeset
   507
729
bd9dfb8c9b17 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 728
diff changeset
   508
    (self arrowPointsFor:startPoint and:endPoint) do:[:p |
358
cdc2277521ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
   509
        |x y|
cdc2277521ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
   510
cdc2277521ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
   511
        x := p x.
cdc2277521ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
   512
        y := p y.
cdc2277521ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
   513
        minX := minX min:x.
cdc2277521ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
   514
        maxX := maxX max:x.
cdc2277521ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
   515
        minY := minY min:y.
cdc2277521ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
   516
        maxY := maxY max:y.
357
9b43dacb35d1 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 354
diff changeset
   517
    ].    
9b43dacb35d1 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 354
diff changeset
   518
    ^ Rectangle left:minX right:maxX top:minY bottom:maxY
9b43dacb35d1 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 354
diff changeset
   519
9b43dacb35d1 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 354
diff changeset
   520
    "
9b43dacb35d1 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 354
diff changeset
   521
     (Arrow from:(10@10) to:(90@90)) bounds 
9b43dacb35d1 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 354
diff changeset
   522
     (Arrow from:(10@10) to:(10@90)) bounds  
9b43dacb35d1 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 354
diff changeset
   523
    "
9b43dacb35d1 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 354
diff changeset
   524
358
cdc2277521ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
   525
    "Modified: 26.5.1996 / 16:31:39 / cg"
490
ef43c7a69346 added dummy Scale & InverseScale classVars.
Claus Gittinger <cg@exept.de>
parents: 455
diff changeset
   526
    "Created: 12.2.1997 / 11:42:22 / cg"
357
9b43dacb35d1 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 354
diff changeset
   527
! !
9b43dacb35d1 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 354
diff changeset
   528
318
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   529
!Arrow class methodsFor:'documentation'!
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   530
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   531
version
1626
8a0e7e7151b9 do not round here (transformation could be nonNil)
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   532
    ^ '$Header: /cvs/stx/stx/libbasic2/Arrow.st,v 1.23 2006-04-07 16:29:59 cg Exp $'
318
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   533
! !
1303
6ca5f36cdc63 category
Claus Gittinger <cg@exept.de>
parents: 979
diff changeset
   534
318
27d26332a987 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   535
Arrow initialize!