< prev index next >

src/java.desktop/share/classes/java/awt/SequencedEvent.java

Print this page




  38  * precise order, even across multiple AppContexts. The nested events will be
  39  * dispatched in the order in which their wrapping SequencedEvents were
  40  * constructed. The only exception to this rule is if the peer of the target of
  41  * the nested event was destroyed (with a call to Component.removeNotify)
  42  * before the wrapping SequencedEvent was able to be dispatched. In this case,
  43  * the nested event is never dispatched.
  44  *
  45  * @author David Mendenhall
  46  */
  47 class SequencedEvent extends AWTEvent implements ActiveEvent {
  48     /*
  49      * serialVersionUID
  50      */
  51     private static final long serialVersionUID = 547742659238625067L;
  52 
  53     private static final int ID =
  54         java.awt.event.FocusEvent.FOCUS_LAST + 1;
  55     private static final LinkedList<SequencedEvent> list = new LinkedList<>();
  56 
  57     private final AWTEvent nested;

  58     private AppContext appContext;
  59     private boolean disposed;
  60     private final LinkedList<AWTEvent> pendingEvents = new LinkedList<>();
  61 
  62     private static boolean fxAppThreadIsDispatchThread;

  63     private Thread fxCheckSequenceThread;
  64     static {
  65         AWTAccessor.setSequencedEventAccessor(new AWTAccessor.SequencedEventAccessor() {
  66             public AWTEvent getNested(AWTEvent sequencedEvent) {
  67                 return ((SequencedEvent)sequencedEvent).nested;
  68             }
  69             public boolean isSequencedEvent(AWTEvent event) {
  70                 return event instanceof SequencedEvent;
  71             }
  72 
  73             public AWTEvent create(AWTEvent event) {
  74                 return new SequencedEvent(event);
  75             }
  76         });
  77         AccessController.doPrivileged(new PrivilegedAction<Object>() {
  78             public Object run() {
  79                 fxAppThreadIsDispatchThread =
  80                         "true".equals(System.getProperty("javafx.embed.singleThread"));
  81                 return null;
  82             }




  38  * precise order, even across multiple AppContexts. The nested events will be
  39  * dispatched in the order in which their wrapping SequencedEvents were
  40  * constructed. The only exception to this rule is if the peer of the target of
  41  * the nested event was destroyed (with a call to Component.removeNotify)
  42  * before the wrapping SequencedEvent was able to be dispatched. In this case,
  43  * the nested event is never dispatched.
  44  *
  45  * @author David Mendenhall
  46  */
  47 class SequencedEvent extends AWTEvent implements ActiveEvent {
  48     /*
  49      * serialVersionUID
  50      */
  51     private static final long serialVersionUID = 547742659238625067L;
  52 
  53     private static final int ID =
  54         java.awt.event.FocusEvent.FOCUS_LAST + 1;
  55     private static final LinkedList<SequencedEvent> list = new LinkedList<>();
  56 
  57     private final AWTEvent nested;
  58     @SuppressWarnings("serial") // Not statically typed as Serializable
  59     private AppContext appContext;
  60     private boolean disposed;
  61     private final LinkedList<AWTEvent> pendingEvents = new LinkedList<>();
  62 
  63     private static boolean fxAppThreadIsDispatchThread;
  64     @SuppressWarnings("serial") // Not statically typed as Serializable
  65     private Thread fxCheckSequenceThread;
  66     static {
  67         AWTAccessor.setSequencedEventAccessor(new AWTAccessor.SequencedEventAccessor() {
  68             public AWTEvent getNested(AWTEvent sequencedEvent) {
  69                 return ((SequencedEvent)sequencedEvent).nested;
  70             }
  71             public boolean isSequencedEvent(AWTEvent event) {
  72                 return event instanceof SequencedEvent;
  73             }
  74 
  75             public AWTEvent create(AWTEvent event) {
  76                 return new SequencedEvent(event);
  77             }
  78         });
  79         AccessController.doPrivileged(new PrivilegedAction<Object>() {
  80             public Object run() {
  81                 fxAppThreadIsDispatchThread =
  82                         "true".equals(System.getProperty("javafx.embed.singleThread"));
  83                 return null;
  84             }


< prev index next >