static void logln(String msg) { log(msg + "\n"); }
public final void run() { for(int i = 0; i < devices.size(); i++) { try { LinuxDevice device = devices.get(i); device.close(); } catch(IOException e) { log("Failed to close device: " + e.getMessage()); } } } }
/** * Creates a new EventQueue. Events in old queue are lost. */ public final void setEventQueueSize(int size) { try { setDeviceEventQueueSize(size); event_queue = new EventQueue(size); } catch (IOException e) { ControllerEnvironment.log("Failed to create new event queue of size " + size + ": " + e); } }
/** * Creates a new EventQueue. Events in old queue are lost. */ public final void setEventQueueSize(int size) { try { setDeviceEventQueueSize(size); event_queue = new EventQueue(size); } catch (IOException e) { ControllerEnvironment.log("Failed to create new event queue of size " + size + ": " + e); } }
/** * Creates a new EventQueue. Events in old queue are lost. */ public final void setEventQueueSize(int size) { try { setDeviceEventQueueSize(size); event_queue = new EventQueue(size); } catch (IOException e) { ControllerEnvironment.log("Failed to create new event queue of size " + size + ": " + e); } }
private void scanControllersAt(String path) { File file = new File(path); if (!file.exists()) { return; } try { Plugins plugins = new Plugins(file); @SuppressWarnings("unchecked") Class<ControllerEnvironment>[] envClasses = plugins.getExtends(ControllerEnvironment.class); for(int i=0;i<envClasses.length;i++){ try { ControllerEnvironment.log("ControllerEnvironment "+ envClasses[i].getName() +" loaded by "+envClasses[i].getClassLoader()); ControllerEnvironment ce = envClasses[i].getDeclaredConstructor().newInstance(); if(ce.isSupported()) { addControllers(ce.getControllers()); loadedPluginNames.add(ce.getClass().getName()); } else { log(envClasses[i].getName() + " is not supported"); } } catch (Throwable e) { e.printStackTrace(); } } } catch (Exception e) { e.printStackTrace(); } }
private void scanControllersAt(String path) { File file = new File(path); if (!file.exists()) { return; } try { Plugins plugins = new Plugins(file); @SuppressWarnings("unchecked") Class<ControllerEnvironment>[] envClasses = plugins.getExtends(ControllerEnvironment.class); for(int i=0;i<envClasses.length;i++){ try { ControllerEnvironment.log("ControllerEnvironment "+ envClasses[i].getName() +" loaded by "+envClasses[i].getClassLoader()); ControllerEnvironment ce = envClasses[i].getDeclaredConstructor().newInstance(); if(ce.isSupported()) { addControllers(ce.getControllers()); loadedPluginNames.add(ce.getClass().getName()); } else { log(envClasses[i].getName() + " is not supported"); } } catch (Throwable e) { e.printStackTrace(); } } } catch (Exception e) { e.printStackTrace(); } }
private void scanControllersAt(String path) { File file = new File(path); if (!file.exists()) { return; } try { Plugins plugins = new Plugins(file); @SuppressWarnings("unchecked") Class<ControllerEnvironment>[] envClasses = plugins.getExtends(ControllerEnvironment.class); for(int i=0;i<envClasses.length;i++){ try { ControllerEnvironment.log("ControllerEnvironment "+ envClasses[i].getName() +" loaded by "+envClasses[i].getClassLoader()); ControllerEnvironment ce = envClasses[i].getDeclaredConstructor().newInstance(); if(ce.isSupported()) { addControllers(ce.getControllers()); loadedPluginNames.add(ce.getClass().getName()); } else { log(envClasses[i].getName() + " is not supported"); } } catch (Throwable e) { e.printStackTrace(); } } } catch (Exception e) { e.printStackTrace(); } }
/** * Returns the data from the last time the control has been polled. * If this axis is a button, the value returned will be either 0.0f or 1.0f. * If this axis is normalised, the value returned will be between -1.0f and * 1.0f. * @return The data from the last time the control has been polled. */ public final float getPollData() { if (!has_polled && !isRelative()) { has_polled = true; try { setPollData(poll()); } catch (IOException e) { ControllerEnvironment.log("Failed to poll component: " + e); } } return value; }
/** * Returns the data from the last time the control has been polled. * If this axis is a button, the value returned will be either 0.0f or 1.0f. * If this axis is normalised, the value returned will be between -1.0f and * 1.0f. * @return The data from the last time the control has been polled. */ public final float getPollData() { if (!has_polled && !isRelative()) { has_polled = true; try { setPollData(poll()); } catch (IOException e) { ControllerEnvironment.log("Failed to poll component: " + e); } } return value; }
/** * Returns the data from the last time the control has been polled. * If this axis is a button, the value returned will be either 0.0f or 1.0f. * If this axis is normalised, the value returned will be between -1.0f and * 1.0f. * @return The data from the last time the control has been polled. */ public final float getPollData() { if (!has_polled && !isRelative()) { has_polled = true; try { setPollData(poll()); } catch (IOException e) { ControllerEnvironment.log("Failed to poll component: " + e); } } return value; }
/** * Returns the data from the last time the control has been polled. * If this axis is a button, the value returned will be either 0.0f or 1.0f. * If this axis is normalised, the value returned will be between -1.0f and * 1.0f. * @return The data from the last time the control has been polled. */ public final float getPollData() { if (!has_polled && !isRelative()) { has_polled = true; try { setPollData(poll()); } catch (IOException e) { ControllerEnvironment.log("Failed to poll component: " + e); } } return value; }
ControllerEnvironment.log("Failed to poll device: " + e.getMessage()); return false;
ControllerEnvironment.log("Failed to poll device: " + e.getMessage()); return false;
ControllerEnvironment.log("Failed to poll device: " + e.getMessage()); return false;