Source for gnu.gcj.xlib.XEvent

   1: /* Copyright (C) 2000  Free Software Foundation
   2: 
   3:    This file is part of libgcj.
   4: 
   5: This software is copyrighted work licensed under the terms of the
   6: Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
   7: details.  */
   8: 
   9: package gnu.gcj.xlib;
  10: 
  11: import gnu.gcj.RawData;
  12: 
  13: /**
  14:  * Base class for interpreters of specific X event types.  For methods
  15:  * concerning all X events, see XAnyEvent.
  16:  *
  17:  * @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
  18:  */
  19: public class XEvent
  20: {
  21:   public XEvent(XAnyEvent event)
  22:   {
  23:     this.event = event;
  24:   }
  25:   
  26:   public XEvent(int type, Display display)
  27:   {
  28:     this(new XAnyEvent(display));
  29:     event.setType(type);
  30:   }
  31: 
  32:   XAnyEvent event;
  33: 
  34:   public XAnyEvent getXAnyEvent()
  35:   {
  36:     return event;
  37:   }
  38: 
  39:   public String toString()
  40:   {
  41:     if (event == null)
  42:       return super.toString();
  43:     return event.toString();
  44:   }
  45: }