< prev index next >

modules/javafx.graphics/src/main/java/com/sun/glass/ui/Cursor.java

Print this page
rev 10044 : 8166230: use @Native annotation in graphics, media classes
Reviewed-by: kcr
   1 /*
   2  * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 package com.sun.glass.ui;
  26 


  27 public abstract class Cursor {
  28 
  29     public final static int CURSOR_NONE = -1;
  30     public final static int CURSOR_CUSTOM = 0;
  31     public final static int CURSOR_DEFAULT = 1;
  32     public final static int CURSOR_TEXT = 2;
  33     public final static int CURSOR_CROSSHAIR = 3;
  34     public final static int CURSOR_CLOSED_HAND = 4;
  35     public final static int CURSOR_OPEN_HAND = 5;
  36     public final static int CURSOR_POINTING_HAND = 6;
  37     public final static int CURSOR_RESIZE_LEFT = 7;
  38     public final static int CURSOR_RESIZE_RIGHT = 8;
  39     public final static int CURSOR_RESIZE_UP = 9;
  40     public final static int CURSOR_RESIZE_DOWN = 10;
  41     public final static int CURSOR_RESIZE_LEFTRIGHT = 11;
  42     public final static int CURSOR_RESIZE_UPDOWN = 12;
  43     public final static int CURSOR_DISAPPEAR = 13;
  44     public final static int CURSOR_WAIT = 14;
  45     public final static int CURSOR_RESIZE_SOUTHWEST = 15;
  46     public final static int CURSOR_RESIZE_SOUTHEAST = 16;
  47     public final static int CURSOR_RESIZE_NORTHWEST = 17;
  48     public final static int CURSOR_RESIZE_NORTHEAST = 18;
  49     public final static int CURSOR_MOVE = 19;
  50     private final static int CURSOR_MAX = 19;
  51 
  52     private final int type;
  53 
  54     // Native cursor ptr, for custom cursors
  55     private long ptr;
  56 
  57     protected Cursor(final int type) {
  58         Application.checkEventThread();
  59         this.type = type;
  60     }
  61 
  62     protected Cursor(final int x, final int y, final Pixels pixels) {
  63         this(CURSOR_CUSTOM);
  64         ptr = _createCursor(x, y, pixels);
  65     }
  66 
  67     public final int getType() {
  68         Application.checkEventThread();
  69         return type;


   1 /*
   2  * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 package com.sun.glass.ui;
  26 
  27 import java.lang.annotation.Native;
  28 
  29 public abstract class Cursor {
  30 
  31     @Native public final static int CURSOR_NONE = -1;
  32     @Native public final static int CURSOR_CUSTOM = 0;
  33     @Native public final static int CURSOR_DEFAULT = 1;
  34     @Native public final static int CURSOR_TEXT = 2;
  35     @Native public final static int CURSOR_CROSSHAIR = 3;
  36     @Native public final static int CURSOR_CLOSED_HAND = 4;
  37     @Native public final static int CURSOR_OPEN_HAND = 5;
  38     @Native public final static int CURSOR_POINTING_HAND = 6;
  39     @Native public final static int CURSOR_RESIZE_LEFT = 7;
  40     @Native public final static int CURSOR_RESIZE_RIGHT = 8;
  41     @Native public final static int CURSOR_RESIZE_UP = 9;
  42     @Native public final static int CURSOR_RESIZE_DOWN = 10;
  43     @Native public final static int CURSOR_RESIZE_LEFTRIGHT = 11;
  44     @Native public final static int CURSOR_RESIZE_UPDOWN = 12;
  45     @Native public final static int CURSOR_DISAPPEAR = 13;
  46     @Native public final static int CURSOR_WAIT = 14;
  47     @Native public final static int CURSOR_RESIZE_SOUTHWEST = 15;
  48     @Native public final static int CURSOR_RESIZE_SOUTHEAST = 16;
  49     @Native public final static int CURSOR_RESIZE_NORTHWEST = 17;
  50     @Native public final static int CURSOR_RESIZE_NORTHEAST = 18;
  51     @Native public final static int CURSOR_MOVE = 19;
  52     private final static int CURSOR_MAX = 19;
  53 
  54     private final int type;
  55 
  56     // Native cursor ptr, for custom cursors
  57     private long ptr;
  58 
  59     protected Cursor(final int type) {
  60         Application.checkEventThread();
  61         this.type = type;
  62     }
  63 
  64     protected Cursor(final int x, final int y, final Pixels pixels) {
  65         this(CURSOR_CUSTOM);
  66         ptr = _createCursor(x, y, pixels);
  67     }
  68 
  69     public final int getType() {
  70         Application.checkEventThread();
  71         return type;


< prev index next >