Mercurial > hg > Database > Christie
changeset 261:de4962913f24
rm unnecessary file and tweak
author | ichikitakahiro <e165713@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 28 Jan 2020 20:17:10 +0900 |
parents | 9b0ad65ae5c0 |
children | ed1baf1fb48b |
files | src/main/java/christie/remoteTextEditor/CheckCommand.java src/main/java/christie/remoteTextEditor/DecrialiseInsertCommand.java src/main/java/christie/remoteTextEditor/Insert.java src/main/java/christie/remoteTextEditor/SerializeInsert.java src/main/java/christie/remoteTextEditor/receiveCommand.java |
diffstat | 5 files changed, 13 insertions(+), 61 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/christie/remoteTextEditor/CheckCommand.java Sat Jan 25 18:55:14 2020 +0900 +++ b/src/main/java/christie/remoteTextEditor/CheckCommand.java Tue Jan 28 20:17:10 2020 +0900 @@ -16,23 +16,18 @@ @Override protected void run(CodeGearManager cgm) { - int sendOffset; - String sendString; if(myEditor.checkPermission() == true) { + int sendOffset; + String sendString; sendOffset = myEditor.returnOffset(); sendString = myEditor.returnString(); Insert ins = new Insert(sendOffset, sendString); -// String cmd = "file"; myEditor.changeToFalseSendPermmision(); -// SerializeInsert serializeInsert = new SerializeInsert(ins, cmd); - put("partner", "cmd", ins); + cgm.getDGM("partner").put("cmd" , ins); System.out.println(topoDG.getNodeName() + " :catch,offset = " + myEditor.returnOffset()); -// insert,deleteなどの命令を飛ばす。その中にoffset,stringが含まれる。コマンドパターン。 // get,setの単語は紛らわしいのでよくない。 - cgm.setup(new CheckCommand()); - }else{ - cgm.setup(new CheckCommand()); } + cgm.setup(new CheckCommand()); } }
--- a/src/main/java/christie/remoteTextEditor/DecrialiseInsertCommand.java Sat Jan 25 18:55:14 2020 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -package christie.remoteTextEditor; - -import java.io.FileInputStream; -import java.io.IOException; -import java.io.ObjectInputStream; - -public class DecrialiseInsertCommand { - public static Insert DecrialiseInsertCommand(String fileName) throws IOException, ClassNotFoundException { - FileInputStream fileInputStream = new FileInputStream(fileName); - ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream); - - - Insert ins = (Insert) objectInputStream.readObject(); - - objectInputStream.close(); - - return ins; - - } -}
--- a/src/main/java/christie/remoteTextEditor/Insert.java Sat Jan 25 18:55:14 2020 +0900 +++ b/src/main/java/christie/remoteTextEditor/Insert.java Tue Jan 28 20:17:10 2020 +0900 @@ -4,22 +4,17 @@ import org.msgpack.annotation.Message; - @Message -public class Insert { +class Insert { + public String string; + public int fastOffset; +// int endOffset; + public Insert () {} - String string; - - int fastOffset; -// int endOffset; - - public Insert(int fastOffset, String string) { + public Insert (int fastOffset, String string) { this.string = string; this.fastOffset = fastOffset; } -} -// public void execute(NewTextEditor myEditor) { -// System.out.println("used insert"); -// } +}
--- a/src/main/java/christie/remoteTextEditor/SerializeInsert.java Sat Jan 25 18:55:14 2020 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -package christie.remoteTextEditor; - -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.ObjectOutputStream; -import christie.remoteTextEditor.Insert; - -public class SerializeInsert { - public static void SerializeInsert(Insert ins, String fileName) throws IOException { - FileOutputStream fileOutputStream = new FileOutputStream(fileName); - ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream); - - objectOutputStream.writeObject(ins); - objectOutputStream.flush(); - objectOutputStream.close(); - - } -}
--- a/src/main/java/christie/remoteTextEditor/receiveCommand.java Sat Jan 25 18:55:14 2020 +0900 +++ b/src/main/java/christie/remoteTextEditor/receiveCommand.java Tue Jan 28 20:17:10 2020 +0900 @@ -5,10 +5,11 @@ import christie.codegear.CodeGear; import christie.codegear.CodeGearManager; import christie.textEditor.NewTextEditor; +import christie.topology.Message; public class receiveCommand extends CodeGear { @Take - Class cmd; + Insert cmd; @Peek NewTextEditor myEditor;