Class ThincCMsgEventMouseMove

java.lang.Object
  extended by ThincMsg
      extended by ThincCMsg
          extended by ThincCMsgEvent
              extended by ThincCMsgEventMouseMove
All Implemented Interfaces:
java.awt.event.MouseMotionListener, java.util.EventListener

public final class ThincCMsgEventMouseMove
extends ThincCMsgEvent
implements java.awt.event.MouseMotionListener

ThincCMsgEventMouseMove handles the mouse moved event from canvas. it simply implements MouseMotionListener interfaces provided from java, and it is added as a MouseMotionListener on ThincClientCanvas.

Author:
Young Jin Yoon

Field Summary
static int MESSAGE_SIZE
           
static int MESSAGE_TYPE
           
static int TIME_QUANTUM
           
private  short x
           
private  short y
           
 
Fields inherited from class ThincMsg
canvas, handler
 
Constructor Summary
ThincCMsgEventMouseMove(ThincMsgHandler h, ThincClientCanvas c)
          creates ThincCMsgEventMove object.
 
Method Summary
 byte getMsgType()
          getMsgType() returns a type of the message.
 short messageSize()
          messageSize() returns the total messageSize to send.
 void mouseDragged(java.awt.event.MouseEvent moved)
          mouseDragged() get the current position of cursor by using getX() and getY from MouseEvent object. then resize it if required. finally, it invokes process() method.
 void mouseMoved(java.awt.event.MouseEvent moved)
          mouseMoved() get the current position of cursor by using getX() and getY from MouseEvent object. then resize it if required. finally, it invokes process() method. it is exactly as same as mouseDragged() method.
 void process()
          process() is general processing method for each thinc messages.
 void putMessage(java.nio.ByteBuffer b)
          putMessage() simply puts new coordination information for cursor.
 
Methods inherited from class ThincCMsg
getFlag, headerSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MESSAGE_TYPE

public static final int MESSAGE_TYPE
See Also:
Constant Field Values

MESSAGE_SIZE

public static final int MESSAGE_SIZE
See Also:
Constant Field Values

TIME_QUANTUM

public static final int TIME_QUANTUM
See Also:
Constant Field Values

x

private short x

y

private short y
Constructor Detail

ThincCMsgEventMouseMove

public ThincCMsgEventMouseMove(ThincMsgHandler h,
                               ThincClientCanvas c)
creates ThincCMsgEventMove object.

Parameters:
h - ThincMsgHandler to handle the message
c - ThincClientCanvas to get the information
Method Detail

getMsgType

public byte getMsgType()
Description copied from class: ThincCMsg
getMsgType() returns a type of the message.

Specified by:
getMsgType in class ThincCMsg
Returns:
type of message

putMessage

public void putMessage(java.nio.ByteBuffer b)
putMessage() simply puts new coordination information for cursor.

Specified by:
putMessage in class ThincCMsg
Parameters:
b - ByteBuffer object to send
See Also:
ThincCMsg.putMessage()

messageSize

public short messageSize()
Description copied from class: ThincCMsg
messageSize() returns the total messageSize to send.

Specified by:
messageSize in class ThincCMsg
Returns:
total messageSize refered from ThincMsgHandler class

process

public void process()
             throws ThincException
Description copied from class: ThincMsg
process() is general processing method for each thinc messages. Most of client messages, it simply invokes send() methods in ThincMsgHandler object to send the client messages. In server messages, it interacts with ThincClientCanvas in this method.

Specified by:
process in class ThincMsg
Throws:
ThincException

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent moved)
mouseDragged() get the current position of cursor by using getX() and getY from MouseEvent object. then resize it if required. finally, it invokes process() method.

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent moved)
mouseMoved() get the current position of cursor by using getX() and getY from MouseEvent object. then resize it if required. finally, it invokes process() method. it is exactly as same as mouseDragged() method.

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener