Mercurial > hg > Database > Christie
changeset 231:b312656c7ec0
Backout changeset 401981622a1e4ec473ebb6d85815ef7fe79bc522
author | ichikitakahiro <e165713@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 21 Jan 2020 19:44:23 +0900 |
parents | 401981622a1e |
children | 68b5958179d0 |
files | src/main/java/christie/remotingTextEditor/GetOpponentMessage.java src/main/java/christie/remotingTextEditor/SetEditorCommunication.java src/main/java/christie/remotingTextEditor/SetInstance.java src/main/java/christie/textEditor/NewTextEditor.java |
diffstat | 4 files changed, 10 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/christie/remotingTextEditor/GetOpponentMessage.java Fri Dec 27 16:09:10 2019 +0900 +++ b/src/main/java/christie/remotingTextEditor/GetOpponentMessage.java Tue Jan 21 19:44:23 2020 +0900 @@ -10,10 +10,7 @@ public class GetOpponentMessage extends CodeGear { @Take - int offset; - - @Take - String string; + Message offset; @Peek NewTextEditor myEditor; @@ -24,9 +21,7 @@ @Override protected void run(CodeGearManager cgm) { - System.out.println( topoDG.getNodeName() + " gave:" + string + " on " + offset); - myEditor.prohibitDL(); - myEditor.insertMessage(offset, string); + System.out.println( topoDG.getNodeName() + " catch Offest:" + offset); cgm.setup(new GetOpponentMessage()); } }
--- a/src/main/java/christie/remotingTextEditor/SetEditorCommunication.java Fri Dec 27 16:09:10 2019 +0900 +++ b/src/main/java/christie/remotingTextEditor/SetEditorCommunication.java Tue Jan 21 19:44:23 2020 +0900 @@ -25,11 +25,9 @@ } } int sendOffset = myEditor.getOffset(); - String sendString = myEditor.getString(); System.out.println(topoDG.getNodeName()+ ":catchoffset=: " + sendOffset); +// put("opponent", "offset", new Message()); myEditor.changeToFalseSendPermmision(); - put("opponent", "offset", sendOffset); - put("opponent", "string", sendString); cgm.setup(new SetEditorCommunication()); }
--- a/src/main/java/christie/remotingTextEditor/SetInstance.java Fri Dec 27 16:09:10 2019 +0900 +++ b/src/main/java/christie/remotingTextEditor/SetInstance.java Tue Jan 21 19:44:23 2020 +0900 @@ -15,8 +15,6 @@ import java.io.FileWriter; -import static christie.codegear.StartCodeGear.createCGM; - public class SetInstance extends CodeGear { @@ -30,17 +28,17 @@ NewTextEditor Editor0 = new NewTextEditor(); Editor0.StartEditor(topoDG.getNodeName()); System.out.println("node0"); + //cgm.setup(new GetOpponentMessage()); cgm.setup(new SetEditorCommunication()); cgm.getLocalDGM().put("myEditor", Editor0); - cgm.setup(new GetOpponentMessage()); }else if(topoDG.getNodeName().equals("node1")){ NewTextEditor Editor1 = new NewTextEditor(); Editor1.StartEditor(topoDG.getNodeName()); System.out.println("node1"); + //cgm.setup(new GetOpponentMessage()); cgm.setup(new SetEditorCommunication()); cgm.getLocalDGM().put("myEditor", Editor1); - cgm.setup(new GetOpponentMessage()); } //cgm.setup(new CatchDG());
--- a/src/main/java/christie/textEditor/NewTextEditor.java Fri Dec 27 16:09:10 2019 +0900 +++ b/src/main/java/christie/textEditor/NewTextEditor.java Tue Jan 21 19:44:23 2020 +0900 @@ -14,6 +14,11 @@ TextFrame textFrame = new TextFrame(); static JTextArea textArea = new JTextArea(); + + public void callInner(){ + textFrame.insertText(); + } + public boolean checkPermission(){ return textFrame.SendPermission(); } @@ -22,16 +27,10 @@ return textFrame.returnOffset(); } - public String getString(){return textFrame.returnString();} - - public void prohibitDL(){textFrame.prohibitDL();} - public void changeToFalseSendPermmision(){ textFrame.changeToFalseSend(); } - public void insertMessage(int offset, String str){textFrame.insertText(offset, str);} - // public static void main(String[] args){ // NewTextEditor editor = new NewTextEditor(); //