JavaView.st
author cg
Fri, 04 Dec 1998 14:37:29 +0000
changeset 482 08fd07acb9b7
parent 478 bccd73a1d975
child 491 5623ece3bf3c
permissions -rw-r--r--
*** empty log message ***
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
231
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
     1
View subclass:#JavaView
242
30c61addabd9 *** empty log message ***
cg
parents: 240
diff changeset
     2
	instanceVariableNames:'eventReceiver updateRegions javaPeer'
231
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
     3
	classVariableNames:''
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
     4
	poolDictionaries:''
234
78953bbfaba1 checkin from browser
cg
parents: 231
diff changeset
     5
	category:'Java-Views-Support'
231
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
     6
!
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
     7
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
     8
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
     9
!JavaView methodsFor:'accessing'!
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    10
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    11
delegate:anObject
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    12
    super delegate:anObject.
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    13
    eventReceiver := anObject.
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    14
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    15
    "Created: 18.8.1997 / 15:22:20 / cg"
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    16
!
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    17
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    18
getNextUpdateRectangle
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    19
    |r|
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    20
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    21
    updateRegions size == 0 ifTrue:[^ nil].
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    22
    r := updateRegions removeFirst.
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    23
    updateRegions size == 0 ifTrue:[updateRegions := nil].
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    24
    ^ r
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    25
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    26
    "Created: 18.8.1997 / 15:37:31 / cg"
242
30c61addabd9 *** empty log message ***
cg
parents: 240
diff changeset
    27
!
30c61addabd9 *** empty log message ***
cg
parents: 240
diff changeset
    28
30c61addabd9 *** empty log message ***
cg
parents: 240
diff changeset
    29
javaPeer
30c61addabd9 *** empty log message ***
cg
parents: 240
diff changeset
    30
    "for debugging support - here is a handle to the corresponding
30c61addabd9 *** empty log message ***
cg
parents: 240
diff changeset
    31
     javaPeer"
30c61addabd9 *** empty log message ***
cg
parents: 240
diff changeset
    32
30c61addabd9 *** empty log message ***
cg
parents: 240
diff changeset
    33
    ^ javaPeer
30c61addabd9 *** empty log message ***
cg
parents: 240
diff changeset
    34
30c61addabd9 *** empty log message ***
cg
parents: 240
diff changeset
    35
    "Created: 18.8.1997 / 22:34:35 / cg"
30c61addabd9 *** empty log message ***
cg
parents: 240
diff changeset
    36
!
30c61addabd9 *** empty log message ***
cg
parents: 240
diff changeset
    37
30c61addabd9 *** empty log message ***
cg
parents: 240
diff changeset
    38
javaPeer:aJavaView
30c61addabd9 *** empty log message ***
cg
parents: 240
diff changeset
    39
    "for debugging support - here is a handle to the corresponding
30c61addabd9 *** empty log message ***
cg
parents: 240
diff changeset
    40
     javaPeer"
30c61addabd9 *** empty log message ***
cg
parents: 240
diff changeset
    41
30c61addabd9 *** empty log message ***
cg
parents: 240
diff changeset
    42
    javaPeer := aJavaView
30c61addabd9 *** empty log message ***
cg
parents: 240
diff changeset
    43
30c61addabd9 *** empty log message ***
cg
parents: 240
diff changeset
    44
    "Created: 18.8.1997 / 22:34:30 / cg"
231
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    45
! !
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    46
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    47
!JavaView methodsFor:'event handling'!
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    48
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    49
exposeX:x y:y width:w height:h
391
ad7117dee90d expose handling
cg
parents: 337
diff changeset
    50
    |ev rect|
ad7117dee90d expose handling
cg
parents: 337
diff changeset
    51
ad7117dee90d expose handling
cg
parents: 337
diff changeset
    52
    rect := Rectangle left:x top:y width:w height:h.
248
964ad5f9e8bc no reinit - multiple browsers
cg
parents: 245
diff changeset
    53
316
beb8e55ba106 removed debugPrints
cg
parents: 308
diff changeset
    54
"/ 'JavaView expose' printCR.
255
2d8b3948a08a *** empty log message ***
cg
parents: 248
diff changeset
    55
231
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    56
    updateRegions isNil ifTrue:[
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    57
        updateRegions := OrderedCollection new.
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    58
    ].
391
ad7117dee90d expose handling
cg
parents: 337
diff changeset
    59
    updateRegions add:rect.
240
8474d3b49c77 checkin from browser
cg
parents: 234
diff changeset
    60
    eventReceiver notNil ifTrue:[
248
964ad5f9e8bc no reinit - multiple browsers
cg
parents: 245
diff changeset
    61
        ev := WindowEvent 
964ad5f9e8bc no reinit - multiple browsers
cg
parents: 245
diff changeset
    62
                damageFor:self 
391
ad7117dee90d expose handling
cg
parents: 337
diff changeset
    63
                rectangle:rect. 
248
964ad5f9e8bc no reinit - multiple browsers
cg
parents: 245
diff changeset
    64
        eventReceiver processEvent:ev.
240
8474d3b49c77 checkin from browser
cg
parents: 234
diff changeset
    65
    ].
391
ad7117dee90d expose handling
cg
parents: 337
diff changeset
    66
"/    super exposeX:x y:y width:w height:h
231
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    67
255
2d8b3948a08a *** empty log message ***
cg
parents: 248
diff changeset
    68
    "Created: / 18.8.1997 / 15:00:24 / cg"
391
ad7117dee90d expose handling
cg
parents: 337
diff changeset
    69
    "Modified: / 19.10.1998 / 23:10:15 / cg"
231
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    70
! !
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    71
245
5177c0378723 checkin from browser
cg
parents: 242
diff changeset
    72
!JavaView methodsFor:'initialization'!
5177c0378723 checkin from browser
cg
parents: 242
diff changeset
    73
5177c0378723 checkin from browser
cg
parents: 242
diff changeset
    74
initialize
5177c0378723 checkin from browser
cg
parents: 242
diff changeset
    75
    super initialize.
261
d95d5a3cc475 lots of new stuff
cg
parents: 255
diff changeset
    76
d95d5a3cc475 lots of new stuff
cg
parents: 255
diff changeset
    77
    self enableMotionEvents.
245
5177c0378723 checkin from browser
cg
parents: 242
diff changeset
    78
    (superView notNil and:[superView isMemberOf:JavaEmbeddedFrameView])
5177c0378723 checkin from browser
cg
parents: 242
diff changeset
    79
    ifTrue:[
5177c0378723 checkin from browser
cg
parents: 242
diff changeset
    80
        self viewBackground:superView viewBackground
5177c0378723 checkin from browser
cg
parents: 242
diff changeset
    81
    ]
5177c0378723 checkin from browser
cg
parents: 242
diff changeset
    82
261
d95d5a3cc475 lots of new stuff
cg
parents: 255
diff changeset
    83
    "Created: / 21.8.1997 / 16:37:45 / cg"
d95d5a3cc475 lots of new stuff
cg
parents: 255
diff changeset
    84
    "Modified: / 13.1.1998 / 14:29:30 / cg"
245
5177c0378723 checkin from browser
cg
parents: 242
diff changeset
    85
! !
5177c0378723 checkin from browser
cg
parents: 242
diff changeset
    86
482
08fd07acb9b7 *** empty log message ***
cg
parents: 478
diff changeset
    87
!JavaView methodsFor:'queries'!
08fd07acb9b7 *** empty log message ***
cg
parents: 478
diff changeset
    88
08fd07acb9b7 *** empty log message ***
cg
parents: 478
diff changeset
    89
isJavaView
08fd07acb9b7 *** empty log message ***
cg
parents: 478
diff changeset
    90
    ^ true
08fd07acb9b7 *** empty log message ***
cg
parents: 478
diff changeset
    91
08fd07acb9b7 *** empty log message ***
cg
parents: 478
diff changeset
    92
    "Created: / 4.12.1998 / 14:09:30 / cg"
08fd07acb9b7 *** empty log message ***
cg
parents: 478
diff changeset
    93
! !
08fd07acb9b7 *** empty log message ***
cg
parents: 478
diff changeset
    94
231
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    95
!JavaView class methodsFor:'documentation'!
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    96
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    97
version
482
08fd07acb9b7 *** empty log message ***
cg
parents: 478
diff changeset
    98
    ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaView.st,v 1.16 1998/12/04 14:34:16 cg Exp $'
231
e8a2f47da1a3 intitial checkin
cg
parents:
diff changeset
    99
! !