PageRenderTime 7ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/src/main/java/com/wet/wired/jrc/connector/ControlPacket.java

http://java-remote-control.googlecode.com/
Java | 24 lines | 17 code | 5 blank | 2 comment | 0 complexity | 227ccc87959868e874b1087d509c708d MD5 | raw file
 1package com.wet.wired.jrc.connector;
 2
 3public class ControlPacket {
 4	//Control packets are sent in the format
 5	// COMMAND COMMAND_SPACE (ARG_0 COMMAND_SPACE ARG_1 etc) COMMAND_END
 6	
 7	public static final String COMMAND_SPACE = "\t";
 8	public static final String COMMAND_END = "\n";
 9	public static final String COMMAND_FRAME_SIZE = "frameSize";
10	public static final String COMMAND_PACKET_SENT = "packetSent";
11	public static final String COMMAND_KEY_PRESSED = "keyPressed";
12	public static final String COMMAND_MOUSE_POSITION = "keyPressed";
13	
14	private ControlPacket() {}
15	
16	public static String getFrameSizePacket(int width,int height) {
17		String command = COMMAND_FRAME_SIZE+COMMAND_SPACE;
18		command+=width+COMMAND_SPACE;
19		command+=height+COMMAND_SPACE;
20		command+=COMMAND_END;
21		
22		return command;
23	}
24}