java.awt

Class AWTEvent

Implemented Interfaces:
Serializable
Known Direct Subclasses:
ActionEvent, AdjustmentEvent, AncestorEvent, ComponentEvent, HierarchyEvent, InputMethodEvent, InternalFrameEvent, InvocationEvent, ItemEvent, TextEvent

public abstract class AWTEvent
extends EventObject

The root event class for all AWT events. This class and its subclasses supercede the original java.awt.Event class. Subclasses of this root AWTEvent class defined outside of the java.awt.event package should define event ID values greater than the value defined by RESERVED_ID_MAX.

The event masks defined in this class are needed by Component subclasses which are using Component.enableEvents() to select for event types not selected by registered listeners. If a listener is registered on a component, the appropriate event mask is already set internally by the component.

The masks are also used to specify to which types of events an AWTEventListener should listen. The masks are bitwise-ORed together and passed to Toolkit.addAWTEventListener.

Since:
1.1
See Also:
Component.enableEvents(long), Toolkit.addAWTEventListener(AWTEventListener,long), ActionEvent, AdjustmentEvent, ComponentEvent, ContainerEvent, FocusEvent, InputMethodEvent, InvocationEvent, ItemEvent, HierarchyEvent, KeyEvent, MouseEvent, MouseWheelEvent, PaintEvent, TextEvent, WindowEvent, Serialized Form

Field Summary

static long
ACTION_EVENT_MASK
The event mask for selecting action events.
static long
ADJUSTMENT_EVENT_MASK
The event mask for selecting adjustment events.
static long
COMPONENT_EVENT_MASK
The event mask for selecting component events.
static long
CONTAINER_EVENT_MASK
The event mask for selecting container events.
static long
FOCUS_EVENT_MASK
The event mask for selecting focus events.
static long
HIERARCHY_BOUNDS_EVENT_MASK
The event mask for selecting hierarchy bounds events.
static long
HIERARCHY_EVENT_MASK
The event mask for selecting hierarchy events.
static long
INPUT_METHOD_EVENT_MASK
The event mask for selecting input method events.
static long
INVOCATION_EVENT_MASK
The event mask for selecting invocation events.
static long
ITEM_EVENT_MASK
The event mask for selecting item events.
static long
KEY_EVENT_MASK
The event mask for selecting key events.
static long
MOUSE_EVENT_MASK
The event mask for selecting mouse events.
static long
MOUSE_MOTION_EVENT_MASK
The event mask for selecting mouse motion events.
static long
MOUSE_WHEEL_EVENT_MASK
The event mask for selecting mouse wheel events.
static long
PAINT_EVENT_MASK
The event mask for selecting paint events.
static int
RESERVED_ID_MAX
The maximum value for reserved AWT event IDs.
static long
TEXT_EVENT_MASK
The event mask for selecting text events.
static long
WINDOW_EVENT_MASK
The event mask for selecting window events.
static long
WINDOW_FOCUS_EVENT_MASK
The event mask for selecting window focus events.
static long
WINDOW_STATE_EVENT_MASK
The event mask for selecting window state events.
protected boolean
consumed
Controls whether or not the event is sent back down to the peer once the source has processed it - false means it's sent to the peer; true means it's not.
protected int
id
The event's id.

Fields inherited from class java.util.EventObject

source

Constructor Summary

AWTEvent(Event event)
Constructs an AWTEvent object from the parameters of a 1.0-style event.
AWTEvent(Object source, int id)
Constructs an AWTEvent object with the specified source object and type.

Method Summary

protected void
consume()
Consumes this event, if this event can be consumed.
int
getID()
Returns the event type.
protected boolean
isConsumed()
Returns whether this event has been consumed.
String
paramString()
Returns a string representing the state of this Event.
void
setSource(Object newSource)
Retargets an event to a new source.
String
toString()
Returns a String representation of this object.

Methods inherited from class java.util.EventObject

getSource, toString

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

ACTION_EVENT_MASK

public static final long ACTION_EVENT_MASK
The event mask for selecting action events.
Field Value:
128L
Usages and Demos :

View More Examples of AWTEvent.ACTION_EVENT_MASK
   1:         if(SwingUtilities.isLeftMouseButton(e) && e.getClickCount()==2) {
   2:         EEGAnalysis.window.configureComponent.actionPerformed(new ActionEvent(this,(int) AWTEvent.ACTION_EVENT_MASK,""));
   3:         }
   4:     }
   5:         

View Full Code Here
   1:             },
   2:             AWTEvent.ACTION_EVENT_MASK | 
   3:             AWTEvent.MOUSE_EVENT_MASK
   4:         );
   5:     }

View Full Code Here
   1:     if (event.getSource() != this &&
   2:     event.getID() == AWTEvent.ACTION_EVENT_MASK) {
   3:       readFields();
   4:       return;
   5:     }

View Full Code Here
   1:     enableEvents(
   2:       AWTEvent.ACTION_EVENT_MASK |
   3:       AWTEvent.ADJUSTMENT_EVENT_MASK |
   4:         ...
   5:   public MyButton() {
   6:     enableEvents(AWTEvent.ACTION_EVENT_MASK);
   7:   }
   8:   public void paint(Graphics g) {
   9:     g.setColor(Color.green);

View Full Code Here
   1:                         if(configurePath.isEnabled())
   2:                             configurePath.actionPerformed(new ActionEvent(pathChoice,(int) AWTEvent.ACTION_EVENT_MASK,""));
   3:                     }
   4:         ...
   5:                 if(e.getClickCount()==2 && SwingUtilities.isLeftMouseButton(e)) {
   6:                     configurePiece.actionPerformed(new ActionEvent(pieceList,(int) AWTEvent.ACTION_EVENT_MASK,""));
   7:                 }
   8:             }
   9:         });

View Full Code Here

ADJUSTMENT_EVENT_MASK

public static final long ADJUSTMENT_EVENT_MASK
The event mask for selecting adjustment events.
Field Value:
256L
Usages and Demos :

View More Examples of AWTEvent.ADJUSTMENT_EVENT_MASK
   1:          && event instanceof ActionEvent)
   2:         || ((mask & AWTEvent.ADJUSTMENT_EVENT_MASK) != 0
   3:             && event instanceof AdjustmentEvent)
   4:         || ((mask & AWTEvent.COMPONENT_EVENT_MASK) != 0
   5:             && event instanceof ComponentEvent

View Full Code Here
   1:       AWTEvent.ACTION_EVENT_MASK |
   2:       AWTEvent.ADJUSTMENT_EVENT_MASK |
   3:       AWTEvent.ITEM_EVENT_MASK |
   4:       AWTEvent.TEXT_EVENT_MASK |
   5:       AWTEvent.WINDOW_EVENT_MASK |

View Full Code Here

COMPONENT_EVENT_MASK

public static final long COMPONENT_EVENT_MASK
The event mask for selecting component events.
Field Value:
1L
Usages and Demos :

View More Examples of AWTEvent.COMPONENT_EVENT_MASK
   1:         tk.addAWTEventListener(this,
   2:             AWTEvent.COMPONENT_EVENT_MASK);
   3:     }
   4: 
   5:     public void eventDispatched(AWTEvent evt) {

View Full Code Here
   1:             && event instanceof AdjustmentEvent)
   2:         || ((mask & AWTEvent.COMPONENT_EVENT_MASK) != 0
   3:             && event instanceof ComponentEvent
   4:             && (id >= ComponentEvent.COMPONENT_FIRST
   5:                 && id <= ComponentEvent.COMPONENT_LAST))

View Full Code Here
   1:       AWTEvent.WINDOW_EVENT_MASK |
   2:       AWTEvent.COMPONENT_EVENT_MASK |
   3:       AWTEvent.FOCUS_EVENT_MASK |
   4:       AWTEvent.KEY_EVENT_MASK |
   5:       AWTEvent.MOUSE_EVENT_MASK |

View Full Code Here
   1:               AWTEvent.FOCUS_EVENT_MASK |
   2:               AWTEvent.COMPONENT_EVENT_MASK |
   3:               AWTEvent.WINDOW_EVENT_MASK);
   4:     this.setPreferredSize(new Dimension(500, 400));
   5:     }

View Full Code Here
   1:             };
   2:             Toolkit.getDefaultToolkit().addAWTEventListener(awtListener, AWTEvent.COMPONENT_EVENT_MASK | AWTEvent.FOCUS_EVENT_MASK);
   3:         }
   4:         
   5:         private void destroy() {

View Full Code Here

CONTAINER_EVENT_MASK

public static final long CONTAINER_EVENT_MASK
The event mask for selecting container events.
Field Value:
2L
Usages and Demos :

View More Examples of AWTEvent.CONTAINER_EVENT_MASK
   1:                 && id <= ComponentEvent.COMPONENT_LAST))
   2:         || ((mask & AWTEvent.CONTAINER_EVENT_MASK) != 0
   3:             && event instanceof ContainerEvent)
   4:         || ((mask & AWTEvent.FOCUS_EVENT_MASK) != 0
   5:             && event instanceof FocusEvent)

View Full Code Here
   1:       AWTEvent.MOUSE_MOTION_EVENT_MASK |
   2:       AWTEvent.CONTAINER_EVENT_MASK);
   3:   }
   4:   public void update(Graphics g) {
   5:     paint(g);

View Full Code Here

FOCUS_EVENT_MASK

public static final long FOCUS_EVENT_MASK
The event mask for selecting focus events.
Field Value:
4L
Usages and Demos :

View More Examples of AWTEvent.FOCUS_EVENT_MASK
   1:             && event instanceof ContainerEvent)
   2:         || ((mask & AWTEvent.FOCUS_EVENT_MASK) != 0
   3:             && event instanceof FocusEvent)
   4:         || ((mask & AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK) != 0
   5:             && event instanceof HierarchyEvent

View Full Code Here
   1:       AWTEvent.COMPONENT_EVENT_MASK |
   2:       AWTEvent.FOCUS_EVENT_MASK |
   3:       AWTEvent.KEY_EVENT_MASK |
   4:       AWTEvent.MOUSE_EVENT_MASK |
   5:       AWTEvent.MOUSE_MOTION_EVENT_MASK |

View Full Code Here
   1:               AWTEvent.KEY_EVENT_MASK |
   2:               AWTEvent.FOCUS_EVENT_MASK |
   3:               AWTEvent.COMPONENT_EVENT_MASK |
   4:               AWTEvent.WINDOW_EVENT_MASK);
   5:     this.setPreferredSize(new Dimension(500, 400));

View Full Code Here
   1:             };
   2:             Toolkit.getDefaultToolkit().addAWTEventListener(awtListener, AWTEvent.COMPONENT_EVENT_MASK | AWTEvent.FOCUS_EVENT_MASK);
   3:         }
   4:         
   5:         private void destroy() {

View Full Code Here
   1:         enableEvents(AWTEvent.COMPONENT_EVENT_MASK |
   2:             AWTEvent.FOCUS_EVENT_MASK | AWTEvent.KEY_EVENT_MASK |
   3:             AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_MOTION_EVENT_MASK | WHEEL_MASK);
   4:             try {
   5:                 if ((System.getProperty("java.vendor").indexOf("Insignia") != -1) &&

View Full Code Here

HIERARCHY_BOUNDS_EVENT_MASK

public static final long HIERARCHY_BOUNDS_EVENT_MASK
The event mask for selecting hierarchy bounds events.
Field Value:
65536L
Usages and Demos :

View More Examples of AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK
   1:             && event instanceof FocusEvent)
   2:         || ((mask & AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK) != 0
   3:             && event instanceof HierarchyEvent
   4:             && (id == HierarchyEvent.ANCESTOR_MOVED
   5:                 || id == HierarchyEvent.ANCESTOR_RESIZED))

View Full Code Here

HIERARCHY_EVENT_MASK

public static final long HIERARCHY_EVENT_MASK
The event mask for selecting hierarchy events.
Field Value:
32768L
Usages and Demos :

View More Examples of AWTEvent.HIERARCHY_EVENT_MASK
   1:                 || id == HierarchyEvent.ANCESTOR_RESIZED))
   2:         || ((mask & AWTEvent.HIERARCHY_EVENT_MASK) != 0
   3:             && event instanceof HierarchyEvent
   4:             && id == HierarchyEvent.HIERARCHY_CHANGED)
   5:         || ((mask & AWTEvent.INPUT_METHOD_EVENT_MASK) != 0

View Full Code Here
   1:         vIncludedGC.addMouseListener(vIncludedGC);
   2:         vIncludedGC.enableEvents(AWTEvent.HIERARCHY_EVENT_MASK + AWTEvent.MOUSE_EVENT_MASK);
   3:         return true;
   4: 
   5:     private int setupVTable (APanel aPanel, MTab mTab, VTable table)

View Full Code Here

INPUT_METHOD_EVENT_MASK

public static final long INPUT_METHOD_EVENT_MASK
The event mask for selecting input method events.
Field Value:
2048L
Usages and Demos :

View More Examples of AWTEvent.INPUT_METHOD_EVENT_MASK
   1:             && id == HierarchyEvent.HIERARCHY_CHANGED)
   2:         || ((mask & AWTEvent.INPUT_METHOD_EVENT_MASK) != 0
   3:             && event instanceof InputMethodEvent)
   4:         || ((mask & AWTEvent.INVOCATION_EVENT_MASK) != 0
   5:             && event instanceof InvocationEvent)

View Full Code Here

INVOCATION_EVENT_MASK

public static final long INVOCATION_EVENT_MASK
The event mask for selecting invocation events.
Field Value:
16384L
Usages and Demos :

View More Examples of AWTEvent.INVOCATION_EVENT_MASK
   1:             && event instanceof InputMethodEvent)
   2:         || ((mask & AWTEvent.INVOCATION_EVENT_MASK) != 0
   3:             && event instanceof InvocationEvent)
   4:         || ((mask & AWTEvent.ITEM_EVENT_MASK) != 0
   5:             && event instanceof ItemEvent)

View Full Code Here

ITEM_EVENT_MASK

public static final long ITEM_EVENT_MASK
The event mask for selecting item events.
Field Value:
512L
Usages and Demos :

View More Examples of AWTEvent.ITEM_EVENT_MASK
   1:             && event instanceof InvocationEvent)
   2:         || ((mask & AWTEvent.ITEM_EVENT_MASK) != 0
   3:             && event instanceof ItemEvent)
   4:         || ((mask & AWTEvent.KEY_EVENT_MASK) != 0
   5:             && event instanceof KeyEvent)

View Full Code Here
   1:       AWTEvent.ADJUSTMENT_EVENT_MASK |
   2:       AWTEvent.ITEM_EVENT_MASK |
   3:       AWTEvent.TEXT_EVENT_MASK |
   4:       AWTEvent.WINDOW_EVENT_MASK |
   5:       AWTEvent.COMPONENT_EVENT_MASK |

View Full Code Here

KEY_EVENT_MASK

public static final long KEY_EVENT_MASK
The event mask for selecting key events.
Field Value:
8L
Usages and Demos :

View More Examples of AWTEvent.KEY_EVENT_MASK
   1:         KeyboardFlasher flasher = new KeyboardFlasher();
   2:         tk.addAWTEventListener(flasher, AWTEvent.KEY_EVENT_MASK);
   3:         
   4:         JFrame frame = new JFrame("Hack #63: Keyboard Flasher");
   5:         JTextField tf = new JTextField("this is some text");

View Full Code Here
   1:         if (visible) {
   2:             Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.KEY_EVENT_MASK);
   3:         } else {
   4:             Toolkit.getDefaultToolkit().removeAWTEventListener(this);
   5:         }

View Full Code Here
   1:              AWTEvent.MOUSE_MOTION_EVENT_MASK |
   2:              AWTEvent.KEY_EVENT_MASK);
   3:     }
   4: 
   5:     public void processMouseEvent(MouseEvent e) {

View Full Code Here
   1: 
   2:             Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.KEY_EVENT_MASK);
   3: 
   4:             this.requestFocus();

View Full Code Here
   1:             Toolkit.getDefaultToolkit().addAWTEventListener(
   2:                     this, AWTEvent.KEY_EVENT_MASK);
   3: 
   4:             this.requestFocus();

View Full Code Here

MOUSE_EVENT_MASK

public static final long MOUSE_EVENT_MASK
The event mask for selecting mouse events.
Field Value:
16L
Usages and Demos :

View More Examples of AWTEvent.MOUSE_EVENT_MASK
   1:         Toolkit.getDefaultToolkit().addAWTEventListener(
   2:                 globalMouseListener, AWTEvent.MOUSE_EVENT_MASK);
   3:     }
   4:     
   5:     

View Full Code Here
   1:         Toolkit.getDefaultToolkit().addAWTEventListener(
   2:                 m_mouseClickListener, AWTEvent.MOUSE_EVENT_MASK);
   3:     }
   4:     
   5:     public Point getLastMouseClickPosition() {

View Full Code Here
   1:     static long EVENT_MASK = AWTEvent.KEY_EVENT_MASK | 
   2:                              AWTEvent.MOUSE_EVENT_MASK |
   3:                              AWTEvent.WINDOW_EVENT_MASK;
   4:     
   5:     public void show() {

View Full Code Here
   1:       AWTEvent.KEY_EVENT_MASK |
   2:       AWTEvent.MOUSE_EVENT_MASK |
   3:       AWTEvent.MOUSE_MOTION_EVENT_MASK |
   4:       AWTEvent.CONTAINER_EVENT_MASK);
   5:   }

View Full Code Here
   1:         reset();
   2:         Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_MOTION_EVENT_MASK);
   3:     }
   4:         ...
   5:     public void eventDispatched(final AWTEvent awtEvent) {
   6:         if ((awtEvent.getID() & AWTEvent.MOUSE_EVENT_MASK) != 0) {
   7:             MouseEvent e = (MouseEvent)awtEvent;
   8:             switch (e.getID()) {
   9:                 case MouseEvent.MOUSE_CLICKED:

View Full Code Here

MOUSE_MOTION_EVENT_MASK

public static final long MOUSE_MOTION_EVENT_MASK
The event mask for selecting mouse motion events.
Field Value:
32L
Usages and Demos :

View More Examples of AWTEvent.MOUSE_MOTION_EVENT_MASK
   1:     enableEvents(AWTEvent.MOUSE_EVENT_MASK |
   2:                  AWTEvent.MOUSE_MOTION_EVENT_MASK);
   3:   }
   4: 
   5:   public void processMouseEvent(MouseEvent event) {

View Full Code Here
   1:     enableEvents(AWTEvent.MOUSE_EVENT_MASK |
   2:              AWTEvent.MOUSE_MOTION_EVENT_MASK |
   3:              AWTEvent.KEY_EVENT_MASK);
   4:     }

View Full Code Here
   1:         
   2:         Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.MOUSE_MOTION_EVENT_MASK);
   3:     }
   4:     
   5:     public JButton addAction(final Action action) {

View Full Code Here
   1:     enableEvents(AWTEvent.MOUSE_EVENT_MASK |
   2:              AWTEvent.MOUSE_MOTION_EVENT_MASK);
   3:     }
   4: 
   5:     public void clear() {

View Full Code Here
   1:     enableEvents(AWTEvent.MOUSE_EVENT_MASK |
   2:              AWTEvent.MOUSE_MOTION_EVENT_MASK);
   3: 
   4:     Button b = new Button("Print");
   5:     b.addActionListener(new ActionListener() {

View Full Code Here

MOUSE_WHEEL_EVENT_MASK

public static final long MOUSE_WHEEL_EVENT_MASK
The event mask for selecting mouse wheel events.
Field Value:
131072L
Since:
1.4
Usages and Demos :

View More Examples of AWTEvent.MOUSE_WHEEL_EVENT_MASK
   1:                 || id == MouseEvent.MOUSE_DRAGGED))
   2:         || ((mask & AWTEvent.MOUSE_WHEEL_EVENT_MASK) != 0
   3:             && event instanceof MouseWheelEvent)
   4:         || ((mask & AWTEvent.PAINT_EVENT_MASK) != 0
   5:             && event instanceof PaintEvent)

View Full Code Here

PAINT_EVENT_MASK

public static final long PAINT_EVENT_MASK
The event mask for selecting paint events.
Field Value:
8192L
Usages and Demos :

View More Examples of AWTEvent.PAINT_EVENT_MASK
   1:             && event instanceof MouseWheelEvent)
   2:         || ((mask & AWTEvent.PAINT_EVENT_MASK) != 0
   3:             && event instanceof PaintEvent)
   4:         || ((mask & AWTEvent.TEXT_EVENT_MASK) != 0
   5:             && event instanceof TextEvent)

View Full Code Here

RESERVED_ID_MAX

public static final int RESERVED_ID_MAX
The maximum value for reserved AWT event IDs. Programs defining their own event IDs should use IDs greater than this value.
Field Value:
1999

TEXT_EVENT_MASK

public static final long TEXT_EVENT_MASK
The event mask for selecting text events.
Field Value:
1024L
Usages and Demos :

View More Examples of AWTEvent.TEXT_EVENT_MASK
   1:             && event instanceof PaintEvent)
   2:         || ((mask & AWTEvent.TEXT_EVENT_MASK) != 0
   3:             && event instanceof TextEvent)
   4:         || ((mask & AWTEvent.WINDOW_EVENT_MASK) != 0
   5:             && event instanceof WindowEvent

View Full Code Here
   1:       AWTEvent.ITEM_EVENT_MASK |
   2:       AWTEvent.TEXT_EVENT_MASK |
   3:       AWTEvent.WINDOW_EVENT_MASK |
   4:       AWTEvent.COMPONENT_EVENT_MASK |
   5:       AWTEvent.FOCUS_EVENT_MASK |

View Full Code Here

WINDOW_EVENT_MASK

public static final long WINDOW_EVENT_MASK
The event mask for selecting window events.
Field Value:
64L
Usages and Demos :

View More Examples of AWTEvent.WINDOW_EVENT_MASK
   1:                 windowWatcher, 
   2:                 AWTEvent.WINDOW_EVENT_MASK);
   3:     }
   4: 
   5:     public Window getWindow(String title) throws TimeoutException {

View Full Code Here
   1:                 windowWatcher, 
   2:                 AWTEvent.WINDOW_EVENT_MASK);
   3:     }
   4: 
   5:     public Window getWindow(String title) throws TimeoutException {

View Full Code Here
   1:         Toolkit tk = Toolkit.getDefaultToolkit();
   2:         tk.addAWTEventListener(WindowSaver.getInstance(),AWTEvent.WINDOW_EVENT_MASK);
   3:         
   4:         final JFrame frame = new JFrame("Hack X");
   5:         frame.setName("WSTes.main");

View Full Code Here
   1:         this.start();
   2:         this.enableEvents(AWTEvent.WINDOW_EVENT_MASK);
   3:         this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
   4:         jToggle.setSelected(auto);
   5:         this.show();

View Full Code Here
   1:     super(parent, true);
   2:     this.enableEvents(AWTEvent.WINDOW_EVENT_MASK);
   3:     this.setTitle(viewResource.getString(Label.A_PROPOS));
   4:     this.setResizable(false);
   5:     JPanel voletContenu = new JPanel(new BorderLayout());

View Full Code Here

WINDOW_FOCUS_EVENT_MASK

public static final long WINDOW_FOCUS_EVENT_MASK
The event mask for selecting window focus events.
Field Value:
524288L
Since:
1.4
Usages and Demos :

View More Examples of AWTEvent.WINDOW_FOCUS_EVENT_MASK
   1:                 || id == WindowEvent.WINDOW_DEACTIVATED))
   2:         || ((mask & AWTEvent.WINDOW_FOCUS_EVENT_MASK) != 0
   3:             && event instanceof WindowEvent
   4:             && (id == WindowEvent.WINDOW_GAINED_FOCUS
   5:                 || id == WindowEvent.WINDOW_LOST_FOCUS))

View Full Code Here

WINDOW_STATE_EVENT_MASK

public static final long WINDOW_STATE_EVENT_MASK
The event mask for selecting window state events.
Field Value:
262144L
Since:
1.4
Usages and Demos :

View More Examples of AWTEvent.WINDOW_STATE_EVENT_MASK
   1:                 || id == WindowEvent.WINDOW_LOST_FOCUS))
   2:         || ((mask & AWTEvent.WINDOW_STATE_EVENT_MASK) != 0
   3:             && event instanceof WindowEvent
   4:             && id == WindowEvent.WINDOW_STATE_CHANGED))
   5:       ((AWTEventListener) getListener()).eventDispatched(event);

View Full Code Here

consumed

protected boolean consumed
Controls whether or not the event is sent back down to the peer once the source has processed it - false means it's sent to the peer; true means it's not. Semantic events always have a 'true' value since they were generated by the peer in response to a low-level event.

id

protected int id
The event's id.
See Also:
getID(), AWTEvent

Constructor Details

AWTEvent

public AWTEvent(Event event)
Constructs an AWTEvent object from the parameters of a 1.0-style event.
Parameters:
event - the old-style event

AWTEvent

public AWTEvent(Object source,
                int id)
Constructs an AWTEvent object with the specified source object and type.
Parameters:
source - the object where the event originated

Method Details

consume

protected void consume()
Consumes this event, if this event can be consumed. Only low-level, system events can be consumed

getID

public int getID()
Returns the event type.
Usages and Demos :

View More Examples of getID()
   1: 
   2:   public void processEvent(AWTEvent event) {
   3:     if (event.getSource() != this &&
   4:         ...
   5:     event.getID() == AWTEvent.ACTION_EVENT_MASK) {
   6:       readFields();
   7:       return;
   8:     }

View Full Code Here
   1: 
   2:     AWTEvent copyEvent(Component src, AWTEvent evt) {
   3: 
   4:         ...
   5:         MouseEvent mev=(MouseEvent)evt;
   6:         return new MouseEvent(src, evt.getID(), mev.getWhen(), mev.getModifiers(),
   7:                   mev.getX(), mev.getY(), mev.getClickCount(),
   8:         ...
   9:         KeyEvent kev=(KeyEvent)evt;
  10:         return new KeyEvent(src, evt.getID(), kev.getWhen(), kev.getModifiers(), 
  11:                 kev.getKeyCode(), kev.getKeyChar());
  12:         ...
  13:     if(evt instanceof ActionEvent)
  14:         return new ActionEvent(src, evt.getID(), ((ActionEvent)evt).getActionCommand(),

View Full Code Here
   1: 
   2:     public void processEvent(String comp_name, AWTEvent evt) {
   3:         ...
   4:         AWTEvent copy_evt = null;
   5:         Component src = findComponent(mainFrame, comp_name);
   6:         ...
   7:             try {
   8:                 AWTEvent evt = event_queue.getNextEvent();
   9:                 Object obj = evt.getSource();
  10:         ...
  11: 
  12:             return new MouseEvent(src, evt.getID(), mev.getWhen(), mev.getModifiers(), mev.getX(), 

View Full Code Here

isConsumed

protected boolean isConsumed()
Returns whether this event has been consumed.

paramString

public String paramString()
Returns a string representing the state of this Event. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null.
Returns:
a string representation of this event
Usages and Demos :

View More Examples of paramString()
   1:       }
   2:       public void processEvent(AWTEvent e) {
   3:          ThreadGroup currentTG =  Thread.currentThread().getThreadGroup();
   4:         ...
   5:          } else {
   6:             System.out.println("OK :" + e.paramString());
   7:          }
   8:       }

View Full Code Here

setSource

public void setSource(Object newSource)
Retargets an event to a new source. This method is typically used to retarget an event to a lightweight child Component of the original heavyweight source.

This method is intended to be used only by event targeting subsystems, such as client-defined KeyboardFocusManagers. It is not for general client use.

Parameters:
newSource - the new Object to which the event should be dispatched

toString

public String toString()
Returns a String representation of this object.
Overrides:
toString in interface EventObject
Usages and Demos :

View More Examples of toString()
   1:     }
   2:     protected void perform(AWTEvent e)
   3:     {
   4:         ...
   5:             gradientChoice.getSelectedIndex()); }
   6:         catch (FlowJException e) { IJ.error(e.toString()); return; }
   7:         lucas.start();
   8:     }
   9:     public void doFlatFlow(OF3DFlow of3d)

View Full Code Here