changeset 126:291c62984ba0

*** empty log message ***
author kono
date Wed, 27 Aug 2008 17:58:09 +0900
parents 9faacdd6c9cb
children b0179c726bd8
files rep/EditorPlus.java rep/REPActionEvent.java rep/REPActionListener.java test/ConnectToSessionManager.java
diffstat 4 files changed, 32 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/rep/EditorPlus.java	Wed Aug 27 17:54:47 2008 +0900
+++ b/rep/EditorPlus.java	Wed Aug 27 17:58:09 2008 +0900
@@ -1,12 +1,12 @@
 package rep;
 
-import java.nio.channels.SocketChannel;
+import rep.channel.REPSocketChannel;
 
-public class EditorPlus {
+public class EditorPlus<P> {
 
 	private int eid;
-	private SocketChannel channel;
-	public EditorPlus(int eid, SocketChannel channel) {
+	private REPSocketChannel<P> channel;
+	public EditorPlus(int eid, REPSocketChannel<P> channel) {
 		this.eid = eid;
 		this.channel = channel;
 	}
@@ -16,7 +16,7 @@
 	public int getEID(){
 		return eid;
 	}
-	public SocketChannel getChannel(){
+	public REPSocketChannel<P> getChannel(){
 		return channel;
 		
 	}
--- a/rep/REPActionEvent.java	Wed Aug 27 17:54:47 2008 +0900
+++ b/rep/REPActionEvent.java	Wed Aug 27 17:58:09 2008 +0900
@@ -1,32 +1,28 @@
 package rep;
 
-import java.nio.channels.SocketChannel;
+import rep.channel.REPSocketChannel;
 
-public class REPActionEvent {
+public class REPActionEvent<P> {
 
-	private SocketChannel editorChannel;
+	private REPSocketChannel<P> editorChannel;
 	private int sid;
 	private int eid;
 
-	public REPActionEvent(EditorPlus plus, SessionPlus plus2) {
-		// TODO Auto-generated constructor stub
+	public REPActionEvent(EditorPlus<P> plus, SessionPlus plus2) {
 		this.editorChannel = plus.getChannel();
 		this.eid = plus.getEID();
 		this.sid = plus2.getSID();
 	}
 
-	public SocketChannel getEditorChannel() {
-		// TODO Auto-generated method stub
+	public REPSocketChannel<P> getEditorChannel() {
 		return editorChannel;
 	}
 
 	public int getSID() {
-		// TODO Auto-generated method stub
 		return sid;
 	}
 
 	public int getEID() {
-		// TODO Auto-generated method stub
 		return eid;
 	}
 
--- a/rep/REPActionListener.java	Wed Aug 27 17:54:47 2008 +0900
+++ b/rep/REPActionListener.java	Wed Aug 27 17:58:09 2008 +0900
@@ -1,8 +1,8 @@
 package rep;
 
-public interface REPActionListener {
+public interface REPActionListener<P> {
 	
-	public void ActionOccured(REPActionEvent event);
+	public void ActionOccured(REPActionEvent<P> event);
 
 	public void undo();
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/ConnectToSessionManager.java	Wed Aug 27 17:58:09 2008 +0900
@@ -0,0 +1,20 @@
+package test;
+
+import rep.REPCommand;
+import rep.net.REPNet;
+
+public class ConnectToSessionManager {
+	private REPNet rnet;
+	
+	public static void main(String[] args){
+		ConnectToSessionManager test = new ConnectToSessionManager();
+		test.sm_join("localhost");
+	}
+
+	public void sm_join(String host){
+		rnet = new REPNet();
+		rnet.sm_connect(host, 8765);
+		rnet.send(REPCommand.SMCMD_SESSION_JOIN);
+	}
+
+}