changeset 22:45176f732171

put protocol instance for stop SenderTask and ReceiverTask
author sugi
date Sat, 08 Nov 2014 15:46:31 +0900
parents 966878ff1227
children 0d3cf24fe634
files .hgignore src/main/java/com/glavsoft/rfb/protocol/Protocol.java src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java
diffstat 3 files changed, 16 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgignore	Sat Nov 08 15:46:31 2014 +0900
@@ -0,0 +1,5 @@
+
+syntax: glob
+.classpath
+syntax: glob
+.build_no
\ No newline at end of file
--- a/src/main/java/com/glavsoft/rfb/protocol/Protocol.java	Thu Nov 06 19:32:15 2014 +0900
+++ b/src/main/java/com/glavsoft/rfb/protocol/Protocol.java	Sat Nov 08 15:46:31 2014 +0900
@@ -24,6 +24,9 @@
 
 package com.glavsoft.rfb.protocol;
 
+import alice.datasegment.DataSegment;
+import alice.datasegment.ReceiveData;
+
 import com.glavsoft.core.SettingsChangedEvent;
 import com.glavsoft.exceptions.*;
 import com.glavsoft.rfb.*;
@@ -191,6 +194,9 @@
 				decoders, this);
 		receiverThread = new Thread(receiverTask, "RfbReceiverTask");
 		receiverThread.start();
+		// add
+		ReceiveData rData = new ReceiveData(this, false, false);
+		DataSegment.getLocal().put("protocol", rData, null);
 	}
 
     private void correctServerPixelFormat() {
@@ -309,8 +315,8 @@
     }
 
     public void setMessageQueue(MessageQueue queue) { // add
-        messageQueue = queue; 
-        
+        messageQueue = queue;
+
     }
 
 }
--- a/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java	Thu Nov 06 19:32:15 2014 +0900
+++ b/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java	Sat Nov 08 15:46:31 2014 +0900
@@ -803,15 +803,15 @@
                     }
                 });
         kbdButtons.add(altButton);
-        
-        JButton screenButton = buttonsBar.createButton("share", "Share my screen", new ActionListener() {
+
+        JButton shareButton = buttonsBar.createButton("share", "Share my screen", new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent e) {
                 ReceiveData rData = new ReceiveData("Request", false, false);
                 DataSegment.getLocal().put("Request", rData, null);
             }
         });
-        kbdButtons.add(screenButton);
+        kbdButtons.add(shareButton);
 
         ModifierButtonEventListener modifierButtonListener = new ModifierButtonEventListener();
         modifierButtonListener.addButton(KeyEvent.VK_CONTROL, ctrlButton);