Source for gnu.gcj.xlib.XID

   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: /**
  12:  * Common base class for all resources that are stored on the server
  13:  * and refered to on the client side using XIDs.
  14:  *
  15:  * @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
  16:  */
  17: public class XID
  18: {
  19:   public XID(Display display, int xid)
  20:   {
  21:     this.display = display;
  22:     this.xid = xid;
  23:   }
  24: 
  25:   public final int getXID()
  26:   {
  27:     return xid;
  28:   }
  29: 
  30:   public final Display getDisplay()
  31:   {
  32:     return display;
  33:   }
  34: 
  35:   protected Display display;
  36:   protected int xid;
  37: 
  38:   private Object clientData;
  39:   public final Object getClientData()
  40:   {
  41:     return clientData;
  42:   }
  43:   public final void setClientData(Object clientData)
  44:   {
  45:     this.clientData = clientData;
  46:   }
  47: 
  48:   protected String params()
  49:   {
  50:     return "display=" + display + ",xid=" + Integer.toHexString(xid);
  51:   }
  52:   
  53:   public String toString()
  54:   {
  55:     return getClass().getName() +
  56:       "[" + params() + "]";
  57:   }
  58: }