[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] libvob doc/design_custominput.rst org/nongnu/li...
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] libvob doc/design_custominput.rst org/nongnu/li... |
Date: |
Mon, 30 Jun 2003 03:08:32 -0400 |
CVSROOT: /cvsroot/libvob
Module name: libvob
Branch:
Changes by: Tuomas J. Lukka <address@hidden> 03/06/30 03:08:31
Modified files:
doc : design_custominput.rst
org/nongnu/libvob/input: AbsoluteAxisListener.java Axis.java
RelativeAxisListener.java
org/nongnu/libvob/input/impl: StandardBoundedFloatModel.java
Added files:
org/nongnu/libvob/input/impl: PS2MouseDevice.java
RelativeAxis.java
Log message:
More on input
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/doc/design_custominput.rst.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/input/AbsoluteAxisListener.java.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/input/Axis.java.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/input/RelativeAxisListener.java.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/input/impl/PS2MouseDevice.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/input/impl/RelativeAxis.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/input/impl/StandardBoundedFloatModel.java.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
Patches:
Index: libvob/doc/design_custominput.rst
diff -u libvob/doc/design_custominput.rst:1.6
libvob/doc/design_custominput.rst:1.7
--- libvob/doc/design_custominput.rst:1.6 Sun Jun 29 10:34:45 2003
+++ libvob/doc/design_custominput.rst Mon Jun 30 03:08:30 2003
@@ -217,11 +217,14 @@
class InputDevice "interface"
jlink
assoc multi(1) - multi(*) Axis
+
class Axis "interface"
jlink
methods
getName()
+ void setState(int state)
+ float getChoiceProbability()
---
horizontally(60, xx, InputDeviceManager, InputDevice, Axis);
@@ -230,8 +233,43 @@
Implementation
==============
+Axes
+----
+Inside, we have classes to adapt the delta input from the mouse
+to the axis interface.
+
+.. UML:: custominputs_ps2mouse
+
+ jlinkpackage org.nongnu.libvob.input.impl
+
+ class (PSMD) PS2MouseDevice
+ jlink
+ realize InputDevice
+ fields
+ RandomAccessFile dev
+ assoc multi(0..1) - multi(3) role(xyz) RelativeAxis
+
+ class RelativeAxis
+ jlink
+ realize RelativeAxisListener
+ realize Axis
+ methods
+ int changedRelative(int delta)
+
+ jlinkpackage org.nongnu.libvob.input
+
+ class InputDevice "interface"
+ jlink
+
+ class Axis "interface"
+ jlink
+
+ ---
+ horizontally(40, xx, InputDevice, Axis);
+ horizontally(70, yy, PSMD, RelativeInputAxis);
+ vertically(50, zz, xx, yy);
Index: libvob/org/nongnu/libvob/input/AbsoluteAxisListener.java
diff -u libvob/org/nongnu/libvob/input/AbsoluteAxisListener.java:1.1
libvob/org/nongnu/libvob/input/AbsoluteAxisListener.java:1.2
--- libvob/org/nongnu/libvob/input/AbsoluteAxisListener.java:1.1 Sun Jun
29 05:25:24 2003
+++ libvob/org/nongnu/libvob/input/AbsoluteAxisListener.java Mon Jun 30
03:08:31 2003
@@ -5,7 +5,7 @@
/** A class which receives absolute events from an axis.
*/
-public interface AbsoluteAxisListener {
+public interface AbsoluteAxisListener extends AxisListener {
/** Called when the value of the listened-to axis is changed
* absolutely. The value given to this method shall always
* be between 0 and 1.
Index: libvob/org/nongnu/libvob/input/Axis.java
diff -u libvob/org/nongnu/libvob/input/Axis.java:1.1
libvob/org/nongnu/libvob/input/Axis.java:1.2
--- libvob/org/nongnu/libvob/input/Axis.java:1.1 Sun Jun 29 05:25:24 2003
+++ libvob/org/nongnu/libvob/input/Axis.java Mon Jun 30 03:08:31 2003
@@ -6,5 +6,24 @@
/** A single input axis.
*/
public interface Axis {
+ /** Get the (user-readable) name of this axis.
+ */
+ String getName();
+
+ /** Set the main listener.
+ * There is only one main listener at a time - the previous one will be
+ * forgotten.
+ */
void setMainListener(AxisListener listener);
+
+ /** Set the state of this object; normal, calibrating or choosing.
+ * @param state One of InputDeviceManager.STATE_*
+ */
+ void setState(int state);
+
+ /** In the choosing state, returns the probability that this
+ * axis has been chosen; some function of how much this
+ * axis has been moved, between 0 and 1.
+ */
+ float getChoiceProbability();
}
Index: libvob/org/nongnu/libvob/input/RelativeAxisListener.java
diff -u libvob/org/nongnu/libvob/input/RelativeAxisListener.java:1.1
libvob/org/nongnu/libvob/input/RelativeAxisListener.java:1.2
--- libvob/org/nongnu/libvob/input/RelativeAxisListener.java:1.1 Sun Jun
29 05:25:24 2003
+++ libvob/org/nongnu/libvob/input/RelativeAxisListener.java Mon Jun 30
03:08:31 2003
@@ -5,7 +5,7 @@
/** A class which receives relative events from an axis.
*/
-public interface RelativeAxisListener {
+public interface RelativeAxisListener extends AxisListener {
/** Called when the value of the listened-to axis is changed.
* There are no limits on the value given to this method.
*/
Index: libvob/org/nongnu/libvob/input/impl/StandardBoundedFloatModel.java
diff -u libvob/org/nongnu/libvob/input/impl/StandardBoundedFloatModel.java:1.1
libvob/org/nongnu/libvob/input/impl/StandardBoundedFloatModel.java:1.2
--- libvob/org/nongnu/libvob/input/impl/StandardBoundedFloatModel.java:1.1
Sun Jun 29 05:25:24 2003
+++ libvob/org/nongnu/libvob/input/impl/StandardBoundedFloatModel.java Mon Jun
30 03:08:31 2003
@@ -8,6 +8,13 @@
extends AbstractModel
implements BoundedFloatModel {
private double min, max, val;
+
+ public StandardBoundedFloatModel(double min, double max) {
+ this.min = min;
+ this.max = max;
+ this.val = .5 * (min + max);
+ }
+
public void setMinimum(double min) {
this.min = min;
if(val < min) val = min;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] libvob doc/design_custominput.rst org/nongnu/li...,
Tuomas J. Lukka <=