changeset 262:a187180e0106

*** empty log message ***
author pin
date Tue, 09 Sep 2008 18:33:48 +0900
parents d557252092e3
children 4768984ea4bc
files rep/translater/Translate.java rep/translater/TranslaterImp1.java rep/xml/SessionXMLDecoder.java test/SessionXMLParser.java test/TestGUI.java test/TestUTF8.java
diffstat 6 files changed, 0 insertions(+), 92 deletions(-) [+]
line wrap: on
line diff
--- a/rep/translater/Translate.java	Tue Sep 09 18:23:08 2008 +0900
+++ b/rep/translater/Translate.java	Tue Sep 09 18:33:48 2008 +0900
@@ -1,6 +1,5 @@
 package rep.translater;
 
-import java.util.Iterator;
 import java.util.List;
 
 import rep.REPCommand;
--- a/rep/translater/TranslaterImp1.java	Tue Sep 09 18:23:08 2008 +0900
+++ b/rep/translater/TranslaterImp1.java	Tue Sep 09 18:33:48 2008 +0900
@@ -4,7 +4,6 @@
 import java.util.Collection;
 import java.util.Comparator;
 import java.util.LinkedList;
-import java.util.List;
 import java.util.Stack;
 import java.util.TreeSet;
 
@@ -21,7 +20,6 @@
 	private int seq;
 	private LinkedList<REPCommand> undoReplaceList;
 	private LinkedList<REPCommand> sentMergedList;
-	private int interruptNumber;
 	private LinkedList<REPCommand> mergeAgainList;
 
 	public TranslaterImp1(int _eid){
--- a/rep/xml/SessionXMLDecoder.java	Tue Sep 09 18:23:08 2008 +0900
+++ b/rep/xml/SessionXMLDecoder.java	Tue Sep 09 18:33:48 2008 +0900
@@ -1,36 +1,21 @@
 package rep.xml;
 
-import java.io.File;
-import java.io.InputStream;
-import java.io.OutputStream;
 import java.io.StringReader;
-import java.io.StringWriter;
-import java.nio.channels.SocketChannel;
-import java.util.LinkedList;
 
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
 
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
-import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 import org.xml.sax.InputSource;
 
 import rep.Editor;
 import rep.Session;
 import rep.SessionList;
-import rep.channel.REPSocketChannel;
 
 public class SessionXMLDecoder {
 
-	private REPSocketChannel channel;
-
 	public SessionXMLDecoder(String string) {
 		decode(string);
 	}
@@ -87,10 +72,6 @@
 				Element elementHost = (Element) nodelistEditorHost.item(0); 
 				String host = elementHost.getFirstChild().getNodeValue();
 				
-				NodeList nodelistEditorPort = elementEditor.getElementsByTagName("port");
-				Element elementPort = (Element) nodelistEditorPort.item(0);
-				String port = elementPort.getFirstChild().getNodeValue();
-				
 				if(elementEditor.getChildNodes().getLength() > 2){
 					NodeList nodelistEditorFile = elementEditor.getElementsByTagName("file");
 					Element elementFile = (Element) nodelistEditorFile.item(0); 
@@ -107,65 +88,11 @@
 					editor.setHost(host);/* editor.setPort(port)*/; editor.setName(null); editor.setEID(Integer.parseInt(eid));
 					if(session != null){
 						session.addEditor(editor);
-						//sessionlist.addSession(session);
 					}
 				}
 			}
 		}
 		return sessionlist;
 	}
-
-	private SessionList createSessionList(Element root){
-		NodeList nodelistSession = root.getChildNodes();
-		SessionList sessionlist = new SessionList();
-		
-		for(int i = 0; i < nodelistSession.getLength(); i++){
-			Node nodeSession = nodelistSession.item(i);
-			NodeList nodelistEditor = nodeSession.getChildNodes();
-			Session session = null;
-			
-			for(int j = 0; j < nodelistEditor.getLength(); j++){
-				Node nodeEditor = nodelistEditor.item(j);
-				NodeList nodelistEditorInfo = nodeEditor.getChildNodes();
-				
-				Editor editor = new Editor();
-				String host = nodelistEditorInfo.item(0).getTextContent();
-				editor.setHost(host);
-				String port = nodelistEditorInfo.item(1).getTextContent();
-//				editor.setPort(port);
-				if(nodelistEditorInfo.getLength() == 3){
-					String name = nodelistEditorInfo.item(2).getTextContent();
-					editor.setName(name);
-					session = new Session(editor);
-				}
-				//System.out.println(editor.toString());
-				session.addEditor(editor);
-				
-			}
-			sessionlist.addSession(session);
-
-		}
-		
-		return sessionlist;
-	}
-
-	/*
-	private void seachNode(NodeList list) {
-		String[] host_port_name = new String[3];
-		for(int i = 0; i < list.getLength(); i++){
-			Element element = null;
-			if(list.item(i) instanceof Element) {
-				element = (Element) list.item(i);
-				System.out.println(element.getNodeName());
-			}else{
-				String string = list.item(i).getNodeValue();
-				sessionListSize += string;
-				host_port_name[i] = string;
-				System.out.println("    " + i + ":" + string);
-			}
-			if(element != null) seachNode(element.getChildNodes());
-		}
-	}
-	*/
 	
 }
--- a/test/SessionXMLParser.java	Tue Sep 09 18:23:08 2008 +0900
+++ b/test/SessionXMLParser.java	Tue Sep 09 18:33:48 2008 +0900
@@ -12,15 +12,8 @@
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.DefaultHandler;
 
-import rep.Editor;
-import rep.Session;
-import rep.SessionList;
-
 public class SessionXMLParser extends DefaultHandler{
 	
-	private SessionList sessionlist;
-	private Editor editor;
-
 	public void startDocument() {
 		System.out.println("Start Document.");
 	}
--- a/test/TestGUI.java	Tue Sep 09 18:23:08 2008 +0900
+++ b/test/TestGUI.java	Tue Sep 09 18:33:48 2008 +0900
@@ -1,12 +1,9 @@
 package test;
 
 import java.awt.Container;
-import java.awt.LayoutManager;
-
 import javax.swing.JFrame;
 
 import rep.ConnectionListener;
-import rep.RPanel;
 import rep.gui.ConnectionPanel;
 
 public class TestGUI {
--- a/test/TestUTF8.java	Tue Sep 09 18:23:08 2008 +0900
+++ b/test/TestUTF8.java	Tue Sep 09 18:33:48 2008 +0900
@@ -2,7 +2,6 @@
 package test;
 
 import java.io.IOException;
-import java.io.UnsupportedEncodingException;
 import java.nio.ByteBuffer;
 import java.nio.CharBuffer;
 import java.nio.charset.CharacterCodingException;
@@ -10,7 +9,6 @@
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CharsetEncoder;
 
-import rep.REP;
 import rep.REPCommand;
 
 public class TestUTF8 {
@@ -64,7 +62,6 @@
 		int lineno = buffer.getInt();
 		int textsiz = buffer.getInt();
 		
-		ByteBuffer textBuffer = ByteBuffer.allocateDirect(textsiz);
 		//textBuffer.rewind();
 		for(int i=0;i<(textsiz/2);i++) {
 			text +=buffer.getChar();
@@ -74,8 +71,6 @@
 	}
 
 	public static void unpackUConv_check(ByteBuffer buffer) {
-		final int HEADER_SIZE = 24;
-		String text = "";
 		int cmd = buffer.getInt();
 		int sid = buffer.getInt();
 		int eid = buffer.getInt();
@@ -101,7 +96,6 @@
 	
 	public static void main(String[] args) throws IOException{
 		String text = "あいうえお、かきくけこ、さしすせそ";
-		REP rep;
 		REPCommand utf8buf = new REPCommand(1, 2, 3, 4, 5, 0, text);
 		REPCommand buf = new REPCommand(1, 2, 3, 4, 5, 0, text);
 	    ByteBuffer buf1,buf2;