// Path: src/main/java/ch/rasc/s4ws/drawboard/DrawMessage.java
// public static class ParseException extends Exception {
// 	private static final long serialVersionUID = -6651972769789842960L;
// 
// 	public ParseException(Throwable root) {
// 		super(root);
// 	}
// 
// 	public ParseException(String message) {
// 		super(message);
// 	}
// }


import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import javax.imageio.ImageIO;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.event.EventListener;
import ch.rasc.s4ws.drawboard.DrawMessage.ParseException;
	@EventListener
	public void handleIncomingData(IncomingMessageEvent incomingMessageEvent) {
		String msg = incomingMessageEvent.getPayload();
		String sessionId = incomingMessageEvent.getSessionId();

		char messageType = msg.charAt(0);
		String messageContent = msg.substring(1);

		if (messageType == '1') {
			try {
				int indexOfChar = messageContent.indexOf('|');
				Long msgId = Long.valueOf(messageContent.substring(0, indexOfChar));
				this.playerMap.put(sessionId, msgId);

				DrawMessage drawMessage = DrawMessage
						.parseFromString(messageContent.substring(indexOfChar + 1));
				drawMessage.draw(this.roomGraphics);
				String drawMessageString = drawMessage.toString();

				for (String playerSessionId : this.playerMap.keySet()) {

					this.publisher.publishEvent(new SendMessageEvent(playerSessionId,
							null, "1" + this.playerMap.get(playerSessionId) + ","
									+ drawMessageString));
				}

			}
			catch (NumberFormatException e) {
				e.printStackTrace();
			}
// Path: src/main/java/ch/rasc/s4ws/drawboard/DrawMessage.java
// public static class ParseException extends Exception {
// 	private static final long serialVersionUID = -6651972769789842960L;
// 
// 	public ParseException(Throwable root) {
// 		super(root);
// 	}
// 
// 	public ParseException(String message) {
// 		super(message);
// 	}
// }


// Path: src/main/java/ch/rasc/s4ws/drawboard/Room.java
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import javax.imageio.ImageIO;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.event.EventListener;
import ch.rasc.s4ws.drawboard.DrawMessage.ParseException;

	@EventListener
	public void handleIncomingData(IncomingMessageEvent incomingMessageEvent) {
		String msg = incomingMessageEvent.getPayload();
		String sessionId = incomingMessageEvent.getSessionId();

		char messageType = msg.charAt(0);
		String messageContent = msg.substring(1);

		if (messageType == '1') {
			try {
				int indexOfChar = messageContent.indexOf('|');
				Long msgId = Long.valueOf(messageContent.substring(0, indexOfChar));
				this.playerMap.put(sessionId, msgId);

				DrawMessage drawMessage = DrawMessage
						.parseFromString(messageContent.substring(indexOfChar + 1));
				drawMessage.draw(this.roomGraphics);
				String drawMessageString = drawMessage.toString();

				for (String playerSessionId : this.playerMap.keySet()) {

					this.publisher.publishEvent(new SendMessageEvent(playerSessionId,
							null, "1" + this.playerMap.get(playerSessionId) + ","
									+ drawMessageString));
				}

			}
			catch (NumberFormatException e) {
				e.printStackTrace();
			}
			catch (ParseException e) {