Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
e819e755
Kaydet (Commit)
e819e755
authored
Nis 11, 2003
tarafından
Vladimir Glazounov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
INTEGRATION: CWS vcl07 (1.3.2); FILE ADDED
2003/04/08 14:28:43 obr 1.3.2.1: re-added accessibility workbench
üst
81204d08
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
126 additions
and
0 deletions
+126
-0
EventQueue.java
toolkit/test/accessibility/EventQueue.java
+126
-0
No files found.
toolkit/test/accessibility/EventQueue.java
0 → 100644
Dosyayı görüntüle @
e819e755
import
drafts.com.sun.star.accessibility.*
;
import
com.sun.star.lang.EventObject
;
import
java.util.LinkedList
;
/** The event queue singleton dispatches events received from OpenOffice.org
applications in a thread separate from the AWB main thread.
The queue of event objects, LinkedList<Runnable> The queue object will
also serve as lock for the consumer/producer type syncronization.
*/
class
EventQueue
implements
Runnable
{
public
boolean
mbVerbose
=
false
;
public
boolean
mbHandleDisposingEventsSynchronous
=
true
;
public
synchronized
static
EventQueue
Instance
()
{
if
(
maInstance
==
null
)
maInstance
=
new
EventQueue
();
return
maInstance
;
}
public
void
addEvent
(
Runnable
aEvent
)
{
synchronized
(
maMonitor
)
{
if
(
mbVerbose
)
System
.
out
.
println
(
"queing regular event "
+
aEvent
);
maRegularQueue
.
addLast
(
aEvent
);
maMonitor
.
notify
();
}
}
public
void
addDisposingEvent
(
Runnable
aEvent
)
{
if
(
mbHandleDisposingEventsSynchronous
)
aEvent
.
run
();
else
synchronized
(
maMonitor
)
{
if
(
mbVerbose
)
System
.
out
.
println
(
"queing disposing event "
+
aEvent
);
maDisposingQueue
.
addLast
(
aEvent
);
maMonitor
.
notify
();
}
}
private
EventQueue
()
{
maMonitor
=
new
Boolean
(
true
);
maRegularQueue
=
new
LinkedList
();
maDisposingQueue
=
new
LinkedList
();
new
Thread
(
this
,
"AWB.EventQueue"
).
start
();
}
/// This thread's main method: deliver all events
public
void
run
()
{
// in an infinite loop, check for events to deliver, then
// wait on lock (which will be notified when new events arrive)
while
(
true
)
{
Runnable
aEvent
=
null
;
do
{
synchronized
(
maMonitor
)
{
if
(
maDisposingQueue
.
size
()
>
0
)
{
aEvent
=
(
Runnable
)
maDisposingQueue
.
removeFirst
();
if
(
mbVerbose
)
System
.
out
.
println
(
"delivering disposing event "
+
aEvent
);
}
else
if
(
maRegularQueue
.
size
()
>
0
)
{
aEvent
=
(
Runnable
)
maRegularQueue
.
removeFirst
();
if
(
mbVerbose
)
System
.
out
.
println
(
"delivering regular event "
+
aEvent
);
}
else
aEvent
=
null
;
}
if
(
aEvent
!=
null
)
{
try
{
aEvent
.
run
();
}
catch
(
Throwable
e
)
{
System
.
out
.
println
(
"caught exception during event delivery: "
+
e
);
e
.
printStackTrace
();
}
}
}
while
(
aEvent
!=
null
);
try
{
synchronized
(
maMonitor
)
{
maMonitor
.
wait
();
}
}
catch
(
Exception
e
)
{
// can't wait? odd!
System
.
err
.
println
(
"Can't wait!"
);
e
.
printStackTrace
();
}
}
}
private
static
EventQueue
maInstance
=
null
;
private
Object
maMonitor
;
private
LinkedList
maRegularQueue
;
private
LinkedList
maDisposingQueue
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment