From 0b624384cd52be20e61284551d832b499d7b7707 Mon Sep 17 00:00:00 2001 From: Jonathan McCrohan Date: Sat, 14 Apr 2012 12:56:48 +0100 Subject: Imported Upstream version 2.1.8.20120216 --- .../phidgets/event/AccelerationChangeEvent.java | 69 ++++++++++++++++++ .../phidgets/event/AccelerationChangeListener.java | 20 ++++++ Java/com/phidgets/event/AttachEvent.java | 46 ++++++++++++ Java/com/phidgets/event/AttachListener.java | 20 ++++++ Java/com/phidgets/event/BackEMFUpdateEvent.java | 70 ++++++++++++++++++ Java/com/phidgets/event/BackEMFUpdateListener.java | 21 ++++++ Java/com/phidgets/event/BridgeDataEvent.java | 69 ++++++++++++++++++ Java/com/phidgets/event/BridgeDataListener.java | 20 ++++++ Java/com/phidgets/event/CodeEvent.java | 73 +++++++++++++++++++ Java/com/phidgets/event/CodeListener.java | 21 ++++++ Java/com/phidgets/event/CurrentChangeEvent.java | 69 ++++++++++++++++++ Java/com/phidgets/event/CurrentChangeListener.java | 21 ++++++ Java/com/phidgets/event/CurrentUpdateEvent.java | 70 ++++++++++++++++++ Java/com/phidgets/event/CurrentUpdateListener.java | 20 ++++++ Java/com/phidgets/event/DetachEvent.java | 46 ++++++++++++ Java/com/phidgets/event/DetachListener.java | 20 ++++++ .../phidgets/event/EncoderPositionChangeEvent.java | 84 ++++++++++++++++++++++ .../event/EncoderPositionChangeListener.java | 20 ++++++ .../phidgets/event/EncoderPositionUpdateEvent.java | 73 +++++++++++++++++++ .../event/EncoderPositionUpdateListener.java | 20 ++++++ Java/com/phidgets/event/ErrorEvent.java | 59 +++++++++++++++ Java/com/phidgets/event/ErrorListener.java | 21 ++++++ .../phidgets/event/FrequencyCounterCountEvent.java | 81 +++++++++++++++++++++ .../event/FrequencyCounterCountListener.java | 20 ++++++ .../com/phidgets/event/GPSPositionChangeEvent.java | 80 +++++++++++++++++++++ .../phidgets/event/GPSPositionChangeListener.java | 20 ++++++ .../event/GPSPositionFixStatusChangeEvent.java | 58 +++++++++++++++ .../event/GPSPositionFixStatusChangeListener.java | 20 ++++++ Java/com/phidgets/event/InputChangeEvent.java | 69 ++++++++++++++++++ Java/com/phidgets/event/InputChangeListener.java | 21 ++++++ Java/com/phidgets/event/KeyChangeEvent.java | 63 ++++++++++++++++ Java/com/phidgets/event/KeyChangeListener.java | 21 ++++++ Java/com/phidgets/event/KeyRemovalEvent.java | 61 ++++++++++++++++ Java/com/phidgets/event/KeyRemovalListener.java | 21 ++++++ Java/com/phidgets/event/LearnEvent.java | 60 ++++++++++++++++ Java/com/phidgets/event/LearnListener.java | 21 ++++++ .../phidgets/event/MotorVelocityChangeEvent.java | 69 ++++++++++++++++++ .../event/MotorVelocityChangeListener.java | 20 ++++++ Java/com/phidgets/event/OutputChangeEvent.java | 69 ++++++++++++++++++ Java/com/phidgets/event/OutputChangeListener.java | 21 ++++++ Java/com/phidgets/event/PHChangeEvent.java | 58 +++++++++++++++ Java/com/phidgets/event/PHChangeListener.java | 20 ++++++ Java/com/phidgets/event/RawDataEvent.java | 70 ++++++++++++++++++ Java/com/phidgets/event/RawDataListener.java | 21 ++++++ Java/com/phidgets/event/SensorChangeEvent.java | 69 ++++++++++++++++++ Java/com/phidgets/event/SensorChangeListener.java | 19 +++++ Java/com/phidgets/event/SensorUpdateEvent.java | 70 ++++++++++++++++++ Java/com/phidgets/event/SensorUpdateListener.java | 19 +++++ Java/com/phidgets/event/ServerConnectEvent.java | 48 +++++++++++++ Java/com/phidgets/event/ServerConnectListener.java | 20 ++++++ Java/com/phidgets/event/ServerDisconnectEvent.java | 48 +++++++++++++ .../phidgets/event/ServerDisconnectListener.java | 20 ++++++ .../phidgets/event/ServoPositionChangeEvent.java | 70 ++++++++++++++++++ .../event/ServoPositionChangeListener.java | 21 ++++++ .../phidgets/event/ServoVelocityChangeEvent.java | 69 ++++++++++++++++++ .../event/ServoVelocityChangeListener.java | 20 ++++++ Java/com/phidgets/event/SpatialDataEvent.java | 60 ++++++++++++++++ Java/com/phidgets/event/SpatialDataListener.java | 21 ++++++ .../phidgets/event/StepperPositionChangeEvent.java | 70 ++++++++++++++++++ .../event/StepperPositionChangeListener.java | 21 ++++++ .../phidgets/event/StepperVelocityChangeEvent.java | 69 ++++++++++++++++++ .../event/StepperVelocityChangeListener.java | 20 ++++++ Java/com/phidgets/event/TagGainEvent.java | 59 +++++++++++++++ Java/com/phidgets/event/TagGainListener.java | 21 ++++++ Java/com/phidgets/event/TagLossEvent.java | 59 +++++++++++++++ Java/com/phidgets/event/TagLossListener.java | 21 ++++++ .../com/phidgets/event/TemperatureChangeEvent.java | 70 ++++++++++++++++++ .../phidgets/event/TemperatureChangeListener.java | 20 ++++++ Java/com/phidgets/event/WeightChangeEvent.java | 58 +++++++++++++++ Java/com/phidgets/event/WeightChangeListener.java | 20 ++++++ 70 files changed, 2998 insertions(+) create mode 100644 Java/com/phidgets/event/AccelerationChangeEvent.java create mode 100644 Java/com/phidgets/event/AccelerationChangeListener.java create mode 100644 Java/com/phidgets/event/AttachEvent.java create mode 100644 Java/com/phidgets/event/AttachListener.java create mode 100644 Java/com/phidgets/event/BackEMFUpdateEvent.java create mode 100644 Java/com/phidgets/event/BackEMFUpdateListener.java create mode 100644 Java/com/phidgets/event/BridgeDataEvent.java create mode 100644 Java/com/phidgets/event/BridgeDataListener.java create mode 100644 Java/com/phidgets/event/CodeEvent.java create mode 100644 Java/com/phidgets/event/CodeListener.java create mode 100644 Java/com/phidgets/event/CurrentChangeEvent.java create mode 100644 Java/com/phidgets/event/CurrentChangeListener.java create mode 100644 Java/com/phidgets/event/CurrentUpdateEvent.java create mode 100644 Java/com/phidgets/event/CurrentUpdateListener.java create mode 100644 Java/com/phidgets/event/DetachEvent.java create mode 100644 Java/com/phidgets/event/DetachListener.java create mode 100644 Java/com/phidgets/event/EncoderPositionChangeEvent.java create mode 100644 Java/com/phidgets/event/EncoderPositionChangeListener.java create mode 100644 Java/com/phidgets/event/EncoderPositionUpdateEvent.java create mode 100644 Java/com/phidgets/event/EncoderPositionUpdateListener.java create mode 100644 Java/com/phidgets/event/ErrorEvent.java create mode 100644 Java/com/phidgets/event/ErrorListener.java create mode 100644 Java/com/phidgets/event/FrequencyCounterCountEvent.java create mode 100644 Java/com/phidgets/event/FrequencyCounterCountListener.java create mode 100644 Java/com/phidgets/event/GPSPositionChangeEvent.java create mode 100644 Java/com/phidgets/event/GPSPositionChangeListener.java create mode 100644 Java/com/phidgets/event/GPSPositionFixStatusChangeEvent.java create mode 100644 Java/com/phidgets/event/GPSPositionFixStatusChangeListener.java create mode 100644 Java/com/phidgets/event/InputChangeEvent.java create mode 100644 Java/com/phidgets/event/InputChangeListener.java create mode 100644 Java/com/phidgets/event/KeyChangeEvent.java create mode 100644 Java/com/phidgets/event/KeyChangeListener.java create mode 100644 Java/com/phidgets/event/KeyRemovalEvent.java create mode 100644 Java/com/phidgets/event/KeyRemovalListener.java create mode 100644 Java/com/phidgets/event/LearnEvent.java create mode 100644 Java/com/phidgets/event/LearnListener.java create mode 100644 Java/com/phidgets/event/MotorVelocityChangeEvent.java create mode 100644 Java/com/phidgets/event/MotorVelocityChangeListener.java create mode 100644 Java/com/phidgets/event/OutputChangeEvent.java create mode 100644 Java/com/phidgets/event/OutputChangeListener.java create mode 100644 Java/com/phidgets/event/PHChangeEvent.java create mode 100644 Java/com/phidgets/event/PHChangeListener.java create mode 100644 Java/com/phidgets/event/RawDataEvent.java create mode 100644 Java/com/phidgets/event/RawDataListener.java create mode 100644 Java/com/phidgets/event/SensorChangeEvent.java create mode 100644 Java/com/phidgets/event/SensorChangeListener.java create mode 100644 Java/com/phidgets/event/SensorUpdateEvent.java create mode 100644 Java/com/phidgets/event/SensorUpdateListener.java create mode 100644 Java/com/phidgets/event/ServerConnectEvent.java create mode 100644 Java/com/phidgets/event/ServerConnectListener.java create mode 100644 Java/com/phidgets/event/ServerDisconnectEvent.java create mode 100644 Java/com/phidgets/event/ServerDisconnectListener.java create mode 100644 Java/com/phidgets/event/ServoPositionChangeEvent.java create mode 100644 Java/com/phidgets/event/ServoPositionChangeListener.java create mode 100644 Java/com/phidgets/event/ServoVelocityChangeEvent.java create mode 100644 Java/com/phidgets/event/ServoVelocityChangeListener.java create mode 100644 Java/com/phidgets/event/SpatialDataEvent.java create mode 100644 Java/com/phidgets/event/SpatialDataListener.java create mode 100644 Java/com/phidgets/event/StepperPositionChangeEvent.java create mode 100644 Java/com/phidgets/event/StepperPositionChangeListener.java create mode 100644 Java/com/phidgets/event/StepperVelocityChangeEvent.java create mode 100644 Java/com/phidgets/event/StepperVelocityChangeListener.java create mode 100644 Java/com/phidgets/event/TagGainEvent.java create mode 100644 Java/com/phidgets/event/TagGainListener.java create mode 100644 Java/com/phidgets/event/TagLossEvent.java create mode 100644 Java/com/phidgets/event/TagLossListener.java create mode 100644 Java/com/phidgets/event/TemperatureChangeEvent.java create mode 100644 Java/com/phidgets/event/TemperatureChangeListener.java create mode 100644 Java/com/phidgets/event/WeightChangeEvent.java create mode 100644 Java/com/phidgets/event/WeightChangeListener.java (limited to 'Java/com/phidgets/event') diff --git a/Java/com/phidgets/event/AccelerationChangeEvent.java b/Java/com/phidgets/event/AccelerationChangeEvent.java new file mode 100644 index 0000000..92f9c69 --- /dev/null +++ b/Java/com/phidgets/event/AccelerationChangeEvent.java @@ -0,0 +1,69 @@ +/* + * Copyright 2006 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +import com.phidgets.Phidget; + +/** + * This class represents the data for an AccelerationChangeEvent. + * + * @author Phidgets Inc. + */ +public class AccelerationChangeEvent +{ + Phidget source; + int index; + double value; + + /** + * Class constructor. This is called internally by the phidget library when creating this event. + * + * @param source the Phidget object from which this event originated + */ + public AccelerationChangeEvent(Phidget source, int index, double value) { + this.source = source; + this.index = index; + this.value = value; + } + + /** + * Returns the source Phidget of this event. This is a reference to the Phidget object from which this + * event was called. This object can be cast into a specific type of Phidget object to call specific + * device calls on it. + * + * @return the event caller + */ + public Phidget getSource() { + return source; + } + + /** + * Returns the index of the axis. + * + * @return the index of the axis + */ + public int getIndex() { + return index; + } + + /** + * Returns the acceleration. This is returned in g's + * + * @return the acceleration of the axis + */ + public double getValue() { + return value; + } + + /** + * Returns a string containing information about the event. + * + * @return an informative event string + */ + public String toString() { + return source.toString() + " Acceleration " + index + " changed to " + + value; + } +} diff --git a/Java/com/phidgets/event/AccelerationChangeListener.java b/Java/com/phidgets/event/AccelerationChangeListener.java new file mode 100644 index 0000000..b97172e --- /dev/null +++ b/Java/com/phidgets/event/AccelerationChangeListener.java @@ -0,0 +1,20 @@ +/* + * Copyright 2006 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +/** + * This interface represents a AccelerationChangeEvent. This event originates from the Phidget Accelerometer + * + * @author Phidgets Inc. + */ +public interface AccelerationChangeListener +{ + /** + * This method is called with the event data when a new event arrives. + * + * @param ae the event data object containing event data + */ + public void accelerationChanged(AccelerationChangeEvent ae); +} diff --git a/Java/com/phidgets/event/AttachEvent.java b/Java/com/phidgets/event/AttachEvent.java new file mode 100644 index 0000000..eecb7b0 --- /dev/null +++ b/Java/com/phidgets/event/AttachEvent.java @@ -0,0 +1,46 @@ +/* + * Copyright 2006 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +import com.phidgets.Phidget; + +/** + * This class represents the data for a AttachEvent. + * + * @author Phidgets Inc. + */ +public class AttachEvent +{ + Phidget source; + + /** + * Class constructor. This is called internally by the phidget library when creating this event. + * + * @param source the Phidget object from which this event originated + */ + public AttachEvent(Phidget source) { + this.source = source; + } + + /** + * Returns the source Phidget of this event. This is a reference to the Phidget object from which this + * event was called. This object can be cast into a specific type of Phidget object to call specific + * device calls on it. + * + * @return the event caller + */ + public Phidget getSource() { + return source; + } + + /** + * Returns a string containing information about the event. + * + * @return an informative event string + */ + public String toString() { + return source.toString(); + } +} diff --git a/Java/com/phidgets/event/AttachListener.java b/Java/com/phidgets/event/AttachListener.java new file mode 100644 index 0000000..5fe8c00 --- /dev/null +++ b/Java/com/phidgets/event/AttachListener.java @@ -0,0 +1,20 @@ +/* + * Copyright 2006 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +/** + * This interface represents a AttachEvent. This event originates from all Phidgets. + * + * @author Phidgets Inc. + */ +public interface AttachListener +{ + /** + * This method is called with the event data when a new event arrives. + * + * @param ae the event data object containing event data + */ + public void attached(AttachEvent ae); +} diff --git a/Java/com/phidgets/event/BackEMFUpdateEvent.java b/Java/com/phidgets/event/BackEMFUpdateEvent.java new file mode 100644 index 0000000..7dace73 --- /dev/null +++ b/Java/com/phidgets/event/BackEMFUpdateEvent.java @@ -0,0 +1,70 @@ +/* + * Copyright 2011 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +import com.phidgets.Phidget; + +/** + * This class represents the data for a BackEMFUpdateEvent. + * + * @author Phidgets Inc. + */ +public class BackEMFUpdateEvent +{ + Phidget source; + int index; + double voltage; + + /** + * Class constructor. This is called internally by the phidget library when creating this event. + * + * @param source the Phidget object from which this event originated + */ + public BackEMFUpdateEvent(Phidget source, int index, double voltage) + { + this.source = source; + this.index = index; + this.voltage = voltage; + } + + /** + * Returns the source Phidget of this event. This is a reference to the Phidget object from which this + * event was called. This object can be cast into a specific type of Phidget object to call specific + * device calls on it. + * + * @return the event caller + */ + public Phidget getSource() { + return source; + } + + /** + * Returns the index of the motor. + * + * @return the index of the motor + */ + public int getIndex() { + return index; + } + + /** + * Returns the backEMF value. + * + * @return the backEMF value + */ + public double getVoltage() { + return voltage; + } + + /** + * Returns a string containing information about the event. + * + * @return an informative event string + */ + public String toString() { + return source.toString() + " BackEMF Value " + index + " is " + + voltage; + } +} diff --git a/Java/com/phidgets/event/BackEMFUpdateListener.java b/Java/com/phidgets/event/BackEMFUpdateListener.java new file mode 100644 index 0000000..9a99a97 --- /dev/null +++ b/Java/com/phidgets/event/BackEMFUpdateListener.java @@ -0,0 +1,21 @@ +/* + * Copyright 2011 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +/** + * This interface represents a BackEMFUpdateEvent. This event originates from the + * Phidget Motor Control. This event is not supported by all Motor Controllers. + * + * @author Phidgets Inc. + */ +public interface BackEMFUpdateListener +{ + /** + * This method is called with the event data every 16ms, when back EMF sensing is enabled for that motor. + * + * @param ae the event data object containing event data + */ + public void backEMFUpdated(BackEMFUpdateEvent ae); +} diff --git a/Java/com/phidgets/event/BridgeDataEvent.java b/Java/com/phidgets/event/BridgeDataEvent.java new file mode 100644 index 0000000..3dd1578 --- /dev/null +++ b/Java/com/phidgets/event/BridgeDataEvent.java @@ -0,0 +1,69 @@ +/* + * Copyright 2011 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +import com.phidgets.Phidget; + +/** + * This class represents the data for a BridgeDataEvent. + * + * @author Phidgets Inc. + */ +public class BridgeDataEvent +{ + Phidget source; + int index; + double value; + + /** + * Class constructor. This is called internally by the phidget library when creating this event. + * + * @param source the Phidget object from which this event originated + */ + public BridgeDataEvent(Phidget source, int index, double value) { + this.source = source; + this.index = index; + this.value = value; + } + + /** + * Returns the source Phidget of this event. This is a reference to the Phidget object from which this + * event was called. This object can be cast into a specific type of Phidget object to call specific + * device calls on it. + * + * @return the event caller + */ + public Phidget getSource() { + return source; + } + + /** + * Returns the index of the bridge. + * + * @return the index of the bridge + */ + public int getIndex() { + return index; + } + + /** + * Retuns the bridge value, in mV/V. + * + * @return the bridge value + */ + public double getValue() { + return value; + } + + /** + * Returns a string containing information about the event. + * + * @return an informative event string + */ + public String toString() { + return source.toString() + " bridge " + index + " value changed to " + + value; + } +} diff --git a/Java/com/phidgets/event/BridgeDataListener.java b/Java/com/phidgets/event/BridgeDataListener.java new file mode 100644 index 0000000..de2f993 --- /dev/null +++ b/Java/com/phidgets/event/BridgeDataListener.java @@ -0,0 +1,20 @@ +/* + * Copyright 2011 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; +/** + * This interface represents a BridgeDataEvent. This event originates from the Phidget Bridge + * + * @author Phidgets Inc. + */ +public interface BridgeDataListener +{ + /** + * This method is called with the event data when a new event arrives. The event is issued at the specified data rate, for + * each enabled bridge. + * + * @param ae the event data object containing event data + */ + public void bridgeData(BridgeDataEvent ae); +} diff --git a/Java/com/phidgets/event/CodeEvent.java b/Java/com/phidgets/event/CodeEvent.java new file mode 100644 index 0000000..0cb5336 --- /dev/null +++ b/Java/com/phidgets/event/CodeEvent.java @@ -0,0 +1,73 @@ +/* + * Copyright 2006 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +import com.phidgets.Phidget; +import com.phidgets.IRCode; + +/** + * This class represents the data for a CodeEvent. + * + * @author Phidgets Inc. + */ +public class CodeEvent +{ + Phidget source; + IRCode code; + boolean repeat; + + /** + * Class constructor. This is called internally by the phidget library when creating this event. + * + * @param source the Phidget object from which this event originated + * @param code the IR code + * @param repeat whether the code is a repeat + */ + public CodeEvent(Phidget source, IRCode code, boolean repeat) + { + this.source = source; + this.code = code; + this.repeat = repeat; + } + + /** + * Returns the source Phidget of this event. This is a reference to the Phidget object from which this + * event was called. This object can be cast into a specific type of Phidget object to call specific + * device calls on it. + * + * @return the event caller + */ + public Phidget getSource() { + return source; + } + + /** + * Returns the code. + * + * @return the code + */ + public IRCode getCode() { + return code; + } + + /** + * Returns the repeat identifier. + * + * @return whether this is a repeat + */ + public boolean getRepeat() { + return repeat; + } + + /** + * Returns a string containing information about the event. + * + * @return an informative event string + */ + public String toString() { + return source.toString() + " Code: " + + code.toString(); + } +} diff --git a/Java/com/phidgets/event/CodeListener.java b/Java/com/phidgets/event/CodeListener.java new file mode 100644 index 0000000..30bdde1 --- /dev/null +++ b/Java/com/phidgets/event/CodeListener.java @@ -0,0 +1,21 @@ +/* + * Copyright 2006 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +/** + * This interface represents a CodeEvent. This event originates from the Phidget IR. + * This event occurs when a code is seen by the reader. + * + * @author Phidgets Inc. + */ +public interface CodeListener +{ + /** + * This method is called with the event data when a new event arrives. + * + * @param ae the event data object containing event data + */ + public void code(CodeEvent ae); +} diff --git a/Java/com/phidgets/event/CurrentChangeEvent.java b/Java/com/phidgets/event/CurrentChangeEvent.java new file mode 100644 index 0000000..b279ce8 --- /dev/null +++ b/Java/com/phidgets/event/CurrentChangeEvent.java @@ -0,0 +1,69 @@ +/* + * Copyright 2006 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +import com.phidgets.Phidget; + +/** + * This class represents the data for a CurrentChangeEvent. + * + * @author Phidgets Inc. + */ +public class CurrentChangeEvent +{ + Phidget source; + int index; + double value; + + /** + * Class constructor. This is called internally by the phidget library when creating this event. + * + * @param source the Phidget object from which this event originated + */ + public CurrentChangeEvent(Phidget source, int index, double value) { + this.source = source; + this.index = index; + this.value = value; + } + + /** + * Returns the source Phidget of this event. This is a reference to the Phidget object from which this + * event was called. This object can be cast into a specific type of Phidget object to call specific + * device calls on it. + * + * @return the event caller + */ + public Phidget getSource() { + return source; + } + + /** + * Returns the index of the motor. + * + * @return the index of the motor + */ + public int getIndex() { + return index; + } + + /** + * Returns the current of the motor. This is a representation of the ammount of current being used by the motor. + * + * @return the motor's current draw + */ + public double getValue() { + return value; + } + + /** + * Returns a string containing information about the event. + * + * @return an informative event string + */ + public String toString() { + return source.toString() + " current " + index + " changed to " + + value; + } +} diff --git a/Java/com/phidgets/event/CurrentChangeListener.java b/Java/com/phidgets/event/CurrentChangeListener.java new file mode 100644 index 0000000..f45681c --- /dev/null +++ b/Java/com/phidgets/event/CurrentChangeListener.java @@ -0,0 +1,21 @@ +/* + * Copyright 2011 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +/** + * This interface represents a CurrentChangeEvent. This event originates from the Phidget Motor Controller. + * This event is not supported by all Motor Controllers. + * + * @author Phidgets Inc. + */ +public interface CurrentChangeListener +{ + /** + * This method is called with the event data when a new event arrives. + * + * @param ae the event data object containing event data + */ + public void currentChanged(CurrentChangeEvent ae); +} diff --git a/Java/com/phidgets/event/CurrentUpdateEvent.java b/Java/com/phidgets/event/CurrentUpdateEvent.java new file mode 100644 index 0000000..12265e5 --- /dev/null +++ b/Java/com/phidgets/event/CurrentUpdateEvent.java @@ -0,0 +1,70 @@ +/* + * Copyright 2006 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +import com.phidgets.Phidget; + +/** + * This class represents the data for a CurrentUpdateEvent. + * + * @author Phidgets Inc. + */ +public class CurrentUpdateEvent +{ + Phidget source; + int index; + double value; + + /** + * Class constructor. This is called internally by the Phidget library when creating this event. + * + * @param source the Phidget object from which this event originated + */ + public CurrentUpdateEvent(Phidget source, int index, double value) + { + this.source = source; + this.index = index; + this.value = value; + } + + /** + * Returns the source Phidget of this event. This is a reference to the Phidget object from which this + * event was called. This object can be cast into a specific type of Phidget object to call specific + * device calls on it. + * + * @return the event caller + */ + public Phidget getSource() { + return source; + } + + /** + * Returns the index of the motor. + * + * @return the index of the motor + */ + public int getIndex() { + return index; + } + + /** + * Returns the current of the motor. This is a representation of the amount of current being used by the motor. + * + * @return the motor's current draw + */ + public double getValue() { + return value; + } + + /** + * Returns a string containing information about the event. + * + * @return an informative event string + */ + public String toString() { + return source.toString() + " current " + index + " is " + + value; + } +} diff --git a/Java/com/phidgets/event/CurrentUpdateListener.java b/Java/com/phidgets/event/CurrentUpdateListener.java new file mode 100644 index 0000000..20a6784 --- /dev/null +++ b/Java/com/phidgets/event/CurrentUpdateListener.java @@ -0,0 +1,20 @@ +/* + * Copyright 2011 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +/** + * This interface represents a CurrentUpdateEvent. This event originates from the Phidget Motor Controller. This event is not supported by all Motor Controllers. + * + * @author Phidgets Inc. + */ +public interface CurrentUpdateListener +{ + /** + * This method is called with every 8ms. + * + * @param ae the event data object containing event data + */ + public void currentUpdated(CurrentUpdateEvent ae); +} diff --git a/Java/com/phidgets/event/DetachEvent.java b/Java/com/phidgets/event/DetachEvent.java new file mode 100644 index 0000000..97bfe29 --- /dev/null +++ b/Java/com/phidgets/event/DetachEvent.java @@ -0,0 +1,46 @@ +/* + * Copyright 2006 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +import com.phidgets.Phidget; + +/** + * This class represents the data for a DetachEvent. + * + * @author Phidgets Inc. + */ +public class DetachEvent +{ + Phidget source; + + /** + * Class constructor. This is called internally by the phidget library when creating this event. + * + * @param source the Phidget object from which this event originated + */ + public DetachEvent(Phidget source) { + this.source = source; + } + + /** + * Returns the source Phidget of this event. This is a reference to the Phidget object from which this + * event was called. This object can be cast into a specific type of Phidget object to call specific + * device calls on it. + * + * @return the event caller + */ + public Phidget getSource() { + return source; + } + + /** + * Returns a string containing information about the event. + * + * @return an informative event string + */ + public String toString() { + return source.toString(); + } +} diff --git a/Java/com/phidgets/event/DetachListener.java b/Java/com/phidgets/event/DetachListener.java new file mode 100644 index 0000000..b74e0ec --- /dev/null +++ b/Java/com/phidgets/event/DetachListener.java @@ -0,0 +1,20 @@ +/* + * Copyright 2006 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +/** + * This interface represents a DetachEvent. This event originates from all Phidgets, as well as the Phidget Manager. + * + * @author Phidgets Inc. + */ +public interface DetachListener +{ + /** + * This method is called with the event data when a new event arrives. + * + * @param ae the event data object containing event data + */ + public void detached(DetachEvent ae); +} diff --git a/Java/com/phidgets/event/EncoderPositionChangeEvent.java b/Java/com/phidgets/event/EncoderPositionChangeEvent.java new file mode 100644 index 0000000..52118a7 --- /dev/null +++ b/Java/com/phidgets/event/EncoderPositionChangeEvent.java @@ -0,0 +1,84 @@ +/* + * Copyright 2006 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +import com.phidgets.Phidget; + +/** + * This class represents the data for a EncoderPositionChangeEvent. + * + * @author Phidgets Inc. + */ +public class EncoderPositionChangeEvent +{ + Phidget source; + int index; + int value; + int time; + + /** + * Class constructor. This is called internally by the phidget library when creating this event. + * + * @param source the Phidget object from which this event originated + */ + public EncoderPositionChangeEvent(Phidget source, int index, int time, int value) { + this.source = source; + this.index = index; + this.value = value; + this.time = time; + } + + /** + * Returns the source Phidget of this event. This is a reference to the Phidget object from which this + * event was called. This object can be cast into a specific type of Phidget object to call specific + * device calls on it. + * + * @return the event caller + */ + public Phidget getSource() { + return source; + } + + /** + * Returns the index of the encoder. + * + * @return the index of the encoder + */ + public int getIndex() { + return index; + } + + /** + * Returns the position change of the encoder. This is the amount of change in the encoder's position + * since the last {@link #EncoderPositionChangeEvent}. + * + * @return the change in position of the encoder + */ + public int getValue() { + return value; + } + + /** + * Returns the timestamp of this position change. This is the time since the last {@link #EncoderPositionChangeEvent}. + * This time is not represented in a real quantitly such as seconds, but can be used as a qualitative quantity. + * + * @return the timestamp of this change event + */ + public int getTime() + { + return time; + } + + /** + * Returns a string containing information about the event. + * + * @return an informative event string + */ + public String toString() { + + return source.toString() + " encoder position " + index + " changed by " + + value + " Time: " + time; + } +} diff --git a/Java/com/phidgets/event/EncoderPositionChangeListener.java b/Java/com/phidgets/event/EncoderPositionChangeListener.java new file mode 100644 index 0000000..dabdb08 --- /dev/null +++ b/Java/com/phidgets/event/EncoderPositionChangeListener.java @@ -0,0 +1,20 @@ +/* + * Copyright 2006 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +/** + * This interface represents an EncoderPositionChangeEvent. This event originates from the Phidget Encoder and the Phidget Motor Controller. This event is not supported by all Motor Controllers. + * + * @author Phidgets Inc. + */ +public interface EncoderPositionChangeListener +{ + /** + * This method is called with the event data when a new event arrives. + * + * @param ae the event data object containing event data + */ + public void encoderPositionChanged(EncoderPositionChangeEvent ae); +} diff --git a/Java/com/phidgets/event/EncoderPositionUpdateEvent.java b/Java/com/phidgets/event/EncoderPositionUpdateEvent.java new file mode 100644 index 0000000..8124b04 --- /dev/null +++ b/Java/com/phidgets/event/EncoderPositionUpdateEvent.java @@ -0,0 +1,73 @@ +/* + * Copyright 2011 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +import com.phidgets.Phidget; + +/** + * This class represents the data for a EncoderPositionUpdateEvent. + * + * @author Phidgets Inc. + */ +public class EncoderPositionUpdateEvent +{ + Phidget source; + int index; + int value; + + /** + * Class constructor. This is called internally by the Phidget library when creating this event. + * + * @param source the Phidget object from which this event originated + */ + public EncoderPositionUpdateEvent(Phidget source, int index, int value) + { + this.source = source; + this.index = index; + this.value = value; + + } + + /** + * Returns the source Phidget of this event. This is a reference to the Phidget object from which this + * event was called. This object can be cast into a specific type of Phidget object to call specific + * device calls on it. + * + * @return the event caller + */ + public Phidget getSource() { + return source; + } + + /** + * Returns the index of the encoder. + * + * @return the index of the encoder + */ + public int getIndex() { + return index; + } + + /** + * Returns the position change of the encoder. This is the amount of change in the encoder's position + * since the last {@link #EncoderPositionUpdateEvent}. + * + * @return the change in position of the encoder + */ + public int getValue() { + return value; + } + + /** + * Returns a string containing information about the event. + * + * @return an informative event string + */ + public String toString() { + + return source.toString() + " encoder position " + index + " is " + + value; + } +} diff --git a/Java/com/phidgets/event/EncoderPositionUpdateListener.java b/Java/com/phidgets/event/EncoderPositionUpdateListener.java new file mode 100644 index 0000000..f16c899 --- /dev/null +++ b/Java/com/phidgets/event/EncoderPositionUpdateListener.java @@ -0,0 +1,20 @@ +/* + * Copyright 2011 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +/** + * This interface represents an EncoderPositionUpdateEvent. This event originates from the Phidget Motor Controller. This event is not supported by all Motor Controllers. + * + * @author Phidgets Inc. + */ +public interface EncoderPositionUpdateListener +{ + /** + * This method is called with the event data when a new event arrives. + * + * @param ae the event data object containing event data + */ + public void encoderPositionUpdated(EncoderPositionUpdateEvent ae); +} diff --git a/Java/com/phidgets/event/ErrorEvent.java b/Java/com/phidgets/event/ErrorEvent.java new file mode 100644 index 0000000..e0dc374 --- /dev/null +++ b/Java/com/phidgets/event/ErrorEvent.java @@ -0,0 +1,59 @@ +/* + * Copyright 2006 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +import com.phidgets.Phidget; +import com.phidgets.PhidgetException; + +/** + * This class represents the data for a ErrorEvent. + * + * @author Phidgets Inc. + */ +public class ErrorEvent +{ + Phidget source; + PhidgetException exception; + + /** + * Class constructor. This is called internally by the phidget library when creating this event. + * + * @param source the Phidget object from which this event originated + */ + public ErrorEvent(Phidget source, PhidgetException ex) { + this.source = source; + this.exception = ex; + } + + /** + * Returns the source Phidget of this event. This is a reference to the Phidget object from which this + * event was called. This object can be cast into a specific type of Phidget object to call specific + * device calls on it. + * + * @return the event caller + */ + public Phidget getSource() { + return source; + } + + /** + * Returns the exception that describes the error. + * + * @return the event exception + */ + public PhidgetException getException() + { + return exception; + } + + /** + * Returns a string containing information about the event. + * + * @return an informative event string + */ + public String toString() { + return "Error Event (" + exception.getErrorNumber() + "): " + exception.getDescription(); + } +} diff --git a/Java/com/phidgets/event/ErrorListener.java b/Java/com/phidgets/event/ErrorListener.java new file mode 100644 index 0000000..a1a0207 --- /dev/null +++ b/Java/com/phidgets/event/ErrorListener.java @@ -0,0 +1,21 @@ +/* + * Copyright 2006 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +/** + * This interface represents a ErrorEvent. This event originates from all Phidgets. + * It is used for asynchronous error handling. + * + * @author Phidgets Inc. + */ +public interface ErrorListener +{ + /** + * This method is called with the event data when a new event arrives. + * + * @param ae the event data object containing event data + */ + public void error(ErrorEvent ae); +} diff --git a/Java/com/phidgets/event/FrequencyCounterCountEvent.java b/Java/com/phidgets/event/FrequencyCounterCountEvent.java new file mode 100644 index 0000000..4a9291b --- /dev/null +++ b/Java/com/phidgets/event/FrequencyCounterCountEvent.java @@ -0,0 +1,81 @@ +/* + * Copyright 2011 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +import com.phidgets.Phidget; + +/** + * This class represents the data for a FrequencyCounterCountEvent. + * + * @author Phidgets Inc. + */ +public class FrequencyCounterCountEvent +{ + Phidget source; + int index; + int time; + int count; + + /** + * Class constructor. This is called internally by the phidget library when creating this event. + * + * @param source the Phidget object from which this event originated + */ + public FrequencyCounterCountEvent(Phidget source, int index, int time, int count) { + this.source = source; + this.index = index; + this.time = time; + this.count = count; + } + + /** + * Returns the source Phidget of this event. This is a reference to the Phidget object from which this + * event was called. This object can be cast into a specific type of Phidget object to call specific + * device calls on it. + * + * @return the event caller + */ + public Phidget getSource() { + return source; + } + + /** + * Returns the index of the channel. + * + * @return the index of the channel + */ + public int getIndex() { + return index; + } + + /** + * Returns the amount of time in which the number of counts occured, in microseconds. + * + * @return the amount of time in which the number of counts occured + */ + public int getTime() { + return time; + } + + /** + * Returns the number of counts detected. + * + * @return the number of counts detected + */ + public int getCount() { + return count; + } + + /** + * Returns a string containing information about the event. + * + * @return an informative event string + */ + public String toString() { + + return source.toString() + " Channel " + index + ": " + count + " pulses in " + + time + " miroseconds"; + } +} diff --git a/Java/com/phidgets/event/FrequencyCounterCountListener.java b/Java/com/phidgets/event/FrequencyCounterCountListener.java new file mode 100644 index 0000000..fd19348 --- /dev/null +++ b/Java/com/phidgets/event/FrequencyCounterCountListener.java @@ -0,0 +1,20 @@ +/* + * Copyright 2011 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +/** + * This interface represents a FrequencyCounterCountEvent. This event originates from the Phidget Frequency Counter + * + * @author Phidgets Inc. + */ +public interface FrequencyCounterCountListener +{ + /** + * This method is called with the event data when a new event arrives. + * + * @param ae the event data object containing event data + */ + public void frequencyCounterCounted(FrequencyCounterCountEvent ae); +} diff --git a/Java/com/phidgets/event/GPSPositionChangeEvent.java b/Java/com/phidgets/event/GPSPositionChangeEvent.java new file mode 100644 index 0000000..42b9199 --- /dev/null +++ b/Java/com/phidgets/event/GPSPositionChangeEvent.java @@ -0,0 +1,80 @@ +/* + * Copyright 2006 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +import com.phidgets.Phidget; + +/** + * This class represents the data for a GPSPositionChangeEvent. + * + * @author Phidgets Inc. + */ +public class GPSPositionChangeEvent +{ + Phidget source; + double latitude; + double longitude; + double altitude; + + /** + * Class constructor. This is called internally by the phidget library when creating this event. + * + * @param source the Phidget object from which this event originated + */ + public GPSPositionChangeEvent(Phidget source, double latitude, double longitude, double altitude) { + this.source = source; + this.latitude = latitude; + this.longitude = longitude; + this.altitude = altitude; + } + + /** + * Returns the source Phidget of this event. This is a reference to the Phidget object from which this + * event was called. This object can be cast into a specific type of Phidget object to call specific + * device calls on it. + * + * @return the event caller + */ + public Phidget getSource() { + return source; + } + + /** + * Returns the latitude of the GPS, in signed degrees format. + * + * @return the latitude + */ + public double getLatitude() { + return latitude; + } + + /** + * Returns the longitude of the GPS, in signed degrees format + * + * @return the longitude + */ + public double getLongitude() { + return longitude; + } + + /** + * Returns the altitude of the GPS, in meters. + * + * @return the altitude + */ + public double getAltitude() { + return altitude; + } + + /** + * Returns a string containing information about the event. + * + * @return an informative event string + */ + public String toString() { + return("Position is - Latitude: "+ latitude + " degrees" + + ", Longitude: " + longitude + " degrees" + ", Altitude: "+ altitude + "m"); + } +} diff --git a/Java/com/phidgets/event/GPSPositionChangeListener.java b/Java/com/phidgets/event/GPSPositionChangeListener.java new file mode 100644 index 0000000..dceb712 --- /dev/null +++ b/Java/com/phidgets/event/GPSPositionChangeListener.java @@ -0,0 +1,20 @@ +/* + * Copyright 2011 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +/** + * This interface represents a GPSPositionChangeEvent. This event originates from the Phidget GPS + * + * @author Phidgets Inc. + */ +public interface GPSPositionChangeListener +{ + /** + * This method is called with the event data when a new event arrives. + * + * @param ae the event data object containing event data + */ + public void gpsPositionChanged(GPSPositionChangeEvent ae); +} diff --git a/Java/com/phidgets/event/GPSPositionFixStatusChangeEvent.java b/Java/com/phidgets/event/GPSPositionFixStatusChangeEvent.java new file mode 100644 index 0000000..94f08a9 --- /dev/null +++ b/Java/com/phidgets/event/GPSPositionFixStatusChangeEvent.java @@ -0,0 +1,58 @@ +/* + * Copyright 2006 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +import com.phidgets.Phidget; + +/** + * This class represents the data for a GPSPositionFixStatusChangeEvent. + * + * @author Phidgets Inc. + */ +public class GPSPositionFixStatusChangeEvent +{ + Phidget source; + boolean status; + + + /** + * Class constructor. This is called internally by the phidget library when creating this event. + * + * @param source the Phidget object from which this event originated + */ + public GPSPositionFixStatusChangeEvent(Phidget source, boolean status) { + this.source = source; + this.status = status; + } + + /** + * Returns the source Phidget of this event. This is a reference to the Phidget object from which this + * event was called. This object can be cast into a specific type of Phidget object to call specific + * device calls on it. + * + * @return the event caller + */ + public Phidget getSource() { + return source; + } + + /** + * Returns the position fix status of the GPS. + * + * @return the position fix status + */ + public boolean getStatus() { + return status; + } + + /** + * Returns a string containing information about the event. + * + * @return an informative event string + */ + public String toString() { + return("Position fix status IS : " + status); + } +} diff --git a/Java/com/phidgets/event/GPSPositionFixStatusChangeListener.java b/Java/com/phidgets/event/GPSPositionFixStatusChangeListener.java new file mode 100644 index 0000000..2768cea --- /dev/null +++ b/Java/com/phidgets/event/GPSPositionFixStatusChangeListener.java @@ -0,0 +1,20 @@ +/* + * Copyright 2011 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +/** + * This interface represents a GPSPositionFixStatusChangeEvent. This event originates from the Phidget GPS + * + * @author Phidgets Inc. + */ +public interface GPSPositionFixStatusChangeListener +{ + /** + * This method is called with the event data when a new event arrives. + * + * @param ae the event data object containing event data + */ + public void gpsPositionFixStatusChanged(GPSPositionFixStatusChangeEvent ae); +} diff --git a/Java/com/phidgets/event/InputChangeEvent.java b/Java/com/phidgets/event/InputChangeEvent.java new file mode 100644 index 0000000..273bb9b --- /dev/null +++ b/Java/com/phidgets/event/InputChangeEvent.java @@ -0,0 +1,69 @@ +/* + * Copyright 2006 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +import com.phidgets.Phidget; + +/** + * This class represents the data for a InputChangeEvent. + * + * @author Phidgets Inc. + */ +public class InputChangeEvent +{ + Phidget source; + int index; + boolean state; + + /** + * Class constructor. This is called internally by the phidget library when creating this event. + * + * @param source the Phidget object from which this event originated + */ + public InputChangeEvent(Phidget source, int index, boolean state) { + this.source = source; + this.index = index; + this.state = state; + } + + /** + * Returns the source Phidget of this event. This is a reference to the Phidget object from which this + * event was called. This object can be cast into a specific type of Phidget object to call specific + * device calls on it. + * + * @return the event caller + */ + public Phidget getSource() { + return source; + } + + /** + * Returns the index of the digital input. + * + * @return the index of the input + */ + public int getIndex() { + return index; + } + + /** + * Returns the state of the input. True indicates that it is activated, False indicated the default state. + * + * @return the state of the input + */ + public boolean getState() { + return state; + } + + /** + * Returns a string containing information about the event. + * + * @return an informative event string + */ + public String toString() { + return source.toString() + " input " + index + " changed to " + + state; + } +} diff --git a/Java/com/phidgets/event/InputChangeListener.java b/Java/com/phidgets/event/InputChangeListener.java new file mode 100644 index 0000000..c63ade9 --- /dev/null +++ b/Java/com/phidgets/event/InputChangeListener.java @@ -0,0 +1,21 @@ +/* + * Copyright 2006 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +/** + * This interface represents a InputChangeEvent. This event originates from the Phidget Encoder, the Phidget InterfaceKit, + * and the Phidget Motor Controller. + * + * @author Phidgets Inc. + */ +public interface InputChangeListener +{ + /** + * This method is called with the event data when a new event arrives. + * + * @param ae the event data object containing event data + */ + public void inputChanged(InputChangeEvent ae); +} diff --git a/Java/com/phidgets/event/KeyChangeEvent.java b/Java/com/phidgets/event/KeyChangeEvent.java new file mode 100644 index 0000000..fe86cda --- /dev/null +++ b/Java/com/phidgets/event/KeyChangeEvent.java @@ -0,0 +1,63 @@ +/* + * Copyright 2006 Dictionarys Inc. All rights reserved. + */ + +package com.phidgets.event; + +import com.phidgets.Dictionary; + +/** + * This class represents the data for a KeyChangeEvent. + * + * @author Dictionarys Inc. + */ +public class KeyChangeEvent +{ + Dictionary source; + String value; + String key; + + /** + * Class constructor. This is called internally by the Dictionary library when creating this event. + * + * @param source the Dictionary object from which this event originated + */ + public KeyChangeEvent(Dictionary source, String key, String value) + { + this.source = source; + this.value = value; + this.key = key; + } + + /** + * Returns the source Dictionary of this event. This is a reference to the Dictionary object from which this + * event was called. This object can be cast into a specific type of Dictionary object to call specific + * device calls on it. + * + * @return the event caller + */ + public Dictionary getSource() { + return source; + } + + public String getKey() + { + return key; + } + + public String getValue() + { + return value; + } + + /** + * Returns a string containing information about the event. + * + * @return an informative event string + */ + public String toString() + { + return source.toString() + " Key changed: " + + key + ":" + value; + } +} diff --git a/Java/com/phidgets/event/KeyChangeListener.java b/Java/com/phidgets/event/KeyChangeListener.java new file mode 100644 index 0000000..07772c2 --- /dev/null +++ b/Java/com/phidgets/event/KeyChangeListener.java @@ -0,0 +1,21 @@ +/* + * Copyright 2006 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +/** + * This interface represents a KeyChangeEvent. This event originates from the Phidget Dictionary. Key Change events + * occur when key that matches the listen pattern is either added or changes in the Dictionary. + * + * @author Phidgets Inc. + */ +public interface KeyChangeListener +{ + /** + * This method is called with the event data when a new event arrives. + * + * @param ae the event data object containing event data + */ + public void keyChanged(KeyChangeEvent ae); +} diff --git a/Java/com/phidgets/event/KeyRemovalEvent.java b/Java/com/phidgets/event/KeyRemovalEvent.java new file mode 100644 index 0000000..1a7fe9f --- /dev/null +++ b/Java/com/phidgets/event/KeyRemovalEvent.java @@ -0,0 +1,61 @@ +/* + * Copyright 2006 Dictionarys Inc. All rights reserved. + */ + +package com.phidgets.event; + +import com.phidgets.Dictionary; + +/** + * This class represents the data for a KeyRemovalEvent. + * + * @author Dictionarys Inc. + */ +public class KeyRemovalEvent +{ + Dictionary source; + String value; + String key; + + /** + * Class constructor. This is called internally by the Dictionary library when creating this event. + * + * @param source the Dictionary object from which this event originated + */ + public KeyRemovalEvent(Dictionary source, String key, String value) + { + this.source = source; + this.value = value; + this.key = key; + } + + /** + * Returns the source Dictionary of this event. This is a reference to the Dictionary object from which this + * event was called. This object can be cast into a specific type of Dictionary object to call specific + * device calls on it. + * + * @return the event caller + */ + public Dictionary getSource() { + return source; + } + + public String getKey() + { + return key; + } + + public String getValue() { + return value; + } + + /** + * Returns a string containing information about the event. + * + * @return an informative event string + */ + public String toString() { + return source.toString() + " Key removed: " + + key + ":" + value; + } +} diff --git a/Java/com/phidgets/event/KeyRemovalListener.java b/Java/com/phidgets/event/KeyRemovalListener.java new file mode 100644 index 0000000..bac9a92 --- /dev/null +++ b/Java/com/phidgets/event/KeyRemovalListener.java @@ -0,0 +1,21 @@ +/* + * Copyright 2006 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +/** + * This interface represents a KeyRemovalEvent. This event originates from the Phidget Dictionary. + * This event occurs key that matches the listen pattern is removed. + * + * @author Phidgets Inc. + */ +public interface KeyRemovalListener +{ + /** + * This method is called with the event data when a new event arrives. + * + * @param ae the event data object containing event data + */ + public void keyRemoved(KeyRemovalEvent ae); +} diff --git a/Java/com/phidgets/event/LearnEvent.java b/Java/com/phidgets/event/LearnEvent.java new file mode 100644 index 0000000..f0a784d --- /dev/null +++ b/Java/com/phidgets/event/LearnEvent.java @@ -0,0 +1,60 @@ +/* + * Copyright 2006 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +import com.phidgets.Phidget; +import com.phidgets.IRLearnedCode; + +/** + * This class represents the data for a LearnEvent. + * + * @author Phidgets Inc. + */ +public class LearnEvent +{ + Phidget source; + IRLearnedCode value; + + /** + * Class constructor. This is called internally by the phidget library when creating this event. + * + * @param source the Phidget object from which this event originated + */ + public LearnEvent(Phidget source, IRLearnedCode value) + { + this.source = source; + this.value = value; + } + + /** + * Returns the source Phidget of this event. This is a reference to the Phidget object from which this + * event was called. This object can be cast into a specific type of Phidget object to call specific + * device calls on it. + * + * @return the event caller + */ + public Phidget getSource() { + return source; + } + + /** + * Returns the learned code. + * + * @return the learned code + */ + public IRLearnedCode getValue() { + return value; + } + + /** + * Returns a string containing information about the event. + * + * @return an informative event string + */ + public String toString() { + return source.toString() + " Learned Code: " + + value; + } +} diff --git a/Java/com/phidgets/event/LearnListener.java b/Java/com/phidgets/event/LearnListener.java new file mode 100644 index 0000000..174aa30 --- /dev/null +++ b/Java/com/phidgets/event/LearnListener.java @@ -0,0 +1,21 @@ +/* + * Copyright 2006 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +/** + * This interface represents a LearnEvent. This event originates from the Phidget IR. + * This event occurs when a code is learned by the reader. + * + * @author Phidgets Inc. + */ +public interface LearnListener +{ + /** + * This method is called with the event data when a new event arrives. + * + * @param ae the event data object containing event data + */ + public void learn(LearnEvent ae); +} diff --git a/Java/com/phidgets/event/MotorVelocityChangeEvent.java b/Java/com/phidgets/event/MotorVelocityChangeEvent.java new file mode 100644 index 0000000..b3aef63 --- /dev/null +++ b/Java/com/phidgets/event/MotorVelocityChangeEvent.java @@ -0,0 +1,69 @@ +/* + * Copyright 2006 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +import com.phidgets.Phidget; + +/** + * This class represents the data for a MotorVelocityChangeEvent. + * + * @author Phidgets Inc. + */ +public class MotorVelocityChangeEvent +{ + Phidget source; + int index; + double value; + + /** + * Class constructor. This is called internally by the phidget library when creating this event. + * + * @param source the Phidget object from which this event originated + */ + public MotorVelocityChangeEvent(Phidget source, int index, double value) { + this.source = source; + this.index = index; + this.value = value; + } + + /** + * Returns the source Phidget of this event. This is a reference to the Phidget object from which this + * event was called. This object can be cast into a specific type of Phidget object to call specific + * device calls on it. + * + * @return the event caller + */ + public Phidget getSource() { + return source; + } + + /** + * Returns the index of the motor. + * + * @return the index of the motor + */ + public int getIndex() { + return index; + } + + /** + * Return the velocity of the motor. This is reported back from the motor controller as the motor changes speed. + * + * @return the motor velocity + */ + public double getValue() { + return value; + } + + /** + * Returns a string containing information about the event. + * + * @return an informative event string + */ + public String toString() { + return source.toString() + " motor velocity " + index + " changed to " + + value; + } +} diff --git a/Java/com/phidgets/event/MotorVelocityChangeListener.java b/Java/com/phidgets/event/MotorVelocityChangeListener.java new file mode 100644 index 0000000..88cd722 --- /dev/null +++ b/Java/com/phidgets/event/MotorVelocityChangeListener.java @@ -0,0 +1,20 @@ +/* + * Copyright 2006 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +/** + * This interface represents a MotorVelocityChangeEvent. This event originates from the Phidget Motor Controller + * + * @author Phidgets Inc. + */ +public interface MotorVelocityChangeListener +{ + /** + * This method is called with the event data when a new event arrives. + * + * @param ae the event data object containing event data + */ + public void motorVelocityChanged(MotorVelocityChangeEvent ae); +} diff --git a/Java/com/phidgets/event/OutputChangeEvent.java b/Java/com/phidgets/event/OutputChangeEvent.java new file mode 100644 index 0000000..01e6af5 --- /dev/null +++ b/Java/com/phidgets/event/OutputChangeEvent.java @@ -0,0 +1,69 @@ +/* + * Copyright 2006 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +import com.phidgets.Phidget; + +/** + * This class represents the data for a OutputChangeEvent. + * + * @author Phidgets Inc. + */ +public class OutputChangeEvent +{ + Phidget source; + int index; + boolean state; + + /** + * Class constructor. This is called internally by the phidget library when creating this event. + * + * @param source the Phidget object from which this event originated + */ + public OutputChangeEvent(Phidget source, int index, boolean state) { + this.source = source; + this.index = index; + this.state = state; + } + + /** + * Returns the source Phidget of this event. This is a reference to the Phidget object from which this + * event was called. This object can be cast into a specific type of Phidget object to call specific + * device calls on it. + * + * @return the event caller + */ + public Phidget getSource() { + return source; + } + + /** + * Returns the index of the output. + * + * @return the index of the output + */ + public int getIndex() { + return index; + } + + /** + * Returns the state of the output. True indicated that the output is active, False indicated the default inactive state. + * + * @return the state of the output + */ + public boolean getState() { + return state; + } + + /** + * Returns a string containing information about the event. + * + * @return an informative event string + */ + public String toString() { + return source.toString() + " output " + index + " changed to " + + state; + } +} diff --git a/Java/com/phidgets/event/OutputChangeListener.java b/Java/com/phidgets/event/OutputChangeListener.java new file mode 100644 index 0000000..998ffbf --- /dev/null +++ b/Java/com/phidgets/event/OutputChangeListener.java @@ -0,0 +1,21 @@ +/* + * Copyright 2006 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +/** + * This interface represents a OutputChangeEvent. This event originates from the + * Phidget Interface Kit and the Phidget RFID Reader + * + * @author Phidgets Inc. + */ +public interface OutputChangeListener +{ + /** + * This method is called with the event data when a new event arrives. + * + * @param ae the event data object containing event data + */ + public void outputChanged(OutputChangeEvent ae); +} diff --git a/Java/com/phidgets/event/PHChangeEvent.java b/Java/com/phidgets/event/PHChangeEvent.java new file mode 100644 index 0000000..a885132 --- /dev/null +++ b/Java/com/phidgets/event/PHChangeEvent.java @@ -0,0 +1,58 @@ +/* + * Copyright 2006 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +import com.phidgets.Phidget; + +/** + * This class represents the data for a PHChangeEvent. + * + * @author Phidgets Inc. + */ +public class PHChangeEvent +{ + Phidget source; + double value; + + /** + * Class constructor. This is called internally by the phidget library when creating this event. + * + * @param source the Phidget object from which this event originated + */ + public PHChangeEvent(Phidget source, double value) { + this.source = source; + this.value = value; + } + + /** + * Returns the source Phidget of this event. This is a reference to the Phidget object from which this + * event was called. This object can be cast into a specific type of Phidget object to call specific + * device calls on it. + * + * @return the event caller + */ + public Phidget getSource() { + return source; + } + + /** + * Returns the pH. This value can range from 0-14 + * + * @return the pH + */ + public double getValue() { + return value; + } + + /** + * Returns a string containing information about the event. + * + * @return an informative event string + */ + public String toString() { + return source.toString() + " ph changed to " + + value; + } +} diff --git a/Java/com/phidgets/event/PHChangeListener.java b/Java/com/phidgets/event/PHChangeListener.java new file mode 100644 index 0000000..0791631 --- /dev/null +++ b/Java/com/phidgets/event/PHChangeListener.java @@ -0,0 +1,20 @@ +/* + * Copyright 2006 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +/** + * This interface represents a PHChangeEvent. This event originates from the Phidget PH Sensor + * + * @author Phidgets Inc. + */ +public interface PHChangeListener +{ + /** + * This method is called with the event data when a new event arrives. + * + * @param ae the event data object containing event data + */ + public void phChanged(PHChangeEvent ae); +} diff --git a/Java/com/phidgets/event/RawDataEvent.java b/Java/com/phidgets/event/RawDataEvent.java new file mode 100644 index 0000000..ba0c644 --- /dev/null +++ b/Java/com/phidgets/event/RawDataEvent.java @@ -0,0 +1,70 @@ +/* + * Copyright 2006 Phidgets Inc. All rights reserved. + */ + +package com.phidgets.event; + +import com.phidgets.Phidget; + +/** + * This class represents the data for a RawDataEvent. + * + * @author Phidgets Inc. + */ +public class RawDataEvent +{ + Phidget source; + int[] data; + + /** + * Class constructor. This is called internally by the phidget library when creating this event. + * + * @param source the Phidget object from which this event originated + */ + public RawDataEvent(Phidget source, int[] data) + { + this.source = source; + this.data = new int[data.length]; + for(int i=0;i