JavaPopUpView.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 24 May 2013 17:55:42 +0100
branchbuiltin-class-support
changeset 2629 cedb88626902
parent 2429 ebece4dcaab9
child 2711 a00302fe5083
permissions -rw-r--r--
Closing branch.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
545
6a841644c5e9 checkin from browser
cg
parents: 481
diff changeset
     1
"
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2108
diff changeset
     2
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
545
6a841644c5e9 checkin from browser
cg
parents: 481
diff changeset
     3
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2164
diff changeset
     4
 New code and modifications done at SWING Research Group [1]:
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2164
diff changeset
     5
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2164
diff changeset
     6
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2164
diff changeset
     7
                            SWING Research Group, Czech Technical University in Prague
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2164
diff changeset
     8
545
6a841644c5e9 checkin from browser
cg
parents: 481
diff changeset
     9
 This software is furnished under a license and may be used
6a841644c5e9 checkin from browser
cg
parents: 481
diff changeset
    10
 only in accordance with the terms of that license and with the
6a841644c5e9 checkin from browser
cg
parents: 481
diff changeset
    11
 inclusion of the above copyright notice.   This software may not
6a841644c5e9 checkin from browser
cg
parents: 481
diff changeset
    12
 be provided or otherwise made available to, or used by, any
6a841644c5e9 checkin from browser
cg
parents: 481
diff changeset
    13
 other person.  No title to or ownership of the software is
6a841644c5e9 checkin from browser
cg
parents: 481
diff changeset
    14
 hereby transferred.
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2164
diff changeset
    15
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2164
diff changeset
    16
 [1] Code written at SWING Research Group contains a signature
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2164
diff changeset
    17
     of one of the above copright owners. For exact set of such code,
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2164
diff changeset
    18
     see the differences between this version and version stx:libjava
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2164
diff changeset
    19
     as of 1.9.2010
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2108
diff changeset
    20
"
713
75e92ac63bf1 category change
cg
parents: 545
diff changeset
    21
"{ Package: 'stx:libjava' }"
75e92ac63bf1 category change
cg
parents: 545
diff changeset
    22
481
672f794c4232 initial checkin
cg
parents:
diff changeset
    23
PopUpView subclass:#JavaPopUpView
672f794c4232 initial checkin
cg
parents:
diff changeset
    24
	instanceVariableNames:'eventReceiver updateRegions javaPeer'
672f794c4232 initial checkin
cg
parents:
diff changeset
    25
	classVariableNames:''
672f794c4232 initial checkin
cg
parents:
diff changeset
    26
	poolDictionaries:''
713
75e92ac63bf1 category change
cg
parents: 545
diff changeset
    27
	category:'Languages-Java-Views-Support'
481
672f794c4232 initial checkin
cg
parents:
diff changeset
    28
!
672f794c4232 initial checkin
cg
parents:
diff changeset
    29
545
6a841644c5e9 checkin from browser
cg
parents: 481
diff changeset
    30
!JavaPopUpView class methodsFor:'documentation'!
6a841644c5e9 checkin from browser
cg
parents: 481
diff changeset
    31
6a841644c5e9 checkin from browser
cg
parents: 481
diff changeset
    32
copyright
6a841644c5e9 checkin from browser
cg
parents: 481
diff changeset
    33
"
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2108
diff changeset
    34
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
545
6a841644c5e9 checkin from browser
cg
parents: 481
diff changeset
    35
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2164
diff changeset
    36
 New code and modifications done at SWING Research Group [1]:
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2164
diff changeset
    37
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2164
diff changeset
    38
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2164
diff changeset
    39
                            SWING Research Group, Czech Technical University in Prague
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2164
diff changeset
    40
545
6a841644c5e9 checkin from browser
cg
parents: 481
diff changeset
    41
 This software is furnished under a license and may be used
6a841644c5e9 checkin from browser
cg
parents: 481
diff changeset
    42
 only in accordance with the terms of that license and with the
6a841644c5e9 checkin from browser
cg
parents: 481
diff changeset
    43
 inclusion of the above copyright notice.   This software may not
6a841644c5e9 checkin from browser
cg
parents: 481
diff changeset
    44
 be provided or otherwise made available to, or used by, any
6a841644c5e9 checkin from browser
cg
parents: 481
diff changeset
    45
 other person.  No title to or ownership of the software is
6a841644c5e9 checkin from browser
cg
parents: 481
diff changeset
    46
 hereby transferred.
6a841644c5e9 checkin from browser
cg
parents: 481
diff changeset
    47
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2164
diff changeset
    48
 [1] Code written at SWING Research Group contains a signature
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2164
diff changeset
    49
     of one of the above copright owners. For exact set of such code,
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2164
diff changeset
    50
     see the differences between this version and version stx:libjava
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2164
diff changeset
    51
     as of 1.9.2010
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2164
diff changeset
    52
545
6a841644c5e9 checkin from browser
cg
parents: 481
diff changeset
    53
"
6a841644c5e9 checkin from browser
cg
parents: 481
diff changeset
    54
! !
481
672f794c4232 initial checkin
cg
parents:
diff changeset
    55
2396
fadc6d7a2f5b Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2353
diff changeset
    56
481
672f794c4232 initial checkin
cg
parents:
diff changeset
    57
!JavaPopUpView methodsFor:'accessing'!
672f794c4232 initial checkin
cg
parents:
diff changeset
    58
672f794c4232 initial checkin
cg
parents:
diff changeset
    59
delegate:anObject
672f794c4232 initial checkin
cg
parents:
diff changeset
    60
"/    super delegate:anObject.
672f794c4232 initial checkin
cg
parents:
diff changeset
    61
    eventReceiver := anObject.
672f794c4232 initial checkin
cg
parents:
diff changeset
    62
672f794c4232 initial checkin
cg
parents:
diff changeset
    63
    "Modified: / 2.12.1998 / 23:57:57 / cg"
672f794c4232 initial checkin
cg
parents:
diff changeset
    64
    "Created: / 4.12.1998 / 14:09:12 / cg"
672f794c4232 initial checkin
cg
parents:
diff changeset
    65
!
672f794c4232 initial checkin
cg
parents:
diff changeset
    66
672f794c4232 initial checkin
cg
parents:
diff changeset
    67
getNextUpdateRectangle
672f794c4232 initial checkin
cg
parents:
diff changeset
    68
    |r|
672f794c4232 initial checkin
cg
parents:
diff changeset
    69
672f794c4232 initial checkin
cg
parents:
diff changeset
    70
    updateRegions size == 0 ifTrue:[^ nil].
672f794c4232 initial checkin
cg
parents:
diff changeset
    71
    r := updateRegions removeFirst.
672f794c4232 initial checkin
cg
parents:
diff changeset
    72
    updateRegions size == 0 ifTrue:[updateRegions := nil].
672f794c4232 initial checkin
cg
parents:
diff changeset
    73
    ^ r
672f794c4232 initial checkin
cg
parents:
diff changeset
    74
672f794c4232 initial checkin
cg
parents:
diff changeset
    75
    "Created: / 4.12.1998 / 14:09:12 / cg"
672f794c4232 initial checkin
cg
parents:
diff changeset
    76
!
672f794c4232 initial checkin
cg
parents:
diff changeset
    77
672f794c4232 initial checkin
cg
parents:
diff changeset
    78
javaPeer
672f794c4232 initial checkin
cg
parents:
diff changeset
    79
    "for debugging support - here is a handle to the corresponding
672f794c4232 initial checkin
cg
parents:
diff changeset
    80
     javaPeer"
672f794c4232 initial checkin
cg
parents:
diff changeset
    81
672f794c4232 initial checkin
cg
parents:
diff changeset
    82
    ^ javaPeer
672f794c4232 initial checkin
cg
parents:
diff changeset
    83
672f794c4232 initial checkin
cg
parents:
diff changeset
    84
    "Created: / 4.12.1998 / 14:09:13 / cg"
672f794c4232 initial checkin
cg
parents:
diff changeset
    85
!
672f794c4232 initial checkin
cg
parents:
diff changeset
    86
672f794c4232 initial checkin
cg
parents:
diff changeset
    87
javaPeer:aJavaView
672f794c4232 initial checkin
cg
parents:
diff changeset
    88
    "for debugging support - here is a handle to the corresponding
672f794c4232 initial checkin
cg
parents:
diff changeset
    89
     javaPeer"
672f794c4232 initial checkin
cg
parents:
diff changeset
    90
672f794c4232 initial checkin
cg
parents:
diff changeset
    91
    javaPeer := aJavaView
672f794c4232 initial checkin
cg
parents:
diff changeset
    92
672f794c4232 initial checkin
cg
parents:
diff changeset
    93
    "Created: / 4.12.1998 / 14:09:13 / cg"
672f794c4232 initial checkin
cg
parents:
diff changeset
    94
! !
672f794c4232 initial checkin
cg
parents:
diff changeset
    95
2396
fadc6d7a2f5b Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2353
diff changeset
    96
481
672f794c4232 initial checkin
cg
parents:
diff changeset
    97
!JavaPopUpView methodsFor:'defaults'!
672f794c4232 initial checkin
cg
parents:
diff changeset
    98
672f794c4232 initial checkin
cg
parents:
diff changeset
    99
defaultShadow
672f794c4232 initial checkin
cg
parents:
diff changeset
   100
    ^ false
672f794c4232 initial checkin
cg
parents:
diff changeset
   101
672f794c4232 initial checkin
cg
parents:
diff changeset
   102
    "Created: / 4.12.1998 / 15:12:13 / cg"
672f794c4232 initial checkin
cg
parents:
diff changeset
   103
! !
672f794c4232 initial checkin
cg
parents:
diff changeset
   104
2396
fadc6d7a2f5b Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2353
diff changeset
   105
481
672f794c4232 initial checkin
cg
parents:
diff changeset
   106
!JavaPopUpView methodsFor:'event handling'!
672f794c4232 initial checkin
cg
parents:
diff changeset
   107
672f794c4232 initial checkin
cg
parents:
diff changeset
   108
exposeX:x y:y width:w height:h
672f794c4232 initial checkin
cg
parents:
diff changeset
   109
    |ev rect|
672f794c4232 initial checkin
cg
parents:
diff changeset
   110
672f794c4232 initial checkin
cg
parents:
diff changeset
   111
    rect := Rectangle left:x top:y width:w height:h.
672f794c4232 initial checkin
cg
parents:
diff changeset
   112
672f794c4232 initial checkin
cg
parents:
diff changeset
   113
"/ 'JavaView expose' printCR.
672f794c4232 initial checkin
cg
parents:
diff changeset
   114
672f794c4232 initial checkin
cg
parents:
diff changeset
   115
    updateRegions isNil ifTrue:[
672f794c4232 initial checkin
cg
parents:
diff changeset
   116
        updateRegions := OrderedCollection new.
672f794c4232 initial checkin
cg
parents:
diff changeset
   117
    ].
672f794c4232 initial checkin
cg
parents:
diff changeset
   118
    updateRegions add:rect.
672f794c4232 initial checkin
cg
parents:
diff changeset
   119
    eventReceiver notNil ifTrue:[
672f794c4232 initial checkin
cg
parents:
diff changeset
   120
        ev := WindowEvent 
672f794c4232 initial checkin
cg
parents:
diff changeset
   121
                damageFor:self 
672f794c4232 initial checkin
cg
parents:
diff changeset
   122
                rectangle:rect. 
672f794c4232 initial checkin
cg
parents:
diff changeset
   123
        eventReceiver processEvent:ev.
672f794c4232 initial checkin
cg
parents:
diff changeset
   124
    ].
672f794c4232 initial checkin
cg
parents:
diff changeset
   125
"/    super exposeX:x y:y width:w height:h
672f794c4232 initial checkin
cg
parents:
diff changeset
   126
672f794c4232 initial checkin
cg
parents:
diff changeset
   127
    "Modified: / 19.10.1998 / 23:10:15 / cg"
672f794c4232 initial checkin
cg
parents:
diff changeset
   128
    "Created: / 4.12.1998 / 14:09:13 / cg"
672f794c4232 initial checkin
cg
parents:
diff changeset
   129
! !
672f794c4232 initial checkin
cg
parents:
diff changeset
   130
2396
fadc6d7a2f5b Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2353
diff changeset
   131
481
672f794c4232 initial checkin
cg
parents:
diff changeset
   132
!JavaPopUpView methodsFor:'initialization'!
672f794c4232 initial checkin
cg
parents:
diff changeset
   133
672f794c4232 initial checkin
cg
parents:
diff changeset
   134
initialize
672f794c4232 initial checkin
cg
parents:
diff changeset
   135
    super initialize.
672f794c4232 initial checkin
cg
parents:
diff changeset
   136
672f794c4232 initial checkin
cg
parents:
diff changeset
   137
    self enableMotionEvents.
672f794c4232 initial checkin
cg
parents:
diff changeset
   138
672f794c4232 initial checkin
cg
parents:
diff changeset
   139
    "Modified: / 2.12.1998 / 23:32:30 / cg"
672f794c4232 initial checkin
cg
parents:
diff changeset
   140
    "Created: / 4.12.1998 / 14:09:13 / cg"
672f794c4232 initial checkin
cg
parents:
diff changeset
   141
! !
672f794c4232 initial checkin
cg
parents:
diff changeset
   142
2396
fadc6d7a2f5b Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2353
diff changeset
   143
481
672f794c4232 initial checkin
cg
parents:
diff changeset
   144
!JavaPopUpView methodsFor:'queries'!
672f794c4232 initial checkin
cg
parents:
diff changeset
   145
672f794c4232 initial checkin
cg
parents:
diff changeset
   146
isJavaView
672f794c4232 initial checkin
cg
parents:
diff changeset
   147
    ^ true
672f794c4232 initial checkin
cg
parents:
diff changeset
   148
672f794c4232 initial checkin
cg
parents:
diff changeset
   149
    "Created: / 4.12.1998 / 14:09:40 / cg"
672f794c4232 initial checkin
cg
parents:
diff changeset
   150
! !
672f794c4232 initial checkin
cg
parents:
diff changeset
   151
2396
fadc6d7a2f5b Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2353
diff changeset
   152
481
672f794c4232 initial checkin
cg
parents:
diff changeset
   153
!JavaPopUpView class methodsFor:'documentation'!
672f794c4232 initial checkin
cg
parents:
diff changeset
   154
672f794c4232 initial checkin
cg
parents:
diff changeset
   155
version
2396
fadc6d7a2f5b Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2353
diff changeset
   156
    ^ '$Header: /cvs/stx/stx/libjava/JavaPopUpView.st,v 1.7 2013-02-25 11:15:31 vrany Exp $'
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2164
diff changeset
   157
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2164
diff changeset
   158
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2164
diff changeset
   159
version_CVS
2396
fadc6d7a2f5b Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2353
diff changeset
   160
    ^ '$Header: /cvs/stx/stx/libjava/JavaPopUpView.st,v 1.7 2013-02-25 11:15:31 vrany Exp $'
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2164
diff changeset
   161
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2164
diff changeset
   162
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2164
diff changeset
   163
version_HG
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2164
diff changeset
   164
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2164
diff changeset
   165
    ^ '$Changeset: <not expanded> $'
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2108
diff changeset
   166
!
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2108
diff changeset
   167
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2108
diff changeset
   168
version_SVN
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2164
diff changeset
   169
    ^ '§Id§'
2108
ca8c4e7db2e8 category change
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
   170
! !
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2164
diff changeset
   171