home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1999 April / DPPCPRO0499.ISO / April / Notes / 50b2wic.exe / DATA1.CAB / NotesProgramFilesJavaSupport / rt.jar / java / awt / Cursor.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-04-23  |  1.4 KB  |  52 lines

  1. package java.awt;
  2.  
  3. import java.io.Serializable;
  4.  
  5. public class Cursor implements Serializable {
  6.    public static final int DEFAULT_CURSOR = 0;
  7.    public static final int CROSSHAIR_CURSOR = 1;
  8.    public static final int TEXT_CURSOR = 2;
  9.    public static final int WAIT_CURSOR = 3;
  10.    public static final int SW_RESIZE_CURSOR = 4;
  11.    public static final int SE_RESIZE_CURSOR = 5;
  12.    public static final int NW_RESIZE_CURSOR = 6;
  13.    public static final int NE_RESIZE_CURSOR = 7;
  14.    public static final int N_RESIZE_CURSOR = 8;
  15.    public static final int S_RESIZE_CURSOR = 9;
  16.    public static final int W_RESIZE_CURSOR = 10;
  17.    public static final int E_RESIZE_CURSOR = 11;
  18.    public static final int HAND_CURSOR = 12;
  19.    public static final int MOVE_CURSOR = 13;
  20.    protected static Cursor[] predefined = new Cursor[14];
  21.    int type = 0;
  22.    private static final long serialVersionUID = 8028237497568985504L;
  23.  
  24.    public static Cursor getPredefinedCursor(int var0) {
  25.       if (var0 >= 0 && var0 <= 13) {
  26.          if (predefined[var0] == null) {
  27.             predefined[var0] = new Cursor(var0);
  28.          }
  29.  
  30.          return predefined[var0];
  31.       } else {
  32.          throw new IllegalArgumentException("illegal cursor type");
  33.       }
  34.    }
  35.  
  36.    public static Cursor getDefaultCursor() {
  37.       return getPredefinedCursor(0);
  38.    }
  39.  
  40.    public Cursor(int var1) {
  41.       if (var1 >= 0 && var1 <= 13) {
  42.          this.type = var1;
  43.       } else {
  44.          throw new IllegalArgumentException("illegal cursor type");
  45.       }
  46.    }
  47.  
  48.    public int getType() {
  49.       return this.type;
  50.    }
  51. }
  52.