Commit 89539d3d authored by Eric Tobias's avatar Eric Tobias

Major code review to prepare for merging intern's dev branch into regular dev branch.

~ Changed preference files to use the correct null check in Eclipse.
+ Removed code from the neverfear namespace as it was integrated rather than use a library. This required the removal of some tests. These should be reintegrated when the project was moved to maven and the library containing that namespace can be integrated correctly.
~ Changed some naming in the properties file.
+ Corrected some errors while doing code review.
+ Refactored some of the adapter code related to drops, lift, and updates to centralized code and reduce redundancy.
~ Preparing for a review of the drawing mechanism. Hence, changed some names in the Corona class and it's Image child.
parent e73bfd50
......@@ -9,11 +9,11 @@ org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=dbc.annotation.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=dbc.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nullable=dbc.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
......
......@@ -20,8 +20,8 @@ centred = false
# Properties for the calibration of the object manager
#The value below is best left at or above 1024
cursorIDRemappingConstant = 1024
cursor.id.remapping.constant = 1024
# Add the property "tableAdapter" with the adapter to load
# Syntax is : tableAdapter = packageName.ClassName
# i.e : tableAdapter = lu.list.itis.dkd.tui.adapter.TuioAdapter
\ No newline at end of file
# The low-level computer vision (or similar) adapter to load.
# Syntax is : adapter.class = packageName.ClassName
adapter.class = lu.list.itis.dkd.tui.adapter.TuioAdapter
\ No newline at end of file
......@@ -105,33 +105,28 @@ public abstract class TangibleApplication {
interfaceManager = new TangibleInterfaceManager(this, logger, properties);
try {
adapter = (TuiAdapter) Class.forName(properties.getProperty("tableAdapter")).getConstructor(TangibleInterfaceManager.class).newInstance(interfaceManager); //$NON-NLS-1$
adapter = (TuiAdapter) Class.forName(properties.getProperty("adapter.class")).getConstructor(TangibleInterfaceManager.class).newInstance(interfaceManager); //$NON-NLS-1$
} catch (InstantiationException e) {
logger.log(Level.SEVERE, "Cannot instantiate adapter. You try to instantiate an abstract class or an interface!"); //$NON-NLS-1$s
logger.log(Level.SEVERE, "Cannot instantiate adapter. The adapter must be a concrete class, not an interface or abstract class and it must directly inherit from TuiAdapter! Check your properties file and set adapter.class accordingly."); //$NON-NLS-1$s
System.exit(42);
} catch (IllegalAccessException e) {
logger.log(Level.SEVERE, "The currently executing method does not have access to the definition of the constructor."); //$NON-NLS-1$
System.exit(42);
} catch (IllegalArgumentException e) {
logger.log(Level.SEVERE, "A wrong argument has been passed to the adapter."); //$NON-NLS-1$
logger.log(Level.SEVERE, "A erroneous argument has been passed to the adapter."); //$NON-NLS-1$
System.exit(42);
} catch (InvocationTargetException e) {
logger.log(Level.SEVERE, "An exception has been thrown in the constructor of the adapter"); //$NON-NLS-1$
logger.log(Level.SEVERE, "An exception has been thrown in the constructor of the adapter."); //$NON-NLS-1$
System.exit(42);
} catch (NoSuchMethodException e) {
logger.log(Level.SEVERE, "The called method was not found"); //$NON-NLS-1$
logger.log(Level.SEVERE, "The called method was not found. Make sure your implementation supports the method."); //$NON-NLS-1$
System.exit(42);
} catch (SecurityException e) {
logger.log(Level.SEVERE, "Security violation"); //$NON-NLS-1$
logger.log(Level.SEVERE, "Security violation."); //$NON-NLS-1$
System.exit(42);
} catch (ClassNotFoundException e) {
logger.log(Level.SEVERE, "The class " + properties.getProperty("tableAdapter") + " was not found. Check the spelling !"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
logger.log(Level.SEVERE, "The class " + properties.getProperty("adapter.class") + " was not found. Check your spelling!"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
System.exit(42);
}
......
......@@ -40,8 +40,9 @@ import java.util.logging.Logger;
* locks to synchronise all calls to manage objects.
*
* @author Eric TOBIAS [eric.tobias@list.lu]
* @author Nicolas Gilmard
* @since 1.0
* @version 1.0.2
* @version 2.0.2
*/
@NonNullByDefault
public abstract class TangibleObjectManager {
......@@ -85,7 +86,7 @@ public abstract class TangibleObjectManager {
* widgets to use by implementing this method. <b>By default, no widgets are instantiated</b>.<br>
* <br>
*
* When adding Widgets to map to cursors, refer to {@link IDMapper#remapCursorID(int)}. Cursor
* When adding Widgets to map to cursors, refer to {@link IDMapper#remapCursorId(int)}. Cursor
* IDs are remapped as not to clash with any symbol ID assigned by reacTIVision. A good practice
* is to reason with regular cursor IDs and add them to the map by calling for example:
* <code>objectList.put(remapCursorID(0), W extends BaseWidget);</code> to the first cursor that
......@@ -172,7 +173,6 @@ public abstract class TangibleObjectManager {
cursorList.get(tangibleObject.getObjectId()).actionDrop(tangibleObject);
ensureConsistency();
break;
case OBJECT:
......@@ -184,11 +184,12 @@ public abstract class TangibleObjectManager {
break;
case BLOB:
// TODO This line add a small shadow with each blob. This behaviour might not be
// desired but needs to be investigated. Opening issue #27.
blobList.putIfAbsent(tangibleObject.getObjectId(), new BaseWidgetBuilder().withCorona(tangibleObject.getObjectId(), new ShadowBuilder(new Point()).withShape(ShapeFactory.buildCircle(5)).build()).build());
blobList.get(tangibleObject.getObjectId()).actionDrop(tangibleObject);
ensureConsistency();
break;
default:
logger.log(Level.WARNING, "The recognised symbol was not assigned to a widget!"); //$NON-NLS-1$
break;
......@@ -224,6 +225,7 @@ public abstract class TangibleObjectManager {
if (blobList.containsKey(tangibleObject.getObjectId())) {
blobList.remove(tangibleObject.getObjectId()).actionLift(tangibleObject);
}
break;
default:
logger.log(Level.WARNING, "The recognised symbol was not assigned to a widget!"); //$NON-NLS-1$
break;
......@@ -261,6 +263,7 @@ public abstract class TangibleObjectManager {
} else {
logger.log(Level.WARNING, "The blob could not be recognised!"); //$NON-NLS-1$
}
break;
default:
logger.log(Level.WARNING, "The recognised symbol was not assigned to a widget!"); //$NON-NLS-1$
break;
......
......@@ -17,6 +17,7 @@ import lu.list.itis.dkd.tui.TangibleApplication;
import lu.list.itis.dkd.tui.utility.Point;
import lu.tudor.ssi.kiss.dbc.annotation.NonNullByDefault;
import lu.tudor.ssi.kiss.dbc.annotation.Nullable;
import java.util.ArrayList;
import java.util.logging.Level;
......@@ -79,7 +80,10 @@ public class TangibleObject {
/** The rotation acceleration value. */
protected float rotationAccel;
/** A Vector of {@link Point} containing all the previous positions of the tangible object. */
/**
* An {@link ArrayList} of {@link Point} containing all the previous positions of the tangible
* object.
*/
protected ArrayList<Point> path;
/** Reflects the current state of the {@link TangibleObject} */
......@@ -94,6 +98,7 @@ public class TangibleObject {
this.identifier = identifier;
}
@Nullable
static State getState(int id) {
switch (id) {
case 0:
......@@ -110,10 +115,8 @@ public class TangibleObject {
return State.ROTATING;
default:
logger.log(Level.WARNING, "Unrecognised state identifier!"); //$NON-NLS-1$
break;
return null;
}
return null;
}
/**
......@@ -137,9 +140,10 @@ public class TangibleObject {
/**
* Default constructor
* Default constructor.
*
* @param tangibleObjectBuilder
* The builder holding the values from which to instantiate this object.
*
*/
public TangibleObject(TangibleObjectBuilder tangibleObjectBuilder) {
......@@ -474,4 +478,4 @@ public class TangibleObject {
public void setArea(float area) {
this.area = area;
}
}
}
\ No newline at end of file
......@@ -22,15 +22,13 @@ import lu.tudor.ssi.kiss.dbc.annotation.NonNullByDefault;
import java.util.ArrayList;
/**
* REFACTORED Method names should be refactored due to them not being additions as suggested. Use
* the "with" naming style such as "withMotionAcceleration".
*
* {@link TangibleObjectBuilder} class used to construct a {@link TangibleObject} by providing
* methods to set all parameters.
*
* @author Nicolas GILMARD [nicolas.gilmard@list.lu]
* @since 2.0
* @version 2.0.1
* @version 2.0.2
*/
@NonNullByDefault
@SuppressWarnings("hiding")
......@@ -87,8 +85,9 @@ public class TangibleObjectBuilder {
* Constructor setting the required fields of a tangibleObject
*
* @param objectId
* The id of the tangibleObject
* The id of the tangible object.
* @param type
* The {@link Type} of the tangible object.
* @param x
* The X coordinate
* @param y
......@@ -271,8 +270,9 @@ public class TangibleObjectBuilder {
* Method for building a {@link TangibleObject} with the values set by the builder.
*
* @return An instance of {@link TangibleObject} as by the values issued to the builder.
* @pre objectId and path != null
* @pre path contains at least one point
* @pre objectId != <code>null</code>
* @pre path != <code>null</code>
* @pre path != empty
*/
public TangibleObject build() {
return new TangibleObject(this);
......
......@@ -20,15 +20,18 @@ import lu.list.itis.dkd.tui.logging.EventLogger;
import lu.tudor.ssi.kiss.dbc.annotation.NonNullByDefault;
import java.util.Collection;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JComponent;
/**
* Abstract class managing interaction with a tangible table using a typical protocol.
*
* @author Nicolas GILMARD [nicolas.gilmard@list.lu]
* @author Nicolas GILMARD
* @author Eric TOBIAS [eric.tobias@list.lu]
* @since 2.0
* @version 2.0.1
* @version 2.0.2
*/
@NonNullByDefault
public abstract class TuiAdapter {
......@@ -101,7 +104,7 @@ public abstract class TuiAdapter {
* Method returning the {@link TangibleObject} (cursor) with the given id
*
* @param id
* of the cursor to get
* The ID of the cursor to get.
*
* @return The {@link TangibleObject} with objectId = id.
*/
......@@ -111,7 +114,7 @@ public abstract class TuiAdapter {
* Method returning the {@link TangibleObject} (object) with the given id
*
* @param id
* of the object to get
* The ID of the object to get.
*
* @return The {@link TangibleObject} with objectId = id.
*/
......@@ -121,46 +124,35 @@ public abstract class TuiAdapter {
* Method returning the {@link TangibleObject} (blob) with the given id
*
* @param id
* of the blob to get
* The ID of the blob to get.
*
* @return The {@link TangibleObject} with objectId = id.
*/
public abstract TangibleObject getBlob(long id);
/**
* create a string representation of a tangible object to the logging mechanism
*
* @param tangibleObject
* is the concerned object.
* @param operation
* is the move done.
*/
public synchronized void addObjInfo(TangibleObject tangibleObject, String operation) {
EventLogger.getInstance().addObjInfo(tangibleObject.getObjectId(), tangibleObject.getX(), tangibleObject.getY(), tangibleObject.getAngle(), operation, tangibleObject.getTotalMilliseconds());
}
/**
* create a string representation of a tangible object to the logging mechanism
*
* @param tangibleObject
* is the concerned cursor.
* @param operation
* is the move done.
*/
public synchronized void addCurInfo(TangibleObject tangibleObject, String operation) {
EventLogger.getInstance().addCurInfo(tangibleObject.getObjectId(), tangibleObject.getX(), tangibleObject.getY(), operation, tangibleObject.getTotalMilliseconds());
}
/**
* create a string representation of a tangible object to the logging mechanism
* Method called to log all available information of a {@link TangibleObject}.
*
* @param tangibleObject
* is the concerned blob.
* The cursor for which to log the info for.
* @param operation
* is the move done.
* The operation to register.
*/
public synchronized void addBlobInfo(TangibleObject tangibleObject, String operation) {
EventLogger.getInstance().addObjInfo(tangibleObject.getObjectId(), tangibleObject.getX(), tangibleObject.getY(), tangibleObject.getAngle(), operation, tangibleObject.getTotalMilliseconds());
public synchronized void logInfo(TangibleObject tangibleObject, String operation) {
switch (tangibleObject.getType()) {
case BLOB:
EventLogger.getInstance().addObjInfo(tangibleObject.getObjectId(), tangibleObject.getX(), tangibleObject.getY(), tangibleObject.getAngle(), operation, tangibleObject.getTotalMilliseconds());
break;
case CURSOR:
EventLogger.getInstance().addCurInfo(tangibleObject.getObjectId(), tangibleObject.getX(), tangibleObject.getY(), operation, tangibleObject.getTotalMilliseconds());
break;
case OBJECT:
EventLogger.getInstance().addObjInfo(tangibleObject.getObjectId(), tangibleObject.getX(), tangibleObject.getY(), tangibleObject.getAngle(), operation, tangibleObject.getTotalMilliseconds());
break;
default:
Logger.getLogger(TuiAdapter.class.getSimpleName()).log(Level.WARNING, "A logging attempt was made for a tangible object that did not conform to any prescribed type. The type was:" + tangibleObject.getType()); //$NON-NLS-1$
break;
}
}
}
}
\ No newline at end of file
......@@ -67,7 +67,7 @@ public abstract class Content implements Comparable<Content> {
/**
* Getter method for the draw priority. The method will have to do the computation to account
* for the offset and the current position of the widget influencing the content if any.
* for the initialTranslation and the current position of the widget influencing the content if any.
*
* @return The draw priority of this content instance.
*/
......
......@@ -48,7 +48,7 @@ public class BluetoothClient extends ClientAdapter {
* Default constructor which assign uuidService.
*
* @param uuidService
* is the uuid of the service to connect to.
* The UUID of the service to connect to.
*/
public BluetoothClient(String uuidService) {
this.uuidService = uuidService;
......
......@@ -18,13 +18,15 @@ import lu.tudor.ssi.kiss.dbc.annotation.NonNullByDefault;
import com.google.common.base.Preconditions;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.net.UnknownHostException;
/**
* Adapter class managing a communication over TCP using {@link Socket}.
*
* @author Nicolas GILMARD [nicolas.gilmard@list.lu]
* @author Nicolas GILMARD
* @since 2.0
* @version 2.0.41
*/
......@@ -65,7 +67,10 @@ public class TcpClient extends ClientAdapter {
* {@inheritDoc}
*
* @throws IOException
* Thrown if an I/O error occurs when creating the socket or if an I/O error occurs when
* creating the input/output stream or if the socket is not connected.
* @throws UnknownHostException
* Thrown if the IP address of the host could not be determined.
*/
@Override
public void connect() throws UnknownHostException, IOException {
......@@ -78,6 +83,8 @@ public class TcpClient extends ClientAdapter {
* {@inheritDoc}
*
* @throws IOException
* See {@link OutputStream#close()}, {@link InputStream#close}, and
* {@link Socket#close()}.
*/
@Override
public void disconnect() throws IOException {
......@@ -91,4 +98,4 @@ public class TcpClient extends ClientAdapter {
client.close();
}
}
}
}
\ No newline at end of file
......@@ -60,17 +60,20 @@ public class XbeeAdapter extends ClientAdapter {
* Default constructor
*
* @param port
* != null
* @param baudRate
* == 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200 or 230400
*
* @pre port != null
* @pre baudRate == (1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200 or 230400)
*/
public XbeeAdapter(String port, int baudRate) {
Preconditions.checkState(baudRate == 1200 || baudRate == 2400 || baudRate == 4800 || baudRate == 9600 || baudRate == 19200 || baudRate == 38400 || baudRate == 57600 || baudRate == 115200 || baudRate == 230400, "The baud rate must be equals to 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200 or 230400"); //$NON-NLS-1$
// TODO Add precondition for port number.
this.port = port;
this.baudRate = baudRate;
portId = null;
Enumeration portEnum = CommPortIdentifier.getPortIdentifiers();
Enumeration<?> portEnum = CommPortIdentifier.getPortIdentifiers();
// find an instance of serial port as set in port field.
while (portEnum.hasMoreElements()) {
......
......@@ -96,9 +96,9 @@ public class Calibration {
/**
* Method for transforming the coordinate mapping from the camera in the range [0;1] to the
* screen mapping in pixels. This method multiplies the ratio by the camera's width (also a
* ratio), adds the camera offset and transforms the ratio into screen coordinates by
* ratio), adds the camera initialTranslation and transforms the ratio into screen coordinates by
* multiplying by the screen's width. <br>
* <b>Note:</b> The method accounts for camera offset.
* <b>Note:</b> The method accounts for camera initialTranslation.
*
* @param x
* The X coordinate to remap.
......@@ -112,9 +112,9 @@ public class Calibration {
/**
* Method for transforming the coordinate mapping from the camera in the range [0;1] to the
* screen mapping in pixels. This method multiplies the ratio by the camera's width (also a
* ratio), adds the camera offset and transforms the ratio into screen coordinates by
* ratio), adds the camera initialTranslation and transforms the ratio into screen coordinates by
* multiplying by the screen's width. <br>
* <b>Note:</b> The method accounts for camera offset.
* <b>Note:</b> The method accounts for camera initialTranslation.
*
* @param x
* The X coordinate to remap.
......@@ -129,9 +129,9 @@ public class Calibration {
/**
* Method for transforming the coordinate mapping from the camera in the range [0;1] to the
* screen mapping in pixels. This method multiplies the ratio by the camera's height (also a
* ratio), adds the camera offset and transforms the ratio into screen coordinates by
* ratio), adds the camera initialTranslation and transforms the ratio into screen coordinates by
* multiplying by the screen's height. <br>
* <b>Note:</b> The method accounts for camera offset.
* <b>Note:</b> The method accounts for camera initialTranslation.
*
* @param y
* The Y coordinate to remap.
......@@ -145,9 +145,9 @@ public class Calibration {
/**
* Method for transforming the coordinate mapping from the camera in the range [0;1] to the
* screen mapping in pixels. This method multiplies the ratio by the camera's height (also a
* ratio), adds the camera offset and transforms the ratio into screen coordinates by
* ratio), adds the camera initialTranslation and transforms the ratio into screen coordinates by
* multiplying by the screen's height.<br>
* <b>Note:</b> The method accounts for camera offset.
* <b>Note:</b> The method accounts for camera initialTranslation.
*
* @param y
* The Y coordinate to remap.
......@@ -160,9 +160,9 @@ public class Calibration {
/**
* Method for transforming the coordinate mapping from the screen in pixels to the camera
* mapping coordinates range [0;1]. The method transforms the pixel coordinate into a ratio by
* dividing by the screen width before subtracting the camera offset. The final range is
* dividing by the screen width before subtracting the camera initialTranslation. The final range is
* computed by dividing by the camera width.<br>
* <b>Note:</b> The method accounts for camera offset.
* <b>Note:</b> The method accounts for camera initialTranslation.
*
* @param x
* The X coordinate to remap.
......@@ -176,9 +176,9 @@ public class Calibration {
/**
* Method for transforming the coordinate mapping from the screen in pixels to the camera
* mapping coordinates range [0;1]. The method transforms the pixel coordinate into a ratio by
* dividing by the screen height before subtracting the camera offset. The final range is
* dividing by the screen height before subtracting the camera initialTranslation. The final range is
* computed by dividing by the camera height.<br>
* <b>Note:</b> The method accounts for camera offset.
* <b>Note:</b> The method accounts for camera initialTranslation.
*
* @param y
* The Y coordinate to remap.
......@@ -192,7 +192,7 @@ public class Calibration {
/**
* Method for transforming the coordinate mapping from the camera in the range [0;1] to the
* table mapping in millimetres. The method multiplies by the camera width before adding the
* camera offset. Then, the intermediate result is multiplied by the table's width.<br>
* camera initialTranslation. Then, the intermediate result is multiplied by the table's width.<br>
* <b>Note:</b> The measures in table coordinates a equivalent to concrete measures.
*
* @param x
......@@ -207,7 +207,7 @@ public class Calibration {
/**
* Method for transforming the coordinate mapping from the table in millimetres to the range
* [0;1] range of the camera mapping as a ratio. The method divides by the table height before
* subtracting the camera offset. Then, the intermediate result is divided by the camera's
* subtracting the camera initialTranslation. Then, the intermediate result is divided by the camera's
* height.<br>
* <b>Note:</b> The measures in table coordinates a equivalent to concrete measures.
*
......@@ -223,7 +223,7 @@ public class Calibration {
/**
* Method for transforming the coordinate mapping from the table in millimetres to the range
* [0;1] range of the camera mapping as a ratio. The method divides by the table width before
* subtracting the camera offset. Then, the intermediate result is divided by the camera's
* subtracting the camera initialTranslation. Then, the intermediate result is divided by the camera's
* width.<br>
* <b>Note:</b> The measures in table coordinates a equivalent to concrete measures.
*
......@@ -239,7 +239,7 @@ public class Calibration {
/**
* Method for transforming the coordinate mapping from the camera in the range [0;1] to the
* table mapping in millimetres. The method multiplies by the camera width before adding the
* camera offset. Then, the intermediate result is multiplied by the table's width.<br>
* camera initialTranslation. Then, the intermediate result is multiplied by the table's width.<br>
* <b>Note:</b> The measures in table coordinates a equivalent to concrete measures.
*
* @param y
......@@ -256,7 +256,7 @@ public class Calibration {
* dimensions, to the screen mapping in pixels depending on its resolution. The method will
* multiply the coordinate by the ratio of the screen's width to the table's width.<br>
* <b>Note:</b> The measures in table coordinates a equivalent to concrete measures.<br>
* <b>Note:</b> The method accounts for camera offset.
* <b>Note:</b> The method accounts for camera initialTranslation.
*
* @param x
* The X coordinate to remap.
......@@ -271,7 +271,7 @@ public class Calibration {
* dimensions, to the screen mapping in pixels depending on its resolution. The method will
* multiply the coordinate by the ratio of the screen's height to the table's height.<br>
* <b>Note:</b> The measures in table coordinates a equivalent to concrete measures.<br>
* <b>Note:</b> The method accounts for camera offset.
* <b>Note:</b> The method accounts for camera initialTranslation.
*
* @param y
* The Y coordinate to remap.
......@@ -286,7 +286,7 @@ public class Calibration {
* dimensions, to the screen mapping in pixels depending on its resolution. The method will
* multiply the coordinate by the ratio of the screen's width to the table's width.<br>
* <b>Note:</b> The measures in table coordinates a equivalent to concrete measures.<br>
* <b>Note:</b> The method accounts for camera offset.
* <b>Note:</b> The method accounts for camera initialTranslation.
*
* @param x
* The X coordinate to remap.
......@@ -302,7 +302,7 @@ public class Calibration {
* dimensions, to the screen mapping in pixels depending on its resolution. The method will
* multiply the coordinate by the ratio of the screen's height to the table's height.<br>
* <b>Note:</b> The measures in table coordinates a equivalent to concrete measures.<br>
* <b>Note:</b> The method accounts for camera offset.
* <b>Note:</b> The method accounts for camera initialTranslation.
*
* @param y
* The Y coordinate to remap.
......@@ -319,7 +319,7 @@ public class Calibration {
* resolution, to the table mapping in millimetres depending on its dimensions. The method will
* multiply the input coordinate by the ratio of the table's width to the screen's width.<br>
* <b>Note:</b> The measures in table coordinates a equivalent to concrete measures.<br>
* <b>Note:</b> The method accounts for camera offset.
* <b>Note:</b> The method accounts for camera initialTranslation.
*
* @param x
* The X coordinate to remap.
......@@ -335,7 +335,7 @@ public class Calibration {
* resolution, to the table mapping in millimetres depending on its dimensions. The method will
* multiply the input coordinate by the ratio of the table's height to the screen's height.<br>
* <b>Note:</b> The measures in table coordinates a equivalent to concrete measures.<br>
* <b>Note:</b> The method accounts for camera offset.
* <b>Note:</b> The method accounts for camera initialTranslation.
*
* @param y
* The Y coordinate to remap.
......
......@@ -25,7 +25,7 @@ import java.util.Properties;
*
* @author Eric TOBIAS [eric.tobias@list.lu]
* @since 1.0
* @version 1.0.2
* @version 2.0.1
*/
@NonNullByDefault
public class IDMapper {
......@@ -47,15 +47,15 @@ public class IDMapper {
* chosen to remap their ID. The remapping adds a constant to each ID as defined by the
* properties file.
*
* @param cursorID
* @param cursorId
* The cursor ID to remap.
* @return The remapped cursor ID.
* @pre cursorID >= 0
* @post result > cursorID
*/
public static int remapCursorID(int cursorID) {
Preconditions.checkArgument(cursorID >= 0, "The provided ID must be positive!"); //$NON-NLS-1$
return cursorID + Integer.parseInt(properties.getProperty("cursorIDRemappingConstant", "1024")); //$NON-NLS-1$ //$NON-NLS-2$
public static int remapCursorId(int cursorId) {