front_processing/extern/TUIO_JAVA/src/TUIO/TuioCursor.java
changeset 0 6fefd4afe506
child 3 92f19af39024
equal deleted inserted replaced
-1:000000000000 0:6fefd4afe506
       
     1 /*
       
     2 	TUIO Java backend - part of the reacTIVision project
       
     3 	http://reactivision.sourceforge.net/
       
     4 
       
     5 	Copyright (c) 2005-2009 Martin Kaltenbrunner <mkalten@iua.upf.edu>
       
     6 
       
     7     This program is free software; you can redistribute it and/or modify
       
     8     it under the terms of the GNU General Public License as published by
       
     9     the Free Software Foundation; either version 2 of the License, or
       
    10     (at your option) any later version.
       
    11 
       
    12     This program is distributed in the hope that it will be useful,
       
    13     but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    15     GNU General Public License for more details.
       
    16 
       
    17     You should have received a copy of the GNU General Public License
       
    18     along with this program; if not, write to the Free Software
       
    19     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
       
    20 */
       
    21 package TUIO;
       
    22 
       
    23 /**
       
    24  * The TuioCursor class encapsulates /tuio/2Dcur TUIO cursors.
       
    25  *
       
    26  * @author Martin Kaltenbrunner
       
    27  * @version 1.4
       
    28  */ 
       
    29 public class TuioCursor extends TuioContainer {
       
    30 
       
    31 	/**
       
    32 	 * The individual cursor ID number that is assigned to each TuioCursor.
       
    33 	 */ 
       
    34 	protected int cursor_id;
       
    35 	
       
    36 	/**
       
    37 	 * This constructor takes a TuioTime argument and assigns it along  with the provided 
       
    38 	 * Session ID, Cursor ID, X and Y coordinate to the newly created TuioCursor.
       
    39 	 *
       
    40 	 * @param	ttime	the TuioTime to assign
       
    41 	 * @param	si	the Session ID  to assign
       
    42 	 * @param	ci	the Cursor ID  to assign
       
    43 	 * @param	xp	the X coordinate to assign
       
    44 	 * @param	yp	the Y coordinate to assign
       
    45 	 */
       
    46 	public TuioCursor (TuioTime ttime, long si, int ci, float xp, float yp) {
       
    47 		super(ttime, si,xp,yp);
       
    48 		this.cursor_id = ci;
       
    49 	}
       
    50 	
       
    51 	/**
       
    52 	 * This constructor takes the provided Session ID, Cursor ID, X and Y coordinate 
       
    53 	 * and assigs these values to the newly created TuioCursor.
       
    54 	 *
       
    55 	 * @param	si	the Session ID  to assign
       
    56 	 * @param	ci	the Cursor ID  to assign
       
    57 	 * @param	xp	the X coordinate to assign
       
    58 	 * @param	yp	the Y coordinate to assign
       
    59 	 */
       
    60 	public TuioCursor (long si, int ci, float xp, float yp) {
       
    61 		super(si,xp,yp);
       
    62 		this.cursor_id = ci;
       
    63 	}
       
    64 
       
    65 	/**
       
    66 	 * This constructor takes the atttibutes of the provided TuioCursor 
       
    67 	 * and assigs these values to the newly created TuioCursor.
       
    68 	 *
       
    69 	 * @param	tcur	the TuioCursor to assign
       
    70 	 */
       
    71 	public TuioCursor (TuioCursor tcur) {
       
    72 		super(tcur);
       
    73 		this.cursor_id = tcur.getCursorID();
       
    74 	}
       
    75 	
       
    76 	/**
       
    77 	 * Returns the Cursor ID of this TuioCursor.
       
    78 	 * @return	the Cursor ID of this TuioCursor
       
    79 	 */
       
    80 	public int getCursorID() {
       
    81 		return cursor_id;
       
    82 	}
       
    83 	
       
    84 }