|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.unifr.pai.twice.multipointer.client.MultiCursorController ch.unifr.pai.twice.multipointer.client.ExtendedWebsocketControl
public class ExtendedWebsocketControl
The currently used controller for multi-cursor device types
Nested Class Summary | |
---|---|
private class |
ExtendedWebsocketControl.CursorColor
A map between the cursor name (related to the .png's in the public folder) and their corresponding HTML color codes. |
Field Summary | |
---|---|
private java.util.Map<java.lang.String,MouseCursor> |
assignedMouseCursors
|
(package private) int |
currentCursor
|
private java.util.List<ExtendedWebsocketControl.CursorColor> |
cursorColors
|
private boolean |
opened
|
(package private) com.google.gwt.event.shared.HandlerRegistration |
r
|
private com.google.gwt.storage.client.Storage |
storage
|
private java.util.List<MouseCursor> |
visibleCursors
|
private com.google.gwt.core.client.JavaScriptObject |
websocket
|
Constructor Summary | |
---|---|
ExtendedWebsocketControl()
|
Method Summary | |
---|---|
private com.google.gwt.core.client.JavaScriptObject |
createOnBeforeUnloadHandler(com.google.gwt.core.client.JavaScriptObject websocket)
stops the web socket connection before unload to prevent connections to be unused. |
private com.google.gwt.core.client.JavaScriptObject |
createWebsocket(ExtendedWebsocketControl w,
java.lang.String url)
Initializes a websocket connection if available |
private MouseCursor |
defineMouseCursor(java.lang.String cursor,
java.lang.String color)
Create and attach a new mouse pointer representation |
private MouseCursor |
getOrCreateCursor(java.lang.String uuid)
Looks up the assigned mouse pointer for a specific device (by the uuid) and returns it. |
private void |
initializeCursorList()
Initializes the available cursor colors. |
boolean |
isInIFrame()
|
void |
notifyCursor(java.lang.String uuid,
java.lang.String action)
Notify the cursor with the given unique identifier about a given action |
private void |
onClose()
actions on close of the web socket server |
private void |
onMessage(java.lang.String data)
If a message arrives, it is analyzed and provided to the MouseCursor for further interpretation. |
private void |
onOpen()
As soon as the web socket channel is opened, the component sends its screen dimensions to the server |
void |
onResize(com.google.gwt.event.logical.shared.ResizeEvent event)
If the screen of the shared device is resized, the component updates the information on the server side. |
private void |
send(com.google.gwt.core.client.JavaScriptObject websocket,
java.lang.String message)
Sends a message through the websocket to the server |
void |
start()
Start the execution of the component |
void |
stop()
Stop the execution of the component |
private com.google.gwt.core.client.JavaScriptObject |
stopWebsocket(com.google.gwt.core.client.JavaScriptObject websocket)
stops the websocket connection |
Methods inherited from class ch.unifr.pai.twice.multipointer.client.MultiCursorController |
---|
getColorNative, getInstance, getMaxCursorsOnScreen, getUUID, isDefaultCursor, setMaxCursorsOnScreen |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private boolean opened
private com.google.gwt.core.client.JavaScriptObject websocket
private final java.util.List<MouseCursor> visibleCursors
private final java.util.Map<java.lang.String,MouseCursor> assignedMouseCursors
private final com.google.gwt.storage.client.Storage storage
private final java.util.List<ExtendedWebsocketControl.CursorColor> cursorColors
int currentCursor
com.google.gwt.event.shared.HandlerRegistration r
Constructor Detail |
---|
public ExtendedWebsocketControl()
Method Detail |
---|
private void initializeCursorList()
private MouseCursor defineMouseCursor(java.lang.String cursor, java.lang.String color)
cursor
- color
-
public boolean isInIFrame()
public void start()
MultiCursorController
start
in class MultiCursorController
public void stop()
MultiCursorController
stop
in class MultiCursorController
private void send(com.google.gwt.core.client.JavaScriptObject websocket, java.lang.String message)
websocket
- message
- private com.google.gwt.core.client.JavaScriptObject createOnBeforeUnloadHandler(com.google.gwt.core.client.JavaScriptObject websocket)
websocket
-
private com.google.gwt.core.client.JavaScriptObject stopWebsocket(com.google.gwt.core.client.JavaScriptObject websocket)
websocket
-
private com.google.gwt.core.client.JavaScriptObject createWebsocket(ExtendedWebsocketControl w, java.lang.String url)
w
- url
-
private void onMessage(java.lang.String data)
MouseCursor
for further interpretation.
data
- private MouseCursor getOrCreateCursor(java.lang.String uuid)
uuid
-
private void onOpen()
private void onClose()
public void onResize(com.google.gwt.event.logical.shared.ResizeEvent event)
onResize
in interface com.google.gwt.event.logical.shared.ResizeHandler
ResizeHandler.onResize(com.google.gwt.event.logical.shared.ResizeEvent)
public void notifyCursor(java.lang.String uuid, java.lang.String action)
MultiCursorController
notifyCursor
in class MultiCursorController
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |