GeometricWrapper.st
author Claus Gittinger <cg@exept.de>
Sat, 12 May 2018 14:23:45 +0200
changeset 4088 bbf9b58f99c8
parent 2661 14f345ff3b82
child 3855 1db7742d33ad
permissions -rw-r--r--
#FEATURE by cg class: MIMETypes class changed: #initializeFileInfoMappings class: MIMETypes::MIMEType added: #asMimeType #isCHeaderType #isCPPSourceType #isCSourceType
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
"
1789
f52f0a0d8448 category
Claus Gittinger <cg@exept.de>
parents: 1220
diff changeset
    12
"{ Package: 'stx:libview2' }"
f52f0a0d8448 category
Claus Gittinger <cg@exept.de>
parents: 1220
diff changeset
    13
251
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
Wrapper subclass:#GeometricWrapper
404
502b2dc1b0ba moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
    15
	instanceVariableNames:'foregroundColor backgroundColor'
251
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	classVariableNames:''
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
1789
f52f0a0d8448 category
Claus Gittinger <cg@exept.de>
parents: 1220
diff changeset
    18
	category:'Compatibility-ST80-Graphics-Display Objects'
251
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!GeometricWrapper class methodsFor:'documentation'!
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
copyright
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
"
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
 COPYRIGHT (c) 1996 by Claus Gittinger
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
              All Rights Reserved
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
 This software is furnished under a license and may be used
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
 only in accordance with the terms of that license and with the
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 be provided or otherwise made available to, or used by, any
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 other person.  No title to or ownership of the software is
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 hereby transferred.
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
"
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
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
documentation
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
"
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    abstract class for wrappers of geometric objects.
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    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
    45
254
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
    46
    (background info: geometrics are mathematical objects - they do not 
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
    47
     keep any color or lineStyle attributes. Wrappers add this information
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
    48
     and can also be used as components of a view)
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
    49
265
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    50
    Notice: 
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    51
        this class was implemented using protocol information
365
47e0d48fd769 commentary
Claus Gittinger <cg@exept.de>
parents: 295
diff changeset
    52
        from alpha testers, from reading PD programs and 
47e0d48fd769 commentary
Claus Gittinger <cg@exept.de>
parents: 295
diff changeset
    53
        from the Hopkins/Horan book.
265
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    54
        - it may not be complete or compatible to the corresponding ST-80 class. 
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    55
        If you encounter any incompatibilities, please forward a note 
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    56
        describing the incompatibility verbal (i.e. no code) to the ST/X team.
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    57
251
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
    [see also:]
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
        StrokingWrapper FillingWrapper
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
        Geometric GraphicsContext
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
    [author:]
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
        Claus Gittinger
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
"
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
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
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    70
!GeometricWrapper methodsFor:'accessing'!
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    71
404
502b2dc1b0ba moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
    72
backgroundColor
502b2dc1b0ba moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
    73
    ^ backgroundColor
502b2dc1b0ba moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
    74
!
502b2dc1b0ba moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
    75
502b2dc1b0ba moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
    76
backgroundColor:something
502b2dc1b0ba moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
    77
    backgroundColor := something.
2661
14f345ff3b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
    78
    self invalidate.
404
502b2dc1b0ba moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
    79
!
502b2dc1b0ba moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
    80
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    81
component:someComponent
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    82
    "set the wrappers component. 
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    83
     Redefined to not set the components container - we know, those
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    84
     Geometrics dont know about containers."
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    85
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    86
    component := someComponent.
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    87
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    88
    "Created: 28.5.1996 / 23:02:36 / cg"
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    89
    "Modified: 28.5.1996 / 23:02:52 / cg"
404
502b2dc1b0ba moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
    90
!
502b2dc1b0ba moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
    91
502b2dc1b0ba moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
    92
foregroundColor
502b2dc1b0ba moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
    93
    ^ foregroundColor
502b2dc1b0ba moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
    94
!
502b2dc1b0ba moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
    95
502b2dc1b0ba moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
    96
foregroundColor:something
502b2dc1b0ba moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
    97
    foregroundColor := something.
2661
14f345ff3b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
    98
    self invalidate.
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    99
! !
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   100
251
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
!GeometricWrapper methodsFor:'accessing - bounds'!
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
293
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   103
bounds
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   104
    "return the components bounds as default bounds"
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   105
2661
14f345ff3b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
   106
    frame notNil ifTrue:[^ frame].
295
e1a91bbfbef3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 293
diff changeset
   107
    ^ component bounds rounded
293
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   108
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   109
    "Created: 5.6.1996 / 02:29:10 / cg"
295
e1a91bbfbef3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 293
diff changeset
   110
    "Modified: 5.6.1996 / 20:30:50 / cg"
293
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   111
!
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   112
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   113
bounds:newBounds
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   114
    "set my bounds"
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   115
2661
14f345ff3b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
   116
    frame := newBounds
293
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   117
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   118
    "Created: 5.6.1996 / 02:30:00 / cg"
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
251
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
preferredBounds
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
    "return the components bounds as preferredBounds"
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
2661
14f345ff3b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
   124
    ^ component bounds ceiling
251
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
! !
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
418
e8f4ea6e1040 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 404
diff changeset
   127
!GeometricWrapper methodsFor:'initialize / release'!
e8f4ea6e1040 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 404
diff changeset
   128
e8f4ea6e1040 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 404
diff changeset
   129
flushCoordinateCaches
642
60793c327a75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 418
diff changeset
   130
    "/ geometrics are not interested in that
418
e8f4ea6e1040 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 404
diff changeset
   131
e8f4ea6e1040 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 404
diff changeset
   132
    "Created: 12.2.1997 / 11:56:07 / cg"
1220
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   133
!
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   134
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   135
initialize
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   136
   foregroundColor := Color black.
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   137
418
e8f4ea6e1040 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 404
diff changeset
   138
! !
e8f4ea6e1040 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 404
diff changeset
   139
293
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   140
!GeometricWrapper methodsFor:'view protocol mimicri'!
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   141
2661
14f345ff3b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
   142
destroyComponent
14f345ff3b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
   143
    "component is not a visualPart. Ignored here"
14f345ff3b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
   144
!
14f345ff3b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
   145
293
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   146
realize
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   147
    "my container realized itself. Ignored here"
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   148
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   149
    "Created: 5.6.1996 / 02:32:39 / cg"
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   150
! !
d10ad10d23fa prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   151
251
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
!GeometricWrapper class methodsFor:'documentation'!
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
version
2661
14f345ff3b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
   155
    ^ '$Header: /cvs/stx/stx/libview2/GeometricWrapper.st,v 1.13 2009-05-08 11:54:36 cg Exp $'
251
9c6e546a96e2 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
! !