2010-09-28 17:11:35 -04:00
|
|
|
/*
|
2008-04-07 14:36:09 -04:00
|
|
|
* Copyright (c) 2002-2008 LWJGL Project
|
2003-08-17 12:38:57 -04:00
|
|
|
* All rights reserved.
|
2010-09-28 17:11:35 -04:00
|
|
|
*
|
2003-08-17 12:38:57 -04:00
|
|
|
* Redistribution and use in source and binary forms, with or without
|
2010-09-28 17:11:35 -04:00
|
|
|
* modification, are permitted provided that the following conditions are
|
2003-08-17 12:38:57 -04:00
|
|
|
* met:
|
2010-09-28 17:11:35 -04:00
|
|
|
*
|
|
|
|
* * Redistributions of source code must retain the above copyright
|
2003-08-17 12:38:57 -04:00
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
*
|
|
|
|
* * Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
2010-09-28 17:11:35 -04:00
|
|
|
* * Neither the name of 'LWJGL' nor the names of
|
|
|
|
* its contributors may be used to endorse or promote products derived
|
2003-08-17 12:38:57 -04:00
|
|
|
* from this software without specific prior written permission.
|
2010-09-28 17:11:35 -04:00
|
|
|
*
|
2003-08-17 12:38:57 -04:00
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
2010-09-28 17:11:35 -04:00
|
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
|
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
|
|
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
|
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
2003-08-17 12:38:57 -04:00
|
|
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
2010-09-28 17:11:35 -04:00
|
|
|
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
2003-08-17 12:38:57 -04:00
|
|
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
|
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
package org.lwjgl.input;
|
|
|
|
|
2004-02-08 15:41:00 -05:00
|
|
|
import java.nio.IntBuffer;
|
|
|
|
|
2013-10-30 11:20:28 -04:00
|
|
|
import org.lwjgl.BufferChecks;
|
2004-11-20 11:46:44 -05:00
|
|
|
import org.lwjgl.BufferUtils;
|
|
|
|
import org.lwjgl.LWJGLException;
|
2005-04-09 13:35:37 -04:00
|
|
|
import org.lwjgl.LWJGLUtil;
|
2004-05-05 10:28:40 -04:00
|
|
|
import org.lwjgl.Sys;
|
2003-08-17 12:38:57 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* A class representing a native cursor. Instances of this
|
|
|
|
* class can be used with Mouse.setCursor(), if available.
|
|
|
|
*
|
|
|
|
* @author elias_naur <elias_naur@users.sourceforge.net>
|
|
|
|
* @version $Revision$
|
2006-03-23 14:32:21 -05:00
|
|
|
* $Id$
|
2003-08-17 12:38:57 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
public class Cursor {
|
2005-01-18 07:34:36 -05:00
|
|
|
/** 1 bit transparency for native cursor */
|
2022-08-10 11:43:59 -04:00
|
|
|
@java.lang.annotation.Native
|
2005-01-18 07:34:36 -05:00
|
|
|
public static final int CURSOR_ONE_BIT_TRANSPARENCY = 1;
|
|
|
|
|
|
|
|
/** 8 bit alhpa native cursor */
|
2022-08-10 11:43:59 -04:00
|
|
|
@java.lang.annotation.Native
|
2005-01-18 07:34:36 -05:00
|
|
|
public static final int CURSOR_8_BIT_ALPHA = 2;
|
|
|
|
|
|
|
|
/** animation native cursor */
|
2022-08-10 11:43:59 -04:00
|
|
|
@java.lang.annotation.Native
|
2005-01-18 07:34:36 -05:00
|
|
|
public static final int CURSOR_ANIMATION = 4;
|
|
|
|
|
2004-03-27 06:55:07 -05:00
|
|
|
/** First element to display */
|
2004-07-25 10:28:50 -04:00
|
|
|
private final CursorElement[] cursors;
|
2010-09-28 17:11:35 -04:00
|
|
|
|
2004-03-27 06:55:07 -05:00
|
|
|
/** Index into list of cursors */
|
2010-09-28 17:11:35 -04:00
|
|
|
private int index;
|
2005-02-20 06:24:22 -05:00
|
|
|
|
|
|
|
private boolean destroyed;
|
2010-09-28 17:11:35 -04:00
|
|
|
|
2004-03-27 06:55:07 -05:00
|
|
|
/**
|
|
|
|
* Constructs a new Cursor, with the given parameters. Mouse must have been created before you can create
|
|
|
|
* Cursor objects. Cursor images are in ARGB format, but only one bit transparancy is guaranteed to be supported.
|
|
|
|
* So to maximize portability, lwjgl applications should only create cursor images with 0x00 or 0xff as alpha values.
|
|
|
|
* The constructor will copy the images and delays, so there's no need to keep them around.
|
|
|
|
*
|
|
|
|
* @param width cursor image width
|
|
|
|
* @param height cursor image height
|
|
|
|
* @param xHotspot the x coordinate of the cursor hotspot
|
|
|
|
* @param yHotspot the y coordinate of the cursor hotspot
|
|
|
|
* @param numImages number of cursor images specified. Must be 1 if animations are not supported.
|
|
|
|
* @param images A buffer containing the images. The origin is at the lower left corner, like OpenGL.
|
|
|
|
* @param delays An int buffer of animation frame delays, if numImages is greater than 1, else null
|
2004-03-27 10:05:24 -05:00
|
|
|
* @throws LWJGLException if the cursor could not be created for any reason
|
2010-09-28 17:11:35 -04:00
|
|
|
*/
|
2004-03-27 10:05:24 -05:00
|
|
|
public Cursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException {
|
2007-02-12 07:18:26 -05:00
|
|
|
synchronized (OpenGLPackageAccess.global_lock) {
|
|
|
|
if ((getCapabilities() & CURSOR_ONE_BIT_TRANSPARENCY) == 0)
|
|
|
|
throw new LWJGLException("Native cursors not supported");
|
2013-10-30 11:20:28 -04:00
|
|
|
BufferChecks.checkBufferSize(images, width*height*numImages);
|
2007-04-23 12:47:25 -04:00
|
|
|
if (delays != null)
|
2013-10-30 11:20:28 -04:00
|
|
|
BufferChecks.checkBufferSize(delays, numImages);
|
2007-02-12 07:18:26 -05:00
|
|
|
if (!Mouse.isCreated())
|
|
|
|
throw new IllegalStateException("Mouse must be created before creating cursor objects");
|
|
|
|
if (width*height*numImages > images.remaining())
|
|
|
|
throw new IllegalArgumentException("width*height*numImages > images.remaining()");
|
|
|
|
if (xHotspot >= width || xHotspot < 0)
|
|
|
|
throw new IllegalArgumentException("xHotspot > width || xHotspot < 0");
|
|
|
|
if (yHotspot >= height || yHotspot < 0)
|
|
|
|
throw new IllegalArgumentException("yHotspot > height || yHotspot < 0");
|
|
|
|
|
|
|
|
Sys.initialize();
|
|
|
|
|
2010-09-28 17:11:35 -04:00
|
|
|
// Hmm
|
|
|
|
yHotspot = height - 1 - yHotspot;
|
2007-02-12 07:18:26 -05:00
|
|
|
|
|
|
|
// create cursor (or cursors if multiple images supplied)
|
|
|
|
cursors = createCursors(width, height, xHotspot, yHotspot, numImages, images, delays);
|
|
|
|
}
|
2004-03-27 06:55:07 -05:00
|
|
|
}
|
2005-01-18 07:34:36 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the minimum size of a native cursor. Can only be called if
|
|
|
|
* The Mouse is created and cursor caps includes at least
|
|
|
|
* CURSOR_ONE_BIT_TRANSPARANCY.
|
|
|
|
*
|
|
|
|
* @return the maximum size of a native cursor
|
|
|
|
*/
|
|
|
|
public static int getMinCursorSize() {
|
2022-08-14 13:21:03 -04:00
|
|
|
if (!Mouse.isCreated())
|
|
|
|
throw new IllegalStateException("Mouse must be created.");
|
|
|
|
return Mouse.getImplementation().getMinCursorSize();
|
2005-01-18 07:34:36 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the maximum size of a native cursor. Can only be called if
|
|
|
|
* The Mouse is created and cursor caps includes at least
|
|
|
|
* CURSOR_ONE_BIT_TRANSPARANCY.
|
|
|
|
*
|
|
|
|
* @return the maximum size of a native cursor
|
|
|
|
*/
|
|
|
|
public static int getMaxCursorSize() {
|
2022-08-14 13:21:03 -04:00
|
|
|
if (!Mouse.isCreated())
|
|
|
|
throw new IllegalStateException("Mouse must be created.");
|
|
|
|
return Mouse.getImplementation().getMaxCursorSize();
|
2005-01-18 07:34:36 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the capabilities of the native cursor. Return a bit mask of the native cursor capabilities.
|
|
|
|
* The CURSOR_ONE_BIT_TRANSPARANCY indicates support for cursors with one bit transparancy,
|
|
|
|
* the CURSOR_8_BIT_ALPHA indicates support for 8 bit alpha and CURSOR_ANIMATION indicates
|
|
|
|
* support for cursor animations.
|
|
|
|
*
|
|
|
|
* @return A bit mask with native cursor capabilities.
|
|
|
|
*/
|
|
|
|
public static int getCapabilities() {
|
2022-08-14 13:21:03 -04:00
|
|
|
if (Mouse.getImplementation() != null) {
|
|
|
|
return Mouse.getImplementation().getNativeCursorCapabilities();
|
|
|
|
} else {
|
|
|
|
return OpenGLPackageAccess.createImplementation().getNativeCursorCapabilities();
|
2007-02-12 07:18:26 -05:00
|
|
|
}
|
2005-01-18 07:34:36 -05:00
|
|
|
}
|
|
|
|
|
2004-03-27 06:55:07 -05:00
|
|
|
/**
|
|
|
|
* Creates the actual cursor, using a platform specific class
|
|
|
|
*/
|
2004-07-25 10:28:50 -04:00
|
|
|
private static CursorElement[] createCursors(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException {
|
2004-03-27 06:55:07 -05:00
|
|
|
// create copy and flip images to match ogl
|
2004-07-25 10:28:50 -04:00
|
|
|
IntBuffer images_copy = BufferUtils.createIntBuffer(images.remaining());
|
2004-03-27 06:55:07 -05:00
|
|
|
flipImages(width, height, numImages, images, images_copy);
|
2010-09-28 17:11:35 -04:00
|
|
|
|
2013-01-29 17:59:40 -05:00
|
|
|
// Mac and Windows doesn't (afaik) allow for animation based cursors, except in the .ani
|
|
|
|
// format on Windows, which we don't support.
|
2004-04-12 03:20:01 -04:00
|
|
|
// The cursor animation was therefor developed using java side time tracking.
|
|
|
|
// unfortunately X flickers when changing cursor. We therefore check for either
|
2013-01-29 17:59:40 -05:00
|
|
|
// Windows, Mac or X and do accordingly.
|
|
|
|
// we might want to split it into a X/Win/Mac cursor if it gets too cluttered
|
2010-09-28 17:11:35 -04:00
|
|
|
|
2004-07-25 10:28:50 -04:00
|
|
|
CursorElement[] cursors;
|
2005-04-09 13:35:37 -04:00
|
|
|
switch (LWJGLUtil.getPlatform()) {
|
|
|
|
case LWJGLUtil.PLATFORM_MACOSX:
|
2013-01-31 17:44:43 -05:00
|
|
|
|
|
|
|
// OS X requires the image format to be in ABGR format
|
|
|
|
convertARGBtoABGR(images_copy);
|
|
|
|
|
2013-01-24 19:28:26 -05:00
|
|
|
// create our cursor elements
|
2013-01-29 17:59:40 -05:00
|
|
|
cursors = new CursorElement[numImages];
|
|
|
|
for(int i=0; i<numImages; i++) {
|
|
|
|
Object handle = Mouse.getImplementation().createCursor(width, height, xHotspot, yHotspot, 1, images_copy, null);
|
|
|
|
long delay = (delays != null) ? delays.get(i) : 0;
|
|
|
|
long timeout = System.currentTimeMillis();
|
|
|
|
cursors[i] = new CursorElement(handle, delay, timeout);
|
|
|
|
|
|
|
|
// offset to next image
|
|
|
|
images_copy.position(width*height*(i+1));
|
|
|
|
}
|
2013-01-24 19:28:26 -05:00
|
|
|
break;
|
2005-04-09 13:35:37 -04:00
|
|
|
case LWJGLUtil.PLATFORM_WINDOWS:
|
|
|
|
// create our cursor elements
|
|
|
|
cursors = new CursorElement[numImages];
|
|
|
|
for(int i=0; i<numImages; i++) {
|
2010-09-28 17:11:35 -04:00
|
|
|
|
2007-10-20 10:48:07 -04:00
|
|
|
// iterate through the images, and make sure that the pixels are either 0xffxxxxxx or 0x00000000
|
|
|
|
int size = width * height;
|
|
|
|
for(int j=0; j<size; j++) {
|
|
|
|
int index = j + (i*size);
|
|
|
|
int alpha = images_copy.get(index) >> 24 & 0xff;
|
|
|
|
if(alpha != 0xff) {
|
|
|
|
images_copy.put(index, 0);
|
|
|
|
}
|
|
|
|
}
|
2010-09-28 17:11:35 -04:00
|
|
|
|
2006-10-08 05:05:16 -04:00
|
|
|
Object handle = Mouse.getImplementation().createCursor(width, height, xHotspot, yHotspot, 1, images_copy, null);
|
2005-04-09 13:35:37 -04:00
|
|
|
long delay = (delays != null) ? delays.get(i) : 0;
|
|
|
|
long timeout = System.currentTimeMillis();
|
|
|
|
cursors[i] = new CursorElement(handle, delay, timeout);
|
|
|
|
|
|
|
|
// offset to next image
|
|
|
|
images_copy.position(width*height*(i+1));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case LWJGLUtil.PLATFORM_LINUX:
|
|
|
|
// create our cursor elements
|
2006-10-08 05:05:16 -04:00
|
|
|
Object handle = Mouse.getImplementation().createCursor(width, height, xHotspot, yHotspot, numImages, images_copy, delays);
|
2005-04-09 13:35:37 -04:00
|
|
|
CursorElement cursor_element = new CursorElement(handle, -1, -1);
|
|
|
|
cursors = new CursorElement[]{cursor_element};
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
throw new RuntimeException("Unknown OS");
|
2004-04-12 03:20:01 -04:00
|
|
|
}
|
2004-07-25 10:28:50 -04:00
|
|
|
return cursors;
|
2010-09-28 17:11:35 -04:00
|
|
|
}
|
2013-01-31 17:44:43 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Convert an IntBuffer image of ARGB format into ABGR
|
|
|
|
*
|
|
|
|
* @param imageBuffer image to convert
|
|
|
|
*/
|
|
|
|
private static void convertARGBtoABGR(IntBuffer imageBuffer) {
|
|
|
|
for (int i = 0; i < imageBuffer.limit(); i++) {
|
|
|
|
int argbColor = imageBuffer.get(i);
|
|
|
|
|
|
|
|
byte alpha = (byte)(argbColor >>> 24);
|
|
|
|
byte blue = (byte)(argbColor >>> 16);
|
|
|
|
byte green = (byte)(argbColor >>> 8);
|
|
|
|
byte red = (byte)argbColor;
|
|
|
|
|
|
|
|
int abgrColor = ((alpha & 0xff) << 24 ) + ((red & 0xff) << 16 ) + ((green & 0xff) << 8 ) + ((blue & 0xff) );
|
|
|
|
|
|
|
|
imageBuffer.put(i, abgrColor);
|
|
|
|
}
|
|
|
|
}
|
2010-09-28 17:11:35 -04:00
|
|
|
|
2004-03-27 06:55:07 -05:00
|
|
|
/**
|
|
|
|
* Flips the images so they're oriented according to opengl
|
2010-09-28 17:11:35 -04:00
|
|
|
*
|
2004-03-27 06:55:07 -05:00
|
|
|
* @param width Width of image
|
2010-09-28 17:11:35 -04:00
|
|
|
* @param height Height of images
|
2004-03-27 06:55:07 -05:00
|
|
|
* @param numImages How many images to flip
|
|
|
|
* @param images Source images
|
|
|
|
* @param images_copy Destination images
|
|
|
|
*/
|
|
|
|
private static void flipImages(int width, int height, int numImages, IntBuffer images, IntBuffer images_copy) {
|
|
|
|
for (int i = 0; i < numImages; i++) {
|
|
|
|
int start_index = i*width*height;
|
|
|
|
flipImage(width, height, start_index, images, images_copy);
|
|
|
|
}
|
|
|
|
}
|
2003-08-17 12:38:57 -04:00
|
|
|
|
2004-03-27 06:55:07 -05:00
|
|
|
/**
|
|
|
|
* @param width Width of image
|
2010-09-28 17:11:35 -04:00
|
|
|
* @param height Height of images
|
2004-03-27 06:55:07 -05:00
|
|
|
* @param start_index index into source buffer to copy to
|
|
|
|
* @param images Source images
|
|
|
|
* @param images_copy Destination images
|
|
|
|
*/
|
|
|
|
private static void flipImage(int width, int height, int start_index, IntBuffer images, IntBuffer images_copy) {
|
|
|
|
for (int y = 0; y < height>>1; y++) {
|
|
|
|
int index_y_1 = y*width + start_index;
|
|
|
|
int index_y_2 = (height - y - 1)*width + start_index;
|
|
|
|
for (int x = 0; x < width; x++) {
|
|
|
|
int index1 = index_y_1 + x;
|
|
|
|
int index2 = index_y_2 + x;
|
|
|
|
int temp_pixel = images.get(index1 + images.position());
|
|
|
|
images_copy.put(index1, images.get(index2 + images.position()));
|
|
|
|
images_copy.put(index2, temp_pixel);
|
|
|
|
}
|
|
|
|
}
|
2010-09-28 17:11:35 -04:00
|
|
|
}
|
|
|
|
|
2004-03-27 06:55:07 -05:00
|
|
|
/**
|
|
|
|
* Gets the native handle associated with the cursor object.
|
|
|
|
*/
|
2004-11-11 08:27:59 -05:00
|
|
|
Object getHandle() {
|
2005-02-20 06:24:22 -05:00
|
|
|
checkValid();
|
2004-03-27 06:55:07 -05:00
|
|
|
return cursors[index].cursorHandle;
|
|
|
|
}
|
2010-09-28 17:11:35 -04:00
|
|
|
|
2005-02-20 06:24:22 -05:00
|
|
|
private void checkValid() {
|
|
|
|
if (destroyed)
|
|
|
|
throw new IllegalStateException("The cursor is destroyed");
|
|
|
|
}
|
2010-09-28 17:11:35 -04:00
|
|
|
|
2004-03-27 06:55:07 -05:00
|
|
|
/**
|
2004-07-05 10:06:40 -04:00
|
|
|
* Destroy the native cursor. If the cursor is current,
|
|
|
|
* the current native cursor is set to null (the default
|
|
|
|
* OS cursor)
|
2004-03-27 06:55:07 -05:00
|
|
|
*/
|
|
|
|
public void destroy() {
|
2007-02-12 07:18:26 -05:00
|
|
|
synchronized (OpenGLPackageAccess.global_lock) {
|
|
|
|
if (destroyed)
|
|
|
|
return;
|
|
|
|
if (Mouse.getNativeCursor() == this) {
|
|
|
|
try {
|
|
|
|
Mouse.setNativeCursor(null);
|
|
|
|
} catch (LWJGLException e) {
|
|
|
|
// ignore
|
|
|
|
}
|
2004-07-05 10:06:40 -04:00
|
|
|
}
|
2010-09-28 17:11:35 -04:00
|
|
|
for ( CursorElement cursor : cursors ) {
|
|
|
|
Mouse.getImplementation().destroyCursor(cursor.cursorHandle);
|
2007-02-12 07:18:26 -05:00
|
|
|
}
|
|
|
|
destroyed = true;
|
2004-07-05 10:06:40 -04:00
|
|
|
}
|
2004-03-27 06:55:07 -05:00
|
|
|
}
|
2003-08-17 12:38:57 -04:00
|
|
|
|
2004-03-27 06:55:07 -05:00
|
|
|
/**
|
|
|
|
* Sets the timout property to the time it should be changed
|
|
|
|
*/
|
|
|
|
protected void setTimeout() {
|
2005-02-20 06:24:22 -05:00
|
|
|
checkValid();
|
2004-03-27 06:55:07 -05:00
|
|
|
cursors[index].timeout = System.currentTimeMillis() + cursors[index].delay;
|
|
|
|
}
|
2003-08-17 12:38:57 -04:00
|
|
|
|
2004-03-27 06:55:07 -05:00
|
|
|
/**
|
|
|
|
* Determines whether this cursor has timed out
|
|
|
|
* @return true if the this cursor has timed out, false if not
|
|
|
|
*/
|
|
|
|
protected boolean hasTimedOut() {
|
2005-02-20 06:24:22 -05:00
|
|
|
checkValid();
|
2004-03-27 06:55:07 -05:00
|
|
|
return cursors.length > 1 && cursors[index].timeout < System.currentTimeMillis();
|
|
|
|
}
|
2003-08-17 12:38:57 -04:00
|
|
|
|
2010-09-28 17:11:35 -04:00
|
|
|
/**
|
|
|
|
* Changes to the next cursor
|
2004-03-27 06:55:07 -05:00
|
|
|
*/
|
|
|
|
protected void nextCursor() {
|
2005-02-20 06:24:22 -05:00
|
|
|
checkValid();
|
2004-03-27 06:55:07 -05:00
|
|
|
index = ++index % cursors.length;
|
|
|
|
}
|
2010-09-28 17:11:35 -04:00
|
|
|
|
2004-03-27 06:55:07 -05:00
|
|
|
/**
|
|
|
|
* A single cursor element, used when animating
|
|
|
|
*/
|
2004-07-25 10:28:50 -04:00
|
|
|
private static class CursorElement {
|
2004-03-27 06:55:07 -05:00
|
|
|
/** Handle to cursor */
|
2004-11-11 08:27:59 -05:00
|
|
|
final Object cursorHandle;
|
2010-09-28 17:11:35 -04:00
|
|
|
|
2004-03-27 06:55:07 -05:00
|
|
|
/** How long a delay this element should have */
|
2004-07-25 10:28:50 -04:00
|
|
|
final long delay;
|
2010-09-28 17:11:35 -04:00
|
|
|
|
2004-03-27 06:55:07 -05:00
|
|
|
/** Absolute time this element times out */
|
|
|
|
long timeout;
|
2004-07-25 10:28:50 -04:00
|
|
|
|
2004-11-11 08:27:59 -05:00
|
|
|
CursorElement(Object cursorHandle, long delay, long timeout) {
|
2004-07-25 10:28:50 -04:00
|
|
|
this.cursorHandle = cursorHandle;
|
|
|
|
this.delay = delay;
|
|
|
|
this.timeout = timeout;
|
|
|
|
}
|
2004-03-27 06:55:07 -05:00
|
|
|
}
|
2003-08-17 12:38:57 -04:00
|
|
|
}
|