Commit 256f362c authored by Nico Mack's avatar Nico Mack

Add tapInterval calibration property (required by TouchManager)

parent dfd5c10d
......@@ -23,6 +23,7 @@
<rectangleHeight>20</rectangleHeight>
<movementThreshold>0.01</movementThreshold>
<rotationThreshold>0.2</rotationThreshold>
<tapInterval>100</tapInterval>
</table>
<window>
<x>0</x>
......
......@@ -16,6 +16,7 @@
*/
package lu.list.itis.dkd.tui.feature.touch;
import lu.list.itis.dkd.tui.utility.Calibration;
import lu.list.itis.dkd.tui.utility.Point;
import lu.list.itis.dkd.tui.utility.ScreenCoordinates;
import lu.list.itis.dkd.tui.utility.StringUtils;
......@@ -60,7 +61,7 @@ public class TouchManager implements ActionListener {
// * Constants *
// ***************************************************************************
private static final int TAP_INTERVAL = 250;
// private static final int TAP_INTERVAL = 250;
@SuppressWarnings("nls")
private static final String[] STATE_NAMES = {"RLSD", "TAPD", "TCHD", "DRAG", "LTCH"};
......@@ -308,7 +309,7 @@ public class TouchManager implements ActionListener {
if (touched) {
touch.setPosition(event.getPosition());
Timer tapTimer = new Timer(TAP_INTERVAL, this);
Timer tapTimer = new Timer(Calibration.getTapInterval(), this);
tapTimer.setActionCommand(Integer.toString(touchId));
tapTimer.setRepeats(false);
tapTimer.start();
......
......@@ -104,6 +104,7 @@ public class Calibration {
private static float movementThreshold = 0.1f;
private static float rotationThreshold = 0.2f;
private static int tapInterval = 250;
/**
* Method for transforming the coordinate mapping from the camera in the range [0;1] to the screen
......@@ -401,6 +402,8 @@ public class Calibration {
cornerRadius = Integer.parseInt(tableNode.getChildText("cornerRadius")); //$NON-NLS-1$
movementThreshold = Float.parseFloat(tableNode.getChildText("movementThreshold")); //$NON-NLS-1$
rotationThreshold = Float.parseFloat(tableNode.getChildText("rotationThreshold")); //$NON-NLS-1$
tapInterval = Integer.parseInt(tableNode.getChildText("tapInterval")); //$NON-NLS-1$
Element windowNode = rootNode.getChild("window"); //$NON-NLS-1$
......@@ -649,6 +652,10 @@ public class Calibration {
return rotationThreshold;
}
public static int getTapInterval() {
return tapInterval;
}
/**
* Simple getter method for topLeftXCoordinate.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment