From 174cfa972139a2c42b0e7f0a792c857d14db1b0a Mon Sep 17 00:00:00 2001 From: Rik Veenboer Date: Fri, 3 Jun 2011 16:15:38 +0000 Subject: [PATCH] Winamp api (qotsa) verwijderd, want ongebruikt. JXInput (hardcode) source files vervangen voor jar. --- java/lib/jxinput.jar | Bin 0 -> 73232 bytes .../com/qotsa/exception/InvalidHandle.java | 40 -- .../com/qotsa/exception/InvalidParameter.java | 40 -- java/src/com/qotsa/exception/package.html | 20 - .../com/qotsa/jni/controller/JNIWinamp.java | 227 ------- .../jni/controller/WinampController.java | 592 ------------------ .../src/com/qotsa/jni/controller/package.html | 20 - java/src/de/hardcode/jxinput/Axis.java | 72 --- java/src/de/hardcode/jxinput/Button.java | 35 -- java/src/de/hardcode/jxinput/Directional.java | 45 -- java/src/de/hardcode/jxinput/Feature.java | 38 -- .../de/hardcode/jxinput/JXInputDevice.java | 71 --- .../de/hardcode/jxinput/JXInputManager.java | 233 ------- .../hardcode/jxinput/directinput/DIAxis.java | 70 --- .../jxinput/directinput/DIButton.java | 55 -- .../jxinput/directinput/DIDirectional.java | 78 --- .../directinput/DirectInputDevice.java | 170 ----- .../directinput/DirectInputDriver.java | 184 ------ .../de/hardcode/jxinput/directinput/Log.java | 34 - .../jxinput/event/JXInputAxisEvent.java | 48 -- .../event/JXInputAxisEventListener.java | 19 - .../jxinput/event/JXInputButtonEvent.java | 38 -- .../event/JXInputButtonEventListener.java | 19 - .../event/JXInputDirectionalEvent.java | 56 -- .../JXInputDirectionalEventListener.java | 19 - .../jxinput/event/JXInputEventManager.java | 284 --------- .../jxinput/j3d/DeviceConfiguration.java | 95 --- .../jxinput/j3d/IsActiveCondition.java | 25 - .../j3d/IsActiveOnButtonCondition.java | 39 -- .../jxinput/j3d/IsAlwaysActiveCondition.java | 38 -- .../hardcode/jxinput/j3d/J3DInputDevice.java | 171 ----- java/src/de/hardcode/jxinput/j3d/package.html | 11 - .../jxinput/j3d/test/HelloUniverse.java | 205 ------ .../jxinput/j3d/test/SensorBehavior.java | 70 --- .../keyboard/InvalidKeyCodeException.java | 35 -- .../keyboard/JXKeyboardInputDevice.java | 175 ------ .../hardcode/jxinput/keyboard/KeyButton.java | 94 --- .../jxinput/keyboard/KeyboardDriver.java | 141 ----- .../de/hardcode/jxinput/keyboard/package.html | 10 - .../hardcode/jxinput/test/AxisListener.java | 39 -- .../hardcode/jxinput/test/ButtonListener.java | 38 -- .../jxinput/test/DirectionalListener.java | 37 -- .../jxinput/test/JXInputDevicePanel.form | 97 --- .../jxinput/test/JXInputDevicePanel.java | 296 --------- .../jxinput/test/JXInputTestDialog.form | 79 --- .../jxinput/test/JXInputTestDialog.java | 286 --------- .../jxinput/util/LatestChangedValueAxis.java | 98 --- .../de/hardcode/jxinput/util/OrButton.java | 52 -- .../jxinput/virtual/JXVirtualInputDevice.java | 140 ----- .../hardcode/jxinput/virtual/VirtualAxis.java | 207 ------ .../jxinput/virtual/VirtualDriver.java | 95 --- .../de/hardcode/jxinput/virtual/package.html | 11 - 52 files changed, 5091 deletions(-) create mode 100644 java/lib/jxinput.jar delete mode 100644 java/src/com/qotsa/exception/InvalidHandle.java delete mode 100644 java/src/com/qotsa/exception/InvalidParameter.java delete mode 100644 java/src/com/qotsa/exception/package.html delete mode 100644 java/src/com/qotsa/jni/controller/JNIWinamp.java delete mode 100644 java/src/com/qotsa/jni/controller/WinampController.java delete mode 100644 java/src/com/qotsa/jni/controller/package.html delete mode 100644 java/src/de/hardcode/jxinput/Axis.java delete mode 100644 java/src/de/hardcode/jxinput/Button.java delete mode 100644 java/src/de/hardcode/jxinput/Directional.java delete mode 100644 java/src/de/hardcode/jxinput/Feature.java delete mode 100644 java/src/de/hardcode/jxinput/JXInputDevice.java delete mode 100644 java/src/de/hardcode/jxinput/JXInputManager.java delete mode 100644 java/src/de/hardcode/jxinput/directinput/DIAxis.java delete mode 100644 java/src/de/hardcode/jxinput/directinput/DIButton.java delete mode 100644 java/src/de/hardcode/jxinput/directinput/DIDirectional.java delete mode 100644 java/src/de/hardcode/jxinput/directinput/DirectInputDevice.java delete mode 100644 java/src/de/hardcode/jxinput/directinput/DirectInputDriver.java delete mode 100644 java/src/de/hardcode/jxinput/directinput/Log.java delete mode 100644 java/src/de/hardcode/jxinput/event/JXInputAxisEvent.java delete mode 100644 java/src/de/hardcode/jxinput/event/JXInputAxisEventListener.java delete mode 100644 java/src/de/hardcode/jxinput/event/JXInputButtonEvent.java delete mode 100644 java/src/de/hardcode/jxinput/event/JXInputButtonEventListener.java delete mode 100644 java/src/de/hardcode/jxinput/event/JXInputDirectionalEvent.java delete mode 100644 java/src/de/hardcode/jxinput/event/JXInputDirectionalEventListener.java delete mode 100644 java/src/de/hardcode/jxinput/event/JXInputEventManager.java delete mode 100644 java/src/de/hardcode/jxinput/j3d/DeviceConfiguration.java delete mode 100644 java/src/de/hardcode/jxinput/j3d/IsActiveCondition.java delete mode 100644 java/src/de/hardcode/jxinput/j3d/IsActiveOnButtonCondition.java delete mode 100644 java/src/de/hardcode/jxinput/j3d/IsAlwaysActiveCondition.java delete mode 100644 java/src/de/hardcode/jxinput/j3d/J3DInputDevice.java delete mode 100644 java/src/de/hardcode/jxinput/j3d/package.html delete mode 100644 java/src/de/hardcode/jxinput/j3d/test/HelloUniverse.java delete mode 100644 java/src/de/hardcode/jxinput/j3d/test/SensorBehavior.java delete mode 100644 java/src/de/hardcode/jxinput/keyboard/InvalidKeyCodeException.java delete mode 100644 java/src/de/hardcode/jxinput/keyboard/JXKeyboardInputDevice.java delete mode 100644 java/src/de/hardcode/jxinput/keyboard/KeyButton.java delete mode 100644 java/src/de/hardcode/jxinput/keyboard/KeyboardDriver.java delete mode 100644 java/src/de/hardcode/jxinput/keyboard/package.html delete mode 100644 java/src/de/hardcode/jxinput/test/AxisListener.java delete mode 100644 java/src/de/hardcode/jxinput/test/ButtonListener.java delete mode 100644 java/src/de/hardcode/jxinput/test/DirectionalListener.java delete mode 100644 java/src/de/hardcode/jxinput/test/JXInputDevicePanel.form delete mode 100644 java/src/de/hardcode/jxinput/test/JXInputDevicePanel.java delete mode 100644 java/src/de/hardcode/jxinput/test/JXInputTestDialog.form delete mode 100644 java/src/de/hardcode/jxinput/test/JXInputTestDialog.java delete mode 100644 java/src/de/hardcode/jxinput/util/LatestChangedValueAxis.java delete mode 100644 java/src/de/hardcode/jxinput/util/OrButton.java delete mode 100644 java/src/de/hardcode/jxinput/virtual/JXVirtualInputDevice.java delete mode 100644 java/src/de/hardcode/jxinput/virtual/VirtualAxis.java delete mode 100644 java/src/de/hardcode/jxinput/virtual/VirtualDriver.java delete mode 100644 java/src/de/hardcode/jxinput/virtual/package.html diff --git a/java/lib/jxinput.jar b/java/lib/jxinput.jar new file mode 100644 index 0000000000000000000000000000000000000000..dbb035a872f930561d1c196853fddfa674291e08 GIT binary patch literal 73232 zcmdUY31D1TdG0^bjP7W3B}*g8mMqyG@3ySPOYFo;9Ltg%%aLSb$#z5t&R81TlSmq) z#S2it5SH@FR!V8Y9vn<5YZ7m`kdzi)p#{3pg}&1Eb)!(0_qx2kZh7B#&bfE)+_^K7 z?2z`!p1Yp?p7Wo7{}0_)8jcD7UUjX1tGY0UatTX+&roMu@4&u}|M;57AvftOk@VTm z^*quX65+27S=^-koddo5dIpEu`}g%HC(XF8@DFb4bDs?`qLwmnW+m?)2Z>P zMDN5%`})dQe=VO|_p+PL7UbaPjc@^u(E&>Go-~q5Z)9y}TL1b$2>B zmN|u*n5FGda{Ba+#8~=7$HQBYZxZ>Elg|Cjbb4&ceQ-84GLF=|uZ-Q_)^)JIzh_`* zM1L6X{4glWO=$+CNRC8-9HZ&U)X20N&LX)N7s#DDo0^y|lCPmaK75cOxt0{k z#ZP_ZMHL-+Hx)V) z(!aOo@bQEDj`w!+Su`XSLx(#D2KzdPdJhhSB#QdXWtlDw6`e{=4_!Eu3Q6g@_2@$s z_p15oK{q;u2ZvKrnK2A}W+EgFLF^GA38F)fA5i@A%50^Q_mhcc<;S^Jvtp{1g2on z_a2l)vTp1+~sBKHun+TVh#+7@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twa?1Y^P?}kL;VHj(KmO{yuWVS2^~+!GJo-n70B5bovlxnW=HfpuEW3_Q z@aO2uuuqpRX13o#CB=L6*hluhbt!toUv6cOVjySjk?Mv4d#jQ&)0yeX^r?a%@O|ay zKimtXlD|FdlKH!I@%dfzt_<^fEIkFa&qC|*ix<{h_#wa+e|w#(aK3c$W1aJ@?S#^) zE?!@K><8`NgfN)Ddvoghho1S?XFxxKlZ+Lwbm61lnn5@phV=2l=XHJatTcG(zW%{; zCtimU0NC8WOBdhq z(s@-BTzuk7wbogRx)-jd0}q-_(J;4Pe7VPiINXT*_$d{ z#epr|v+ls>-tg(EA7IS+Tjh*B&X+F!)N%9RCKUJb$^f@$746DSZ$=e>0PNQ>T+>)0qOe!keD{=*53U z_xa1+u-^Up;No4f$jCzOOI_&7jHX;EN$|vcu;cvwKLD=IU+(t)*Ke4mo~(`PF20k(_u+{@VQEWU{sW{!{a- z&HJqw-Y$3n`@=_M>pOaFUiAeR?{_trE&iv!I(zX$u2Z2x)4=aIEn9xm*XLEfaiiw{ z9Des!+48^j&3Tn?oL%|L_j@ABmjBk@nOFJ7FOk1|zf+iO`NzLCpYnshuHO(KTl!bO zA6)vZW&!>V_!W|~Rb2W}kt!Tb+TeEkRYS9dX8w0@p$>1bu%f8H;eKVJY#kr@=i+r7 z)hb4WOTo?e%Pq4-zYD^sAezu=zA4%(#q_t^FU83g{%57d3(wsnBNU^_KK#4h0QwGE H!6N?;_hS`? literal 0 HcmV?d00001 diff --git a/java/src/com/qotsa/exception/InvalidHandle.java b/java/src/com/qotsa/exception/InvalidHandle.java deleted file mode 100644 index dc965f1..0000000 --- a/java/src/com/qotsa/exception/InvalidHandle.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * InvalidHandle.java - * - * Created on 9 de Outubro de 2007, 14:18 - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -package com.qotsa.exception; - -/** - * Exception to throw when Winamp Handle Fails. - * - * @author Francisco - */ -public class InvalidHandle extends Exception{ - - private static final String defaultMessage = "Invalid Handle. Please Verify if Winamp is running."; - - /** - * Creates a new instance of InvalidHandle - * @param message Message to print in the stack. - */ - public InvalidHandle(String message) { - - super(message); - - } - - /** - * Creates a new instance of InvalidHandle with the default message - */ - public InvalidHandle() { - - super(defaultMessage); - - } - -} diff --git a/java/src/com/qotsa/exception/InvalidParameter.java b/java/src/com/qotsa/exception/InvalidParameter.java deleted file mode 100644 index 0a45a13..0000000 --- a/java/src/com/qotsa/exception/InvalidParameter.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * InvalidParameter.java - * - * Created on 11 de Outubro de 2007, 10:53 - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -package com.qotsa.exception; - -/** - * Exception to throw when any parameter is invalid. - * - * @author Francisco - */ -public class InvalidParameter extends Exception { - - private static final String defaultMessage = "Invalid Parameter"; - - /** - * Creates a new instance of NegativeValueException - * @param message Message to print in the stack. - */ - public InvalidParameter(String message) { - - super(message); - - } - - /** - * Creates a new instance of NegativeValueException with the default message - */ - public InvalidParameter() { - - super(defaultMessage); - - } - -} diff --git a/java/src/com/qotsa/exception/package.html b/java/src/com/qotsa/exception/package.html deleted file mode 100644 index 07b6ce6..0000000 --- a/java/src/com/qotsa/exception/package.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - -Package containing the Exception Class used in the WinampController Class. - - -

Package Specification

- - - - - diff --git a/java/src/com/qotsa/jni/controller/JNIWinamp.java b/java/src/com/qotsa/jni/controller/JNIWinamp.java deleted file mode 100644 index 7d2ea27..0000000 --- a/java/src/com/qotsa/jni/controller/JNIWinamp.java +++ /dev/null @@ -1,227 +0,0 @@ -/* - * JNIWinamp.java - * - * Created on 23 de Abril de 2007, 20:41 - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -package com.qotsa.jni.controller; - -import java.io.IOException; - -/** - * - * @author Francisco Guimarães - */ -final class JNIWinamp { - - static { - System.loadLibrary("wpcom"); - } - - /** - * Verify if Winamp is started - * and if not started, starts it - * @return True - if successful running Winamp - * False - if not successful running Winamp - */ - - protected static native boolean run() throws UnsatisfiedLinkError; - - /* - * Exit Winamp - * @return True - if successful exit - * False - if not successful exit - */ - protected static native boolean exit() throws UnsatisfiedLinkError; - - /** - * Play Winamp. - * - */ - protected static native boolean play() throws UnsatisfiedLinkError; - - /** - * Stop Winamp. - * - */ - protected static native boolean stop() throws UnsatisfiedLinkError; - - /** - * Resume Winamp. - * - */ - protected static native boolean resume() throws UnsatisfiedLinkError; - - /** - * Pause Winamp. - * - */ - protected static native boolean pause() throws UnsatisfiedLinkError; - - /** - * Go to Previous Track. - * - */ - protected static native boolean previousTrack() throws UnsatisfiedLinkError; - - /** - * Go to Next Track. - * - */ - protected static native boolean nextTrack() throws UnsatisfiedLinkError; - - /** - * Fowards 5 seconds on the current song. - * - */ - protected static native boolean fwd5Secs() throws UnsatisfiedLinkError; - - /** - * Rewinds 5 seconds on the current song. - * - */ - protected static native boolean rew5Secs() throws UnsatisfiedLinkError; - - /** - * Increase Volume. - * - */ - protected static native boolean increaseVolume() throws UnsatisfiedLinkError; - - /** - * Decrease Volume. - * - */ - protected static native boolean decreaseVolume() throws UnsatisfiedLinkError; - - /** - * Increase Volume. - * @param percent Percent to Increase. - */ - protected static native boolean increaseVolumePercent(int percent) throws UnsatisfiedLinkError; - - /** - * Decrease Volume. - * @param percent Percent to Decrease. - */ - protected static native boolean decreaseVolumePercent(int percent) throws UnsatisfiedLinkError; - - /** - * Adjust Volume - * @param pos Position to Set Volume between 0 and 99. - */ - protected static native boolean setVolume(int pos) throws UnsatisfiedLinkError; - - /** - * Get Volume. - * @return volume. - */ - protected static native int getVolume() throws UnsatisfiedLinkError; - - /** - * Go to a Specified Position in the List. - * @param pos Position. - */ - protected static native boolean setPlaylistPosition(int pos) throws UnsatisfiedLinkError; - - /** - * Clear List. - * - */ - protected static native boolean clearPlayList() throws UnsatisfiedLinkError; - - /** - * Refresh List´s Cache. - * - */ - protected static native boolean refreshPlayListCache() throws UnsatisfiedLinkError; - - /** - * Return the PlayListLength. - * @return List Length. - */ - protected static native int getPlayListLength() throws UnsatisfiedLinkError; - - /** - * Write a Playlist in \\Winamp.m3u. - * @return List Position. - */ - protected static native int writePlayListToFile() throws UnsatisfiedLinkError; - - /** - * Verify if Shuffle is On. - * @return True - On throws UnsatisfiedLinkError; False - Off. - */ - protected static native int isShuffleStatusOn() throws UnsatisfiedLinkError; - - /** - * Verify if Repeat is On. - * @return True - On throws UnsatisfiedLinkError; False - Off. - */ - protected static native int isRepeatStatusOn() throws UnsatisfiedLinkError; - - /** - * Turn on Repeat. - * @param True - Turn on Repeat throws UnsatisfiedLinkError; False - Turn off Repeat. - */ - protected static native boolean setRepeatStatusOn(boolean mode) throws UnsatisfiedLinkError; - - /** - * Turn on Shuffle. - * @param True - Turn on Shuffle throws UnsatisfiedLinkError; False - Turn off Shuffle. - */ - protected static native boolean setShuffleStatusOn(boolean mode) throws UnsatisfiedLinkError; - - /** - * Append a File in the List - * @param filename FileName to Append. - */ - protected static native boolean appendToPlayList(String filename) throws UnsatisfiedLinkError; - - /** - * Get Winamp Status. - * @return STOPPED - Stop - * PLAYING - play - * PAUSED - Paused - */ - protected static native int getStatus() throws UnsatisfiedLinkError; - - /** - * Get Current List Pos. - * @return Current List Position. - */ - protected static native int getListPos() throws UnsatisfiedLinkError; - - /** - * Get Current Track Title - * @return Current Track Title - */ - protected static native String getTitle() throws UnsatisfiedLinkError; - - /** - * Get Track FileName in List´s index. - * @param index Track Index in the Current PlayList - * @return Current Track FileName - */ - protected static native String getFileNameInList(int index) throws UnsatisfiedLinkError; - - /** - * Get Song Time - * @param mode CURRENTTIME - Currently Time in Milliseconds - * TIMELENGHT - Song Time Length in seconds - * @return Song Time in Seconds - */ - protected static native int getTime(int mode) throws UnsatisfiedLinkError; - - /** - * Get File Name Playing In Winamp. - * - * @return Current File Name. - */ - protected static native String getFileNamePlaying() throws UnsatisfiedLinkError; - -} - diff --git a/java/src/com/qotsa/jni/controller/WinampController.java b/java/src/com/qotsa/jni/controller/WinampController.java deleted file mode 100644 index 0b1e939..0000000 --- a/java/src/com/qotsa/jni/controller/WinampController.java +++ /dev/null @@ -1,592 +0,0 @@ -/* - * WinampController.java - * - * Created on 9 de Outubro de 2007, 14:06 - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -/** - * Package containing the Controller Class to communicate with Winamp. - * - * @author Francisco Guimarães - */ -package com.qotsa.jni.controller; - -import com.qotsa.exception.InvalidHandle; -import com.qotsa.exception.InvalidParameter; -import java.io.File; - -/** - * This class is a wrapper to call JNI functions - * to send Message to Winamp Window. - * - * @author Francisco Guimarães - * - * - */ -public class WinampController { - - /** - * Constant used as return in getTime() - * Value = -1 - */ - public static final int ISNOTPLAYING = -1; - - /** - * Constant used as parameter in getTime() method - * Value = 0 - */ - public static final int CURRENTTIME = 0; - - /** - * Constant used as parameter in getTime() method - * Value = 1 - */ - public static final int TIMELENGTH = 1; - - /** - * Constant used as return in getStatus() method - * Value = 0 - */ - public static final int STOPPED = 0; - - /** - * Constant used as return in getStatus() method - * Value = 1 - */ - public static final int PLAYING = 1; - - /** - * Constant used as return in getStatus() method - * Value = 3 - */ - public static final int PAUSED = 3; - - - /** - * Verify if Winamp is started - * and if not started, starts it. - * - * @throws java.lang.Exception When the key HKEY_LOCAL_MACHINE\Software\Clients\Media\Winamp\shell\open\command - * is not found in the register. This key is used to find Winamp Directory installation to execute it. - */ - - public static void run() throws Exception{ - - if (!JNIWinamp.run()) - throw new Exception("Unable to running Winamp. Verify if it is properly installed"); - - } - - /** - * Exit Winamp. - * - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - */ - public static void exit() throws InvalidHandle { - - if (!JNIWinamp.exit()) - throw new InvalidHandle(); - - - } - - /** - * Play current file in Winamp. - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - */ - public static void play() throws InvalidHandle { - - if (!JNIWinamp.play()) - throw new InvalidHandle(); - - } - - /** - * Stop current file in Winamp. - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - */ - public static void stop() throws InvalidHandle { - - if (!JNIWinamp.stop()) - throw new InvalidHandle(); - - } - - /** - * Resume current file in Winamp. - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - */ - public static void resume() throws InvalidHandle { - - if (!JNIWinamp.resume()) - throw new InvalidHandle(); - - } - - /** - * Pause Winamp. - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - */ - public static void pause() throws InvalidHandle { - - if (!JNIWinamp.pause()) - throw new InvalidHandle(); - - } - - /** - * - * Go to Previous Track in the play list. - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - */ - public static void previousTrack() throws InvalidHandle { - - if (!JNIWinamp.previousTrack()) - throw new InvalidHandle(); - - } - - /** - * Go to Next Track in the play list. - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - */ - public static void nextTrack() throws InvalidHandle { - - if (!JNIWinamp.nextTrack()) - throw new InvalidHandle(); - - } - - /** - * Fowards 5 seconds on the current song. - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - */ - public static void fwd5Secs() throws InvalidHandle { - - if (!JNIWinamp.fwd5Secs()) - throw new InvalidHandle(); - - } - - /** - * Rewinds 5 seconds on the current song. - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - */ - public static void rew5Secs() throws InvalidHandle { - - if (!JNIWinamp.rew5Secs()) - throw new InvalidHandle(); - - } - - /** - * Increase Volume a little bit. - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - */ - public static void increaseVolume() throws InvalidHandle { - - if (!JNIWinamp.increaseVolume()) - throw new InvalidHandle(); - - } - - /** - * Decrease Volume a little bit. - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - */ - public static void decreaseVolume() throws InvalidHandle { - - if (!JNIWinamp.decreaseVolume()) - throw new InvalidHandle(); - - } - - /** - * Increase Volume. - * - * @param percent Percent to Increase Volume. - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - * @throws com.qotsa.exception.InvalidParameter If percent not between 0 and 100 - */ - public static void increaseVolumePercent (int percent) throws InvalidHandle, InvalidParameter { - - if ( (percent < 0) || (percent > 100) ) - throw new InvalidParameter("percent´s value must be between 0 and 100"); - - if (!JNIWinamp.increaseVolumePercent(percent)) - throw new InvalidHandle(); - - } - - /** - * Decrease Volume. - * - * @param percent Percent to Decrease Volume. - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - * @throws com.qotsa.exception.InvalidParameter If percent not between 0 and 100 - */ - public static void decreaseVolumePercent(int percent) throws InvalidHandle, InvalidParameter { - - if ( (percent < 0) || (percent > 100) ) - throw new InvalidParameter("percent´s value must be between 0 and 100"); - if (!JNIWinamp.decreaseVolumePercent(percent)) - throw new InvalidHandle(); - - } - - /** - * Adjust Volume. - * Note that the pos must be between 0(0%) and 255 (100%). - * - * @param pos Position to Set Volume. - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - * @throws com.qotsa.exception.InvalidParameter If pos not between 0 and 255 - */ - public static void setVolume(int pos) throws InvalidHandle, InvalidParameter { - - if ( (pos < 0) || (pos > 255) ) - throw new InvalidParameter("pos value must be between 0 and 255"); - if (!JNIWinamp.setVolume(pos)) - throw new InvalidHandle(); - - } - - /** - * Get Volume. - * @return The volume which is a number between 0 (0%) and 255(100%) - * @throws com.qotsa.exception.InvalidHandle - */ - public static int getVolume() throws InvalidHandle { - int volume = JNIWinamp.getVolume(); - if (volume == -1) - throw new InvalidHandle(); - return volume; - } - - /** - * Get Volume Percent. - * @return Volume percent. - * @throws com.qotsa.exception.InvalidHandle - */ - public static int getVolumePercent() throws InvalidHandle { - - int volume = getVolume(); - int percent = (volume * 100) / 255; - return percent; - } - - /** - * Restarts Winamp. - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - * @throws java.lang.Exception When failed to restart Winamp. - */ - public static void restart() throws InvalidHandle, Exception { - - exit(); - run(); - - } - - /** - * Go to a Specified Position in the List. This method doesn´t play. - * Just set list position. If you wanna play call play() after set position. - * Parameter pos is Zero-based index. - * @param pos Position. - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - * @throws com.qotsa.exception.InvalidParameter If pos is negative or greater than List Length. - */ - public static void setPlaylistPosition(int pos) throws InvalidHandle, InvalidParameter { - - int listLength = getPlayListLength(); - if ( (pos < 0) || ( (pos + 1) > listLength) ) - throw new InvalidParameter("Position is invalid in the list."); - if (!JNIWinamp.setPlaylistPosition(pos)) - throw new InvalidHandle(); - - } - - /** - * Clear Winamp's internal playlist. - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - */ - public static void clearPlayList() throws InvalidHandle { - - if (!JNIWinamp.clearPlayList()) - throw new InvalidHandle(); - - } - - /** - * Flush the playlist cache buffer. - * Call this if you want it to go refetch titles for tracks in the list. - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - */ - public static void refreshPlayListCache() throws InvalidHandle{ - - if (!JNIWinamp.refreshPlayListCache()) - throw new InvalidHandle(); - - } - - /** - * Return the PlayListLength. - * - * @return List Length. - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - */ - public static int getPlayListLength() throws InvalidHandle { - - int length = JNIWinamp.getPlayListLength(); - if (length == -1) - throw new InvalidHandle(); - return length; - - } - - /** - * Write a Playlist in winampDirInstallation\\Winamp.m3u. - * This is default Winamp IPC Default. If you wanna change this, - * just rename the file you´ve created. - * - * @return Current List Position. - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - */ - public static int writePlayListToFile() throws InvalidHandle { - - int playListPos = JNIWinamp.writePlayListToFile(); - if (playListPos == -1) - throw new InvalidHandle(); - return playListPos; - - } - - /** - * Verify if Shuffle is On. - * - * @return True - On ; False - Off. - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - */ - public static boolean isShuffleStatusOn() throws InvalidHandle { - - int status = JNIWinamp.isShuffleStatusOn(); - if (status == -1) - throw new InvalidHandle(); - return (status == 1 ? true : false); - - } - - /** - * Verify if Repeat is On. - * - * @return True - On ; False - Off. - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - */ - public static boolean isRepeatStatusOn() throws InvalidHandle { - - int status = JNIWinamp.isRepeatStatusOn(); - if (status == -1) - throw new InvalidHandle(); - return (status == 1 ? true : false); - - } - - /** - * Turn on Repeat. - * - * @param mode True - Turn on Repeat ; False - Turn off Repeat. - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - */ - public static void setRepeatStatusOn(boolean mode) throws InvalidHandle { - - if (!JNIWinamp.setRepeatStatusOn(mode)) - throw new InvalidHandle(); - - } - - /** - * Turn on Shuffle. - * - * @param mode True - Turn on Shuffle ; False - Turn off Shuffle. - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - */ - public static void setShuffleStatusOn(boolean mode) throws InvalidHandle { - - if (!JNIWinamp.setShuffleStatusOn(mode)) - throw new InvalidHandle(); - - } - - /** - * Append a File into the List. - * - * @param filename FileName to Append in the list. - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - * @throws com.qotsa.exception.InvalidParameter If the filename is an invalid path. - */ - public static void appendToPlayList(String filename) throws InvalidHandle, InvalidParameter { - - File file = new File(filename); - if (!file.exists()) - throw new InvalidParameter("File doesn´t exists."); - if (!JNIWinamp.appendToPlayList(filename)) - throw new InvalidHandle(); - - } - - /** - * Get Winamp Status. - * - * @return STOPPED - Stop - * PLAYING - play - * PAUSED - Paused - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - */ - public static int getStatus() throws InvalidHandle { - - int status = JNIWinamp.getStatus(); - if (status == -1) - throw new InvalidHandle(); - return status; - - } - - /** - * Get Current List Pos. - * - * @return Current List Position. - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - */ - public static int getListPos() throws InvalidHandle { - - int pos = JNIWinamp.getListPos(); - if (pos == -1) - throw new InvalidHandle(); - return pos; - - } - - /** - * Get Current Track Title. - * - * @return Current Track Title - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - */ - public static String getTitle() throws InvalidHandle { - - String title = JNIWinamp.getTitle(); - if (title == null) - throw new InvalidHandle(); - return title; - - } - - /** - * Get Current Track FileName. - * Parameter pos is Zero-based index. - * - * @return Current Track FileName - * @param pos Track Position in the Current PlayList - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - * @throws com.qotsa.exception.InvalidParameter If pos is negative or greater than List Length - */ - public static String getFileNameInList(int pos) throws InvalidHandle, InvalidParameter { - - int listLength = getPlayListLength(); - if ( (pos < 0) || (pos > listLength) ) - throw new InvalidParameter("Position is invalid in the list."); - String filename = JNIWinamp.getFileNameInList(pos); - if (filename == null) - throw new InvalidHandle(); - return filename; - - } - - /** - * Get Song Time. - * - * @return Time Song (depends on Param mode) or - * ISNOTPLAYING if there is no info about time because it not starts to play. - * @param mode CURRENTTIME - Currently Time in Milliseconds - * TIMELENGHT - Song Time Length in seconds - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - * @throws com.qotsa.exception.InvalidParameter if parameter is not CURRENTTIME or TIMELENGTH. - */ - public static int getTime(int mode) throws InvalidHandle, InvalidParameter { - - if (mode != CURRENTTIME && mode != TIMELENGTH) - throw new InvalidParameter(); - int time = JNIWinamp.getTime(mode); - if (time == -2) - throw new InvalidHandle(); - return time; - - } - - /** - * Fowards n Tracks in Play List. - * - * @param n Number of Tracks to Foward - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - * @throws com.qotsa.exception.InvalidParameter if n is negative or Zero. - */ - public static void fwdTracks(int n) throws InvalidParameter, InvalidHandle { - - if (n <= 0) - throw new InvalidParameter("Value must be Positive"); - int pos = getListPos(); - int lengthList = getPlayListLength(); - int newPos = pos + n; - if (newPos > lengthList ) { - setPlaylistPosition(lengthList); - play(); - } - else { - setPlaylistPosition(newPos); - play(); - } - - } - - /** - * Rewinds n Tracks in Play List. - * - * @param n Number of Tracks to Rewind - * @throws com.qotsa.exception.InvalidHandle When the Winamp Windows is not handle(in most case, it means that winamp is not running) - * @throws com.qotsa.exception.InvalidParameter if n is negative or Zero. - */ - public static void rewTracks(int n) throws InvalidParameter, InvalidHandle { - - if (n <= 0) - throw new InvalidParameter("Value must be Positive"); - int pos = getListPos(); - int lengthList = getPlayListLength(); - int newPos = pos - n; - if (newPos < 0 ) { - setPlaylistPosition(0); - play(); - } - else { - setPlaylistPosition(newPos); - play(); - } - - } - - /** - * Get File Name Playing In Winamp. - * - * @return Current File Name. - */ - public static String getFileNamePlaying() throws InvalidHandle { - - String fileName = JNIWinamp.getFileNamePlaying(); - if (fileName == null) - throw new InvalidHandle(); - return fileName; - - } - -} diff --git a/java/src/com/qotsa/jni/controller/package.html b/java/src/com/qotsa/jni/controller/package.html deleted file mode 100644 index 28739eb..0000000 --- a/java/src/com/qotsa/jni/controller/package.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - -Package containing the Controller Class to communicate with Winamp. - - -

Package Specification

- - - - - diff --git a/java/src/de/hardcode/jxinput/Axis.java b/java/src/de/hardcode/jxinput/Axis.java deleted file mode 100644 index 9f1d710..0000000 --- a/java/src/de/hardcode/jxinput/Axis.java +++ /dev/null @@ -1,72 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 19. Dezember 2001, 21:58 -//********************************************************************************************** -package de.hardcode.jxinput; - -/** - * The Axis interface describes the most common feature of a joystick or other input devices. - * - * @author Herkules - */ -public interface Axis extends Feature -{ - // Enumeration of axes. - final static int ID_X = 0; - final static int ID_Y = 1; - final static int ID_Z = 2; - final static int ID_ROTX = 3; - final static int ID_ROTY = 4; - final static int ID_ROTZ = 5; - final static int ID_SLIDER0 = 6; - final static int ID_SLIDER1 = 7; - final static int NUMBER_OF_ID = 8; - - // Enumeration of axis types - final static int TRANSLATION = 0; - final static int ROTATION = 1; - final static int SLIDER = 2; - - /** - * Retrieve the type of the axis. - * The type is describes the meaning and the range of values of the axis. - *

- * TRANSLATION typed axes denote a translational deviation from a center - * position. This can be e.g. the common, basic joystick axes. - * The range of getValue() is [-1.0,1.0]. - *

- * ROTATION typed axes denote a rotational deviation from a center - * position. Something on the stick is turned or twisted. - * The range of getValue() is [-1.0,1.0]. - *

- * SLIDER typed axes denote a shifting device without a center position. - * A good sample is a throttle control. - * The range of getValue() is [0.0,1.0]. - * - * @return [ TRANSLATION | ROTATION | SLIDER ] - */ - int getType(); - - /** - * Returns the current value of the axis. - * The range of the result depends on the axis type. - * - * @return value [-1.0,1.0] or [0.0,1.0] - */ - double getValue(); - - - /** - * Inform about the resolution of the axis. - * - * @return resolution, e.g. 2^-16 - */ - double getResolution(); - -} - - diff --git a/java/src/de/hardcode/jxinput/Button.java b/java/src/de/hardcode/jxinput/Button.java deleted file mode 100644 index 418e2b6..0000000 --- a/java/src/de/hardcode/jxinput/Button.java +++ /dev/null @@ -1,35 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 19. Dezember 2001, 21:58 -//********************************************************************************************** -package de.hardcode.jxinput; - -/** - * - * @author Herkules - */ -public interface Button extends Feature -{ - // Enumeration of button types - final static int PUSHBUTTON = 0; - final static int TOGGLEBUTTON = 1; - - /** - * Retrieve the type of the button. - * Pushbutton will deliver true==getState() as long as they are pressed down. - * Togglebuttons will change their state once they are pressed and keep that state - * until they are pressed again. - * @return [ PUSHBUTTON | TOGGLEBUTTON ] - */ - int getType(); - - /** - * Tells the state of the button at last update. - */ - boolean getState(); -} - diff --git a/java/src/de/hardcode/jxinput/Directional.java b/java/src/de/hardcode/jxinput/Directional.java deleted file mode 100644 index ccd27c1..0000000 --- a/java/src/de/hardcode/jxinput/Directional.java +++ /dev/null @@ -1,45 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 27. Dezember 2001, 23:33 -//********************************************************************************************** -package de.hardcode.jxinput; - -/** - * - * @author Herkules - */ -public interface Directional extends Feature -{ - /** - * If the Directional has a center position where it points to no direction, this - * flag is true when this position is reached. - */ - boolean isCentered(); - - /** - * Retrieve the direction pointed to. - * Value is given in 1/100 degree, [0,36000] - */ - int getDirection(); - - /** - * Retrieve the analog value pointing to the angle described by - * getDirection(). - * For coolie hats this will be either 1,0 for any direction or 0.0 - * when isCentered()==true. - */ - double getValue(); - - /** - * Inform about the resolution of the value returned by getValue(). - * - * @return resolution, e.g. 1.0 for coolie hats - */ - double getResolution(); - -} - diff --git a/java/src/de/hardcode/jxinput/Feature.java b/java/src/de/hardcode/jxinput/Feature.java deleted file mode 100644 index dcaed07..0000000 --- a/java/src/de/hardcode/jxinput/Feature.java +++ /dev/null @@ -1,38 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 27. Dezember 2001, 00:19 -//********************************************************************************************** -package de.hardcode.jxinput; - -/** - * An input device offers a set of features (otherwise it would be pretty useless). - * Features in this sense can be axes, buttons and a feature callede directional here. - * Coolie hats are typical directionals because they control a direction (to look at e.g.). - *

- * There are no concrete classes directly derived from Feature - it only - * provides a basis for other interfaces. - * - * @see Axis - * @see SelectButton - * @see Directional - * - * @author Herkules - */ -public abstract interface Feature -{ - /** - * Features may have a name provided e.g. by the driver. - */ - String getName(); - - /** - * Denote wether this feature has changed beyond it's resolution since it got last - * updated. - */ - boolean hasChanged(); -} - diff --git a/java/src/de/hardcode/jxinput/JXInputDevice.java b/java/src/de/hardcode/jxinput/JXInputDevice.java deleted file mode 100644 index d8a8bc8..0000000 --- a/java/src/de/hardcode/jxinput/JXInputDevice.java +++ /dev/null @@ -1,71 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 19. Dezember 2001, 21:47 -//********************************************************************************************** -package de.hardcode.jxinput; - -/** - * The JXInputDevise is the main entrypoint to the jxinput package. - *

- * A JXInputDevice represents one physical device like a joystick, a gamepad or - * even some emulation (e.g. using keyboard) that implements the interface. - *

- * The basis task of a JXInputDevise is to maintain a consistent state of all its features. - *
- * It is save to distribute the Feature objects into application without worrying - * about someone else performing an update method and thereby destructing the consistent state. - *

- * An additional task is to provide basic device features information like number of axes, buttons - * and directional features. - * - * @see Feature - * @see JXInputManager - * - * @author Herkules - * @version 0.2beta - */ -public interface JXInputDevice -{ - /** - * @directed - */ - /*#Features lnkFeatures;*/ - - /** - *@link aggregationByValue - */ - /*#Feature lnkFeature;*/ - - /** - * Devices may have a name. - * This name might be provided by a system dependant driver. - */ - String getName(); - - /** Actual number of available axes. */ - int getNumberOfAxes(); - - /** Actual number of available buttons. */ - int getNumberOfButtons(); - - /** Actual number of available directional features. */ - int getNumberOfDirectionals(); - - /** Maximum number of axes as an upper bound for index values. */ - int getMaxNumberOfAxes(); - - /** Maximum number of buttons as an upper bound for index values. */ - int getMaxNumberOfButtons(); - - /** Maximum number of directional features as an upper bound for index values. */ - int getMaxNumberOfDirectionals(); - - Axis getAxis( int idx ); - Button getButton( int idx ); - Directional getDirectional( int idx ); -} - diff --git a/java/src/de/hardcode/jxinput/JXInputManager.java b/java/src/de/hardcode/jxinput/JXInputManager.java deleted file mode 100644 index 8c3e050..0000000 --- a/java/src/de/hardcode/jxinput/JXInputManager.java +++ /dev/null @@ -1,233 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 29. Dezember 2001, 02:17 -//********************************************************************************************** -package de.hardcode.jxinput; - -// -// Import driver stuff -// -import de.hardcode.jxinput.directinput.DirectInputDevice; -import de.hardcode.jxinput.event.JXInputEventManager; -import de.hardcode.jxinput.keyboard.JXKeyboardInputDevice; -import de.hardcode.jxinput.virtual.JXVirtualInputDevice; - - -import java.util.ArrayList; -import java.util.Iterator; -import java.awt.Component; - - -/** - * Manages the available instances of JXInputDevice. - * It holds the one central update method which synchronizes with the physical device. - * @author Herkules - */ -public class JXInputManager -{ - - /** Remember when the last update took place. */ - private static long mTimeOfLastUpdate; - - /** Maintain a list of devices. */ - private final static ArrayList mDevices = new ArrayList(); - - /** Maintain a list of direct input devices. */ - private final static ArrayList mDIDevices = new ArrayList(); - - /** Maintain a list of virtual devices. */ - private final static ArrayList mVirtualDevices = new ArrayList(); - - /** Maintain a list of keyboard devices. */ - private final static ArrayList mKBDevices = new ArrayList(); - - /** - * Statically retrieve all DirectInputDevices available. - */ - static - { - reset(); - } - - - /** - * @directed - */ - /*#JXInputDevice lnkJXInputDevice;*/ - - /** - * Creates a new instance of JXInputManager. - * This is prohibited - it only has static members. - */ - private JXInputManager() - { - } - - - /** - * Retrieve the number of available input devices. - */ - public static int getNumberOfDevices() - { - return mDevices.size(); - } - - /** - * Delivers the JXInputDevice with the desired index. - *

- * Take care that idx < getNumberOfDevices()! - */ - public static JXInputDevice getJXInputDevice( int idx ) - { - // - // Be well-behaved even if idx is out of range. - // - if ( idx >= mDevices.size() ) - return null; - return (JXInputDevice)mDevices.get( idx ); - } - - - /** - * Master reset for all devices and events. - * After calling reset(), better forget all devices created or retrieved. - * They are no longer valid. - * Event listeners will no longer be called and should be discarded. - */ - synchronized public static void reset() - { - JXInputEventManager.reset(); - - mDevices.clear(); - - mVirtualDevices.clear(); - mDIDevices.clear(); - - DirectInputDevice.reset(); - - for ( int i = 0; i < DirectInputDevice.getNumberOfDevices(); ++i ) - { - DirectInputDevice dev = new DirectInputDevice( i ); - mDevices.add( dev ); - mDIDevices.add( dev ); - } - - // I have to call updateFeatures one time here during initialization - // bc. I experienced difficulties otherwise while running with the - // J3D sensoring stuff! -// updateFeatures(); - DirectInputDevice.update(); - - int n = mKBDevices.size(); - for ( int i = 0; i < n; ++i ) - ((JXKeyboardInputDevice)mKBDevices.get( i )).shutdown(); - mKBDevices.clear(); - } - - - /** - * Update the (shared) state of all features in one step. - * This method asks the actual device for a consistant state. - * After calling this method, all features may have new values. - * updateFeatures() is meant to be called e.g. once per frame in a gaming environment. - */ - public static void updateFeatures() - { - // Get timing - long now = System.currentTimeMillis(); - long deltaT = now - mTimeOfLastUpdate; - - // Update available driver - DirectInputDevice.update(); - - // - // Update the virtual devices. - // - Iterator vdevices = mVirtualDevices.iterator(); - while ( vdevices.hasNext() ) - { - ((JXVirtualInputDevice)vdevices.next()).update( deltaT ); - } - - // Remember time - mTimeOfLastUpdate = now; - - // Fire all events. - JXInputEventManager.trigger(); - } - - - - /** - * Get time when last update occurred. - * @return tickervalue in milliseconds - */ - public static long getLastUpdateTime() - { - return mTimeOfLastUpdate; - } - - - /** - * Create a new pseudo-device. - */ - public static JXKeyboardInputDevice createKeyboardDevice() - { - JXKeyboardInputDevice d = new JXKeyboardInputDevice(); - mDevices.add( d ); - mKBDevices.add( d ); - return d; - } - - - /** - * Create a new pseudo-device listening to a Swing component. - * Make sure that the component also has the keyboard focus!! - */ - public static JXKeyboardInputDevice createKeyboardDevice( Component comp ) - { - JXKeyboardInputDevice d = new JXKeyboardInputDevice( comp ); - mDevices.add( d ); - mKBDevices.add( d ); - return d; - } - - - /** - * Delete a keyboard device again e.g. when the corresponding - * JComponent gets deleted. - */ - public static void deleteKeyboardDevice( JXKeyboardInputDevice dev ) - { - mDevices.remove( dev ); - mKBDevices.remove( dev ); - ((JXKeyboardInputDevice)dev).shutdown(); - } - - - /** - * Create a new pseudo-device. - */ - public static JXVirtualInputDevice createVirtualDevice() - { - JXVirtualInputDevice d = new JXVirtualInputDevice(); - mDevices.add( d ); - mVirtualDevices.add( d ); - return d; - } - - - /** - * Delete a virtual device again. - */ - public static void deleteVirtualDevice( JXVirtualInputDevice dev ) - { - mDevices.remove( dev ); - mVirtualDevices.remove( dev ); - } - -} diff --git a/java/src/de/hardcode/jxinput/directinput/DIAxis.java b/java/src/de/hardcode/jxinput/directinput/DIAxis.java deleted file mode 100644 index a6d0eac..0000000 --- a/java/src/de/hardcode/jxinput/directinput/DIAxis.java +++ /dev/null @@ -1,70 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 27. Dezember 2001, 00:14 -//********************************************************************************************** -package de.hardcode.jxinput.directinput; - -import de.hardcode.jxinput.Axis; - -/** - * - * @author Herkules - */ -class DIAxis implements Axis -{ - private final int mDeviceIdx; - private final int mIdx; - - /** - * Creates a new instance of DIAxis. - */ - DIAxis( int devidx, int idx ) - { - mDeviceIdx = devidx; - mIdx = idx; - } - - public String getName() - { - return DirectInputDriver.getAxisName( mDeviceIdx, mIdx ); - } - - - /** - * Denote wether this feature has changed beyond it's resolution since it got last - * updated. - */ - public boolean hasChanged() - { - return true; - } - - public double getValue() - { - return DirectInputDriver.getAxisValue( mDeviceIdx, mIdx ); - } - - public int getType() - { - return DirectInputDriver.getAxisType( mDeviceIdx, mIdx ); - } - - /** - * Inform about the resolution of the axis. - * - * @return resolution, e.g. 2^-16 - */ - public double getResolution() - { - // extend the driver here!! - // Here I assume typical 16 bit resolution - return ( getType() == Axis.SLIDER ? 1.0/65536.0 : 2.0/65536.0 ) ; - } - -} - - diff --git a/java/src/de/hardcode/jxinput/directinput/DIButton.java b/java/src/de/hardcode/jxinput/directinput/DIButton.java deleted file mode 100644 index 5419550..0000000 --- a/java/src/de/hardcode/jxinput/directinput/DIButton.java +++ /dev/null @@ -1,55 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 27. Dezember 2001, 00:14 -//********************************************************************************************** -package de.hardcode.jxinput.directinput; - -import de.hardcode.jxinput.Button; - - -/** - * - * @author Herkules - */ -class DIButton implements Button -{ - private final int mDeviceIdx; - private final int mIdx; - - /** - * Creates a new instance of DIButton. - */ - DIButton( int devidx, int idx ) - { - mDeviceIdx = devidx; - mIdx = idx; - } - - public String getName() - { - return DirectInputDriver.getButtonName( mDeviceIdx, mIdx ); - } - - /** - * Denote wether this feature has changed beyond it's resolution since it got last - * updated. - */ - public boolean hasChanged() - { - return true; - } - - public int getType() - { - return DirectInputDriver.getButtonType( mDeviceIdx, mIdx ); - } - - public boolean getState() - { - return DirectInputDriver.getButtonState( mDeviceIdx, mIdx ); - } -} \ No newline at end of file diff --git a/java/src/de/hardcode/jxinput/directinput/DIDirectional.java b/java/src/de/hardcode/jxinput/directinput/DIDirectional.java deleted file mode 100644 index 9da2d3d..0000000 --- a/java/src/de/hardcode/jxinput/directinput/DIDirectional.java +++ /dev/null @@ -1,78 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 27. Dezember 2001, 23:40 -//********************************************************************************************** -package de.hardcode.jxinput.directinput; - -import de.hardcode.jxinput.Directional; - -/** - * - * @author Herkules - */ -class DIDirectional implements Directional -{ - private final int mDeviceIdx; - private final int mIdx; - - /** - * Creates a new instance of DIDirectional. - */ - DIDirectional( int devidx, int idx ) - { - mDeviceIdx = devidx; - mIdx = idx; - } - - /** Features may have a name provided e.g. by the driver. */ - public String getName() - { - return DirectInputDriver.getDirectionalName( mDeviceIdx, mIdx ); - } - - /** - * Denote wether this feature has changed beyond it's resolution since it got last - * updated. - */ - public boolean hasChanged() - { - return true; - } - - - public boolean isCentered() - { - return ( 0xffff == (DirectInputDriver.getDirection( mDeviceIdx, mIdx ) & 0xffff) ); - } - - public int getDirection() - { - return isCentered() ? 0 : DirectInputDriver.getDirection( mDeviceIdx, mIdx ); - } - - public double getValue() - { - if ( isCentered() ) - return 0.0; - return 1.0; - } - - /** - * Inform about the resolution of the value returned by getValue(). - * - * @return resolution, e.g. 1.0 for coolie hats - */ - public double getResolution() - { - // DI POV always return 0.0 or 1.0, so the resolution is 1.0. - return 1.0; - } - - -} - - diff --git a/java/src/de/hardcode/jxinput/directinput/DirectInputDevice.java b/java/src/de/hardcode/jxinput/directinput/DirectInputDevice.java deleted file mode 100644 index a20eab3..0000000 --- a/java/src/de/hardcode/jxinput/directinput/DirectInputDevice.java +++ /dev/null @@ -1,170 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 26. Dezember 2001, 00:40 -//********************************************************************************************** -package de.hardcode.jxinput.directinput; - -import de.hardcode.jxinput.JXInputDevice; -import de.hardcode.jxinput.Axis; -import de.hardcode.jxinput.Directional; -import de.hardcode.jxinput.Button; - -/** - * - * @author Herkules - */ -public class DirectInputDevice implements JXInputDevice -{ - int mDeviceIdx; - - private DIAxis[] mAxes; - private DIButton[] mButtons; - private DIDirectional[] mDirectionals; - - /** - * The number of DirectInput devices available with the driver. - */ - public static int getNumberOfDevices() - { - if ( DirectInputDriver.isAvailable() ) - return DirectInputDriver.getNumberOfDevices(); - return 0; - } - - - /** - * Update the state of all devices. - */ - public static void update() - { - if ( DirectInputDriver.isAvailable() ) - DirectInputDriver.nativeupdate(); - } - - - - - /** - * Creates a new instance of DirectInputDevice. - */ - public DirectInputDevice( int devidx ) - { - mDeviceIdx = devidx; - - init(); - } - - /** - * Reset the DirectInput connection. - */ - public static void reset() - { - if ( DirectInputDriver.isAvailable() ) - DirectInputDriver.reset(); - } - - - /** - * Initialisation of fields. - */ - private final void init() - { - // - // Allocate arrays for max. number of features - // - mAxes = new DIAxis [ getMaxNumberOfAxes() ]; - mButtons = new DIButton [ getMaxNumberOfButtons() ]; - mDirectionals = new DIDirectional [ getMaxNumberOfDirectionals() ]; - - // - // Fill arrays due to the state of the driver. - // - for ( int i = 0; i < mAxes.length; ++i ) - { - if ( DirectInputDriver.isAxisAvailable( mDeviceIdx, i ) ) - mAxes[ i ] = new DIAxis( mDeviceIdx, i ); - } - - for ( int i = 0; i < mButtons.length; ++i ) - { - if ( DirectInputDriver.isButtonAvailable( mDeviceIdx, i ) ) - mButtons[ i ] = new DIButton( mDeviceIdx, i ); - } - - for ( int i = 0; i < mDirectionals.length; ++i ) - { - if ( DirectInputDriver.isDirectionalAvailable( mDeviceIdx, i ) ) - mDirectionals[ i ] = new DIDirectional( mDeviceIdx, i ); - } - } - - /** Devices may have a name. */ - public String getName() - { - String name = DirectInputDriver.getName( mDeviceIdx ); - if ( null == name ) - return "Win32 DirectInput Joystick"; - return name; - } - - - /** Actual number of available buttons. */ - public int getNumberOfButtons() - { - return DirectInputDriver.getNumberOfButtons( mDeviceIdx ); - } - - /** Actual number of available axes. */ - public int getNumberOfAxes() - { - return DirectInputDriver.getNumberOfAxes( mDeviceIdx ); - } - - /** Actual number of available directional features. */ - public int getNumberOfDirectionals() - { - return DirectInputDriver.getNumberOfDirectionals( mDeviceIdx ); - } - - /** Maximum number of buttons as an upper bound for index values. */ - public int getMaxNumberOfButtons() - { - return DirectInputDriver.getMaxNumberOfButtons(); - } - - /** Maximum number of axes as an upper bound for index values. */ - public int getMaxNumberOfAxes() - { - return DirectInputDriver.getMaxNumberOfAxes(); - } - - /** Maximum number of available directional features. */ - public int getMaxNumberOfDirectionals() - { - return DirectInputDriver.getMaxNumberOfDirectionals(); - } - - - public Axis getAxis(int idx) - { - return mAxes[ idx ]; - } - - public Button getButton(int idx) - { - return mButtons[ idx ]; - } - - public Directional getDirectional(int idx) - { - return mDirectionals[ idx ]; - } - -} - - - diff --git a/java/src/de/hardcode/jxinput/directinput/DirectInputDriver.java b/java/src/de/hardcode/jxinput/directinput/DirectInputDriver.java deleted file mode 100644 index 558f7d8..0000000 --- a/java/src/de/hardcode/jxinput/directinput/DirectInputDriver.java +++ /dev/null @@ -1,184 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 19. Dezember 2001, 22:44 -//********************************************************************************************** -package de.hardcode.jxinput.directinput; - -import java.lang.reflect.Array; - -/** - * DirectInputDriver: the connection to the Win32 joystick. - * There is only one allowed, so the layout of this class is merely static. - * - * History: - * - * Changes since 0.1beta: - * - support of multiple devices addressed by the dev index - * - * - * @author Herkules - * @version 0.2beta - */ -class DirectInputDriver -{ - private final static String NATIVE_LIB_NAME = "jxinput"; - - /** Remember wether nativeinit() succeeded. */ - static boolean sIsOperational = false; - - // - // Static arrays to hold the values. - // - private static double [][] sAxisValues; - private static boolean [][] sButtonStates; - private static int [][] sDirectionalValues; - - /** - * Perform the static initialization. - */ - static - { - try - { - // Load the native lib. - System.loadLibrary( NATIVE_LIB_NAME ); - - init(); - } - catch( SecurityException e ) - { - Log.logger.warning("Native library jxinput not loaded due to a SecurityException."); - } - catch( UnsatisfiedLinkError e ) - { - Log.logger.info("Native library jxinput not loaded due to an UnsatisfiedLinkError."); - } - } - - - private final static void init() - { - sIsOperational = false; - // - // Initialize it. - // - if ( nativeinit() ) - { - int devs = getNumberOfDevices(); - sAxisValues = new double [ devs ][ DirectInputDriver.getMaxNumberOfAxes() ]; - sButtonStates = new boolean [ devs ][ DirectInputDriver.getMaxNumberOfButtons() ]; - sDirectionalValues = new int [ devs ][ DirectInputDriver.getMaxNumberOfDirectionals() ]; - - // Bind the native lib to my variables. - bind(); - - // Remember I am fine. - sIsOperational = true; - } - - } - - - /** - * Static ctor of DirectInputDriver. - * No object will be created due to the static layout. - */ - private DirectInputDriver() - { - } - - // Administration - private static native boolean nativeinit(); - private static native void nativeexit(); - private static native void bind(); - - static native int getNumberOfDevices(); - - // Configuration - static native String getName( int dev ); - static native int getNumberOfAxes( int dev ); - static native int getNumberOfButtons( int dev ); - static native int getNumberOfDirectionals( int dev ); - static native int getMaxNumberOfAxes(); - static native int getMaxNumberOfButtons(); - static native int getMaxNumberOfDirectionals(); - - static native boolean isAxisAvailable( int dev, int idx ); - static native String getAxisName( int dev, int idx ); - static native int getAxisType( int dev, int idx ); - - static native boolean isButtonAvailable( int dev, int idx ); - static native String getButtonName( int dev, int idx ); - static native int getButtonType( int dev, int idx ); - - static native boolean isDirectionalAvailable( int dev, int idx ); - static native String getDirectionalName( int dev, int idx ); - - // Operation - static native void nativeupdate(); - - - public static boolean isAvailable() - { - return sIsOperational; - } - - - /** - * Shutdown the device and free all Win32 resources. - * It is not a good idea to access any joystick features after - * shutdown(). - */ - static void shutdown() - { - nativeexit(); - sAxisValues = null; - sButtonStates = null; - sDirectionalValues = null; - } - - - /** - * Reset the device and free all Win32 resources. - */ - static void reset() - { - shutdown(); - init(); - } - - static double getAxisValue( int dev, int idx ) - { - return sAxisValues[ dev ][ idx ]; - } - - static boolean getButtonState( int dev, int idx ) - { - return sButtonStates[ dev ][ idx ]; - } - - static int getDirection( int dev, int idx ) - { - return sDirectionalValues[ dev ][ idx ]; - } - - /** - * @param args the command line arguments - */ - public static void main (String args[]) - { - - if ( ! sIsOperational ) - return; - - for( int i = 0; i < 5000; ++i ) - nativeupdate(); - - shutdown(); - } - -} diff --git a/java/src/de/hardcode/jxinput/directinput/Log.java b/java/src/de/hardcode/jxinput/directinput/Log.java deleted file mode 100644 index 95e586c..0000000 --- a/java/src/de/hardcode/jxinput/directinput/Log.java +++ /dev/null @@ -1,34 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 29. Oktober 2002, 22:57 -//********************************************************************************************** -package de.hardcode.jxinput.directinput; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * - * @author Herkules - */ -public class Log -{ - public final static Logger logger = Logger.getLogger( Log.class.getPackage().getName() ); - -// static -// { -// logger.setLevel( Level.ALL ); -// } - - /** - * Creates a new instance of Log. - */ - private Log() - { - } - -} diff --git a/java/src/de/hardcode/jxinput/event/JXInputAxisEvent.java b/java/src/de/hardcode/jxinput/event/JXInputAxisEvent.java deleted file mode 100644 index c353b5e..0000000 --- a/java/src/de/hardcode/jxinput/event/JXInputAxisEvent.java +++ /dev/null @@ -1,48 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 31. Januar 2002, 23:33 -//********************************************************************************************** -package de.hardcode.jxinput.event; - -import de.hardcode.jxinput.JXInputDevice; -import de.hardcode.jxinput.Axis; - -/** - * Represents an event coming from an axis. - * @author Joerg Plewe - */ -public class JXInputAxisEvent -{ - private final Axis mAxis; - double mDelta; - - /** - * Creates a new instance of JXInputEvent. - */ - JXInputAxisEvent( Axis axis ) - { - mAxis = axis; - } - - /** - * The feature that caused the event. - */ - public final Axis getAxis() - { - return mAxis; - } - - - /** - * Return the change in value that caused the event. - */ - public double getDelta() - { - return mDelta; - } - -} diff --git a/java/src/de/hardcode/jxinput/event/JXInputAxisEventListener.java b/java/src/de/hardcode/jxinput/event/JXInputAxisEventListener.java deleted file mode 100644 index d8adf46..0000000 --- a/java/src/de/hardcode/jxinput/event/JXInputAxisEventListener.java +++ /dev/null @@ -1,19 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 31. Januar 2002, 23:54 -//********************************************************************************************** -package de.hardcode.jxinput.event; - -/** - * - * @author Herkules - */ -public interface JXInputAxisEventListener -{ - void changed( JXInputAxisEvent ev ); -} - diff --git a/java/src/de/hardcode/jxinput/event/JXInputButtonEvent.java b/java/src/de/hardcode/jxinput/event/JXInputButtonEvent.java deleted file mode 100644 index d82d0b9..0000000 --- a/java/src/de/hardcode/jxinput/event/JXInputButtonEvent.java +++ /dev/null @@ -1,38 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 31. Januar 2002, 23:33 -//********************************************************************************************** -package de.hardcode.jxinput.event; - -import de.hardcode.jxinput.JXInputDevice; -import de.hardcode.jxinput.Button; - -/** - * Represents event coming from a button. - * @author Joerg Plewe - */ -public class JXInputButtonEvent -{ - final Button mButton; - - /** - * Creates a new instance of JXInputEvent. - */ - JXInputButtonEvent( Button button ) - { - mButton = button; - } - - /** - * The feature that caused the event. - */ - public final Button getButton() - { - return mButton; - } - -} diff --git a/java/src/de/hardcode/jxinput/event/JXInputButtonEventListener.java b/java/src/de/hardcode/jxinput/event/JXInputButtonEventListener.java deleted file mode 100644 index afdc323..0000000 --- a/java/src/de/hardcode/jxinput/event/JXInputButtonEventListener.java +++ /dev/null @@ -1,19 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 31. Januar 2002, 23:54 -//********************************************************************************************** -package de.hardcode.jxinput.event; - -/** - * - * @author Herkules - */ -public interface JXInputButtonEventListener -{ - void changed( JXInputButtonEvent ev ); -} - diff --git a/java/src/de/hardcode/jxinput/event/JXInputDirectionalEvent.java b/java/src/de/hardcode/jxinput/event/JXInputDirectionalEvent.java deleted file mode 100644 index 70e6bcd..0000000 --- a/java/src/de/hardcode/jxinput/event/JXInputDirectionalEvent.java +++ /dev/null @@ -1,56 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 31. Januar 2002, 23:33 -//********************************************************************************************** -package de.hardcode.jxinput.event; - -import de.hardcode.jxinput.JXInputDevice; -import de.hardcode.jxinput.Directional; - -/** - * Represents an event coming from an axis. - * @author Joerg Plewe - */ -public class JXInputDirectionalEvent -{ - private final Directional mDirectional; - double mValueDelta; - int mDirectionDelta; - - /** - * Creates a new instance of JXInputEvent. - */ - JXInputDirectionalEvent( Directional directional ) - { - mDirectional = directional; - } - - /** - * The feature that caused the event. - */ - public final Directional getDirectional() - { - return mDirectional; - } - - /** - * Return the change in value that caused the event. - */ - public double getValueDelta() - { - return mValueDelta; - } - - /** - * Return the change in direction that caused the event. - */ - public int getDirectionDelta() - { - return mDirectionDelta; - } - -} diff --git a/java/src/de/hardcode/jxinput/event/JXInputDirectionalEventListener.java b/java/src/de/hardcode/jxinput/event/JXInputDirectionalEventListener.java deleted file mode 100644 index 65c7efa..0000000 --- a/java/src/de/hardcode/jxinput/event/JXInputDirectionalEventListener.java +++ /dev/null @@ -1,19 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 31. Januar 2002, 23:54 -//********************************************************************************************** -package de.hardcode.jxinput.event; - -/** - * - * @author Herkules - */ -public interface JXInputDirectionalEventListener -{ - void changed( JXInputDirectionalEvent ev ); -} - diff --git a/java/src/de/hardcode/jxinput/event/JXInputEventManager.java b/java/src/de/hardcode/jxinput/event/JXInputEventManager.java deleted file mode 100644 index aa196d7..0000000 --- a/java/src/de/hardcode/jxinput/event/JXInputEventManager.java +++ /dev/null @@ -1,284 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 31. Januar 2002, 23:42 -//********************************************************************************************** -package de.hardcode.jxinput.event; - -import de.hardcode.jxinput.JXInputManager; -import de.hardcode.jxinput.JXInputDevice; - -import java.util.ArrayList; -import de.hardcode.jxinput.Axis; -import java.util.Iterator; -import de.hardcode.jxinput.Button; -import de.hardcode.jxinput.Directional; - -/** - * Handles all events and listeners. - * JXInputEventManager is layed out a static singleton. - * @author Herkules - */ -public class JXInputEventManager -{ - - private final static ArrayList mAxisEventListeners = new ArrayList(); - private final static ArrayList mButtonEventListeners = new ArrayList(); - private final static ArrayList mDirectionalEventListeners = new ArrayList(); - - private static autotrigger mAutoTrigger = null; - - /** - * Inner class combining a listener with its scheduling parameters. - */ - private static class axislistener - { - final JXInputAxisEventListener mListener; - final double mTreshold; - final JXInputAxisEvent mEvent; - double mLastValueFired = 0.0; - - axislistener( JXInputAxisEventListener l, Axis axis, double treshold ) - { - mListener = l; - mTreshold = treshold; - mEvent = new JXInputAxisEvent( axis ); - } - - final void checkTrigger() - { - double curval = mEvent.getAxis().getValue(); - double delta = curval - mLastValueFired; - - if ( Math.abs( delta ) >= mTreshold ) - { - mLastValueFired = curval; - mEvent.mDelta = delta; - mListener.changed( mEvent ); - } - } - } - - /** - * Inner class combining a listener with its scheduling parameters. - */ - private static class buttonlistener - { - final JXInputButtonEventListener mListener; - final JXInputButtonEvent mEvent; - boolean mLastValueFired = false; - - buttonlistener( JXInputButtonEventListener l, Button button ) - { - mListener = l; - mEvent = new JXInputButtonEvent( button ); - } - - final void checkTrigger() - { - boolean curstate = mEvent.getButton().getState(); - if ( curstate != mLastValueFired ) - { - mLastValueFired = curstate; - mListener.changed( mEvent ); - } - } - } - - - private static class directionallistener - { - final JXInputDirectionalEventListener mListener; - final double mValueTreshold; - final JXInputDirectionalEvent mEvent; - double mLastValueFired = 0.0; - boolean mLastCenteredFired = true; - int mLastDirectionFired = 0; - - directionallistener( JXInputDirectionalEventListener l, Directional directional, double valuetreshold ) - { - mListener = l; - mValueTreshold = valuetreshold; - mEvent = new JXInputDirectionalEvent( directional ); - } - - final void checkTrigger() - { - double curval = mEvent.getDirectional().getValue(); - int curdir = mEvent.getDirectional().getDirection(); - boolean curctr = mEvent.getDirectional().isCentered(); - - double delta = curval - mLastValueFired; - int dirdelta = curdir - mLastDirectionFired; - boolean centeredchanged = mLastCenteredFired != curctr; - - if ( Math.abs( delta ) >= mValueTreshold - || Math.abs( dirdelta ) > 0 - || centeredchanged ) - { - mLastValueFired = curval; - mLastDirectionFired = curdir; - mLastCenteredFired = curctr; - - mEvent.mValueDelta = delta; - mEvent.mDirectionDelta = dirdelta; - mListener.changed( mEvent ); - } - } - } - - /** - * Creates a new instance of JXInputEventManager. - */ - private JXInputEventManager() - { - } - - - /** - * Remove all listeners at once. - */ - public static void reset() - { - mAxisEventListeners.clear(); - mButtonEventListeners.clear(); - mDirectionalEventListeners.clear(); - } - - - /** - * Query devices and fire all occuring events. - * trigger() is thought to be called by JXInputManager#updateFeatures(). - */ - public static void trigger() - { - int n = mAxisEventListeners.size(); - for ( int i = 0; i < n; i++ ) - { - axislistener l = (axislistener)mAxisEventListeners.get( i ); - l.checkTrigger(); - } - - n = mButtonEventListeners.size(); - for ( int i = 0; i < n; i++ ) - { - buttonlistener l = (buttonlistener)mButtonEventListeners.get( i ); - l.checkTrigger(); - } - - n = mDirectionalEventListeners.size(); - for ( int i = 0; i < n; i++ ) - { - directionallistener l = (directionallistener)mDirectionalEventListeners.get( i ); - l.checkTrigger(); - } - } - - - private final static class autotrigger extends Thread - { - boolean mFinish = false; - final int mDelay; - - autotrigger( int delay ) - { - mDelay = delay; - } - - public void run() - { - while ( ! mFinish ) - { - try - { - Thread.sleep( mDelay ); - JXInputManager.updateFeatures(); - } - catch ( InterruptedException ex ) - { - } - } - } - } - - - /** - * Set the intervall in ms that is used to check for new values of the features. - * Set it to <= 0 to prohibit automatic triggering. Events will then only be fired - * when somebody invokes JXInputManager#updateFeatures(). - */ - public static void setTriggerIntervall( int ms ) - { - // - // Kill current thread, if any - // - if ( null != mAutoTrigger ) - { - mAutoTrigger.mFinish = true; - try - { - mAutoTrigger.join(); - } - catch ( InterruptedException ex ) - { - } - } - - mAutoTrigger = null; - - if ( ms > 0 ) - { - mAutoTrigger = new autotrigger( ms ); - mAutoTrigger.start(); - } - - } - - - - - public static void addListener( JXInputAxisEventListener l, Axis axis, double treshold ) - { - mAxisEventListeners.add( new JXInputEventManager.axislistener( l, axis, treshold ) ); - } - - public static void addListener( JXInputAxisEventListener l, Axis axis ) - { - mAxisEventListeners.add( new JXInputEventManager.axislistener( l, axis, axis.getResolution() ) ); - } - - public static void removeListener( JXInputAxisEventListener l ) - { - mAxisEventListeners.remove( l ); - } - - - public static void addListener( JXInputButtonEventListener l, Button button ) - { - mButtonEventListeners.add( new JXInputEventManager.buttonlistener( l, button ) ); - } - - public static void removeListener( JXInputButtonEventListener l ) - { - mButtonEventListeners.remove( l ); - } - - public static void addListener( JXInputDirectionalEventListener l, Directional directional, double valuetreshold ) - { - mDirectionalEventListeners.add( new JXInputEventManager.directionallistener( l, directional, valuetreshold ) ); - } - - public static void addListener( JXInputDirectionalEventListener l, Directional directional ) - { - mDirectionalEventListeners.add( new JXInputEventManager.directionallistener( l, directional, directional.getResolution() ) ); - } - - public static void removeListener( JXInputDirectionalEventListener l ) - { - mDirectionalEventListeners.remove( l ); - } - -} diff --git a/java/src/de/hardcode/jxinput/j3d/DeviceConfiguration.java b/java/src/de/hardcode/jxinput/j3d/DeviceConfiguration.java deleted file mode 100644 index 8c1288a..0000000 --- a/java/src/de/hardcode/jxinput/j3d/DeviceConfiguration.java +++ /dev/null @@ -1,95 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 23. Februar 2002, 14:05 -//********************************************************************************************** -package de.hardcode.jxinput.j3d; - -import de.hardcode.jxinput.Axis; - - -/** - * Connects JXInput with J3DInputDevice. - * - * @author Herkules - */ -public class DeviceConfiguration -{ - public final static int AXIS_X = 0; - public final static int AXIS_Y = 1; - public final static int AXIS_Z = 2; - - private final static class axisvalue - { - private final Axis mAxis; - private final IsActiveCondition mIsActive; - private final IsActiveCondition mIsIncremental; - private final double mScale; - private final double mOffset; - private double mValue; - - axisvalue( Axis axis, IsActiveCondition active, IsActiveCondition incremental, double offset, double scale ) - { - mAxis = axis; - mIsActive = active; - mIsIncremental = incremental; - mValue = mOffset = offset; - mScale = scale; - } - - double value() - { - if ( mIsActive.isActive() ) - { - double newval = mAxis.getValue() * mScale; - - if ( mIsIncremental.isActive() ) - mValue += newval; - else - mValue = newval + mOffset; - } - return mValue; - } - } - - DeviceConfiguration.axisvalue [] mAxisTrans = new DeviceConfiguration.axisvalue[ 3 ]; - DeviceConfiguration.axisvalue [] mAxisRot = new DeviceConfiguration.axisvalue[ 3 ]; - - /** - * Creates a new instance of DeviceConfiguration. - */ - public DeviceConfiguration() - { - } - - - double getTranslational( int axisid ) - { - DeviceConfiguration.axisvalue val = mAxisTrans[ axisid ]; - return null == val ? 0.0 : val.value(); - } - - double getRotational( int axisid ) - { - DeviceConfiguration.axisvalue val = mAxisRot[ axisid ]; - return null == val ? 0.0 : val.value(); - } - - public void setTranslational( int axisid, Axis axis, IsActiveCondition active, IsActiveCondition incremental, double offset, double scale ) - { - if ( axisid < 0 || axisid > AXIS_Z ) - throw new IllegalArgumentException(); - mAxisTrans[ axisid ] = new DeviceConfiguration.axisvalue( axis, active, incremental, offset, scale ); - } - - public void setRotational( int axisid, Axis axis, IsActiveCondition active, IsActiveCondition incremental, double offset, double scale ) - { - if ( axisid < 0 || axisid > AXIS_Z ) - throw new IllegalArgumentException(); - mAxisRot[ axisid ] = new DeviceConfiguration.axisvalue( axis, active, incremental, offset, scale ); - } - -} diff --git a/java/src/de/hardcode/jxinput/j3d/IsActiveCondition.java b/java/src/de/hardcode/jxinput/j3d/IsActiveCondition.java deleted file mode 100644 index af6ca08..0000000 --- a/java/src/de/hardcode/jxinput/j3d/IsActiveCondition.java +++ /dev/null @@ -1,25 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 25. Februar 2002, 22:41 -//********************************************************************************************** -package de.hardcode.jxinput.j3d; - -/** - * - * @author Herkules - */ -public interface IsActiveCondition -{ - public final static IsActiveCondition ALWAYS = IsAlwaysActiveCondition.ALWAYS; - public final static IsActiveCondition NEVER = IsAlwaysActiveCondition.NEVER; - - /** - * Tell wether a certain thing is active. - */ - boolean isActive(); -} - diff --git a/java/src/de/hardcode/jxinput/j3d/IsActiveOnButtonCondition.java b/java/src/de/hardcode/jxinput/j3d/IsActiveOnButtonCondition.java deleted file mode 100644 index 98da7bb..0000000 --- a/java/src/de/hardcode/jxinput/j3d/IsActiveOnButtonCondition.java +++ /dev/null @@ -1,39 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 25. Februar 2002, 22:43 -//********************************************************************************************** -package de.hardcode.jxinput.j3d; - -import de.hardcode.jxinput.Button; - -/** - * - * @author Herkules - */ -public class IsActiveOnButtonCondition implements IsActiveCondition -{ - private final boolean mActiveState; - private final Button mButton; - - /** - * Creates a new instance of IsAlwayActiveCondition. - */ - public IsActiveOnButtonCondition( Button button, boolean activestate ) - { - mActiveState = activestate; - mButton = button; - } - - /** - * Tell wether a certain thing is active. - */ - public boolean isActive() - { - return mButton.getState() == mActiveState; - } - -} diff --git a/java/src/de/hardcode/jxinput/j3d/IsAlwaysActiveCondition.java b/java/src/de/hardcode/jxinput/j3d/IsAlwaysActiveCondition.java deleted file mode 100644 index cd8b1fe..0000000 --- a/java/src/de/hardcode/jxinput/j3d/IsAlwaysActiveCondition.java +++ /dev/null @@ -1,38 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 25. Februar 2002, 22:43 -//********************************************************************************************** -package de.hardcode.jxinput.j3d; - -/** - * - * @author Herkules - */ -final class IsAlwaysActiveCondition implements IsActiveCondition -{ - private final boolean mIsActive; - - public final static IsActiveCondition ALWAYS = new IsAlwaysActiveCondition( true ); - public final static IsActiveCondition NEVER = new IsAlwaysActiveCondition( false ); - - /** - * Creates a new instance of IsAlwayActiveCondition. - */ - private IsAlwaysActiveCondition(boolean isactive) - { - mIsActive = isactive; - } - - /** - * Tell wether a certain thing is active. - */ - public boolean isActive() - { - return mIsActive; - } - -} diff --git a/java/src/de/hardcode/jxinput/j3d/J3DInputDevice.java b/java/src/de/hardcode/jxinput/j3d/J3DInputDevice.java deleted file mode 100644 index f5b08f2..0000000 --- a/java/src/de/hardcode/jxinput/j3d/J3DInputDevice.java +++ /dev/null @@ -1,171 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 22. Februar 2002, 13:21 -//********************************************************************************************** -package de.hardcode.jxinput.j3d; - -import javax.media.j3d.InputDevice; -import javax.media.j3d.Sensor; -import javax.media.j3d.SensorRead; -import javax.vecmath.Vector3d; -import javax.media.j3d.Transform3D; -import de.hardcode.jxinput.JXInputManager; - - -/** - * Implementation of Java3D's InputDevice - * - * @author Herkules - */ -public class J3DInputDevice - implements InputDevice -{ - private Vector3d mPosition = new Vector3d(); - private Transform3D mNewTransform = new Transform3D(); - - private Transform3D mRotTransX = new Transform3D(); - private Transform3D mRotTransY = new Transform3D(); - private Transform3D mRotTransZ = new Transform3D(); - - private Vector3d mInitPos = new Vector3d( 0.0, 0.0, 0.0 ); - - private Sensor mSensor = new Sensor( this ); - private SensorRead mSensorRead = new SensorRead(); - - private DeviceConfiguration mConfig; - - /** - * Creates a new instance of J3DInputDevice. - */ - public J3DInputDevice( DeviceConfiguration config ) - { - mConfig = config; - setNominalPositionAndOrientation(); - } - - - public void close() - { - // Intentionally empty - } - - - /** - * Retrieve processing mode. - * For this device, it always is NON_BLOCKING. - */ - public int getProcessingMode() - { - return InputDevice.NON_BLOCKING; - } - - - /** - * Don't care for the index, I only support one sensor. - * And I deliver that. - */ - public Sensor getSensor( int param ) - { - return mSensor; - } - - - /** - * Tell the world about the only one sensor I support. - */ - public int getSensorCount() - { - return 1; - } - - - /** - * Well - initialize! - * Nothing to do here. - */ - public boolean initialize() - { - return true; - } - - - /** - * The main update method. - */ - public void pollAndProcessInput() - { - JXInputManager.updateFeatures(); - - mSensorRead.setTime( JXInputManager.getLastUpdateTime() ); - - mRotTransX.rotX( mConfig.getRotational( DeviceConfiguration.AXIS_X ) ); - mRotTransY.rotY( mConfig.getRotational( DeviceConfiguration.AXIS_Y ) ); - mRotTransZ.rotZ( mConfig.getRotational( DeviceConfiguration.AXIS_Z ) ); - - mPosition.set( - mConfig.getTranslational( DeviceConfiguration.AXIS_X ), - mConfig.getTranslational( DeviceConfiguration.AXIS_Y ), - mConfig.getTranslational( DeviceConfiguration.AXIS_Z ) - ); - - mNewTransform.set( mPosition ); - - mNewTransform.mul( mRotTransX ); - mNewTransform.mul( mRotTransY ); - mNewTransform.mul( mRotTransZ ); - - mSensorRead.set( mNewTransform ); - mSensor.setNextSensorRead( mSensorRead ); - } - - - /** - * Not called by current j3d implementation. - */ - public void processStreamInput() - { - // Intentionally empty - } - - - /** - * Reset state. - */ - public void setNominalPositionAndOrientation() - { - mSensorRead.setTime( JXInputManager.getLastUpdateTime() ); - - mRotTransX.rotX( 0.0 ); - mRotTransY.rotY( 0.0 ); - mRotTransZ.rotZ( 0.0 ); - - mPosition.set( mInitPos ); - - mNewTransform.set( mPosition ); - - mNewTransform.mul( mRotTransX ); - mNewTransform.mul( mRotTransY ); - mNewTransform.mul( mRotTransZ ); - - mSensorRead.set( mNewTransform ); - mSensor.setNextSensorRead( mSensorRead ); - - } - - - /** - * Set the processing mode. - * Only NON_BLOCKING is allowed! - */ - public void setProcessingMode(int param) - { - if ( param != InputDevice.NON_BLOCKING ) - throw new IllegalArgumentException("Processing mode must be NON_BLOCKING"); - - } - -} diff --git a/java/src/de/hardcode/jxinput/j3d/package.html b/java/src/de/hardcode/jxinput/j3d/package.html deleted file mode 100644 index 9b92964..0000000 --- a/java/src/de/hardcode/jxinput/j3d/package.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - -Connecting JXInput to Java3D by implementing the interface -javax.media.j3d.InputDevice. - - diff --git a/java/src/de/hardcode/jxinput/j3d/test/HelloUniverse.java b/java/src/de/hardcode/jxinput/j3d/test/HelloUniverse.java deleted file mode 100644 index 73df1f7..0000000 --- a/java/src/de/hardcode/jxinput/j3d/test/HelloUniverse.java +++ /dev/null @@ -1,205 +0,0 @@ - -/* - * @(#)HelloUniverse.java 1.15 02/02/07 14:48:36 - * - * Copyright (c) 1996-2002 Sun Microsystems, Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistribution 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. - * - * Neither the name of Sun Microsystems, Inc. or the names of - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * This software is provided "AS IS," without a warranty of any - * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND - * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY - * EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES - * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR - * DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN - * OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR - * FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR - * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF - * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, - * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You acknowledge that Software is not designed,licensed or intended - * for use in the design, construction, operation or maintenance of - * any nuclear facility. - */ - -package de.hardcode.jxinput.j3d.test; - - -import java.applet.Applet; -import java.awt.*; -import java.awt.event.*; -import com.sun.j3d.utils.applet.MainFrame; -import com.sun.j3d.utils.geometry.ColorCube; -import com.sun.j3d.utils.universe.*; -import javax.media.j3d.*; -import javax.vecmath.*; -import de.hardcode.jxinput.j3d.DeviceConfiguration; -import de.hardcode.jxinput.Axis; -import de.hardcode.jxinput.JXInputManager; -import de.hardcode.jxinput.j3d.IsActiveCondition; -import de.hardcode.jxinput.j3d.J3DInputDevice; -import de.hardcode.jxinput.j3d.IsActiveOnButtonCondition; - - -public class HelloUniverse extends Applet -{ - - private SimpleUniverse u = null; - TransformGroup objTrans; - - public BranchGroup createSceneGraph() - { - BranchGroup objRoot = new BranchGroup(); - objTrans = new TransformGroup(); - objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); - objRoot.addChild(objTrans); - objTrans.addChild(new ColorCube(0.4)); - -// Transform3D yAxis = new Transform3D(); -// Alpha rotationAlpha = new Alpha(-1, Alpha.INCREASING_ENABLE, -// 0, 0, -// 4000, 0, 0, -// 0, 0, 0); -// RotationInterpolator rotator = new RotationInterpolator(rotationAlpha, objTrans, yAxis, -// 0.0f, (float) Math.PI*2.0f); -// BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0); -// rotator.setSchedulingBounds(bounds); -// objTrans.addChild(rotator); - return objRoot; - } - - - public HelloUniverse() - { - - } - - public void init() - { - // These are the string arguments given to the VirtualInputDevice - // constructor. These are settable parameters. Look in the - // VirtualInputDevice constructor for a complete list. - String[] args = new String[10]; - args[0] = "printvalues"; - args[1] = "true"; - args[2] = "yscreeninitloc"; - args[3] = "50"; - args[4] = null; - - - // now create the HelloUniverse Canvas - setLayout(new BorderLayout()); - GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration(); - - Canvas3D c = new Canvas3D(config); - add("Center", c); - - // Create a simple scene and attach it to the virtual universe - BranchGroup scene = createSceneGraph(); - u = new SimpleUniverse(c); - - // - // Use the inputdevice - // - InputDevice device = createInputDevice(); - - // Register the VirtualInputDevice with Java 3D - u.getViewer().getPhysicalEnvironment().addInputDevice( device ); - -// TransformGroup viewTrans = u.getViewingPlatform().getViewPlatformTransform(); - - // Put the behavoir to teh object - SensorBehavior s = new SensorBehavior( objTrans, device.getSensor(0) ); - s.setSchedulingBounds( new BoundingSphere( new Point3d(0.0,0.0,0.0), Float.MAX_VALUE ) ); - objTrans.addChild( s ); - - u.getViewingPlatform().setNominalViewingTransform(); - u.addBranchGraph(scene); - } - - public void destroy() - { - u.removeAllLocales(); - } - - - /** - * Setup an input device. - */ - private InputDevice createInputDevice() - { - IsActiveCondition button1down = new IsActiveOnButtonCondition(JXInputManager.getJXInputDevice( 0 ).getButton( 0 ), true ); - IsActiveCondition button1up = new IsActiveOnButtonCondition(JXInputManager.getJXInputDevice( 0 ).getButton( 0 ), false ); - - Axis xaxis = JXInputManager.getJXInputDevice( 0 ).getAxis( Axis.ID_X ); - Axis yaxis = JXInputManager.getJXInputDevice( 0 ).getAxis( Axis.ID_Y ); - - DeviceConfiguration cnf = new DeviceConfiguration(); - - // - // Setup the configuration to use joysticks x/y for rotation is not button is pressed - // and for translation if button1 is pressed. - // - cnf.setRotational( - DeviceConfiguration.AXIS_Y, - xaxis, - button1up, - IsActiveCondition.NEVER, - 0.0, Math.PI - ); - - cnf.setRotational( - DeviceConfiguration.AXIS_X, - yaxis, - button1up, - IsActiveCondition.NEVER, - 0.0, Math.PI - ); - - cnf.setTranslational( - DeviceConfiguration.AXIS_Z, - yaxis, - button1down, - IsActiveCondition.NEVER, - -5.0, 4.0 - ); - cnf.setTranslational( - DeviceConfiguration.AXIS_X, - xaxis, - button1down, - IsActiveCondition.NEVER, - 0.0, 4.0 - ); - - // We have the config, create the device... - J3DInputDevice d = new J3DInputDevice( cnf ); - - // The InputDevice must be initialized before registering it - // with the PhysicalEnvironment object. - d.initialize(); - - return d; - } - - - public static void main(String[] args) - { - new MainFrame(new HelloUniverse(), 350, 350); - } -} diff --git a/java/src/de/hardcode/jxinput/j3d/test/SensorBehavior.java b/java/src/de/hardcode/jxinput/j3d/test/SensorBehavior.java deleted file mode 100644 index 258ee9d..0000000 --- a/java/src/de/hardcode/jxinput/j3d/test/SensorBehavior.java +++ /dev/null @@ -1,70 +0,0 @@ -package de.hardcode.jxinput.j3d.test; - -/* - * @(#)SensorBehavior.java 1.8 02/02/07 14:48:34 - * - * Copyright (c) 1996-2002 Sun Microsystems, Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistribution 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. - * - * Neither the name of Sun Microsystems, Inc. or the names of - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * This software is provided "AS IS," without a warranty of any - * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND - * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY - * EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES - * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR - * DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN - * OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR - * FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR - * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF - * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, - * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You acknowledge that Software is not designed,licensed or intended - * for use in the design, construction, operation or maintenance of - * any nuclear facility. - */ - -import javax.media.j3d.*; -import java.util.*; - -public class SensorBehavior extends Behavior -{ - private WakeupOnElapsedFrames conditions = new WakeupOnElapsedFrames(0); - private TransformGroup transformGroup; - private Sensor sensor; - private Transform3D transform = new Transform3D(); - - public SensorBehavior( TransformGroup tg, Sensor sensor ) - { - transformGroup = tg; - this.sensor = sensor; - } - - public void initialize() - { - wakeupOn( conditions ); - } - - public void processStimulus( Enumeration criteria ) - { - sensor.getRead( transform ); - transformGroup.setTransform( transform ); - wakeupOn( conditions ); - } - -} diff --git a/java/src/de/hardcode/jxinput/keyboard/InvalidKeyCodeException.java b/java/src/de/hardcode/jxinput/keyboard/InvalidKeyCodeException.java deleted file mode 100644 index f44ee6b..0000000 --- a/java/src/de/hardcode/jxinput/keyboard/InvalidKeyCodeException.java +++ /dev/null @@ -1,35 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 16. April 2002, 23:31 -//********************************************************************************************** -package de.hardcode.jxinput.keyboard; - -/** - * Exeception to be thrown if keycode is not in then range [0,255]. - * - * @author Herkules - */ -public class InvalidKeyCodeException - extends IllegalArgumentException -{ - - /** - * Creates a new instance of InvalidKeyCodeException. - */ - public InvalidKeyCodeException() - { - } - - - /** - * Creates a new instance of InvalidKeyCodeException. - */ - public InvalidKeyCodeException( String s ) - { - super( s ); - } -} diff --git a/java/src/de/hardcode/jxinput/keyboard/JXKeyboardInputDevice.java b/java/src/de/hardcode/jxinput/keyboard/JXKeyboardInputDevice.java deleted file mode 100644 index 858bdb7..0000000 --- a/java/src/de/hardcode/jxinput/keyboard/JXKeyboardInputDevice.java +++ /dev/null @@ -1,175 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 9. April 2002, 22:40 -//********************************************************************************************** -package de.hardcode.jxinput.keyboard; - - -import de.hardcode.jxinput.*; -import java.awt.Component; - - -/** - * Virtual input device treating a AWT keyboard as a source for Buttons. - * - * @author Herkules - */ -public class JXKeyboardInputDevice - implements JXInputDevice -{ - private static final String DEVICENAME = "Swing Keyboard"; - - /** The driver doing all the real work. */ - private final KeyboardDriver mDriver = new KeyboardDriver(); - - /** The Component I am listening to. */ - private Component mComponent = null; - - /** Hold the biggest keycode for which a button has been created. */ - private int mMaxIdxCreated = 0; - - - /** - * Creates a new instance of JXKeyboardInputDevice. - */ - public JXKeyboardInputDevice() - { - } - - - /** - * Creates a new instance of JXKeyboardInputDevice - * immediately listening to a JComponent. - */ - public JXKeyboardInputDevice( Component comp ) - { - listenTo( comp ); - } - - /** - * Makes this device listen to a certain JComponent. - */ - public final void listenTo( Component comp ) - { - shutdown(); - mComponent = comp; - mComponent.addKeyListener( mDriver ); - } - - /** - * Shut down. No longer listen to my JComponent. - */ - public final void shutdown() - { - if ( null != mComponent ) - mComponent.removeKeyListener( mDriver ); - } - - - /** - * Create a button object for a certain keycode. - */ - public Button createButton( int keycode ) - { - if ( 0 > keycode || 0x100 < keycode ) - throw new InvalidKeyCodeException(); - - KeyButton b; - if ( null == (b = mDriver.getButton( keycode ) ) ) - { - b = new KeyButton( keycode ); - mDriver.registerKeyButton( b ); - if ( keycode > mMaxIdxCreated ) - mMaxIdxCreated = keycode; - } - return b; - } - - - public void removeButton( Button b ) - { - mDriver.unregisterKeyButton( (KeyButton) b ); - } - - - - //********************************************************************************************* - // - // Implement JXInputDevice - // - //********************************************************************************************* - - public Axis getAxis(int idx) - { - // No axes on keyboard. - return null; - } - - - public Button getButton(int idx) - { - // idx is interpreted as the keycode - return mDriver.getButton( idx ); - } - - public Directional getDirectional(int idx) - { - // No directionals on keyboard. - return null; - } - - /** Maximum number of axes as an upper bound for index values. */ - public int getMaxNumberOfAxes() - { - // No axes on keyboard. - return 0; - } - - /** Maximum number of buttons as an upper bound for index values. */ - public int getMaxNumberOfButtons() - { - // Return biggest keycode (inclusive). - return mMaxIdxCreated + 1; - } - - /** Maximum number of directional features as an upper bound for index values. */ - public int getMaxNumberOfDirectionals() - { - // No directionals on keyboard. - return 0; - } - - /** - * Devices may have a name. - * This name might be provided by a system dependant driver. - */ - public String getName() - { - return DEVICENAME; - } - - /** Actual number of available axes. */ - public int getNumberOfAxes() - { - // No axes on keyboard. - return 0; - } - - /** Actual number of available buttons. */ - public int getNumberOfButtons() - { - return mDriver.getNumberOfButtons(); - } - - /** Actual number of available directional features. */ - public int getNumberOfDirectionals() - { - // No directionals on keyboard. - return 0; - } - -} diff --git a/java/src/de/hardcode/jxinput/keyboard/KeyButton.java b/java/src/de/hardcode/jxinput/keyboard/KeyButton.java deleted file mode 100644 index 56a8e0c..0000000 --- a/java/src/de/hardcode/jxinput/keyboard/KeyButton.java +++ /dev/null @@ -1,94 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 9. April 2002, 22:51 -//********************************************************************************************** -package de.hardcode.jxinput.keyboard; - -import de.hardcode.jxinput.Button; -import java.awt.event.KeyEvent; - - -/** - * Associates a keycode with a SelectButton and handles the current state of that button. - * - * @author Herkules - */ -class KeyButton - implements Button -{ - private final int mKeyCode; - private boolean mIsPressed; - private boolean mHasChanged; - - /** - * Creates a new instance of KeyButton. - */ - public KeyButton( int keycode ) - { - mKeyCode = keycode; - } - - - /** - * Return the keycode assigned with this button. - */ - public final int getKeyCode() - { - return mKeyCode; - } - - final void setIsPressed( boolean flag ) - { - mIsPressed = flag; - } - - //********************************************************************************************* - // - // Implement SelectButton - // - //********************************************************************************************* - - - /** - * Features may have a name provided e.g. by the driver. - */ - public String getName() - { - return KeyEvent.getKeyText( mKeyCode ); - } - - /** - * Tells the state of the button at last update. - */ - public boolean getState() - { - return mIsPressed; - } - - /** - * Retrieve the type of the button. - * Pushbutton will deliver true==getState() as long as they are pressed down. - * Togglebuttons will change their state once they are pressed and keep that state - * until they are pressed again. - * @return [ PUSHBUTTON | TOGGLEBUTTON ] - */ - public int getType() - { - return Button.PUSHBUTTON; - } - - - /** - * Denote wether this feature has changed beyond it's resolution since it got last - * updated. - */ - public boolean hasChanged() - { - return true; - } - -} diff --git a/java/src/de/hardcode/jxinput/keyboard/KeyboardDriver.java b/java/src/de/hardcode/jxinput/keyboard/KeyboardDriver.java deleted file mode 100644 index 7eb6232..0000000 --- a/java/src/de/hardcode/jxinput/keyboard/KeyboardDriver.java +++ /dev/null @@ -1,141 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 9. April 2002, 22:43 -//********************************************************************************************** -package de.hardcode.jxinput.keyboard; - -import java.awt.event.KeyListener; -import java.awt.event.KeyEvent; -import java.util.HashMap; -import java.security.InvalidParameterException; - - - -/** - * Listen to a JComponent handle handle all associated button objects. - * This is the main worker class for JXKeyboardInputDevice. - * - * @author Herkules - */ -class KeyboardDriver implements KeyListener -{ -// HashMap mKeysToObserveMap = new HashMap(); - - int mNumberOfKeysObserved = 0; - KeyButton [] mKeysObserved = new KeyButton [ 0x100 ]; - - - /** - * Creates a new instance of KeyboardDriver. - */ - public KeyboardDriver() - { - } - - - /** - * How many buttons are registered? - */ - final int getNumberOfButtons() - { - return mNumberOfKeysObserved; -// return mKeysToObserveMap.size(); - } - - - /** - * Place a new button under my observation. - */ - final boolean registerKeyButton( KeyButton b ) - { - final int keycode = b.getKeyCode(); - - if ( 0 > keycode || 0x100 < keycode ) - throw new InvalidKeyCodeException(); - - if ( null == mKeysObserved[ keycode ] ) - { - mKeysObserved[ keycode ] = b; - mNumberOfKeysObserved++; - return true; - } - else - { - return false; - } - -// Integer code = new Integer( b.getKeyCode() ); -// if ( ! mKeysToObserveMap.containsKey( code ) ) -// { -// mKeysToObserveMap.put( code, b ); -// return true; -// } -// else -// { -// return false; -// } - } - - final void unregisterKeyButton( KeyButton b ) - { - final int keycode = b.getKeyCode(); - - if ( 0 > keycode || 0x100 < keycode ) - throw new InvalidKeyCodeException(); - - if ( null != mKeysObserved[ b.getKeyCode() ] ) - { - mKeysObserved[ keycode ] = null; - mNumberOfKeysObserved--; - } - -// Integer code = new Integer( b.getKeyCode() ); -// mKeysToObserveMap.remove( code ); - } - - - /** - * Retrieve the button from its keycode. - */ - final KeyButton getButton( int keycode ) - { - if ( 0 > keycode || 0x100 < keycode ) - throw new InvalidKeyCodeException(); - - return mKeysObserved[ keycode ]; - -// Integer code = new Integer( keycode ); -// return (KeyButton)mKeysToObserveMap.get( code ); - } - - - //********************************************************************************************* - // - // Implement KeyListener - // - //********************************************************************************************* - - public void keyPressed( KeyEvent keyEvent ) - { - KeyButton b = getButton( keyEvent.getKeyCode() ); - if ( null != b ) - b.setIsPressed( true ); - } - - public void keyReleased( KeyEvent keyEvent ) - { - KeyButton b = getButton( keyEvent.getKeyCode() ); - if ( null != b ) - b.setIsPressed( false ); - } - - public void keyTyped( KeyEvent keyEvent ) - { - // Intentionally empty. - } - -} diff --git a/java/src/de/hardcode/jxinput/keyboard/package.html b/java/src/de/hardcode/jxinput/keyboard/package.html deleted file mode 100644 index e1021d1..0000000 --- a/java/src/de/hardcode/jxinput/keyboard/package.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - de.hardcode.jxinput.keyboard - - -Connects Swing keyboard handling to the JXInput infrastructure. - - diff --git a/java/src/de/hardcode/jxinput/test/AxisListener.java b/java/src/de/hardcode/jxinput/test/AxisListener.java deleted file mode 100644 index 7d2b138..0000000 --- a/java/src/de/hardcode/jxinput/test/AxisListener.java +++ /dev/null @@ -1,39 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 20. Februar 2002, 22:19 -//********************************************************************************************** -package de.hardcode.jxinput.test; - -import de.hardcode.jxinput.event.JXInputEventManager; -import de.hardcode.jxinput.event.JXInputAxisEventListener; -import de.hardcode.jxinput.event.JXInputAxisEvent; -import de.hardcode.jxinput.Axis; - -/** - * Example listener to an axis. - * - * @author Herkules - */ -public class AxisListener - implements JXInputAxisEventListener -{ - - /** - * Creates a new instance of AxisListener. - */ - public AxisListener( Axis axis ) - { - JXInputEventManager.addListener( this, axis, 0.1 ); - } - - - public void changed( JXInputAxisEvent ev ) - { - System.out.println( "Axis " + ev.getAxis().getName() + " changed : value=" + ev.getAxis().getValue() + ", event causing delta=" + ev.getDelta() ); - } - -} diff --git a/java/src/de/hardcode/jxinput/test/ButtonListener.java b/java/src/de/hardcode/jxinput/test/ButtonListener.java deleted file mode 100644 index 7e4c92e..0000000 --- a/java/src/de/hardcode/jxinput/test/ButtonListener.java +++ /dev/null @@ -1,38 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 20. Februar 2002, 22:19 -//********************************************************************************************** -package de.hardcode.jxinput.test; - -import de.hardcode.jxinput.event.JXInputEventManager; -import de.hardcode.jxinput.event.JXInputButtonEventListener; -import de.hardcode.jxinput.event.JXInputButtonEvent; -import de.hardcode.jxinput.Button; - -/** - * Sample button listener. - * - * @author Herkules - */ -public class ButtonListener implements JXInputButtonEventListener -{ - - /** - * Creates a new instance of AxisListener. - */ - public ButtonListener( Button button ) - { - JXInputEventManager.addListener( this, button ); - } - - - public void changed( JXInputButtonEvent ev ) - { - System.out.println( "SelectButton " + ev.getButton().getName() + " changed : state=" + ev.getButton().getState() ); - } - -} diff --git a/java/src/de/hardcode/jxinput/test/DirectionalListener.java b/java/src/de/hardcode/jxinput/test/DirectionalListener.java deleted file mode 100644 index 9f79796..0000000 --- a/java/src/de/hardcode/jxinput/test/DirectionalListener.java +++ /dev/null @@ -1,37 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 20. Februar 2002, 22:19 -//********************************************************************************************** -package de.hardcode.jxinput.test; - -import de.hardcode.jxinput.event.JXInputEventManager; -import de.hardcode.jxinput.event.JXInputDirectionalEventListener; -import de.hardcode.jxinput.event.JXInputDirectionalEvent; -import de.hardcode.jxinput.Directional; - -/** - * Sample directional listener. - * - * @author Herkules - */ -public class DirectionalListener implements JXInputDirectionalEventListener -{ - /** - * Creates a new instance of AxisListener. - */ - public DirectionalListener( Directional directional ) - { - JXInputEventManager.addListener( this, directional, 1.0 ); - } - - - public void changed( JXInputDirectionalEvent ev ) - { - System.out.println( "Directional " + ev.getDirectional().getName() + " changed : direction=" + ev.getDirectional().getDirection() + ", value=" + ev.getDirectional().getValue() + ", event causing delta=" + ev.getDirectionDelta() ); - } - -} diff --git a/java/src/de/hardcode/jxinput/test/JXInputDevicePanel.form b/java/src/de/hardcode/jxinput/test/JXInputDevicePanel.form deleted file mode 100644 index fe9f69e..0000000 --- a/java/src/de/hardcode/jxinput/test/JXInputDevicePanel.form +++ /dev/null @@ -1,97 +0,0 @@ - - -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/java/src/de/hardcode/jxinput/test/JXInputDevicePanel.java b/java/src/de/hardcode/jxinput/test/JXInputDevicePanel.java deleted file mode 100644 index 81fbef3..0000000 --- a/java/src/de/hardcode/jxinput/test/JXInputDevicePanel.java +++ /dev/null @@ -1,296 +0,0 @@ -/* - * JXInputDevicePanel.java - * - * Created on 23. Januar 2002, 22:19 - */ -package de.hardcode.jxinput.test; - -import de.hardcode.jxinput.JXInputManager; -import de.hardcode.jxinput.JXInputDevice; -import de.hardcode.jxinput.Axis; -import de.hardcode.jxinput.Directional; -import de.hardcode.jxinput.Button; - -import javax.swing.*; -import java.awt.GridLayout; -import java.util.ArrayList; -import java.util.Iterator; -import java.awt.BorderLayout; -import java.awt.Font; -import java.util.Dictionary; -import java.util.Enumeration; - -/** - * - * @author Herkules - */ -public class JXInputDevicePanel extends javax.swing.JPanel -{ - private static final Font AXIS_SLIDER_FONT = new Font( "Verdana", Font.PLAIN, 9 ); - - private final JXInputDevice mDev; - private final ArrayList mAxisSliders = new ArrayList(); - private final ArrayList mButtonCheckboxes = new ArrayList(); - private final ArrayList mDirectionalLabels = new ArrayList(); - - - /** Creates new form JXInputDevicePanel */ - public JXInputDevicePanel( JXInputDevice dev ) - { - mDev = dev; - initComponents(); - initFromDevice(); - } - - /** - * Helper class connecting a JSlider with an Axis. - */ - private class AxisSlider extends JSlider - { - Axis mAxis; - AxisSlider( Axis axis ) - { - super( ( Axis.SLIDER == axis.getType() ? 0 : -100 ), 100 ); - this.setMajorTickSpacing( Axis.SLIDER == axis.getType() ? 25 : 50 ); - this.setMinorTickSpacing( 5 ); - this.setPaintTicks( true ); - this.setPaintLabels( true ); - this.setEnabled( false ); - - Dictionary labeldict = this.getLabelTable(); - Enumeration labels = labeldict.elements(); - while ( labels.hasMoreElements() ) - { - JLabel label = (JLabel)labels.nextElement(); - label.setFont( AXIS_SLIDER_FONT ); - label.setSize( 32, 12 ); - label.setHorizontalAlignment( SwingConstants.LEFT ); - } - - mAxis = axis; - } - - void update() - { - int ax = (int)(mAxis.getValue() * 100.0); - - // - // Only if value really changes - // - if ( ax != this.getValue() ) - { - this.setValue( ax ); - this.setToolTipText( mAxis.getName() + ": " + Double.toString( mAxis.getValue() ) ); - } - } - - } - - - private class ButtonCheckbox extends JCheckBox - { - Button mButton; - ButtonCheckbox( Button button ) - { - super( button.getName() ); - this.setEnabled( false ); - mButton = button; - } - - void update() - { - boolean state = mButton.getState(); - - // - // Only if value really changes - // - if ( state != this.isSelected() ) - { - this.setSelected( state ); - } - } - } - - - private class DirectionalLabel extends JLabel - { - Directional mDirectional; - int mCurrent = 0; - - DirectionalLabel( Directional directional ) - { - super( directional.getName() ); - mDirectional = directional; - } - - void update() - { - int dir = mDirectional.getDirection(); - - // - // Only if value really changes - // - if ( dir != mCurrent ) - { - this.setText( mDirectional.getName() + ": " + ( mDirectional.isCentered() ? "-" : Integer.toString( dir ) ) ); - mCurrent = dir; - } - } - } - - - /** - * Setup the dialogs content from the JXInputDevice. - */ - void initFromDevice() - { - if ( null != mDev ) - { - ((GridLayout)mAxesPanel.getLayout()).setRows( mDev.getNumberOfAxes() ); - - for ( int i = 0; i < mDev.getMaxNumberOfAxes(); ++i ) - { - if ( null != mDev.getAxis( i ) ) - { - AxisSlider slider = new AxisSlider( mDev.getAxis( i ) ); - - JLabel name = new JLabel( mDev.getAxis( i ).getName() ); - name.setVerticalAlignment( SwingConstants.TOP ); - name.setHorizontalAlignment( SwingConstants.CENTER ); - name.setPreferredSize( new java.awt.Dimension( 90, 0 ) ); - - JPanel p = new JPanel(); - p.setLayout( new BorderLayout() ); - - p.add( name, BorderLayout.WEST ); - p.add( slider, BorderLayout.CENTER ); - - mAxesPanel.add( p ); - - // Add to list of all AxisSlider controls - mAxisSliders.add( slider ); - - // Add an event listener: - new AxisListener( mDev.getAxis( i ) ); - } - } - - - ((GridLayout)mButtonsPanel.getLayout()).setRows( mDev.getNumberOfButtons() ); - for ( int i = 0; i < mDev.getMaxNumberOfButtons(); ++i ) - { - if ( null != mDev.getButton( i ) ) - { - ButtonCheckbox chk = new ButtonCheckbox( mDev.getButton( i ) ); - mButtonCheckboxes.add( chk ); - mButtonsPanel.add( chk ); - - // Add an event listener: - new ButtonListener( mDev.getButton( i ) ); - } - } - - ((GridLayout)mDirectionalPanel.getLayout()).setRows( mDev.getNumberOfDirectionals() / 2 ); - for ( int i = 0; i < mDev.getMaxNumberOfDirectionals(); ++i ) - { - if ( null != mDev.getDirectional( i ) ) - { - DirectionalLabel lbl = new DirectionalLabel( mDev.getDirectional( i ) ); - mDirectionalLabels.add( lbl ); - mDirectionalPanel.add( lbl ); - - // Add an event listener: - new DirectionalListener( mDev.getDirectional( i ) ); - } - } - } - } - - - public void update() - { - Iterator it = mAxisSliders.iterator(); - while ( it.hasNext() ) - { - ((AxisSlider)it.next()).update(); - } - - it = mButtonCheckboxes.iterator(); - while ( it.hasNext() ) - { - ((ButtonCheckbox)it.next()).update(); - } - - it = mDirectionalLabels.iterator(); - while ( it.hasNext() ) - { - ((DirectionalLabel)it.next()).update(); - } - } - - - /** This method is called from within the constructor to - * initialize the form. - * WARNING: Do NOT modify this code. The content of this method is - * always regenerated by the Form Editor. - */ - // //GEN-BEGIN:initComponents - private void initComponents() - { - mAxesPanelContainer = new javax.swing.JPanel(); - mAxesPanel = new javax.swing.JPanel(); - mDirectionalPanel = new javax.swing.JPanel(); - mButtonScrollPane = new javax.swing.JScrollPane(); - mButtonsPanel = new javax.swing.JPanel(); - - setLayout(new java.awt.BorderLayout(2, 2)); - - addComponentListener(new java.awt.event.ComponentAdapter() - { - public void componentShown(java.awt.event.ComponentEvent evt) - { - OnShow(evt); - } - }); - - mAxesPanelContainer.setLayout(new java.awt.BorderLayout()); - - mAxesPanelContainer.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED)); - mAxesPanel.setLayout(new java.awt.GridLayout(1, 1, 0, 20)); - - mAxesPanelContainer.add(mAxesPanel, java.awt.BorderLayout.NORTH); - - add(mAxesPanelContainer, java.awt.BorderLayout.CENTER); - - mDirectionalPanel.setLayout(new java.awt.GridLayout(1, 1)); - - mDirectionalPanel.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED)); - add(mDirectionalPanel, java.awt.BorderLayout.SOUTH); - - mButtonsPanel.setLayout(new java.awt.GridLayout(1, 1)); - - mButtonsPanel.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED)); - mButtonScrollPane.setViewportView(mButtonsPanel); - - add(mButtonScrollPane, java.awt.BorderLayout.EAST); - - }// //GEN-END:initComponents - - private void OnShow(java.awt.event.ComponentEvent evt)//GEN-FIRST:event_OnShow - {//GEN-HEADEREND:event_OnShow - // Commented: the focus is held by a parent component -// System.out.println("OnShow"); -// this.requestFocus(); - }//GEN-LAST:event_OnShow - - - - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JPanel mAxesPanel; - private javax.swing.JPanel mAxesPanelContainer; - private javax.swing.JScrollPane mButtonScrollPane; - private javax.swing.JPanel mButtonsPanel; - private javax.swing.JPanel mDirectionalPanel; - // End of variables declaration//GEN-END:variables - -} diff --git a/java/src/de/hardcode/jxinput/test/JXInputTestDialog.form b/java/src/de/hardcode/jxinput/test/JXInputTestDialog.form deleted file mode 100644 index 1abc589..0000000 --- a/java/src/de/hardcode/jxinput/test/JXInputTestDialog.form +++ /dev/null @@ -1,79 +0,0 @@ - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/src/de/hardcode/jxinput/test/JXInputTestDialog.java b/java/src/de/hardcode/jxinput/test/JXInputTestDialog.java deleted file mode 100644 index cf1354f..0000000 --- a/java/src/de/hardcode/jxinput/test/JXInputTestDialog.java +++ /dev/null @@ -1,286 +0,0 @@ -//********************************************************************************************** -// Dipl. Phys. Joerg Plewe, HARDCODE Development -// Created on 27. Dezember 2001, 01:15 -//********************************************************************************************** - -package de.hardcode.jxinput.test; - -import de.hardcode.jxinput.*; -import de.hardcode.jxinput.event.*; -import de.hardcode.jxinput.keyboard.JXKeyboardInputDevice; -import de.hardcode.jxinput.virtual.JXVirtualInputDevice; -import de.hardcode.jxinput.virtual.VirtualAxis; - -import javax.swing.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyEvent; - - -/** - * Test dialog showing some features of JXInput. - * @author Herkules - */ -public class JXInputTestDialog extends javax.swing.JDialog - implements ActionListener -{ - - private JXKeyboardInputDevice mKeyboardDevice = null; - private JXVirtualInputDevice mVirtualDevice = null; - - Button mButtonUp; - Button mButtonDown; - Button mButtonLeft; - Button mButtonRight; - Button mButtonFire; - Button mButtonSpace; - - /** Creates new form JXInputTestDialog */ - public JXInputTestDialog(java.awt.Frame parent, boolean modal) - { - super(parent, modal); - initComponents(); - configureKeyboardInputDevice(); - configureVirtualInputDevice(); - initDevicePanels(); - pack(); - - // Request the focus so that the keyboarddevice can work - mMainPanel.requestFocus(); - - new Timer( 50, this ).start(); - - // Uncomment this line as an alternative to the Timer above. - // Don't use both!! - //JXInputEventManager.setTriggerIntervall( 50 ); - } - - - /** - * Implement ActionListener#actionPerformed(). - * This is called by the Timer. - */ - public void actionPerformed( ActionEvent e ) - { - JXInputManager.updateFeatures(); - SwingUtilities.invokeLater( - new Runnable() - { - public void run() - { - for ( int i = 0; i < mDevicesTabbedPane.getComponentCount(); ++i ) - { - ((JXInputDevicePanel)mDevicesTabbedPane.getComponent( i )).update(); - } - } - } - ); - } - - - /** - * Configure a test JXKeyboardInputdevice. - */ - void configureKeyboardInputDevice() - { - mKeyboardDevice = JXInputManager.createKeyboardDevice(); - - mKeyboardDevice.createButton( KeyEvent.VK_ESCAPE ); - - mKeyboardDevice.createButton( KeyEvent.VK_F1 ); - mKeyboardDevice.createButton( KeyEvent.VK_F2 ); - mKeyboardDevice.createButton( KeyEvent.VK_F3 ); - mKeyboardDevice.createButton( KeyEvent.VK_F4 ); - - mKeyboardDevice.createButton( KeyEvent.VK_LEFT ); - mKeyboardDevice.createButton( KeyEvent.VK_RIGHT ); - mKeyboardDevice.createButton( KeyEvent.VK_UP ); - mKeyboardDevice.createButton( KeyEvent.VK_DOWN ); - - mKeyboardDevice.createButton( KeyEvent.VK_PAGE_UP ); - mKeyboardDevice.createButton( KeyEvent.VK_PAGE_DOWN ); - - mButtonSpace = mKeyboardDevice.createButton( KeyEvent.VK_SPACE ); - mButtonLeft = mKeyboardDevice.createButton( KeyEvent.VK_A ); - mButtonRight = mKeyboardDevice.createButton( KeyEvent.VK_D ); - mButtonDown = mKeyboardDevice.createButton( KeyEvent.VK_S ); - mButtonUp = mKeyboardDevice.createButton( KeyEvent.VK_W ); - - // Configure it to make it listen to the main panel. - // I try to keep the kbd focus on it. - mKeyboardDevice.listenTo( mMainPanel ); - } - - - /** - * Configure a test JXVirtualInputdevice. - */ - void configureVirtualInputDevice() - { - mVirtualDevice = JXInputManager.createVirtualDevice(); - - Button firebutton; - // - // Remember 'fire' button of first device for use - // in the virtual device. - // For we ran configureKeyboardInputDevice() before, - // getJXInputDevice( 0 ) should not return null - // - firebutton = JXInputManager.getJXInputDevice( 0 ).getButton( 0 ); - - VirtualAxis x = mVirtualDevice.createAxis( Axis.ID_X ); - x.setButtons( mButtonRight, mButtonLeft ); - x.setName( "x: A-D" ); - - VirtualAxis y = mVirtualDevice.createAxis( Axis.ID_Y ); - y.setButtons( mButtonUp, mButtonDown ); - y.setSpringSpeed( 0.0 ); - y.setName( "y: S|W" ); - - VirtualAxis slider = mVirtualDevice.createAxis( Axis.ID_SLIDER0 ); - slider.setIncreaseButton( mButtonSpace ); - slider.setTimeFor0To1( 2000 ); - slider.setName( "" ); - slider.setType( Axis.SLIDER ); - - if ( null != firebutton ) - { - slider = mVirtualDevice.createAxis( Axis.ID_SLIDER1 ); - slider.setIncreaseButton( firebutton ); - slider.setTimeFor0To1( 2000 ); - slider.setName( "JoyButton 0" ); - } - - - } - - - /** - * Initialize one panel for each device available. - */ - void initDevicePanels() - { - int cnt = JXInputManager.getNumberOfDevices(); - - mLabelNoDevice.setVisible( cnt == 0 ); - mDevicesTabbedPane.setVisible( cnt != 0 ); - - for ( int i = 0; i < cnt; ++i ) - { - JXInputDevice dev = JXInputManager.getJXInputDevice( i ); - if ( null != dev ) - { - // - // Setup an own panel for each device. - // - JPanel panel = new JXInputDevicePanel( dev ); - mDevicesTabbedPane.addTab( dev.getName(), panel ); - } - } - } - - - - /** This method is called from within the constructor to - * initialize the form. - * WARNING: Do NOT modify this code. The content of this method is - * always regenerated by the Form Editor. - */ - // //GEN-BEGIN:initComponents - private void initComponents() - { - mMainPanel = new javax.swing.JPanel(); - mLabelNoDevice = new javax.swing.JLabel(); - mDevicesTabbedPane = new javax.swing.JTabbedPane(); - mButtonReset = new javax.swing.JButton(); - - setTitle("JXInput (C) 2001-2006 HARDCODE Dev."); - addWindowListener(new java.awt.event.WindowAdapter() - { - public void windowClosing(java.awt.event.WindowEvent evt) - { - closeDialog(evt); - } - }); - - mMainPanel.setLayout(new java.awt.BorderLayout(10, 0)); - - mLabelNoDevice.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); - mLabelNoDevice.setText("No JXInputDevice available!"); - mLabelNoDevice.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED)); - mMainPanel.add(mLabelNoDevice, java.awt.BorderLayout.NORTH); - - mDevicesTabbedPane.addFocusListener(new java.awt.event.FocusAdapter() - { - public void focusGained(java.awt.event.FocusEvent evt) - { - mDevicesTabbedPaneFocusGained(evt); - } - }); - - mMainPanel.add(mDevicesTabbedPane, java.awt.BorderLayout.CENTER); - - mButtonReset.setText("Reset "); - mButtonReset.addActionListener(new java.awt.event.ActionListener() - { - public void actionPerformed(java.awt.event.ActionEvent evt) - { - mButtonResetActionPerformed(evt); - } - }); - - mMainPanel.add(mButtonReset, java.awt.BorderLayout.SOUTH); - - getContentPane().add(mMainPanel, java.awt.BorderLayout.CENTER); - - pack(); - }// //GEN-END:initComponents - - private void mButtonResetActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_mButtonResetActionPerformed - {//GEN-HEADEREND:event_mButtonResetActionPerformed - - while ( this.mDevicesTabbedPane.getTabCount() > 0 ) - this.mDevicesTabbedPane.removeTabAt( 0 ); - - JXInputManager.reset(); - configureKeyboardInputDevice(); - configureVirtualInputDevice(); - initDevicePanels(); - pack(); - - // Request the focus so that the keyboarddevice can work - mMainPanel.requestFocus(); - - }//GEN-LAST:event_mButtonResetActionPerformed - - private void mDevicesTabbedPaneFocusGained(java.awt.event.FocusEvent evt)//GEN-FIRST:event_mDevicesTabbedPaneFocusGained - {//GEN-HEADEREND:event_mDevicesTabbedPaneFocusGained - // Switch focus back to main panel! - this.mMainPanel.requestFocus(); - }//GEN-LAST:event_mDevicesTabbedPaneFocusGained - - /** Closes the dialog */ - private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog - setVisible(false); - dispose(); - System.exit( 0 ); - }//GEN-LAST:event_closeDialog - - /** - * Allow the dialog to running standalone. - * @param args the command line arguments - */ - public static void main(String args[]) - { - new JXInputTestDialog(new javax.swing.JFrame(), true).setVisible(true); - } - - - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JButton mButtonReset; - private javax.swing.JTabbedPane mDevicesTabbedPane; - private javax.swing.JLabel mLabelNoDevice; - private javax.swing.JPanel mMainPanel; - // End of variables declaration//GEN-END:variables - -} diff --git a/java/src/de/hardcode/jxinput/util/LatestChangedValueAxis.java b/java/src/de/hardcode/jxinput/util/LatestChangedValueAxis.java deleted file mode 100644 index f4f2c35..0000000 --- a/java/src/de/hardcode/jxinput/util/LatestChangedValueAxis.java +++ /dev/null @@ -1,98 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 17. April 2002, 23:24 -//********************************************************************************************** -package de.hardcode.jxinput.util; - -import de.hardcode.jxinput.Axis; - -/** - * - * @author Herkules - */ -public class LatestChangedValueAxis implements Axis -{ - private final Axis mAxis1; - private final Axis mAxis2; - private Axis mAxisInUse; - - private double mSaved1; - private double mSaved2; - - /** - * Creates a new instance of MeanValueAxis. - */ - public LatestChangedValueAxis(Axis a1, Axis a2) - { - mAxis1 = a1; - mAxis2 = a2; - mAxisInUse = a1; - - mSaved1 = a1.getValue(); - mSaved2 = a2.getValue(); - } - - /** - * Features may have a name provided e.g. by the driver. - */ - public String getName() - { - return mAxis1.getName(); - } - - /** Inform about the resolution of the axis. - * - * @return resolution, e.g. 2^-16 - */ - public double getResolution() - { - return mAxis1.getResolution(); - } - - /** - * Retrieve the type of the axis. - * - * @return [ TRANSLATION | ROTATION | SLIDER ] - */ - public int getType() - { - return mAxis1.getType(); - } - - /** Returns the current value of the axis. - * The range of the result depends on the axis type. - *s - * @return value [-1.0,1.0] or [0.0,1.0] - */ - public double getValue() - { - double v1 = mAxis1.getValue(); - double v2 = mAxis2.getValue(); - - if ( Math.abs( v2 - mSaved2 ) > 0.2 ) - { - mAxisInUse = mAxis2; - mSaved2 = v2; - } - if ( Math.abs( v1 - mSaved1 ) > 0.2 ) - { - mAxisInUse = mAxis1; - mSaved1 = v1; - } - - return mAxisInUse.getValue(); - } - - /** Denote wether this feature has changed beyond it's resolution since it got last - * updated. - */ - public boolean hasChanged() - { - return true; - } - -} diff --git a/java/src/de/hardcode/jxinput/util/OrButton.java b/java/src/de/hardcode/jxinput/util/OrButton.java deleted file mode 100644 index 338538c..0000000 --- a/java/src/de/hardcode/jxinput/util/OrButton.java +++ /dev/null @@ -1,52 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 23. Dezember 2002, 19:21 -//********************************************************************************************** -package de.hardcode.jxinput.util; - -import de.hardcode.jxinput.Button; - -/** - * - * @author Herkules - */ -public class OrButton implements Button -{ - private final Button mButton1; - private final Button mButton2; - - - /** - * Creates a new instance of OrButton. - */ - public OrButton( Button b1, Button b2 ) - { - mButton1 = b1; - mButton2 = b2; - } - - public String getName() - { - return mButton1.getName(); - } - - public boolean getState() - { - return mButton1.getState() || mButton2.getState(); - } - - public int getType() - { - return mButton1.getType(); - } - - public boolean hasChanged() - { - return mButton1.hasChanged() || mButton2.hasChanged(); - } - -} diff --git a/java/src/de/hardcode/jxinput/virtual/JXVirtualInputDevice.java b/java/src/de/hardcode/jxinput/virtual/JXVirtualInputDevice.java deleted file mode 100644 index aa125af..0000000 --- a/java/src/de/hardcode/jxinput/virtual/JXVirtualInputDevice.java +++ /dev/null @@ -1,140 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 9. April 2002, 22:40 -//********************************************************************************************** -package de.hardcode.jxinput.virtual; - - -import de.hardcode.jxinput.*; - - -/** - * Virtual input device. - * - * @author Herkules - */ -public class JXVirtualInputDevice implements JXInputDevice -{ - private static final String DEVICENAME = "Virtual Device"; - - /** The driver doing all the real work. */ - private final VirtualDriver mDriver = new VirtualDriver(); - - - /** - * Creates a new instance of JXKeyboardInputDevice. - */ - public JXVirtualInputDevice() - { - } - - - /** - * The virtual input device needs to be updated regularly. - */ - public final void update( long deltaT ) - { - // - // Delegate the update call to the driver. - // - mDriver.update( deltaT ); - } - - /** - * Create a virtual axis object with a certain ID, e.g. Axis.ID_X. - */ - public VirtualAxis createAxis( int id ) - { - VirtualAxis a; - a = new VirtualAxis( id ); - mDriver.registerVirtualAxis( id, a ); - return a; - } - - - public void removeAxis( VirtualAxis a ) - { - mDriver.unregisterVirtualAxis( a ); - } - - - - //********************************************************************************************* - // - // Implement JXInputDevice - // - //********************************************************************************************* - - public Axis getAxis(int idx) - { - return mDriver.getAxis( idx ); - } - - - public Button getButton(int idx) - { - // No virtual buttons. - return null; - } - - - public Directional getDirectional(int idx) - { - // No virtual directionals. - return null; - } - - /** Maximum number of axes as an upper bound for index values. */ - public int getMaxNumberOfAxes() - { - return Axis.NUMBER_OF_ID; - } - - /** Maximum number of buttons as an upper bound for index values. */ - public int getMaxNumberOfButtons() - { - // No virtual buttons. - return 0; - } - - /** Maximum number of directional features as an upper bound for index values. */ - public int getMaxNumberOfDirectionals() - { - // No virtual directionals. - return 0; - } - - /** - * Devices may have a name. - * This name might be provided by a system dependant driver. - */ - public String getName() - { - return DEVICENAME; - } - - /** Actual number of available axes. */ - public int getNumberOfAxes() - { - // No axes on keyboard. - return mDriver.getNumberOfAxes(); - } - - /** Actual number of available buttons. */ - public int getNumberOfButtons() - { - return 0; - } - - /** Actual number of available directional features. */ - public int getNumberOfDirectionals() - { - // No directionals on keyboard. - return 0; - } - -} diff --git a/java/src/de/hardcode/jxinput/virtual/VirtualAxis.java b/java/src/de/hardcode/jxinput/virtual/VirtualAxis.java deleted file mode 100644 index 4be4596..0000000 --- a/java/src/de/hardcode/jxinput/virtual/VirtualAxis.java +++ /dev/null @@ -1,207 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 11. April 2002, 23:40 -//********************************************************************************************** -package de.hardcode.jxinput.virtual; - -import de.hardcode.jxinput.Axis; -import de.hardcode.jxinput.Button; -import java.security.InvalidParameterException; - -/** - * - * @author Jörg Plewe - */ -public class VirtualAxis - implements Axis -{ - - private int mType = Axis.TRANSLATION; - private final int mID; - private String mName = "VirtualAxis"; - private double mCurrentValue = 0; - - private Button mButtonIncrease = null; - private Button mButtonDecrease = null; - private double mSpeed = 1.0 / 500.0; - private double mSpringSpeed = 1.0 / 500.0; - - /** - * Creates a new instance of VirtualAxis. - */ - public VirtualAxis( int id ) - { - mID = id; - } - - - /** - * Set the type of this axis to be either Axis.ROTATION, - * Axis.TRANSLATION or Axis.SLIDER. - */ - public void setType( int type ) - { - if ( Axis.ROTATION != type - && Axis.TRANSLATION != type - && Axis.SLIDER != type - ) - throw new InvalidParameterException( "Invalid type for axis!" ); - - mType = type; - } - - /** - * Update features under my control. - */ - final void update( long deltaT ) - { - double change = mSpeed * deltaT; - double springchange = mSpringSpeed * deltaT; - boolean doincrease = ( null != mButtonIncrease && mButtonIncrease.getState() ); - boolean dodecrease = ( null != mButtonDecrease && mButtonDecrease.getState() ); - boolean iscontrolled = doincrease || dodecrease; - - double controlledchange = 0.0; - if ( doincrease ) - controlledchange += change; - if ( dodecrease ) - controlledchange -= change; - - mCurrentValue += controlledchange; - - if ( mCurrentValue > 0.0 && ! doincrease ) - { - springchange = Math.min( mCurrentValue, springchange ); - mCurrentValue -= springchange; - } - if ( mCurrentValue < 0.0 && ! dodecrease ) - { - springchange = Math.min( -mCurrentValue, springchange ); - mCurrentValue += springchange; - } - - // - // Hold value within range - // - if ( mCurrentValue > 1.0 ) - mCurrentValue = 1.0; - double lowerlimit = Axis.SLIDER == mType ? 0.0 : -1.0; - if ( mCurrentValue < lowerlimit ) - mCurrentValue = lowerlimit; - } - - - /** - * Set the button to increase the axis for a single button axis. - */ - public final void setIncreaseButton( Button b ) - { - if ( null == b ) - throw new InvalidParameterException( "SelectButton may not be null!" ); - - mButtonIncrease = b; - } - - - /** - * Set the buttons to increase and descrease the axis. - */ - public final void setButtons( Button increase, Button decrease ) - { - if ( null == increase || null == decrease ) - throw new InvalidParameterException( "Buttons may not be null!" ); - - mButtonIncrease = increase; - mButtonDecrease = decrease; - } - - - public final void setSpeed( double speed ) - { - mSpeed = speed; - } - - public final void setSpringSpeed( double springspeed ) - { - mSpringSpeed = springspeed; - } - - - public final void setTimeFor0To1( int ms ) - { - if ( 0 >= ms ) - mSpeed = 0.0; - else - mSpeed = 1.0/ ms; - } - public final void setTimeFor1To0( int ms ) - { - if ( 0 >= ms ) - mSpringSpeed = 0.0; - else - mSpringSpeed = 1.0/ ms; - } - - - public final void setName( String name ) - { - mName = name; - } - - //********************************************************************************************* - // - // Implement Axis - // - //********************************************************************************************* - - /** - * Features may have a name provided e.g. by the driver. - */ - public String getName() - { - return mName; - } - - /** - * Inform about the resolution of the axis. - * - * @return resolution, e.g. 2^-16 - */ - public double getResolution() - { - return 1.0/65536.0; - } - - - /** - * Retrieve the type of the axis. - * @return [ TRANSLATION | ROTATION | SLIDER ] - */ - public int getType() - { - return mType; - } - - /** Returns the current value of the axis. - * The range of the result depends on the axis type. - * - * @return value [-1.0,1.0] or [0.0,1.0] - */ - public double getValue() - { - return mCurrentValue; - } - - /** Denote wether this feature has changed beyond it's resolution since it got last - * updated. - */ - public boolean hasChanged() - { - return true; - } - -} diff --git a/java/src/de/hardcode/jxinput/virtual/VirtualDriver.java b/java/src/de/hardcode/jxinput/virtual/VirtualDriver.java deleted file mode 100644 index 5952eff..0000000 --- a/java/src/de/hardcode/jxinput/virtual/VirtualDriver.java +++ /dev/null @@ -1,95 +0,0 @@ -//********************************************************************************************** -// (C) Copyright 2002 by Dipl. Phys. Joerg Plewe, HARDCODE Development -// All rights reserved. Copying, modification, -// distribution or publication without the prior written -// consent of the author is prohibited. -// -// Created on 9. April 2002, 22:43 -//********************************************************************************************** -package de.hardcode.jxinput.virtual; - -import java.util.ArrayList; -import de.hardcode.jxinput.Axis; - - - -/** - * This is the main worker class for JXVirtualInputDevice. - * - * @author Herkules - */ -class VirtualDriver -{ - - private final VirtualAxis[] mVAxes = new VirtualAxis[ Axis.NUMBER_OF_ID ]; - - /** - * Creates a new instance of KeyboardDriver. - */ - VirtualDriver() - { - } - - - /** - * Update features under my control. - */ - final void update( long deltaT ) - { - // - // Delegate the update call to the axes in use. - // - for ( int i = 0; i < mVAxes.length; i++ ) - { - if ( null != mVAxes[ i ] ) - mVAxes[ i ].update( deltaT ); - } - } - - - /** - * How many axes are registered? - */ - final int getNumberOfAxes() - { - int ctr = 0; - for ( int i = 0; i < mVAxes.length; i++ ) - { - if ( null != mVAxes[ i ] ) - ctr++; - } - return ctr; - } - - Axis getAxis(int idx) - { - return mVAxes[ idx ]; - } - - - /** - * Place a new axis under my observation. - */ - final void registerVirtualAxis( int id, VirtualAxis a ) - { - mVAxes[ id ] = a; - } - - - /** - * Remove an axis from my control. - */ - final void unregisterVirtualAxis( VirtualAxis a ) - { - for ( int i = 0; i < mVAxes.length; ++i ) - { - if ( mVAxes[ i ] == a ) - { - mVAxes[ i ] = null; - break; - } - } - } - - -} diff --git a/java/src/de/hardcode/jxinput/virtual/package.html b/java/src/de/hardcode/jxinput/virtual/package.html deleted file mode 100644 index d8e1d6a..0000000 --- a/java/src/de/hardcode/jxinput/virtual/package.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - de.hardcode.jxinput.virtual - - -Allows to define virtual axes that are not derived from any device -but from other JXInput feature objects. - -