GeometricWrapper.st
author Claus Gittinger <cg@exept.de>
Tue, 14 Jan 1997 18:02:37 +0100
changeset 365 47e0d48fd769
parent 295 e1a91bbfbef3
child 404 502b2dc1b0ba
permissions -rw-r--r--
commentary
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
251
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 1996 by Claus Gittinger
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
              All Rights Reserved
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
Wrapper subclass:#GeometricWrapper
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	instanceVariableNames:''
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	classVariableNames:''
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	poolDictionaries:''
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
	category:'Graphics-Display Objects'
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
!
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
!GeometricWrapper class methodsFor:'documentation'!
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
copyright
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
"
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
 COPYRIGHT (c) 1996 by Claus Gittinger
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
              All Rights Reserved
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 This software is furnished under a license and may be used
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 only in accordance with the terms of that license and with the
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 inclusion of the above copyright notice.   This software may not
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 be provided or otherwise made available to, or used by, any
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 other person.  No title to or ownership of the software is
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
 hereby transferred.
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
"
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
!
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
documentation
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
"
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    abstract class for wrappers of geometric objects.
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    These allows any geometric thingy to be used as a component in a view.
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
254
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
    49
    (background info: geometrics are mathematical objects - they do not 
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
    50
     keep any color or lineStyle attributes. Wrappers add this information
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
    51
     and can also be used as components of a view)
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
    52
265
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    53
    Notice: 
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    54
        this class was implemented using protocol information
365
47e0d48fd769 commentary
Claus Gittinger <cg@exept.de>
parents: 295
diff changeset
    55
        from alpha testers, from reading PD programs and 
47e0d48fd769 commentary
Claus Gittinger <cg@exept.de>
parents: 295
diff changeset
    56
        from the Hopkins/Horan book.
265
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    57
        - it may not be complete or compatible to the corresponding ST-80 class. 
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    58
        If you encounter any incompatibilities, please forward a note 
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    59
        describing the incompatibility verbal (i.e. no code) to the ST/X team.
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    60
251
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
    [see also:]
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
        StrokingWrapper FillingWrapper
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
        Geometric GraphicsContext
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
    [author:]
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
        Claus Gittinger
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
"
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
! !
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    73
!GeometricWrapper methodsFor:'accessing'!
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    74
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    75
component:someComponent
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    76
    "set the wrappers component. 
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    77
     Redefined to not set the components container - we know, those
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    78
     Geometrics dont know about containers."
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    79
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    80
    component := someComponent.
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    81
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    82
    "Created: 28.5.1996 / 23:02:36 / cg"
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    83
    "Modified: 28.5.1996 / 23:02:52 / cg"
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    84
! !
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    85
251
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
!GeometricWrapper methodsFor:'accessing - bounds'!
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
293
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
    88
bounds
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
    89
    "return the components bounds as default bounds"
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
    90
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
    91
    bounds notNil ifTrue:[^ bounds].
295
e1a91bbfbef3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 293
diff changeset
    92
    ^ component bounds rounded
293
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
    93
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
    94
    "Created: 5.6.1996 / 02:29:10 / cg"
295
e1a91bbfbef3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 293
diff changeset
    95
    "Modified: 5.6.1996 / 20:30:50 / cg"
293
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
    96
!
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
    97
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
    98
bounds:newBounds
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
    99
    "set my bounds"
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   100
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   101
    bounds := newBounds
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   102
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   103
    "Created: 5.6.1996 / 02:30:00 / cg"
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   104
!
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   105
251
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
preferredBounds
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
    "return the components bounds as preferredBounds"
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
295
e1a91bbfbef3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 293
diff changeset
   109
    ^ component bounds rounded
251
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
    "Created: 9.5.1996 / 10:28:10 / cg"
295
e1a91bbfbef3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 293
diff changeset
   112
    "Modified: 5.6.1996 / 20:30:54 / cg"
251
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
! !
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
293
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   115
!GeometricWrapper methodsFor:'view protocol mimicri'!
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   116
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   117
realize
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   118
    "my container realized itself. Ignored here"
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   119
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   120
    "Created: 5.6.1996 / 02:32:39 / cg"
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   121
! !
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   122
251
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
!GeometricWrapper class methodsFor:'documentation'!
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
version
365
47e0d48fd769 commentary
Claus Gittinger <cg@exept.de>
parents: 295
diff changeset
   126
    ^ '$Header: /cvs/stx/stx/libview2/GeometricWrapper.st,v 1.7 1997-01-14 17:00:00 cg Exp $'
251
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
! !