当前位置: 首页>>代码示例>>Java>>正文


Java XInputNotLoadedException类代码示例

本文整理汇总了Java中com.ivan.xinput.exceptions.XInputNotLoadedException的典型用法代码示例。如果您正苦于以下问题:Java XInputNotLoadedException类的具体用法?Java XInputNotLoadedException怎么用?Java XInputNotLoadedException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


XInputNotLoadedException类属于com.ivan.xinput.exceptions包,在下文中一共展示了XInputNotLoadedException类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import com.ivan.xinput.exceptions.XInputNotLoadedException; //导入依赖的package包/类
@Override
public void init() throws XInputNotLoadedException
{
	this.device = XInputDevice.getDeviceFor(0);
	this.device.addListener(new XInputDeviceListener()
	{
		@Override
		public void disconnected()
		{
			// do nothing
		}

		@Override
		public void connected()
		{
			// do nothing
		}

		@Override
		public void buttonChanged(XInputButton arg0, boolean arg1)
		{
			MainDialog.resetActivityTimer(XBOX_CONTROLLER);
		}
	});
}
 
开发者ID:PolyphasicDevTeam,项目名称:NoMoreOversleeps,代码行数:26,代码来源:IntegrationXboxController.java

示例2: findFirstConnectedXInputDevice

import com.ivan.xinput.exceptions.XInputNotLoadedException; //导入依赖的package包/类
/**
 * Returns a player number for the first connected XInput device or {@code -1} if nothing connected
 * @return the player number or {@code -1}
 */
private static int findFirstConnectedXInputDevice() {
	int firstConnectedDevice = -1;
	try {
		for (int i = 0; i < XInputDevice.getAllDevices().length; i++) {
			XInputDevice device = XInputDevice.getDeviceFor(i);
			device.poll();
			if (device.isConnected()) {
				firstConnectedDevice = i;
				break;
			}
		}
	} catch (XInputNotLoadedException e) {
		e.printStackTrace();
	}
	return firstConnectedDevice;
}
 
开发者ID:n0Live,项目名称:BrickGame,代码行数:21,代码来源:Window.java

示例3: init

import com.ivan.xinput.exceptions.XInputNotLoadedException; //导入依赖的package包/类
@Override
public void init() throws XInputNotLoadedException
{
	File directory = new File(PlatformData.installationDirectory, "out");
	directory.mkdirs();
	scheduleNameFile = new File(directory, "scheduleName");
	scheduleStartedOnFile = new File(directory, "scheduleStartedOn");
	scheduleLastOversleepFile = new File(directory, "scheduleLastOversleep");
	schedulePersonalBestFile = new File(directory, "schedulePersonalBest");
	timeToNextSleepBlockFile = new File(directory, "timeToNextSleepBlock");
}
 
开发者ID:PolyphasicDevTeam,项目名称:NoMoreOversleeps,代码行数:12,代码来源:IntegrationFileWriter.java

示例4: XInputDevicePolling

import com.ivan.xinput.exceptions.XInputNotLoadedException; //导入依赖的package包/类
XInputDevicePolling(final int playerNum, final XInputListener listener)
		throws XInputNotLoadedException {
	this.listener = listener;
	this.device = XInputDevice.getDeviceFor(playerNum);
	device.removeListener(listener);
	device.addListener(listener);
}
 
开发者ID:n0Live,项目名称:BrickGame,代码行数:8,代码来源:Window.java

示例5: setXInputListener

import com.ivan.xinput.exceptions.XInputNotLoadedException; //导入依赖的package包/类
/**
 * Gets the XInput device for the specified player and sets an event
 * listener for it.
 * 
 * @param playerNum
 *            the player number
 * @param listener
 *            the event listener
 */
static void setXInputListener(final int playerNum,
		final XInputListener listener) {
	try {
		xInputPolling.execute(new XInputDevicePolling(playerNum, listener));
	} catch (XInputNotLoadedException e) {
		System.err.println("The XInput native library failed to load");
		e.printStackTrace();
	}
}
 
开发者ID:n0Live,项目名称:BrickGame,代码行数:19,代码来源:Window.java

示例6: checkLibraryReady

import com.ivan.xinput.exceptions.XInputNotLoadedException; //导入依赖的package包/类
/**
 * Checks if the native library is loaded and ready for use.
 *
 * @throws XInputNotLoadedException if the native library is not loaded
 */
private static void checkLibraryReady() throws XInputNotLoadedException {
    if (!XInputNatives14.isLoaded()) {
        throw new XInputNotLoadedException("Native library failed to load", XInputNatives14.getLoadError());
    }
}
 
开发者ID:StrikerX3,项目名称:JXInput,代码行数:11,代码来源:XInputDevice14.java

示例7: checkLibraryReady

import com.ivan.xinput.exceptions.XInputNotLoadedException; //导入依赖的package包/类
/**
 * Checks if the native library is loaded and ready for use.
 *
 * @throws XInputNotLoadedException if the native library is not loaded
 */
private static void checkLibraryReady() throws XInputNotLoadedException {
    if (!XInputNatives.isLoaded()) {
        throw new XInputNotLoadedException("Native library failed to load", XInputNatives.getLoadError());
    }
}
 
开发者ID:StrikerX3,项目名称:JXInput,代码行数:11,代码来源:XInputDevice.java

示例8: getDeviceFor

import com.ivan.xinput.exceptions.XInputNotLoadedException; //导入依赖的package包/类
/**
 * Returns the XInput device for the specified player.
 * <p>
 * The returned object should not be shared among multiple threads.
 *
 * @param playerNum the player number
 * @return the XInput device for the specified player
 * @throws XInputNotLoadedException if the native library failed to load
 */
public static XInputDevice14 getDeviceFor(final int playerNum) throws XInputNotLoadedException {
    checkLibraryReady();
    if (playerNum < 0 || playerNum >= MAX_PLAYERS) {
        throw new IllegalArgumentException("Invalid player number: " + playerNum + ". Must be between 0 and " + (MAX_PLAYERS - 1));
    }
    return DEVICES[playerNum];
}
 
开发者ID:StrikerX3,项目名称:JXInput,代码行数:17,代码来源:XInputDevice14.java

示例9: getDeviceFor

import com.ivan.xinput.exceptions.XInputNotLoadedException; //导入依赖的package包/类
/**
 * Returns the XInput device for the specified player. An instance is created for each of the four players in a system.
 * <p>
 * The returned object should not be shared among multiple threads.
 *
 * @param playerNum the player number
 * @return the XInput device for the specified player
 * @throws XInputNotLoadedException if the native library failed to load
 */
public static XInputDevice getDeviceFor(final int playerNum) throws XInputNotLoadedException {
    checkLibraryReady();
    if (playerNum < 0 || playerNum >= MAX_PLAYERS) {
        throw new IllegalArgumentException("Invalid player number: " + playerNum + ". Must be between 0 and " + (MAX_PLAYERS - 1));
    }
    return DEVICES[playerNum];
}
 
开发者ID:StrikerX3,项目名称:JXInput,代码行数:17,代码来源:XInputDevice.java

示例10: getAllDevices

import com.ivan.xinput.exceptions.XInputNotLoadedException; //导入依赖的package包/类
/**
 * Returns an array containing all registered XInput devices.
 * <p>
 * The XInputDevice14 objects are not thread-safe.
 *
 * @return all XInput devices
 * @throws XInputNotLoadedException if the native library failed to load
 */
public static XInputDevice14[] getAllDevices() throws XInputNotLoadedException {
    checkLibraryReady();
    return DEVICES.clone();
}
 
开发者ID:StrikerX3,项目名称:JXInput,代码行数:13,代码来源:XInputDevice14.java

示例11: getAllDevices

import com.ivan.xinput.exceptions.XInputNotLoadedException; //导入依赖的package包/类
/**
 * Returns an array containing all registered XInput devices.
 * <p>
 * The {@code XInputDevice} objects are not thread-safe.
 *
 * @return all XInput devices
 * @throws XInputNotLoadedException if the native library failed to load
 */
public static XInputDevice[] getAllDevices() throws XInputNotLoadedException {
    checkLibraryReady();
    return DEVICES.clone();
}
 
开发者ID:StrikerX3,项目名称:JXInput,代码行数:13,代码来源:XInputDevice.java


注:本文中的com.ivan.xinput.exceptions.XInputNotLoadedException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。