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

Print this page




  32 
  33 /**
  34  * A mechanism for ensuring that a series of AWTEvents are executed in a
  35  * precise order, even across multiple AppContexts. The nested events will be
  36  * dispatched in the order in which their wrapping SequencedEvents were
  37  * constructed. The only exception to this rule is if the peer of the target of
  38  * the nested event was destroyed (with a call to Component.removeNotify)
  39  * before the wrapping SequencedEvent was able to be dispatched. In this case,
  40  * the nested event is never dispatched.
  41  *
  42  * @author David Mendenhall
  43  */
  44 class SequencedEvent extends AWTEvent implements ActiveEvent {
  45     /*
  46      * serialVersionUID
  47      */
  48     private static final long serialVersionUID = 547742659238625067L;
  49 
  50     private static final int ID =
  51         java.awt.event.FocusEvent.FOCUS_LAST + 1;
  52     private static final LinkedList list = new LinkedList();
  53 
  54     private final AWTEvent nested;
  55     private AppContext appContext;
  56     private boolean disposed;
  57 
  58     static {
  59         AWTAccessor.setSequencedEventAccessor(new AWTAccessor.SequencedEventAccessor() {
  60             public AWTEvent getNested(AWTEvent sequencedEvent) {
  61                 return ((SequencedEvent)sequencedEvent).nested;
  62             }
  63             public boolean isSequencedEvent(AWTEvent event) {
  64                 return event instanceof SequencedEvent;
  65             }
  66         });
  67     }
  68 
  69     /**
  70      * Constructs a new SequencedEvent which will dispatch the specified
  71      * nested event.
  72      *




  32 
  33 /**
  34  * A mechanism for ensuring that a series of AWTEvents are executed in a
  35  * precise order, even across multiple AppContexts. The nested events will be
  36  * dispatched in the order in which their wrapping SequencedEvents were
  37  * constructed. The only exception to this rule is if the peer of the target of
  38  * the nested event was destroyed (with a call to Component.removeNotify)
  39  * before the wrapping SequencedEvent was able to be dispatched. In this case,
  40  * the nested event is never dispatched.
  41  *
  42  * @author David Mendenhall
  43  */
  44 class SequencedEvent extends AWTEvent implements ActiveEvent {
  45     /*
  46      * serialVersionUID
  47      */
  48     private static final long serialVersionUID = 547742659238625067L;
  49 
  50     private static final int ID =
  51         java.awt.event.FocusEvent.FOCUS_LAST + 1;
  52     private static final LinkedList<SequencedEvent> list = new LinkedList<>();
  53 
  54     private final AWTEvent nested;
  55     private AppContext appContext;
  56     private boolean disposed;
  57 
  58     static {
  59         AWTAccessor.setSequencedEventAccessor(new AWTAccessor.SequencedEventAccessor() {
  60             public AWTEvent getNested(AWTEvent sequencedEvent) {
  61                 return ((SequencedEvent)sequencedEvent).nested;
  62             }
  63             public boolean isSequencedEvent(AWTEvent event) {
  64                 return event instanceof SequencedEvent;
  65             }
  66         });
  67     }
  68 
  69     /**
  70      * Constructs a new SequencedEvent which will dispatch the specified
  71      * nested event.
  72      *