From 7bac48f6430ce54e6f1c40e705422929e77fbd7e Mon Sep 17 00:00:00 2001 From: Max Schenkelberg Date: Wed, 13 Jun 2012 17:52:11 -0500 Subject: [PATCH] Issue #697 added support for multiple editors Change-Id: Ic3ac12bb9368f0ec54dd8151ba1876002ff44e82 Former-commit-id: 51c2a41e68be2201d4ea3a8ab0fc6991b0478010 [formerly dd99479eeb4a3bbd898fce4c0b258329e1a9eaa9] [formerly 51c2a41e68be2201d4ea3a8ab0fc6991b0478010 [formerly dd99479eeb4a3bbd898fce4c0b258329e1a9eaa9] [formerly fceef3c5a149914c12e9eaea986631409fd33472 [formerly 3afc7b49cb42c005a0e9cf5221e35fc3ab78007a]]] Former-commit-id: fceef3c5a149914c12e9eaea986631409fd33472 Former-commit-id: f0d2893e97ba5ed421966ff2093caa55e402d5c8 [formerly e5e1a4de6a503da824621729d7047c42ee1fd977] Former-commit-id: f2e34fe03c85894ac1955f721f3fc370a507f0f0 --- .../META-INF/MANIFEST.MF | 8 +- .../session/PeerToPeerCommHelper.java | 7 + .../CollaborationObjectEventStorage.java | 12 +- .../storage}/IObjectEventPersistance.java | 3 +- .../comm/storage}/IObjectEventRetrieval.java | 3 +- .../comm/storage}/IPersistedEvent.java | 2 +- .../META-INF/MANIFEST.MF | 23 +- ...f.common.serialization.ISerializableObject | 7 +- .../plugin.xml | 36 +- .../schema/renderingExtension.exsd | 0 .../viz/collaboration/display/Activator.java | 47 +- .../display/IRemoteDisplayContainer.java | 89 ++ .../display/data}/ColorChangeEvent.java | 2 +- .../display/data}/SessionColorManager.java | 3 +- .../display}/data/SessionContainer.java | 40 +- .../data/SharedDisplaySessionMgr.java | 30 +- .../display/editor/ActivateRemoteDisplay.java | 62 ++ .../display/editor/CollaborationEditor.java | 182 ---- .../editor/CollaborationEditorInput.java | 15 +- .../editor/CollaborationPaneManager.java | 155 ---- ...itorData.java => CreateRemoteDisplay.java} | 78 +- .../display/editor/DisposeRemoteDisplay.java | 62 ++ .../display/editor/ICollaborationEditor.java | 56 ++ .../editor/RemoteDisplayRequested.java | 80 ++ ...ditor.java => ReprojectRemoteDisplay.java} | 36 +- .../input/CollaborationInputHandler.java | 247 ------ .../roles}/AbstractRoleEventController.java | 14 +- .../roles/DataProviderEventController.java | 141 +++ .../display/roles}/IRoleEventController.java | 2 +- .../roles/ParticipantEventController.java | 98 +++ .../dataprovider/CollaborationDispatcher.java | 27 +- .../dataprovider/SharedEditorsManager.java | 804 ++++++++++++++++++ .../dataprovider/event/FrameDisposed.java | 2 +- .../dataprovider/event/IRenderFrameEvent.java | 2 +- .../event/MouseLocationEvent.java | 2 +- .../dataprovider/event/RenderFrame.java | 2 +- .../dataprovider/event/RenderFrameEvent.java | 2 +- .../event/RenderFrameNeededEvent.java | 2 +- .../event/UpdateRenderFrameEvent.java | 2 +- .../dataprovider}/rsc/DataProviderRsc.java | 29 +- .../rsc/DataProviderRscData.java | 29 +- .../display}/rsc/CollaborationResource.java | 159 ++-- .../rsc/CollaborationResourceData.java | 21 +- .../rsc/CollaborationWrapperResource.java | 2 +- .../rsc/CollaborationWrapperResourceData.java | 2 +- .../rsc/ParticipantInitializedEvent.java | 2 +- .../rsc/SelfAddingSystemResourceListener.java | 89 ++ .../display/rsc}/SharedResource.java | 20 +- .../CollaborationRenderingDataManager.java | 18 +- .../CollaborationRenderingHandler.java | 2 +- .../rendering/GeneralRenderingHandler.java | 6 +- .../rendering/ImagingRenderingHandler.java | 4 +- .../rendering/OffscreenRenderingHandler.java | 4 +- .../rendering/PrimitiveRenderingHandler.java | 4 +- .../rsc/rendering/ShapeRenderingHandler.java | 4 +- .../rsc/rendering/StringRenderingHandler.java | 4 +- .../CollaborationDrawingEvent.java | 30 +- .../CollaborationDrawingResource.java | 99 ++- .../CollaborationDrawingResourceData.java | 58 +- .../CollaborationDrawingToolLayer.java | 24 +- .../CollaborationDrawingUIManager.java | 38 +- .../feature.xml | 7 - .../META-INF/MANIFEST.MF | 2 +- .../plugin.xml | 2 +- .../rendering/PointImageRenderingHandler.java | 4 +- .../META-INF/MANIFEST.MF | 2 +- .../plugin.xml | 2 +- .../RadarGraphicsExtRenderingHandler.java | 6 +- .../META-INF/MANIFEST.MF | 17 +- ...f.common.serialization.ISerializableObject | 5 - .../icons/collab_editor.gif} | Bin .../icons/remove_editor.gif | Bin 0 -> 91 bytes .../plugin.xml | 40 +- .../ui/CollaborationGroupView.java | 12 +- .../ui/ConnectionSubscriber.java | 3 +- .../collaboration/ui/CreateSessionDialog.java | 2 +- .../ui/actions}/PopupNotifier.java | 2 +- .../ui/actions/ShareEditorAction.java | 162 +++- .../ui/actions/UnshareEditorAction.java | 91 ++ .../ui/editor/CollaborationEditor.java | 404 +++++++++ .../ui/editor/CollaborationPaneManager.java | 247 ++++++ .../collaboration/ui/editor/EditorSetup.java | 158 ---- .../ui/role/DataProviderEventController.java | 536 ------------ .../viz/collaboration/ui/role/InputUtil.java | 170 ---- .../ui/role/ParticipantEventController.java | 207 ----- .../ui/session/AbstractSessionView.java | 2 +- .../ui/session/CollaborationSessionView.java | 251 ++++-- .../ui/session/ParticipantsLabelProvider.java | 2 +- .../collaboration/ui/session/SessionView.java | 23 +- .../telestrator/handlers/UndoRedoHandler.java | 78 +- .../core/drawables/AbstractDescriptor.java | 15 +- .../uf/viz/core/drawables/IDescriptor.java | 10 + .../uf/viz/core/map/IMapDescriptor.java | 11 - .../uf/viz/core/rsc/AbstractVizResource.java | 10 +- .../uf/viz/core/rsc/ResourceList.java | 4 + .../uf/viz/drawing/DrawingToolLayer.java | 3 +- .../uf/viz/drawing/DrawingToolUIManager.java | 3 + .../.classpath | 7 - .../.settings/org.eclipse.jdt.core.prefs | 8 - .../META-INF/MANIFEST.MF | 14 - .../build.properties | 4 - .../uf/viz/notification/Activator.java | 50 -- .../.pydevproject | 7 - .../src/com/raytheon/viz/spi/SPIResource.java | 128 ++- .../actions/ContributedEditorMenuAction.java | 30 +- .../raytheon/viz/ui/panes/PaneManager.java | 83 +- .../org.jboss.cache}/.project | 2 +- .../META-INF/MANIFEST.MF | 2 +- 108 files changed, 3260 insertions(+), 2601 deletions(-) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider => com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/storage}/CollaborationObjectEventStorage.java (97%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider => com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/storage}/IObjectEventPersistance.java (90%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider => com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/storage}/IObjectEventRetrieval.java (91%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event => com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/storage}/IPersistedEvent.java (94%) rename cave/{com.raytheon.uf.viz.collaboration.ui => com.raytheon.uf.viz.collaboration.display}/schema/renderingExtension.exsd (100%) create mode 100644 cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/IRemoteDisplayContainer.java rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/data}/ColorChangeEvent.java (98%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/data}/SessionColorManager.java (95%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display}/data/SessionContainer.java (66%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display}/data/SharedDisplaySessionMgr.java (70%) create mode 100644 cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/ActivateRemoteDisplay.java delete mode 100644 cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/CollaborationEditor.java delete mode 100644 cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/CollaborationPaneManager.java rename cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/{SharedEditorData.java => CreateRemoteDisplay.java} (58%) create mode 100644 cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/DisposeRemoteDisplay.java create mode 100644 cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/ICollaborationEditor.java create mode 100644 cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/RemoteDisplayRequested.java rename cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/{ReprojectEditor.java => ReprojectRemoteDisplay.java} (73%) delete mode 100644 cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/input/CollaborationInputHandler.java rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles}/AbstractRoleEventController.java (90%) create mode 100644 cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/DataProviderEventController.java rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles}/IRoleEventController.java (95%) create mode 100644 cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/ParticipantEventController.java rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles}/dataprovider/CollaborationDispatcher.java (93%) create mode 100644 cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/SharedEditorsManager.java rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles}/dataprovider/event/FrameDisposed.java (94%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles}/dataprovider/event/IRenderFrameEvent.java (93%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles}/dataprovider/event/MouseLocationEvent.java (97%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles}/dataprovider/event/RenderFrame.java (98%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles}/dataprovider/event/RenderFrameEvent.java (96%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles}/dataprovider/event/RenderFrameNeededEvent.java (95%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles}/dataprovider/event/UpdateRenderFrameEvent.java (94%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider}/rsc/DataProviderRsc.java (85%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider}/rsc/DataProviderRscData.java (83%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display}/rsc/CollaborationResource.java (76%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display}/rsc/CollaborationResourceData.java (89%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display}/rsc/CollaborationWrapperResource.java (99%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display}/rsc/CollaborationWrapperResourceData.java (98%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display}/rsc/ParticipantInitializedEvent.java (96%) create mode 100644 cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/SelfAddingSystemResourceListener.java rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/editor => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc}/SharedResource.java (86%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display}/rsc/rendering/CollaborationRenderingDataManager.java (93%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display}/rsc/rendering/CollaborationRenderingHandler.java (96%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display}/rsc/rendering/GeneralRenderingHandler.java (95%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display}/rsc/rendering/ImagingRenderingHandler.java (99%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display}/rsc/rendering/OffscreenRenderingHandler.java (97%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display}/rsc/rendering/PrimitiveRenderingHandler.java (96%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display}/rsc/rendering/ShapeRenderingHandler.java (98%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display}/rsc/rendering/StringRenderingHandler.java (97%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/telestrator/event => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/telestrator}/CollaborationDrawingEvent.java (80%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc}/telestrator/CollaborationDrawingResource.java (85%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc}/telestrator/CollaborationDrawingResourceData.java (71%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc}/telestrator/CollaborationDrawingToolLayer.java (85%) rename cave/{com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui => com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc}/telestrator/CollaborationDrawingUIManager.java (59%) delete mode 100644 cave/com.raytheon.uf.viz.collaboration.ui/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject rename cave/{com.raytheon.uf.viz.collaboration.display/icons/messages.gif => com.raytheon.uf.viz.collaboration.ui/icons/collab_editor.gif} (100%) create mode 100644 cave/com.raytheon.uf.viz.collaboration.ui/icons/remove_editor.gif rename cave/{com.raytheon.uf.viz.notification/src/com/raytheon/uf/viz/notification/notifier => com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/actions}/PopupNotifier.java (96%) create mode 100644 cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/actions/UnshareEditorAction.java create mode 100644 cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/editor/CollaborationEditor.java create mode 100644 cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/editor/CollaborationPaneManager.java delete mode 100644 cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/editor/EditorSetup.java delete mode 100644 cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/DataProviderEventController.java delete mode 100644 cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/InputUtil.java delete mode 100644 cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/ParticipantEventController.java delete mode 100644 cave/com.raytheon.uf.viz.notification/.classpath delete mode 100644 cave/com.raytheon.uf.viz.notification/.settings/org.eclipse.jdt.core.prefs delete mode 100644 cave/com.raytheon.uf.viz.notification/META-INF/MANIFEST.MF delete mode 100644 cave/com.raytheon.uf.viz.notification/build.properties delete mode 100644 cave/com.raytheon.uf.viz.notification/src/com/raytheon/uf/viz/notification/Activator.java delete mode 100644 cave/com.raytheon.uf.viz.npp.viirs/.pydevproject rename {cave/com.raytheon.uf.viz.notification => cots/org.jboss.cache}/.project (92%) diff --git a/cave/com.raytheon.uf.viz.collaboration.comm/META-INF/MANIFEST.MF b/cave/com.raytheon.uf.viz.collaboration.comm/META-INF/MANIFEST.MF index df2340bd12..133e88ef7e 100644 --- a/cave/com.raytheon.uf.viz.collaboration.comm/META-INF/MANIFEST.MF +++ b/cave/com.raytheon.uf.viz.collaboration.comm/META-INF/MANIFEST.MF @@ -7,7 +7,7 @@ Bundle-Activator: com.raytheon.uf.viz.collaboration.comm.Activator Bundle-Vendor: RAYTHEON Eclipse-RegisterBuddy: com.raytheon.uf.viz.core Require-Bundle: org.eclipse.core.runtime, - org.eclipse.ecf;bundle-version="3.1.300", + org.eclipse.ecf;bundle-version="3.1.300";visibility:=reexport, org.eclipse.ecf.presence;bundle-version="2.0.0", org.eclipse.ecf.provider.xmpp;bundle-version="3.2.0", org.apache.commons.lang;bundle-version="2.3.0", @@ -16,7 +16,8 @@ Require-Bundle: org.eclipse.core.runtime, com.raytheon.uf.viz.core;bundle-version="1.12.1174", org.jivesoftware.smack;bundle-version="3.1.100", org.eclipse.swt;bundle-version="3.6.1", - com.raytheon.uf.common.comm + com.raytheon.uf.common.comm, + com.raytheon.uf.viz.remote.graphics;bundle-version="1.0.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-ActivationPolicy: lazy Export-Package: com.raytheon.uf.viz.collaboration.comm, @@ -32,4 +33,5 @@ Export-Package: com.raytheon.uf.viz.collaboration.comm, com.raytheon.uf.viz.collaboration.comm.provider.event, com.raytheon.uf.viz.collaboration.comm.provider.info, com.raytheon.uf.viz.collaboration.comm.provider.session, - com.raytheon.uf.viz.collaboration.comm.provider.user + com.raytheon.uf.viz.collaboration.comm.provider.user, + com.raytheon.uf.viz.collaboration.comm.storage diff --git a/cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/provider/session/PeerToPeerCommHelper.java b/cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/provider/session/PeerToPeerCommHelper.java index eb356b0260..3ea5fdd2d5 100644 --- a/cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/provider/session/PeerToPeerCommHelper.java +++ b/cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/provider/session/PeerToPeerCommHelper.java @@ -64,6 +64,12 @@ public class PeerToPeerCommHelper implements IIMMessageListener { private static final transient IUFStatusHandler statusHandler = UFStatus .getHandler(PeerToPeerCommHelper.class); + private static String httpServer; + + public static String getCollaborationHttpServer() { + return httpServer; + } + private CollaborationConnection manager; /** @@ -210,6 +216,7 @@ public class PeerToPeerCommHelper implements IIMMessageListener { return; } + httpServer = httpdCollaborationURL; // configuration is valid; publish it. IHttpdCollaborationConfigurationEvent configurationEvent = new HttpdCollaborationConfigurationEvent( httpdCollaborationURL); diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/CollaborationObjectEventStorage.java b/cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/storage/CollaborationObjectEventStorage.java similarity index 97% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/CollaborationObjectEventStorage.java rename to cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/storage/CollaborationObjectEventStorage.java index ca760bcb93..77b517578a 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/CollaborationObjectEventStorage.java +++ b/cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/storage/CollaborationObjectEventStorage.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.role.dataprovider; +package com.raytheon.uf.viz.collaboration.comm.storage; import java.net.URI; import java.util.ArrayList; @@ -42,9 +42,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; import com.raytheon.uf.viz.collaboration.comm.compression.CompressionUtil; import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException; import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession; -import com.raytheon.uf.viz.collaboration.ui.Activator; -import com.raytheon.uf.viz.collaboration.ui.prefs.CollabPrefConstants; -import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event.IPersistedEvent; +import com.raytheon.uf.viz.collaboration.comm.provider.session.PeerToPeerCommHelper; import com.raytheon.uf.viz.remote.graphics.Dispatcher; import com.raytheon.uf.viz.remote.graphics.events.AbstractDispatchingObjectEvent; import com.raytheon.uf.viz.remote.graphics.events.DisposeObjectEvent; @@ -102,11 +100,7 @@ public class CollaborationObjectEventStorage implements int displayId) { this.displayId = displayId; this.client = HttpClient.getInstance(); - this.sessionDataURL = Activator - .getDefault() - .getPreferenceStore() - .getString( - CollabPrefConstants.HttpCollaborationConfiguration.P_HTTP_SESSION_URL); + this.sessionDataURL = PeerToPeerCommHelper.getCollaborationHttpServer(); this.sessionDataURL += session.getSessionId() + "/"; } diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/IObjectEventPersistance.java b/cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/storage/IObjectEventPersistance.java similarity index 90% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/IObjectEventPersistance.java rename to cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/storage/IObjectEventPersistance.java index a2be7e3105..19afb5e3fc 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/IObjectEventPersistance.java +++ b/cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/storage/IObjectEventPersistance.java @@ -17,10 +17,9 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.role.dataprovider; +package com.raytheon.uf.viz.collaboration.comm.storage; import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException; -import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event.IPersistedEvent; import com.raytheon.uf.viz.remote.graphics.events.AbstractDispatchingObjectEvent; /** diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/IObjectEventRetrieval.java b/cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/storage/IObjectEventRetrieval.java similarity index 91% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/IObjectEventRetrieval.java rename to cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/storage/IObjectEventRetrieval.java index feef2b81f9..1bd6e38280 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/IObjectEventRetrieval.java +++ b/cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/storage/IObjectEventRetrieval.java @@ -17,10 +17,9 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.role.dataprovider; +package com.raytheon.uf.viz.collaboration.comm.storage; import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException; -import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event.IPersistedEvent; import com.raytheon.uf.viz.remote.graphics.events.AbstractDispatchingObjectEvent; /** diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/IPersistedEvent.java b/cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/storage/IPersistedEvent.java similarity index 94% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/IPersistedEvent.java rename to cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/storage/IPersistedEvent.java index bf73c598ee..767930d31e 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/IPersistedEvent.java +++ b/cave/com.raytheon.uf.viz.collaboration.comm/src/com/raytheon/uf/viz/collaboration/comm/storage/IPersistedEvent.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event; +package com.raytheon.uf.viz.collaboration.comm.storage; /** * Interface for distinguishing events that are persisted and should be diff --git a/cave/com.raytheon.uf.viz.collaboration.display/META-INF/MANIFEST.MF b/cave/com.raytheon.uf.viz.collaboration.display/META-INF/MANIFEST.MF index 43f798ac35..6093cfc3c0 100644 --- a/cave/com.raytheon.uf.viz.collaboration.display/META-INF/MANIFEST.MF +++ b/cave/com.raytheon.uf.viz.collaboration.display/META-INF/MANIFEST.MF @@ -9,11 +9,26 @@ Eclipse-RegisterBuddy: com.raytheon.uf.viz.core Require-Bundle: org.eclipse.core.runtime, com.raytheon.uf.viz.core, com.raytheon.viz.ui, - org.geotools;bundle-version="2.6.4", org.eclipse.ui;bundle-version="3.6.1", - com.raytheon.uf.viz.collaboration.comm + com.raytheon.uf.viz.collaboration.comm, + com.raytheon.uf.common.colormap;bundle-version="1.12.1174", + com.raytheon.uf.viz.remote.graphics;bundle-version="1.0.0", + com.raytheon.uf.viz.drawing;bundle-version="1.0.0", + com.raytheon.uf.common.comm;bundle-version="1.12.1174", + com.raytheon.uf.common.time;bundle-version="1.12.1174", + com.raytheon.uf.common.geospatial;bundle-version="1.12.1174", + com.raytheon.uf.common.util;bundle-version="1.12.1174", + com.raytheon.viz.core;bundle-version="1.12.1174" Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-ActivationPolicy: lazy -Export-Package: com.raytheon.uf.viz.collaboration.display.editor, - com.raytheon.uf.viz.collaboration.display.editor.input +Export-Package: com.raytheon.uf.viz.collaboration.display, + com.raytheon.uf.viz.collaboration.display.data, + com.raytheon.uf.viz.collaboration.display.editor, + com.raytheon.uf.viz.collaboration.display.roles, + com.raytheon.uf.viz.collaboration.display.roles.dataprovider, + com.raytheon.uf.viz.collaboration.display.roles.dataprovider.event, + com.raytheon.uf.viz.collaboration.display.roles.dataprovider.rsc, + com.raytheon.uf.viz.collaboration.display.rsc, + com.raytheon.uf.viz.collaboration.display.rsc.rendering, + com.raytheon.uf.viz.collaboration.display.rsc.telestrator Import-Package: org.eclipse.swt.widgets diff --git a/cave/com.raytheon.uf.viz.collaboration.display/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject b/cave/com.raytheon.uf.viz.collaboration.display/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject index e57aa443cf..e2b89d8b3e 100644 --- a/cave/com.raytheon.uf.viz.collaboration.display/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject +++ b/cave/com.raytheon.uf.viz.collaboration.display/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject @@ -1,2 +1,5 @@ -com.raytheon.uf.viz.collaboration.display.editor.SharedEditorData -com.raytheon.uf.viz.collaboration.display.editor.ReprojectEditor \ No newline at end of file +com.raytheon.uf.viz.collaboration.display.editor.CreateRemoteDisplay +com.raytheon.uf.viz.collaboration.display.roles.dataprovider.rsc.DataProviderRscData +com.raytheon.uf.viz.collaboration.display.rsc.CollaborationWrapperResourceData +com.raytheon.uf.viz.collaboration.display.rsc.SharedResource +com.raytheon.uf.viz.collaboration.display.rsc.telestrator.CollaborationDrawingResourceData \ No newline at end of file diff --git a/cave/com.raytheon.uf.viz.collaboration.display/plugin.xml b/cave/com.raytheon.uf.viz.collaboration.display/plugin.xml index 975272729b..d465156fc3 100644 --- a/cave/com.raytheon.uf.viz.collaboration.display/plugin.xml +++ b/cave/com.raytheon.uf.viz.collaboration.display/plugin.xml @@ -1,15 +1,27 @@ - - - - - - + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/schema/renderingExtension.exsd b/cave/com.raytheon.uf.viz.collaboration.display/schema/renderingExtension.exsd similarity index 100% rename from cave/com.raytheon.uf.viz.collaboration.ui/schema/renderingExtension.exsd rename to cave/com.raytheon.uf.viz.collaboration.display/schema/renderingExtension.exsd diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/Activator.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/Activator.java index 2057784285..087d78de15 100644 --- a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/Activator.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/Activator.java @@ -3,28 +3,39 @@ package com.raytheon.uf.viz.collaboration.display; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; +import com.raytheon.uf.common.status.IUFStatusHandler; +import com.raytheon.uf.common.status.UFStatus; + public class Activator implements BundleActivator { - private static BundleContext context; + public static final IUFStatusHandler statusHandler = UFStatus + .getHandler(Activator.class); - static BundleContext getContext() { - return context; - } + private static BundleContext context; - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - } + static BundleContext getContext() { + return context; + } - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext bundleContext) throws Exception { - Activator.context = null; - } + /* + * (non-Javadoc) + * + * @see + * org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext + * ) + */ + public void start(BundleContext bundleContext) throws Exception { + Activator.context = bundleContext; + } + + /* + * (non-Javadoc) + * + * @see + * org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext bundleContext) throws Exception { + Activator.context = null; + } } diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/IRemoteDisplayContainer.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/IRemoteDisplayContainer.java new file mode 100644 index 0000000000..4501b94a64 --- /dev/null +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/IRemoteDisplayContainer.java @@ -0,0 +1,89 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.collaboration.display; + +import com.raytheon.uf.viz.core.drawables.IRenderableDisplay; + +/** + * Interface for object that contains remote displays + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 12, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ + +public interface IRemoteDisplayContainer { + + public static class RemoteDisplay { + private final int displayId; + + private final IRenderableDisplay display; + + /** + * @param displayId + * @param display + */ + public RemoteDisplay(int displayId, IRenderableDisplay display) { + this.displayId = displayId; + this.display = display; + } + + /** + * @return the displayId + */ + public int getDisplayId() { + return displayId; + } + + /** + * @return the display + */ + public IRenderableDisplay getDisplay() { + return display; + } + + } + + public static enum RemoteDisplayChangeType { + CREATED, DISPOSED, ACTIVATED; + } + + public static interface IRemoteDisplayChangedListener { + public void remoteDisplayChanged(RemoteDisplay remoteDisplay, + RemoteDisplayChangeType changeType); + } + + public void addRemoteDisplayChangedListener( + IRemoteDisplayChangedListener listener); + + public void removeRemoteDisplayChangedListener( + IRemoteDisplayChangedListener listener); + + public RemoteDisplay getActiveDisplay(); +} diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/ColorChangeEvent.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/data/ColorChangeEvent.java similarity index 98% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/ColorChangeEvent.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/data/ColorChangeEvent.java index 86b498e7ba..f3809f7681 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/ColorChangeEvent.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/data/ColorChangeEvent.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui; +package com.raytheon.uf.viz.collaboration.display.data; import org.eclipse.swt.graphics.RGB; diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/SessionColorManager.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/data/SessionColorManager.java similarity index 95% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/SessionColorManager.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/data/SessionColorManager.java index 5cddd57614..eaa10c759e 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/SessionColorManager.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/data/SessionColorManager.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui; +package com.raytheon.uf.viz.collaboration.display.data; import java.util.HashMap; import java.util.Map; @@ -29,6 +29,7 @@ import com.raytheon.viz.core.ColorUtil; /** * + * Manages colors of different users for a session * *
  * 
diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/data/SessionContainer.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/data/SessionContainer.java
similarity index 66%
rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/data/SessionContainer.java
rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/data/SessionContainer.java
index 543eea70b5..5eb6974054 100644
--- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/data/SessionContainer.java
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/data/SessionContainer.java
@@ -17,15 +17,11 @@
  * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
  * further licensing information.
  **/
-package com.raytheon.uf.viz.collaboration.ui.data;
-
-import java.util.List;
+package com.raytheon.uf.viz.collaboration.display.data;
 
 import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession;
-import com.raytheon.uf.viz.collaboration.display.editor.CollaborationEditor;
-import com.raytheon.uf.viz.collaboration.ui.SessionColorManager;
-import com.raytheon.uf.viz.collaboration.ui.role.IRoleEventController;
-import com.raytheon.viz.ui.editor.AbstractEditor;
+import com.raytheon.uf.viz.collaboration.display.editor.ICollaborationEditor;
+import com.raytheon.uf.viz.collaboration.display.roles.IRoleEventController;
 
 /**
  * A container holding an underlying session and associated data for a shared
@@ -62,13 +58,7 @@ public class SessionContainer {
      * the editor associated with a session, only valid if not fulfilling the
      * Data Provider role
      **/
-    private CollaborationEditor collaborationEditor;
-
-    /**
-     * the editors shared with a session, only valid if fulfilling the Data
-     * Provider role
-     **/
-    private List sharedEditors;
+    private ICollaborationEditor collaborationEditor;
 
     public ISharedDisplaySession getSession() {
         return session;
@@ -86,32 +76,14 @@ public class SessionContainer {
         this.roleEventController = roleEventController;
     }
 
-    public CollaborationEditor getCollaborationEditor() {
+    public ICollaborationEditor getCollaborationEditor() {
         return collaborationEditor;
     }
 
-    public void setCollaborationEditor(CollaborationEditor collaborationEditor) {
-        if (this.sharedEditors != null) {
-            throw new IllegalStateException(
-                    "Cannot have both a "
-                            + "CollaborationEditor and shared editors on the same session at the same time");
-        }
+    public void setCollaborationEditor(ICollaborationEditor collaborationEditor) {
         this.collaborationEditor = collaborationEditor;
     }
 
-    public List getSharedEditors() {
-        return sharedEditors;
-    }
-
-    public void setSharedEditors(List sharedEditors) {
-        if (this.collaborationEditor != null) {
-            throw new IllegalStateException(
-                    "Cannot have both a "
-                            + "CollaborationEditor and shared editors on the same session at the same time");
-        }
-        this.sharedEditors = sharedEditors;
-    }
-
     public String getSessionId() {
         return sessionId;
     }
diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/data/SharedDisplaySessionMgr.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/data/SharedDisplaySessionMgr.java
similarity index 70%
rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/data/SharedDisplaySessionMgr.java
rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/data/SharedDisplaySessionMgr.java
index 21ec96a7ba..1f5ea8d8f2 100644
--- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/data/SharedDisplaySessionMgr.java
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/data/SharedDisplaySessionMgr.java
@@ -17,11 +17,9 @@
  * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
  * further licensing information.
  **/
-package com.raytheon.uf.viz.collaboration.ui.data;
+package com.raytheon.uf.viz.collaboration.display.data;
 
-import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
@@ -30,12 +28,9 @@ import org.eclipse.ui.IEditorPart;
 import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
 import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession;
 import com.raytheon.uf.viz.collaboration.comm.identity.user.SharedDisplayRole;
-import com.raytheon.uf.viz.collaboration.ui.SessionColorManager;
-import com.raytheon.uf.viz.collaboration.ui.role.DataProviderEventController;
-import com.raytheon.uf.viz.collaboration.ui.role.IRoleEventController;
-import com.raytheon.uf.viz.collaboration.ui.role.ParticipantEventController;
-import com.raytheon.viz.ui.VizWorkbenchManager;
-import com.raytheon.viz.ui.editor.AbstractEditor;
+import com.raytheon.uf.viz.collaboration.display.roles.DataProviderEventController;
+import com.raytheon.uf.viz.collaboration.display.roles.IRoleEventController;
+import com.raytheon.uf.viz.collaboration.display.roles.ParticipantEventController;
 
 /**
  * Tracks all of the active sessions that are SharedDisplaySessions. Provides
@@ -78,26 +73,9 @@ public class SharedDisplaySessionMgr {
         switch (initialRole) {
         case DATA_PROVIDER:
             rec = new DataProviderEventController(session);
-            List editorList = new ArrayList();
-            // TODO better way to determine which editor to start sharing?
-            // or better yet, maybe we should add this elsewhere after it has
-            // already been initialized with the correct target/resources
-            IEditorPart part = VizWorkbenchManager.getInstance()
-                    .getActiveEditor();
-            if (part instanceof AbstractEditor) {
-                AbstractEditor sharedEditor = (AbstractEditor) part;
-                editorList.add(sharedEditor);
-                container.setSharedEditors(editorList);
-            } else {
-                throw new CollaborationException(
-                        "Cannot share a Collaboration Editor, please select a different tab");
-            }
             break;
-
         case PARTICIPANT:
             rec = new ParticipantEventController(session);
-            // don't need to set the CollaborationEditor, as it won't be created
-            // until we receive the initial data
             break;
         default:
             throw new IllegalArgumentException(
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/ActivateRemoteDisplay.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/ActivateRemoteDisplay.java
new file mode 100644
index 0000000000..43e5536157
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/ActivateRemoteDisplay.java
@@ -0,0 +1,62 @@
+/**
+ * This software was developed and / or modified by Raytheon Company,
+ * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
+ * 
+ * U.S. EXPORT CONTROLLED TECHNICAL DATA
+ * This software product contains export-restricted data whose
+ * export/transfer/disclosure is restricted by U.S. law. Dissemination
+ * to non-U.S. persons whether in the United States or abroad requires
+ * an export license or other authorization.
+ * 
+ * Contractor Name:        Raytheon Company
+ * Contractor Address:     6825 Pine Street, Suite 340
+ *                         Mail Stop B8
+ *                         Omaha, NE 68106
+ *                         402.291.0100
+ * 
+ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
+ * further licensing information.
+ **/
+package com.raytheon.uf.viz.collaboration.display.editor;
+
+import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
+import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
+
+/**
+ * Event for activating a remote display
+ * 
+ * 
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 8, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ +@DynamicSerialize +public class ActivateRemoteDisplay { + + @DynamicSerializeElement + private int displayId; + + /** + * @return the displayId + */ + public int getDisplayId() { + return displayId; + } + + /** + * @param displayId + * the displayId to set + */ + public void setDisplayId(int displayId) { + this.displayId = displayId; + } + +} diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/CollaborationEditor.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/CollaborationEditor.java deleted file mode 100644 index a75684c4b8..0000000000 --- a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/CollaborationEditor.java +++ /dev/null @@ -1,182 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.viz.collaboration.display.editor; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorSite; -import org.eclipse.ui.ISaveablePart2; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.part.EditorPart; - -import com.raytheon.uf.viz.core.IDisplayPane; -import com.raytheon.uf.viz.core.drawables.IRenderableDisplay; -import com.raytheon.viz.ui.input.InputManager; - -/** - * A collaboration editor that displays the display of an editor shared by the - * Data Provider. - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Mar 16, 2012            njensen     Initial creation
- * 
- * 
- * - * @author njensen - * @version 1.0 - */ - -public class CollaborationEditor extends EditorPart implements ISaveablePart2 { - - public static final String EDITOR_ID = "com.raytheon.uf.viz.collaboration.display.editor.CollaborationEditor"; - - private String sessionId; - - private IRenderableDisplay display; - - private CollaborationPaneManager paneManager; - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.part.EditorPart#init(org.eclipse.ui.IEditorSite, - * org.eclipse.ui.IEditorInput) - */ - @Override - public void init(IEditorSite site, IEditorInput input) - throws PartInitException { - setInput(input); - setSite(site); - CollaborationEditorInput cei = (CollaborationEditorInput) input; - setPartName(cei.getName()); - this.sessionId = cei.getSessionId(); - this.display = cei.getDisplay(); - display.getDescriptor().getResourceList() - .instantiateResources(display.getDescriptor(), true); - paneManager = new CollaborationPaneManager(); - } - - /* - * (non-Javadoc) - * - * @see - * org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets - * .Composite) - */ - @Override - public void createPartControl(Composite parent) { - paneManager.initializeComponents(paneManager, parent); - paneManager.addPane(display); - } - - public InputManager getInputManager() { - return paneManager.getMouseManager(); - } - - public String getSessionId() { - return sessionId; - } - - public IRenderableDisplay getDisplay() { - return display; - } - - public IDisplayPane getActiveDisplayPane() { - return paneManager.getActiveDisplayPane(); - } - - public void setCanvasSize(Rectangle bounds) { - paneManager.setCanvasSize(bounds); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.part.EditorPart#isDirty() - */ - @Override - public boolean isDirty() { - return true; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime. - * IProgressMonitor) - */ - @Override - public void doSave(IProgressMonitor monitor) { - - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.part.EditorPart#doSaveAs() - */ - @Override - public void doSaveAs() { - - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed() - */ - @Override - public boolean isSaveAsAllowed() { - return false; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.part.WorkbenchPart#setFocus() - */ - @Override - public void setFocus() { - paneManager.setFocus(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.ISaveablePart2#promptToSaveOnClose() - */ - @Override - public int promptToSaveOnClose() { - // Let the user know why we refuse to close the editor - MessageDialog.openError(getSite().getShell(), "Closing Disabled", - "Please close the \"" + getPartName() - + "\" chat to exit the session."); - // Cancel the clsoe - return ISaveablePart2.CANCEL; - } -} diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/CollaborationEditorInput.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/CollaborationEditorInput.java index f53e6b9ce9..1ff5bc246f 100644 --- a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/CollaborationEditorInput.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/CollaborationEditorInput.java @@ -23,8 +23,6 @@ import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IPersistableElement; -import com.raytheon.uf.viz.core.drawables.IRenderableDisplay; - /** * Editor input for CollaborationEditor * @@ -44,26 +42,15 @@ import com.raytheon.uf.viz.core.drawables.IRenderableDisplay; public class CollaborationEditorInput implements IEditorInput { - private IRenderableDisplay display; - private String title; private String sessionId; - public CollaborationEditorInput(IRenderableDisplay display, - String sessionId, String title) { - this.display = display; + public CollaborationEditorInput(String sessionId, String title) { this.sessionId = sessionId; this.title = title; } - /** - * @return the display - */ - public IRenderableDisplay getDisplay() { - return display; - } - /** * @return the sessionId */ diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/CollaborationPaneManager.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/CollaborationPaneManager.java deleted file mode 100644 index 1490efdb4a..0000000000 --- a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/CollaborationPaneManager.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.viz.collaboration.display.editor; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.ScrolledComposite; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.ScrollBar; - -import com.raytheon.uf.viz.core.IDisplayPane; -import com.raytheon.uf.viz.core.datastructure.LoopProperties; -import com.raytheon.uf.viz.core.drawables.IRenderableDisplay; -import com.raytheon.viz.ui.panes.PaneManager; - -/** - * PaneManager for the CollaborationEditor - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Jun 7, 2012            mschenke     Initial creation
- * 
- * 
- * - * @author mschenke - * @version 1.0 - */ - -public class CollaborationPaneManager extends PaneManager { - - private Composite wrapperComp; - - private Composite canvasComp; - - private ScrolledComposite scrollable; - - private Rectangle scrollableBounds; - - private Rectangle canvasBounds; - - private LoopProperties loopProperties = new LoopProperties(); - - @Override - public IDisplayPane addPane(IRenderableDisplay renderableDisplay) { - // // scrollable composite - scrollable = new ScrolledComposite(composite, SWT.H_SCROLL - | SWT.V_SCROLL); - scrollable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); - - // Composite for canvas comp - wrapperComp = new Composite(scrollable, SWT.NONE); - GridLayout gl = new GridLayout(1, false); - gl.marginHeight = 0; - gl.marginWidth = 0; - // Sets background color of wrapper composite to white - wrapperComp.setBackground(wrapperComp.getDisplay().getSystemColor( - SWT.COLOR_WHITE)); - wrapperComp.setSize(1000, 1000); - - canvasComp = new Composite(wrapperComp, SWT.NONE); - canvasComp.setLayout(gl); - canvasComp.setSize(1000, 1000); - - // Set canvasComp as content on scrollable - scrollable.setContent(wrapperComp); - scrollable.addListener(SWT.Resize, new Listener() { - @Override - public void handleEvent(Event event) { - scrollableBounds = ((Composite) event.widget).getBounds(); - setCanvasSize(canvasBounds); - } - }); - - IDisplayPane pane = addPane(renderableDisplay, canvasComp); - canvasComp.layout(); - scrollableBounds = scrollable.getBounds(); - canvasBounds = canvasComp.getBounds(); - return pane; - } - - /* - * (non-Javadoc) - * - * @see com.raytheon.viz.ui.panes.PaneManager#getLoopProperties() - */ - @Override - public LoopProperties getLoopProperties() { - return loopProperties; - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.viz.ui.panes.PaneManager#setLoopProperties(com.raytheon. - * uf.viz.core.datastructure.LoopProperties) - */ - @Override - public void setLoopProperties(LoopProperties loopProperties) { - this.loopProperties = loopProperties; - } - - public void setCanvasSize(Rectangle bounds) { - canvasBounds = bounds; - canvasComp.setSize(bounds.width, bounds.height); - - Rectangle scrollableBounds = new Rectangle(this.scrollableBounds.x, - this.scrollableBounds.y, this.scrollableBounds.width, - this.scrollableBounds.height); - - // Subtract size of scroll bars if visible - ScrollBar vertical = scrollable.getVerticalBar(); - ScrollBar horizon = scrollable.getHorizontalBar(); - if (scrollableBounds.width <= canvasBounds.width) { - scrollableBounds.height -= horizon.getSize().y; - } - if (scrollableBounds.height <= canvasBounds.height) { - scrollableBounds.width -= vertical.getSize().x; - } - - wrapperComp.setSize( - Math.max(canvasBounds.width, scrollableBounds.width), - Math.max(canvasBounds.height, scrollableBounds.height)); - canvasComp.setLocation( - Math.max(0, (scrollableBounds.width - bounds.width) / 2), - Math.max(0, (scrollableBounds.height - bounds.height) / 2)); - wrapperComp.layout(); - canvasComp.layout(); - } -} diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/SharedEditorData.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/CreateRemoteDisplay.java similarity index 58% rename from cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/SharedEditorData.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/CreateRemoteDisplay.java index 6841e38b9d..5e664237f3 100644 --- a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/SharedEditorData.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/CreateRemoteDisplay.java @@ -24,15 +24,9 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - -import org.geotools.coverage.grid.GeneralGridGeometry; import com.raytheon.uf.common.serialization.ISerializableObject; -import com.raytheon.uf.common.serialization.adapters.GridGeometryAdapter; -import com.raytheon.uf.common.serialization.adapters.JTSEnvelopeAdapter; import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay; -import com.vividsolutions.jts.geom.Envelope; /** * A SharedEditorData is a POJO to be sent out by the Data Provider that @@ -55,31 +49,27 @@ import com.vividsolutions.jts.geom.Envelope; @XmlAccessorType(XmlAccessType.NONE) @XmlRootElement -public class SharedEditorData implements ISerializableObject { +public class CreateRemoteDisplay implements ISerializableObject { - /** The geometry of the descriptor */ - private GeneralGridGeometry geometry; + @XmlAttribute + private int displayId; @XmlElement private AbstractRenderableDisplay display; - /** the view's extent, i.e. the current zoom/pan */ - private Envelope envelope; - - @XmlAttribute - private int width; - - @XmlAttribute - private int height; - - @XmlElement - @XmlJavaTypeAdapter(value = GridGeometryAdapter.class) - public GeneralGridGeometry getGeometry() { - return geometry; + /** + * @return the displayId + */ + public int getDisplayId() { + return displayId; } - public void setGeometry(GeneralGridGeometry geometry) { - this.geometry = geometry; + /** + * @param displayId + * the displayId to set + */ + public void setDisplayId(int displayId) { + this.displayId = displayId; } /** @@ -97,44 +87,4 @@ public class SharedEditorData implements ISerializableObject { this.display = display; } - @XmlElement - @XmlJavaTypeAdapter(value = JTSEnvelopeAdapter.class) - public Envelope getEnvelope() { - return envelope; - } - - public void setEnvelope(Envelope envelope) { - this.envelope = envelope; - } - - /** - * @return the width - */ - public int getWidth() { - return width; - } - - /** - * @param width - * the width to set - */ - public void setWidth(int width) { - this.width = width; - } - - /** - * @return the height - */ - public int getHeight() { - return height; - } - - /** - * @param height - * the height to set - */ - public void setHeight(int height) { - this.height = height; - } - } diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/DisposeRemoteDisplay.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/DisposeRemoteDisplay.java new file mode 100644 index 0000000000..4a1851423a --- /dev/null +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/DisposeRemoteDisplay.java @@ -0,0 +1,62 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.collaboration.display.editor; + +import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; +import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; + +/** + * Event object for disposes a remote display + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 8, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ +@DynamicSerialize +public class DisposeRemoteDisplay { + + @DynamicSerializeElement + private int displayId; + + /** + * @return the displayId + */ + public int getDisplayId() { + return displayId; + } + + /** + * @param displayId + * the displayId to set + */ + public void setDisplayId(int displayId) { + this.displayId = displayId; + } + +} diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/ICollaborationEditor.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/ICollaborationEditor.java new file mode 100644 index 0000000000..79c49edd9f --- /dev/null +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/ICollaborationEditor.java @@ -0,0 +1,56 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.collaboration.display.editor; + +import org.eclipse.swt.graphics.Rectangle; +import org.eclipse.ui.IEditorPart; + +import com.raytheon.uf.viz.collaboration.display.IRemoteDisplayContainer; +import com.raytheon.uf.viz.core.IDisplayPane; + +/** + * Interface for the Collaboration Editor + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 8, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ + +public interface ICollaborationEditor extends IEditorPart, + IRemoteDisplayContainer { + + public static final String EDITOR_ID = "com.raytheon.uf.viz.collaboration.display.editor.ICollaborationEditor"; + + public IDisplayPane getActiveDisplayPane(); + + public void setCanvasBounds(int displayId, Rectangle canvasBounds); + + public String getSessionId(); + +} diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/RemoteDisplayRequested.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/RemoteDisplayRequested.java new file mode 100644 index 0000000000..c07f33102c --- /dev/null +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/RemoteDisplayRequested.java @@ -0,0 +1,80 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.collaboration.display.editor; + +import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; +import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; + +/** + * Requests a remote display object be sent to the user + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 8, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ +@DynamicSerialize +public class RemoteDisplayRequested { + + @DynamicSerializeElement + private int displayId; + + @DynamicSerializeElement + private String userId; + + /** + * @return the displayId + */ + public int getDisplayId() { + return displayId; + } + + /** + * @param displayId + * the displayId to set + */ + public void setDisplayId(int displayId) { + this.displayId = displayId; + } + + /** + * @return the userId + */ + public String getUserId() { + return userId; + } + + /** + * @param userId + * the userId to set + */ + public void setUserId(String userId) { + this.userId = userId; + } + +} diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/ReprojectEditor.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/ReprojectRemoteDisplay.java similarity index 73% rename from cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/ReprojectEditor.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/ReprojectRemoteDisplay.java index c045527365..5e16bc85d5 100644 --- a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/ReprojectEditor.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/ReprojectRemoteDisplay.java @@ -19,16 +19,10 @@ **/ package com.raytheon.uf.viz.collaboration.display.editor; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - import org.geotools.coverage.grid.GeneralGridGeometry; -import com.raytheon.uf.common.serialization.ISerializableObject; -import com.raytheon.uf.common.serialization.adapters.GridGeometryAdapter; +import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; +import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; /** * Collaboration event to reproject the viewing editor @@ -46,14 +40,30 @@ import com.raytheon.uf.common.serialization.adapters.GridGeometryAdapter; * @author mschenke * @version 1.0 */ -@XmlRootElement -@XmlAccessorType(XmlAccessType.NONE) -public class ReprojectEditor implements ISerializableObject { +@DynamicSerialize +public class ReprojectRemoteDisplay { - @XmlElement - @XmlJavaTypeAdapter(value = GridGeometryAdapter.class) + @DynamicSerializeElement + private int displayId; + + @DynamicSerializeElement private GeneralGridGeometry targetGeometry; + /** + * @return the displayId + */ + public int getDisplayId() { + return displayId; + } + + /** + * @param displayId + * the displayId to set + */ + public void setDisplayId(int displayId) { + this.displayId = displayId; + } + /** * @return the targetGeometry */ diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/input/CollaborationInputHandler.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/input/CollaborationInputHandler.java deleted file mode 100644 index 344a79e7ac..0000000000 --- a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/input/CollaborationInputHandler.java +++ /dev/null @@ -1,247 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.viz.collaboration.display.editor.input; - -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; - -import org.eclipse.swt.widgets.Event; - -import com.raytheon.uf.viz.core.rsc.IInputHandler; - -/** - * CollaborationInputHandler that holds other handlers that should only be used - * when part of a collaboration session. Essentially it's a layer of handlers - * specific for collaboration. - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Apr 4, 2012            njensen     Initial creation
- * 
- * 
- * - * @author njensen - * @version 1.0 - */ - -public class CollaborationInputHandler implements IInputHandler { - - private List handlers = Collections - .synchronizedList(new LinkedList()); - - public void registerInputHandler(IInputHandler handler) { - handlers.add(handler); - } - - public void unregisterInputHandler(IInputHandler handler) { - handlers.remove(handler); - } - - /* - * (non-Javadoc) - * - * @see com.raytheon.uf.viz.core.rsc.IInputHandler#handleMouseDown(int, int, - * int) - */ - @Override - public boolean handleMouseDown(int x, int y, int mouseButton) { - for (IInputHandler handler : handlers) { - if (handler.handleMouseDown(x, y, mouseButton)) { - return true; - } - } - return true; - } - - /* - * (non-Javadoc) - * - * @see com.raytheon.uf.viz.core.rsc.IInputHandler#handleMouseDownMove(int, - * int, int) - */ - @Override - public boolean handleMouseDownMove(int x, int y, int mouseButton) { - for (IInputHandler handler : handlers) { - if (handler.handleMouseDownMove(x, y, mouseButton)) { - return true; - } - } - return true; - } - - /* - * (non-Javadoc) - * - * @see com.raytheon.uf.viz.core.rsc.IInputHandler#handleMouseUp(int, int, - * int) - */ - @Override - public boolean handleMouseUp(int x, int y, int mouseButton) { - for (IInputHandler handler : handlers) { - if (handler.handleMouseUp(x, y, mouseButton)) { - return true; - } - } - return true; - } - - /* - * (non-Javadoc) - * - * @see com.raytheon.uf.viz.core.rsc.IInputHandler#handleMouseHover(int, - * int) - */ - @Override - public boolean handleMouseHover(int x, int y) { - for (IInputHandler handler : handlers) { - if (handler.handleMouseHover(x, y)) { - return true; - } - } - return true; - } - - /* - * (non-Javadoc) - * - * @see com.raytheon.uf.viz.core.rsc.IInputHandler#handleMouseMove(int, int) - */ - @Override - public boolean handleMouseMove(int x, int y) { - for (IInputHandler handler : handlers) { - if (handler.handleMouseMove(x, y)) { - return true; - } - } - return true; - } - - /* - * (non-Javadoc) - * - * @see com.raytheon.uf.viz.core.rsc.IInputHandler#handleDoubleClick(int, - * int, int) - */ - @Override - public boolean handleDoubleClick(int x, int y, int button) { - for (IInputHandler handler : handlers) { - if (handler.handleDoubleClick(x, y, button)) { - return true; - } - } - return true; - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.viz.core.rsc.IInputHandler#handleMouseWheel(org.eclipse - * .swt.widgets.Event, int, int) - */ - @Override - public boolean handleMouseWheel(Event event, int x, int y) { - for (IInputHandler handler : handlers) { - if (handler.handleMouseWheel(event, x, y)) { - return true; - } - } - return true; - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.viz.core.rsc.IInputHandler#handleMouseExit(org.eclipse - * .swt.widgets.Event) - */ - @Override - public boolean handleMouseExit(Event event) { - for (IInputHandler handler : handlers) { - if (handler.handleMouseExit(event)) { - return true; - } - } - return true; - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.viz.core.rsc.IInputHandler#handleMouseEnter(org.eclipse - * .swt.widgets.Event) - */ - @Override - public boolean handleMouseEnter(Event event) { - for (IInputHandler handler : handlers) { - if (handler.handleMouseEnter(event)) { - return true; - } - } - return true; - } - - /* - * (non-Javadoc) - * - * @see com.raytheon.uf.viz.core.rsc.IInputHandler#handleKeyDown(int) - */ - @Override - public boolean handleKeyDown(int keyCode) { - for (IInputHandler handler : handlers) { - if (handler.handleKeyDown(keyCode)) { - return true; - } - } - return true; - } - - /* - * (non-Javadoc) - * - * @see com.raytheon.uf.viz.core.rsc.IInputHandler#handleKeyUp(int) - */ - @Override - public boolean handleKeyUp(int keyCode) { - for (IInputHandler handler : handlers) { - if (handler.handleKeyUp(keyCode)) { - return true; - } - } - return true; - } - - /** - * Get the list of registered handlers - * - * @return - */ - public List getRegisteredHandlers() { - return handlers; - } - -} diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/AbstractRoleEventController.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/AbstractRoleEventController.java similarity index 90% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/AbstractRoleEventController.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/AbstractRoleEventController.java index 7a199458a5..4dc4c1a6fd 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/AbstractRoleEventController.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/AbstractRoleEventController.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.role; +package com.raytheon.uf.viz.collaboration.display.roles; import java.lang.reflect.Constructor; import java.util.ArrayList; @@ -29,18 +29,15 @@ import org.eclipse.ui.IWorkbenchPart; import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession; -import com.raytheon.uf.viz.collaboration.ui.Activator; -import com.raytheon.uf.viz.collaboration.ui.telestrator.CollaborationDrawingResourceData; +import com.raytheon.uf.viz.collaboration.display.Activator; import com.raytheon.uf.viz.core.IDisplayPane; import com.raytheon.uf.viz.core.drawables.IDescriptor; import com.raytheon.uf.viz.core.drawables.IRenderableDisplay; import com.raytheon.uf.viz.core.drawables.ResourcePair; import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.rsc.AbstractVizResource; -import com.raytheon.uf.viz.core.rsc.LoadProperties; import com.raytheon.uf.viz.core.rsc.ResourceList; import com.raytheon.uf.viz.core.rsc.ResourceList.RemoveListener; -import com.raytheon.uf.viz.core.rsc.ResourceProperties; import com.raytheon.viz.ui.editor.AbstractEditor; /** @@ -132,13 +129,6 @@ public abstract class AbstractRoleEventController implements protected List getResourcesToAdd() { List resources = new ArrayList(); - CollaborationDrawingResourceData resourceData = new CollaborationDrawingResourceData(); - resourceData.setSessionId(session.getSessionId()); - ResourcePair resource = new ResourcePair(); - resource.setResourceData(resourceData); - resource.setProperties(new ResourceProperties()); - resource.setLoadProperties(new LoadProperties()); - resources.add(resource); return resources; } diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/DataProviderEventController.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/DataProviderEventController.java new file mode 100644 index 0000000000..cba63445ba --- /dev/null +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/DataProviderEventController.java @@ -0,0 +1,141 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.collaboration.display.roles; + +import org.eclipse.swt.graphics.RGB; + +import com.google.common.eventbus.Subscribe; +import com.raytheon.uf.common.status.IUFStatusHandler; +import com.raytheon.uf.common.status.UFStatus; +import com.raytheon.uf.common.status.UFStatus.Priority; +import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException; +import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession; +import com.raytheon.uf.viz.collaboration.comm.identity.event.IVenueParticipantEvent; +import com.raytheon.uf.viz.collaboration.comm.identity.event.ParticipantEventType; +import com.raytheon.uf.viz.collaboration.display.data.ColorChangeEvent; +import com.raytheon.uf.viz.collaboration.display.data.SessionColorManager; +import com.raytheon.uf.viz.collaboration.display.data.SharedDisplaySessionMgr; +import com.raytheon.uf.viz.collaboration.display.editor.ActivateRemoteDisplay; +import com.raytheon.uf.viz.collaboration.display.roles.dataprovider.SharedEditorsManager; +import com.raytheon.uf.viz.core.IDisplayPane; +import com.raytheon.viz.ui.EditorUtil; +import com.raytheon.viz.ui.editor.AbstractEditor; + +/** + * TODO: This class is in severe need of a refactor! + * + * Handles the events of a session that are specific to the Data Provider role. + * + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 26, 2012            njensen     Initial creation
+ * 
+ * 
+ * + * @author njensen + * @version 1.0 + */ + +public class DataProviderEventController extends AbstractRoleEventController { + + private static final transient IUFStatusHandler statusHandler = UFStatus + .getHandler(DataProviderEventController.class); + + public DataProviderEventController(ISharedDisplaySession session) { + super(session); + } + + @Subscribe + public void participantChanged(IVenueParticipantEvent event) { + if (event.getEventType().equals(ParticipantEventType.ARRIVED) + && !event.getParticipant().equals(session.getUserID())) { + try { + SharedEditorsManager sem = SharedEditorsManager + .getManager(session); + AbstractEditor active = sem.getActiveSharedEditor(); + if (active != null) { + IDisplayPane activePane = active.getActiveDisplayPane(); + if (activePane != null) { + ActivateRemoteDisplay arde = new ActivateRemoteDisplay(); + arde.setDisplayId(sem.getDisplayId(activePane + .getRenderableDisplay())); + session.sendObjectToPeer(event.getParticipant(), arde); + } + } + + // new color for each user + SessionColorManager scm = SharedDisplaySessionMgr + .getSessionContainer(session.getSessionId()) + .getColorManager(); + RGB color = scm.getColorFromUser(event.getParticipant()); + + ColorChangeEvent cce = new ColorChangeEvent( + event.getParticipant(), color); + session.sendObjectToVenue(cce); + } catch (CollaborationException e) { + statusHandler.handle(Priority.PROBLEM, + "Error sending initialization data to new participant " + + event.getParticipant().getName(), e); + } + } + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.viz.collaboration.ui.role.AbstractRoleEventController + * #startup() + */ + @Override + public void startup() { + super.startup(); + AbstractEditor active = EditorUtil + .getActiveEditorAs(AbstractEditor.class); + if (active != null + && SharedEditorsManager.isBeingShared(active) == false) { + try { + SharedEditorsManager.getManager(session).shareEditor(active); + } catch (CollaborationException e) { + statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), + e); + } + } + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.viz.collaboration.ui.role.AbstractRoleEventController + * #shutdown() + */ + @Override + public void shutdown() { + super.shutdown(); + SharedEditorsManager.getManager(session).dispose(); + } + +} diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/IRoleEventController.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/IRoleEventController.java similarity index 95% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/IRoleEventController.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/IRoleEventController.java index 082c8d62ea..51acfea11a 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/IRoleEventController.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/IRoleEventController.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.role; +package com.raytheon.uf.viz.collaboration.display.roles; /** * Interface for an event controller. Starting up an IRoleEventController is diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/ParticipantEventController.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/ParticipantEventController.java new file mode 100644 index 0000000000..1306e47e60 --- /dev/null +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/ParticipantEventController.java @@ -0,0 +1,98 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.collaboration.display.roles; + +import org.eclipse.ui.PartInitException; + +import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession; +import com.raytheon.uf.viz.collaboration.display.data.SessionContainer; +import com.raytheon.uf.viz.collaboration.display.data.SharedDisplaySessionMgr; +import com.raytheon.uf.viz.collaboration.display.editor.CollaborationEditorInput; +import com.raytheon.uf.viz.collaboration.display.editor.ICollaborationEditor; +import com.raytheon.viz.ui.VizWorkbenchManager; + +/** + * Handles the events of a session that are specific to the Participant role. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 26, 2012            njensen     Initial creation
+ * 
+ * 
+ * + * @author njensen + * @version 1.0 + */ + +public class ParticipantEventController extends AbstractRoleEventController { + + public ParticipantEventController(ISharedDisplaySession session) { + super(session); + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.viz.collaboration.ui.role.AbstractRoleEventController + * #startup() + */ + @Override + public void startup() { + super.startup(); + CollaborationEditorInput input = new CollaborationEditorInput( + session.getSessionId(), session.getVenue().getInfo() + .getVenueDescription()); + try { + ICollaborationEditor editor = (ICollaborationEditor) VizWorkbenchManager + .getInstance().getCurrentWindow().getActivePage() + .openEditor(input, ICollaborationEditor.EDITOR_ID); + SessionContainer sc = SharedDisplaySessionMgr + .getSessionContainer(session.getSessionId()); + sc.setCollaborationEditor(editor); + } catch (PartInitException e) { + throw new RuntimeException("Unable to open collaboration editor", e); + } + + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.viz.collaboration.ui.role.AbstractRoleEventController + * #shutdown() + */ + @Override + public void shutdown() { + super.shutdown(); + SessionContainer sc = SharedDisplaySessionMgr + .getSessionContainer(session.getSessionId()); + if (sc != null) { + sc.getCollaborationEditor().getSite().getPage() + .closeEditor(sc.getCollaborationEditor(), false); + } + } + +} diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/CollaborationDispatcher.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/CollaborationDispatcher.java similarity index 93% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/CollaborationDispatcher.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/CollaborationDispatcher.java index 28d10273bb..1714a2a716 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/CollaborationDispatcher.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/CollaborationDispatcher.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.role.dataprovider; +package com.raytheon.uf.viz.collaboration.display.roles.dataprovider; import java.util.ArrayDeque; import java.util.Arrays; @@ -31,13 +31,15 @@ import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.collaboration.comm.compression.CompressionUtil; import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException; import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession; -import com.raytheon.uf.viz.collaboration.ui.Activator; -import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event.IPersistedEvent; -import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event.IRenderFrameEvent; -import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event.MouseLocationEvent; -import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event.RenderFrame; -import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event.RenderFrameNeededEvent; -import com.raytheon.uf.viz.collaboration.ui.rsc.ParticipantInitializedEvent; +import com.raytheon.uf.viz.collaboration.comm.storage.CollaborationObjectEventStorage; +import com.raytheon.uf.viz.collaboration.comm.storage.IObjectEventPersistance; +import com.raytheon.uf.viz.collaboration.comm.storage.IPersistedEvent; +import com.raytheon.uf.viz.collaboration.display.Activator; +import com.raytheon.uf.viz.collaboration.display.roles.dataprovider.event.IRenderFrameEvent; +import com.raytheon.uf.viz.collaboration.display.roles.dataprovider.event.MouseLocationEvent; +import com.raytheon.uf.viz.collaboration.display.roles.dataprovider.event.RenderFrame; +import com.raytheon.uf.viz.collaboration.display.roles.dataprovider.event.RenderFrameNeededEvent; +import com.raytheon.uf.viz.collaboration.display.rsc.ParticipantInitializedEvent; import com.raytheon.uf.viz.core.IDisplayPane; import com.raytheon.uf.viz.core.IDisplayPaneContainer; import com.raytheon.uf.viz.core.drawables.IRenderableDisplay; @@ -154,15 +156,6 @@ public class CollaborationDispatcher extends Dispatcher { display.refresh(); } - /** - * Returns the IRenderableDisplay this dispatcher is dispatching for - * - * @return - */ - public IRenderableDisplay getDisplay() { - return display; - } - @Subscribe public void handleNeedsRenderFrameEvent(RenderFrameNeededEvent event) { synchronized (previousFrames) { diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/SharedEditorsManager.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/SharedEditorsManager.java new file mode 100644 index 0000000000..dd9f7776b7 --- /dev/null +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/SharedEditorsManager.java @@ -0,0 +1,804 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.collaboration.display.roles.dataprovider; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.IdentityHashMap; +import java.util.LinkedHashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.eclipse.ui.IPartListener; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchPart; + +import com.google.common.eventbus.Subscribe; +import com.raytheon.uf.common.status.UFStatus.Priority; +import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException; +import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession; +import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; +import com.raytheon.uf.viz.collaboration.display.Activator; +import com.raytheon.uf.viz.collaboration.display.IRemoteDisplayContainer; +import com.raytheon.uf.viz.collaboration.display.editor.ActivateRemoteDisplay; +import com.raytheon.uf.viz.collaboration.display.editor.CreateRemoteDisplay; +import com.raytheon.uf.viz.collaboration.display.editor.DisposeRemoteDisplay; +import com.raytheon.uf.viz.collaboration.display.editor.RemoteDisplayRequested; +import com.raytheon.uf.viz.collaboration.display.roles.dataprovider.rsc.DataProviderRscData; +import com.raytheon.uf.viz.collaboration.display.rsc.CollaborationWrapperResource; +import com.raytheon.uf.viz.collaboration.display.rsc.CollaborationWrapperResourceData; +import com.raytheon.uf.viz.collaboration.display.rsc.SelfAddingSystemResourceListener; +import com.raytheon.uf.viz.collaboration.display.rsc.SharedResource; +import com.raytheon.uf.viz.core.IDisplayPane; +import com.raytheon.uf.viz.core.IDisplayPaneContainer; +import com.raytheon.uf.viz.core.IRenderableDisplayChangedListener; +import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay; +import com.raytheon.uf.viz.core.drawables.IRenderableDisplay; +import com.raytheon.uf.viz.core.drawables.ResourcePair; +import com.raytheon.uf.viz.core.exception.VizException; +import com.raytheon.uf.viz.core.rsc.AbstractResourceData; +import com.raytheon.uf.viz.core.rsc.ResourceList; +import com.raytheon.uf.viz.core.rsc.ResourceList.AddListener; +import com.raytheon.uf.viz.remote.graphics.Dispatcher; +import com.raytheon.uf.viz.remote.graphics.DispatcherFactory; +import com.raytheon.uf.viz.remote.graphics.DispatchingGraphicsFactory; +import com.raytheon.viz.ui.EditorUtil; +import com.raytheon.viz.ui.editor.AbstractEditor; + +/** + * Manager class for managing the sharing of editors in an + * {@link ISharedDisplaySession} + * + * TODO: Handle DataProviderRsc adding/removing! Maybe put in wrap/unwrap + * resource? + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 8, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ + +public class SharedEditorsManager implements IRemoteDisplayContainer { + + public class RemoteDisplayEventHandler { + @Subscribe + public void remoteDisplayRequested(RemoteDisplayRequested event) { + String userId = event.getUserId(); + UserId user = null; + for (UserId uid : session.getVenue().getParticipants()) { + if (uid.getFQName().equals(userId)) { + user = uid; + } + } + if (user != null) { + int displayId = event.getDisplayId(); + for (DisplayData data : displayData.values()) { + if (data.displayId == displayId) { + CreateRemoteDisplay creation = new CreateRemoteDisplay(); + creation.setDisplayId(displayId); + creation.setDisplay(createRemoteDisplay(data.display)); + sendEvent(creation); + break; + } + } + } + } + } + + private class SharedEditorDisplayChangedListener implements + IRenderableDisplayChangedListener { + + private AbstractEditor sharedEditor; + + private SharedEditorDisplayChangedListener(AbstractEditor sharedEditor) { + this.sharedEditor = sharedEditor; + } + + /* + * (non-Javadoc) + * + * @see com.raytheon.uf.viz.core.IRenderableDisplayChangedListener# + * renderableDisplayChanged(com.raytheon.uf.viz.core.IDisplayPane, + * com.raytheon.uf.viz.core.drawables.IRenderableDisplay, + * com.raytheon.uf + * .viz.core.IRenderableDisplayChangedListener.DisplayChangeType) + */ + @Override + public void renderableDisplayChanged(IDisplayPane pane, + IRenderableDisplay newRenderableDisplay, DisplayChangeType type) { + if (type == DisplayChangeType.ADD) { + try { + if (displayData.containsKey(newRenderableDisplay) == false) { + // We aren't sharing this display, but is anyone else? + if (isBeingShared(newRenderableDisplay)) { + // if so, remove it from their session + removeDisplay(pane); + } + shareDisplay(pane); + } + if (activeSharedEditor == sharedEditor) { + activeSharedEditor = null; + activateEditor(sharedEditor); + } + } catch (CollaborationException e) { + Activator.statusHandler.handle(Priority.PROBLEM, + e.getLocalizedMessage(), e); + } + } + } + + } + + private class SharedEditorPartListener implements IPartListener { + + private List pages = new LinkedList(); + + private void addPage(IWorkbenchPage page) { + if (pages.contains(page) == false) { + page.addPartListener(this); + pages.add(page); + } + } + + private void removePage(IWorkbenchPage page) { + if (pages.contains(page)) { + // We are listening on this page, should we be? + for (AbstractEditor editor : sharedEditors) { + if (editor.getSite().getPage() == page) { + // Another shared editor is on this page, keep listening + return; + } + } + // Made it here, we should not be listening anymore + page.removePartListener(this); + pages.remove(page); + } + } + + @Override + public void partActivated(IWorkbenchPart part) { + if (sharedEditors.contains(part)) { + activateEditor((AbstractEditor) part); + } + } + + @Override + public void partClosed(IWorkbenchPart part) { + if (sharedEditors.contains(part)) { + try { + removeEditor((AbstractEditor) part); + } catch (CollaborationException e) { + Activator.statusHandler.handle(Priority.PROBLEM, + e.getLocalizedMessage(), e); + } + } + } + + @Override + public void partDeactivated(IWorkbenchPart part) { + // Ignore + } + + @Override + public void partOpened(IWorkbenchPart part) { + // Ignored + } + + @Override + public void partBroughtToTop(IWorkbenchPart part) { + // Ignored + } + } + + private class SharedEditorDispatcherFactory implements DispatcherFactory { + @Override + public Dispatcher createNewDispatcher(IRenderableDisplay display) + throws InstantiationException { + try { + CollaborationDispatcher dispatcher = new CollaborationDispatcher( + session, display); + DisplayData data = new DisplayData(); + data.display = display; + data.dispatcher = dispatcher; + data.displayId = dispatcher.getDispatcherId(); + data.resourceListener = new SharedEditorResourceWrapperListener( + display, data.displayId); + displayData.put(display, data); + return dispatcher; + } catch (Exception e) { + throw new InstantiationException( + "Error creating new dispatcher: " + + e.getLocalizedMessage()); + } + } + } + + private class SharedEditorResourceWrapperListener extends + SelfAddingSystemResourceListener implements AddListener { + + private int displayId; + + private SharedEditorResourceWrapperListener(IRenderableDisplay display, + int displayId) throws VizException { + super(new DataProviderRscData(session.getSessionId(), displayId), + display.getDescriptor()); + this.displayId = displayId; + this.descriptor.getResourceList().addPostAddListener(this); + } + + @Override + public void notifyAdd(ResourcePair rp) throws VizException { + wrapResourcePair(rp); + if (shouldBeLocal(rp)) { + sendSharedResource(displayId, rp, false); + } + } + + @Override + public void notifyRemove(ResourcePair rp) throws VizException { + super.notifyRemove(rp); + if (rp.getResource() instanceof CollaborationWrapperResource) { + // Send event to venue to unload + sendSharedResource(displayId, rp, true); + } + } + + /* + * (non-Javadoc) + * + * @see com.raytheon.uf.viz.collaboration.display.rsc. + * SelfAddingSystemResourceListener#dispose() + */ + @Override + public void dispose() { + super.dispose(); + this.descriptor.getResourceList().removePostAddListener(this); + } + + } + + private static class DisplayData { + private SharedEditorResourceWrapperListener resourceListener; + + private CollaborationDispatcher dispatcher; + + private IRenderableDisplay display; + + private int displayId; + } + + private static Map managerMap = new HashMap(); + + private static List allSharedEditors = new LinkedList(); + + /** + * Gets/Creates the SharedEditorManager for the given session + * + * @param session + * @return + */ + public static SharedEditorsManager getManager(ISharedDisplaySession session) { + SharedEditorsManager manager = managerMap.get(session.getSessionId()); + if (manager == null) { + manager = new SharedEditorsManager(session); + managerMap.put(session.getSessionId(), manager); + } + return manager; + } + + /** + * + * @param editor + * @return + */ + public static ISharedDisplaySession getSharedEditorSession( + AbstractEditor editor) { + for (String sessionId : managerMap.keySet()) { + SharedEditorsManager manager = managerMap.get(sessionId); + if (manager.sharedEditors.contains(editor)) { + return manager.session; + } + } + return null; + } + + public static boolean isBeingShared(AbstractEditor editor) { + return allSharedEditors.contains(editor); + } + + public static boolean isBeingShared(IRenderableDisplay display) { + for (SharedEditorsManager manager : managerMap.values()) { + if (manager.displayData.containsKey(display)) { + return true; + } + } + return false; + } + + private DispatcherFactory factory = new SharedEditorDispatcherFactory(); + + private SharedEditorPartListener partListener = new SharedEditorPartListener(); + + private Map listenerMap = new IdentityHashMap(); + + private List sharedEditors = new LinkedList(); + + private Map displayData = new IdentityHashMap(); + + private Set listeners = new LinkedHashSet(); + + private RemoteDisplayEventHandler eventHandler = new RemoteDisplayEventHandler(); + + private AbstractEditor activeSharedEditor; + + private String editorTitleSuffix; + + private ISharedDisplaySession session; + + private SharedEditorsManager(ISharedDisplaySession session) { + this.session = session; + session.registerEventHandler(eventHandler); + editorTitleSuffix = " (" + + session.getVenue().getInfo().getVenueDescription() + ")"; + } + + public void registerRemoteRenderableDisplayChangedListener( + IRenderableDisplayChangedListener listener) { + + } + + public int getDisplayId(IRenderableDisplay display) { + int displayId = -1; + DisplayData data = displayData.get(display); + if (data != null) { + displayId = data.displayId; + } + return displayId; + } + + public AbstractEditor getActiveSharedEditor() { + return activeSharedEditor; + } + + public List getSharedEditors() { + return new ArrayList(sharedEditors); + } + + /** + * Shares the AbstractEditor for the session. Throws exception if editor is + * already being shared + * + * @param editor + * @throws CollaborationException + */ + public void shareEditor(AbstractEditor editor) + throws CollaborationException { + if (sharedEditors.contains(editor) == false) { + if (allSharedEditors.contains(sharedEditors) == false) { + // Add to tracking lists + sharedEditors.add(editor); + allSharedEditors.add(editor); + + try { + for (IDisplayPane pane : editor.getDisplayPanes()) { + shareDisplay(pane); + } + } catch (CollaborationException e) { + removeEditor(editor); + Activator.statusHandler + .handle(Priority.PROBLEM, "Error sharding editor: " + + e.getLocalizedMessage(), e); + return; + } + + // Add and manage display listener + SharedEditorDisplayChangedListener listener = new SharedEditorDisplayChangedListener( + editor); + editor.addRenderableDisplayChangedListener(listener); + listenerMap.put(editor, listener); + + // Update tab title + editor.setTabTitle(editor.getPartName() + editorTitleSuffix); + + partListener.addPage(editor.getSite().getPage()); + + // If editor is currently active, activate it! + if (EditorUtil.getActiveEditor(editor.getSite() + .getWorkbenchWindow()) == editor) { + activateEditor(editor); + } + } else { + throw new CollaborationException( + "Cannot shared editor already being shared with another session"); + } + } else { + throw new CollaborationException( + "Cannot share editor, it is already being shared with the session"); + } + } + + /** + * Removes the editor from being shared in the session. Throws exception if + * editor is not being shared by this session + * + * @param editor + * @throws CollaborationException + */ + public void removeEditor(AbstractEditor editor) + throws CollaborationException { + if (sharedEditors.contains(editor)) { + if (activeSharedEditor == editor) { + activeSharedEditor = null; + } + + // Remove renderable display listener + editor.removeRenderableDisplayChangedListener(listenerMap + .remove(editor)); + // Update tab title + String name = editor.getPartName(); + editor.setTabTitle(name.substring(0, name.length() + - editorTitleSuffix.length())); + + sharedEditors.remove(editor); + allSharedEditors.remove(editor); + partListener.removePage(editor.getSite().getPage()); + + for (IDisplayPane pane : editor.getDisplayPanes()) { + removeDisplay(pane); + } + } else { + throw new CollaborationException( + "Cannot unshare editor that isn't being shared by session"); + } + } + + /** + * Disposes the object, removes all shared editors + */ + public void dispose() { + List copy = new ArrayList(sharedEditors); + for (AbstractEditor editor : copy) { + try { + removeEditor(editor); + } catch (CollaborationException e) { + Activator.statusHandler.handle(Priority.PROBLEM, + e.getLocalizedMessage(), e); + } + } + + // Clean up any dispatchers not removed from editors + Collection data = this.displayData.values(); + for (DisplayData d : data) { + IRenderableDisplay display = d.display; + IDisplayPaneContainer container = display.getContainer(); + for (IDisplayPane pane : container.getDisplayPanes()) { + if (pane.getDisplay() == display) { + removeDisplay(pane); + break; + } + } + } + + session.unregisterEventHandler(eventHandler); + } + + /** + * Shares the display on the pane with the venue by creating a remote object + * representation for the participants, wrapping the local resources and + * injecting the remote target functionality. Should only be called if + * the display on the pane is not already being shared + * + * @param pane + * @throws CollaborationException + */ + private void shareDisplay(IDisplayPane pane) throws CollaborationException { + IRenderableDisplay display = pane.getRenderableDisplay(); + if (display instanceof AbstractRenderableDisplay) { + // Clone the display + AbstractRenderableDisplay clonedDisplay = createRemoteDisplay(display); + if (clonedDisplay != null) { + wrapDisplay(display); + // Inject with remote target, have to find pane + try { + DispatchingGraphicsFactory.injectRemoteFunctionality(pane, + factory); + } catch (InstantiationException e) { + throw new CollaborationException( + "Error injecting remote functionality", e); + } + DisplayData data = displayData.get(display); + if (data != null) { + fireListeners(data, RemoteDisplayChangeType.CREATED); + CreateRemoteDisplay event = new CreateRemoteDisplay(); + event.setDisplayId(data.displayId); + event.setDisplay(clonedDisplay); + sendEvent(event); + } else { + throw new CollaborationException( + "Remote functionality injection failed"); + } + } + } + } + + /** + * Removes the shared display capability from the display pane + * + * @param pane + */ + private void removeDisplay(IDisplayPane pane) { + IRenderableDisplay display = pane.getRenderableDisplay(); + unwrapDisplay(display); + DispatchingGraphicsFactory.extractRemoteFunctionality(pane); + DisplayData data = displayData.remove(display); + if (data != null) { + fireListeners(data, RemoteDisplayChangeType.DISPOSED); + data.dispatcher.dispose(); + data.resourceListener.dispose(); + DisposeRemoteDisplay event = new DisposeRemoteDisplay(); + event.setDisplayId(data.displayId); + sendEvent(event); + } + } + + /** + * Creates a copy of the realDisplay object that can be used to send a + * {@link CreateRemoteDisplay} event. Does not matter if display is + * currently shared or not + * + * @param realDisplay + * @return + */ + private AbstractRenderableDisplay createRemoteDisplay( + IRenderableDisplay realDisplay) { + AbstractRenderableDisplay clonedDisplay = null; + if (realDisplay instanceof AbstractRenderableDisplay) { + clonedDisplay = ((AbstractRenderableDisplay) realDisplay) + .cloneDisplay(); + ResourceList clonedList = clonedDisplay.getDescriptor() + .getResourceList(); + clonedList.clear(); + List toKeep = new ArrayList(); + for (ResourcePair rp : realDisplay.getDescriptor() + .getResourceList()) { + if (shouldBeLocal(rp)) { + AbstractResourceData resourceData = rp.getResourceData(); + if (resourceData != null) { + if (resourceData instanceof CollaborationWrapperResourceData) { + resourceData = ((CollaborationWrapperResourceData) resourceData) + .getWrappedResourceData(); + } + + // Copy ResourcePair for our remote display + ResourcePair copy = new ResourcePair(); + copy.setLoadProperties(rp.getLoadProperties()); + copy.setProperties(rp.getProperties()); + copy.setResourceData(resourceData); + toKeep.add(copy); + } + } + } + clonedList.addAll(toKeep); + } + return clonedDisplay; + } + + /** + * Wraps the resources that will not be shared and drawn locally. + * + * @param display + */ + private void wrapDisplay(IRenderableDisplay display) { + ResourceList list = display.getDescriptor().getResourceList(); + for (ResourcePair rp : list) { + wrapResourcePair(rp); + } + } + + /** + * Unwraps the local wrapped resources from the display. + * + * @param display + */ + private void unwrapDisplay(IRenderableDisplay display) { + ResourceList list = display.getDescriptor().getResourceList(); + for (ResourcePair rp : list) { + unwrapResourcePair(rp); + } + } + + private boolean wrapResourcePair(ResourcePair rp) { + boolean wrapped = false; + if (shouldBeLocal(rp) + && rp.getResource() instanceof CollaborationWrapperResource == false + && rp.getResourceData() instanceof CollaborationWrapperResourceData == false) { + AbstractResourceData resourceData = rp.getResourceData(); + // Wrap resource data with wrapper object + CollaborationWrapperResourceData wrapperRscData = new CollaborationWrapperResourceData(); + wrapperRscData.setWrappedResourceData(resourceData); + rp.setResourceData(wrapperRscData); + if (rp.getResource() != null) { + // If resource is set in pair, set here too + rp.setResource(new CollaborationWrapperResource(wrapperRscData, + rp.getLoadProperties(), rp.getResource())); + } + wrapped = true; + } + return wrapped; + } + + private boolean unwrapResourcePair(ResourcePair rp) { + boolean wasWrapped = false; + if (rp.getResourceData() instanceof CollaborationWrapperResourceData + || rp.getResource() instanceof CollaborationWrapperResource) { + if (rp.getResource() instanceof CollaborationWrapperResource) { + rp.setResource(((CollaborationWrapperResource) rp.getResource()) + .getWrappedResource()); + rp.setResourceData(rp.getResource().getResourceData()); + } else { + rp.setResourceData(((CollaborationWrapperResourceData) rp + .getResourceData()).getWrappedResourceData()); + } + wasWrapped = true; + } + return wasWrapped; + } + + /** + * Determines if the {@link ResourcePair} should be kept as a locally drawn + * resource or not + * + * @param rp + * @return + */ + private boolean shouldBeLocal(ResourcePair rp) { + return rp.getProperties().isMapLayer(); + } + + /** + * Sends an event to the venue marking the active display on the editor as + * the actively painting display + * + * @param editor + */ + private void activateEditor(AbstractEditor editor) { + if (activeSharedEditor != editor) { + activeSharedEditor = editor; + IDisplayPane pane = editor.getActiveDisplayPane(); + IRenderableDisplay display = pane.getRenderableDisplay(); + DisplayData data = displayData.get(display); + if (data != null) { + for (DisplayData d : displayData.values()) { + d.dispatcher.setActiveDisplay(display); + } + fireListeners(data, RemoteDisplayChangeType.ACTIVATED); + ActivateRemoteDisplay event = new ActivateRemoteDisplay(); + event.setDisplayId(data.displayId); + sendEvent(event); + } + } + } + + /** + * Sends a shared resource event + * + * @param rp + * resource to send + * @param remove + * whether the resource should be added or removed by the + * participants + */ + private void sendSharedResource(int displayId, ResourcePair rp, + boolean remove) { + ResourcePair copy = new ResourcePair(); + copy.setLoadProperties(rp.getLoadProperties()); + copy.setProperties(rp.getProperties()); + AbstractResourceData resourceData = rp.getResourceData(); + if (resourceData instanceof CollaborationWrapperResourceData) { + resourceData = ((CollaborationWrapperResourceData) resourceData) + .getWrappedResourceData(); + } else if (rp.getResource() instanceof CollaborationWrapperResource) { + copy.setResourceData(rp.getResource().getResourceData()); + } + copy.setResource(null); + copy.setResourceData(resourceData); + SharedResource resource = new SharedResource(); + resource.setDisplayId(displayId); + resource.setRemoveResource(remove); + resource.setResource(rp); + sendEvent(resource); + } + + /** + * Sends an object to the venue + * + * @param event + */ + private void sendEvent(Object event) { + try { + session.sendObjectToVenue(event); + } catch (CollaborationException e) { + Activator.statusHandler.handle(Priority.PROBLEM, + e.getLocalizedMessage(), e); + } + } + + private void fireListeners(DisplayData data, RemoteDisplayChangeType type) { + for (IRemoteDisplayChangedListener listener : listeners) { + listener.remoteDisplayChanged(new RemoteDisplay(data.displayId, + data.display), type); + } + } + + /* + * (non-Javadoc) + * + * @see com.raytheon.uf.viz.collaboration.display.IRemoteDisplayContainer# + * addRemoteDisplayChangedListener + * (com.raytheon.uf.viz.collaboration.display. + * IRemoteDisplayContainer.IRemoteDisplayChangedListener) + */ + @Override + public void addRemoteDisplayChangedListener( + IRemoteDisplayChangedListener listener) { + listeners.add(listener); + } + + /* + * (non-Javadoc) + * + * @see com.raytheon.uf.viz.collaboration.display.IRemoteDisplayContainer# + * removeRemoteDisplayChangedListener + * (com.raytheon.uf.viz.collaboration.display + * .IRemoteDisplayContainer.IRemoteDisplayChangedListener) + */ + @Override + public void removeRemoteDisplayChangedListener( + IRemoteDisplayChangedListener listener) { + listeners.remove(listener); + } + + /* + * (non-Javadoc) + * + * @see com.raytheon.uf.viz.collaboration.display.IRemoteDisplayContainer# + * getActiveDisplay() + */ + @Override + public RemoteDisplay getActiveDisplay() { + if (activeSharedEditor == null) { + return null; + } + DisplayData data = displayData.get(activeSharedEditor + .getActiveDisplayPane().getRenderableDisplay()); + return new RemoteDisplay(data.displayId, data.display); + } +} diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/FrameDisposed.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/FrameDisposed.java similarity index 94% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/FrameDisposed.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/FrameDisposed.java index 9b75dd141f..ce464b9040 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/FrameDisposed.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/FrameDisposed.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event; +package com.raytheon.uf.viz.collaboration.display.roles.dataprovider.event; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.viz.remote.graphics.events.DisposeObjectEvent; diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/IRenderFrameEvent.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/IRenderFrameEvent.java similarity index 93% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/IRenderFrameEvent.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/IRenderFrameEvent.java index a12ec35f80..0d24da5282 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/IRenderFrameEvent.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/IRenderFrameEvent.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event; +package com.raytheon.uf.viz.collaboration.display.roles.dataprovider.event; /** * Special interface for distinguishing IRenderFrameEvents from other render diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/MouseLocationEvent.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/MouseLocationEvent.java similarity index 97% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/MouseLocationEvent.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/MouseLocationEvent.java index 6fdbb4fab9..469585b402 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/MouseLocationEvent.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/MouseLocationEvent.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event; +package com.raytheon.uf.viz.collaboration.display.roles.dataprovider.event; import java.util.Arrays; diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/RenderFrame.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/RenderFrame.java similarity index 98% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/RenderFrame.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/RenderFrame.java index 979124ab08..1b4c2f2f74 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/RenderFrame.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/RenderFrame.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event; +package com.raytheon.uf.viz.collaboration.display.roles.dataprovider.event; import java.util.ArrayList; import java.util.Iterator; diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/RenderFrameEvent.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/RenderFrameEvent.java similarity index 96% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/RenderFrameEvent.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/RenderFrameEvent.java index e22e5057b1..21afce366d 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/RenderFrameEvent.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/RenderFrameEvent.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event; +package com.raytheon.uf.viz.collaboration.display.roles.dataprovider.event; import java.util.LinkedList; import java.util.List; diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/RenderFrameNeededEvent.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/RenderFrameNeededEvent.java similarity index 95% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/RenderFrameNeededEvent.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/RenderFrameNeededEvent.java index f2a09bdd2d..358ee0abad 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/RenderFrameNeededEvent.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/RenderFrameNeededEvent.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event; +package com.raytheon.uf.viz.collaboration.display.roles.dataprovider.event; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.viz.remote.graphics.events.AbstractDispatchingObjectEvent; diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/UpdateRenderFrameEvent.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/UpdateRenderFrameEvent.java similarity index 94% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/UpdateRenderFrameEvent.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/UpdateRenderFrameEvent.java index 6b41dc7deb..dcf4e4faa3 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/UpdateRenderFrameEvent.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/UpdateRenderFrameEvent.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event; +package com.raytheon.uf.viz.collaboration.display.roles.dataprovider.event; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.viz.remote.graphics.events.rendering.IRenderEvent; diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/DataProviderRsc.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/rsc/DataProviderRsc.java similarity index 85% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/DataProviderRsc.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/rsc/DataProviderRsc.java index c8d94b2821..0f793aa63c 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/DataProviderRsc.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/rsc/DataProviderRsc.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.rsc; +package com.raytheon.uf.viz.collaboration.display.roles.dataprovider.rsc; import org.opengis.referencing.crs.CoordinateReferenceSystem; @@ -25,10 +25,10 @@ import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException; import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession; import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenueInfo; -import com.raytheon.uf.viz.collaboration.display.editor.ReprojectEditor; -import com.raytheon.uf.viz.collaboration.ui.Activator; -import com.raytheon.uf.viz.collaboration.ui.data.SessionContainer; -import com.raytheon.uf.viz.collaboration.ui.data.SharedDisplaySessionMgr; +import com.raytheon.uf.viz.collaboration.display.Activator; +import com.raytheon.uf.viz.collaboration.display.data.SessionContainer; +import com.raytheon.uf.viz.collaboration.display.data.SharedDisplaySessionMgr; +import com.raytheon.uf.viz.collaboration.display.editor.ReprojectRemoteDisplay; import com.raytheon.uf.viz.core.IGraphicsTarget; import com.raytheon.uf.viz.core.drawables.IDescriptor; import com.raytheon.uf.viz.core.drawables.PaintProperties; @@ -77,10 +77,6 @@ public class DataProviderRsc extends } } - public DataProviderRsc(DataProviderRsc rsc) { - this(rsc.getResourceData(), rsc.getLoadProperties()); - } - @Override protected void disposeInternal() { @@ -106,8 +102,9 @@ public class DataProviderRsc extends */ @Override public void project(CoordinateReferenceSystem crs) throws VizException { - ReprojectEditor event = new ReprojectEditor(); + ReprojectRemoteDisplay event = new ReprojectRemoteDisplay(); event.setTargetGeometry(descriptor.getGridGeometry()); + event.setDisplayId(resourceData.getDisplayId()); try { session.sendObjectToVenue(event); } catch (CollaborationException e) { @@ -126,18 +123,6 @@ public class DataProviderRsc extends return text; } - public void setRoomName(String name) { - this.roomName = name; - } - - public void setSubject(String subject) { - this.subject = subject; - } - - public void setSession(ISharedDisplaySession session) { - this.session = session; - } - /* * (non-Javadoc) * diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/DataProviderRscData.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/rsc/DataProviderRscData.java similarity index 83% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/DataProviderRscData.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/rsc/DataProviderRscData.java index 8dbef3d90c..fef1939fe1 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/DataProviderRscData.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/rsc/DataProviderRscData.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.rsc; +package com.raytheon.uf.viz.collaboration.display.roles.dataprovider.rsc; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; @@ -50,6 +50,18 @@ public class DataProviderRscData extends AbstractResourceData { @XmlAttribute private String sessionId; + @XmlAttribute + private int displayId; + + public DataProviderRscData() { + + } + + public DataProviderRscData(String sessionId, int displayId) { + this.sessionId = sessionId; + this.displayId = displayId; + } + /* * (non-Javadoc) * @@ -64,6 +76,21 @@ public class DataProviderRscData extends AbstractResourceData { return new DataProviderRsc(this, loadProperties); } + /** + * @return the displayId + */ + public int getDisplayId() { + return displayId; + } + + /** + * @param displayId + * the displayId to set + */ + public void setDisplayId(int displayId) { + this.displayId = displayId; + } + /** * @return the sessionId */ diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/CollaborationResource.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/CollaborationResource.java similarity index 76% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/CollaborationResource.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/CollaborationResource.java index 4338862660..a219d30bc0 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/CollaborationResource.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/CollaborationResource.java @@ -17,10 +17,9 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.rsc; +package com.raytheon.uf.viz.collaboration.display.rsc; import java.util.ArrayList; -import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashMap; @@ -39,18 +38,18 @@ import com.google.common.eventbus.Subscribe; import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException; import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession; -import com.raytheon.uf.viz.collaboration.display.editor.CollaborationEditor; -import com.raytheon.uf.viz.collaboration.ui.Activator; -import com.raytheon.uf.viz.collaboration.ui.data.SharedDisplaySessionMgr; -import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event.FrameDisposed; -import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event.IPersistedEvent; -import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event.IRenderFrameEvent; -import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event.MouseLocationEvent; -import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event.RenderFrameEvent; -import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event.RenderFrameNeededEvent; -import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event.UpdateRenderFrameEvent; -import com.raytheon.uf.viz.collaboration.ui.rsc.rendering.CollaborationRenderingDataManager; -import com.raytheon.uf.viz.collaboration.ui.rsc.rendering.CollaborationRenderingHandler; +import com.raytheon.uf.viz.collaboration.comm.storage.IPersistedEvent; +import com.raytheon.uf.viz.collaboration.display.Activator; +import com.raytheon.uf.viz.collaboration.display.data.SharedDisplaySessionMgr; +import com.raytheon.uf.viz.collaboration.display.editor.ICollaborationEditor; +import com.raytheon.uf.viz.collaboration.display.roles.dataprovider.event.FrameDisposed; +import com.raytheon.uf.viz.collaboration.display.roles.dataprovider.event.IRenderFrameEvent; +import com.raytheon.uf.viz.collaboration.display.roles.dataprovider.event.MouseLocationEvent; +import com.raytheon.uf.viz.collaboration.display.roles.dataprovider.event.RenderFrameEvent; +import com.raytheon.uf.viz.collaboration.display.roles.dataprovider.event.RenderFrameNeededEvent; +import com.raytheon.uf.viz.collaboration.display.roles.dataprovider.event.UpdateRenderFrameEvent; +import com.raytheon.uf.viz.collaboration.display.rsc.rendering.CollaborationRenderingDataManager; +import com.raytheon.uf.viz.collaboration.display.rsc.rendering.CollaborationRenderingHandler; import com.raytheon.uf.viz.core.IExtent; import com.raytheon.uf.viz.core.IGraphicsTarget; import com.raytheon.uf.viz.core.VizApp; @@ -155,47 +154,32 @@ public class CollaborationResource extends } } - private Map displayData; - private Rectangle previousBounds = null; - private DisplayData currentData; + private DisplayData displayData; public CollaborationResource(CollaborationResourceData resourceData, LoadProperties loadProperties) { super(resourceData, loadProperties); - displayData = new HashMap(); - } - - private DisplayData getDisplayData(int displayId) { - DisplayData data = displayData.get(displayId); - if (data == null) { - data = new DisplayData(displayId, resourceData.getSession(), this); - displayData.put(displayId, data); - } - return data; } @Override protected void disposeInternal() { resourceData.getSession().unregisterEventHandler(this); - for (DisplayData data : displayData.values()) { - data.dispose(); - } - displayData.clear(); + displayData.dispose(); } @Override protected void paintInternal(IGraphicsTarget target, PaintProperties paintProps) throws VizException { - if (currentData == null) { + if (displayData == null) { return; } - Map> renderableMap = currentData.renderableMap; - List dataChangeEvents = currentData.dataChangeEvents; - Set waitingOnObjects = currentData.waitingOnObjects; - EventBus renderingRouter = currentData.renderingRouter; + Map> renderableMap = displayData.renderableMap; + List dataChangeEvents = displayData.dataChangeEvents; + Set waitingOnObjects = displayData.waitingOnObjects; + EventBus renderingRouter = displayData.renderingRouter; // Get the renderables for my extent List currentRenderables = null; @@ -203,9 +187,9 @@ public class CollaborationResource extends currentRenderables = renderableMap.get(paintProps.getView() .getExtent()); if (currentRenderables == null) { - synchronized (currentData.currentRenderables) { + synchronized (displayData.currentRenderables) { currentRenderables = new ArrayList( - currentData.currentRenderables); + displayData.currentRenderables); } } } @@ -225,7 +209,7 @@ public class CollaborationResource extends } } - currentData.dataManager.beginRender(target, paintProps); + displayData.dataManager.beginRender(target, paintProps); synchronized (renderingRouter) { for (AbstractRemoteGraphicsEvent event : currentDataChangeEvents) { @@ -235,29 +219,29 @@ public class CollaborationResource extends for (IRenderEvent event : currentRenderables) { renderingRouter.post(event); } - if (currentData.latestMouseLocation != null) { - renderingRouter.post(currentData.latestMouseLocation); + if (displayData.latestMouseLocation != null) { + renderingRouter.post(displayData.latestMouseLocation); } } } - public void lockObject(int displayId, int objectId) { - DisplayData data = getDisplayData(displayId); - synchronized (data.dataChangeEvents) { - data.waitingOnObjects.add(objectId); + public void lockObject(int objectId) { + synchronized (displayData.dataChangeEvents) { + displayData.waitingOnObjects.add(objectId); } } - public void unlockObject(int displayId, int objectId) { - DisplayData data = getDisplayData(displayId); - synchronized (data.dataChangeEvents) { - data.waitingOnObjects.remove(objectId); + public void unlockObject(int objectId) { + synchronized (displayData.dataChangeEvents) { + displayData.waitingOnObjects.remove(objectId); } } @Override protected void initInternal(IGraphicsTarget target) throws VizException { ISharedDisplaySession session = resourceData.getSession(); + displayData = new DisplayData(resourceData.getDisplayId(), session, + this); ParticipantInitializedEvent event = new ParticipantInitializedEvent(); event.setUserId(session.getUserID().getFQName()); try { @@ -271,13 +255,14 @@ public class CollaborationResource extends @Subscribe public void updateRenderFrameEvent(UpdateRenderFrameEvent event) { - DisplayData data = getDisplayData(event.getDisplayId()); - currentData = data; + if (event.getDisplayId() != resourceData.getDisplayId()) { + return; + } int objectId = event.getObjectId(); - RenderFrameEvent frame = data.dataManager.getRenderableObject(objectId, - RenderFrameEvent.class, false); + RenderFrameEvent frame = displayData.dataManager.getRenderableObject( + objectId, RenderFrameEvent.class, false); if (frame == null) { - if (data.waitingOnFrames.contains(objectId) == false) { + if (displayData.waitingOnFrames.contains(objectId) == false) { RenderFrameNeededEvent needEvent = new RenderFrameNeededEvent(); needEvent.setDisplayId(event.getDisplayId()); needEvent.setObjectId(objectId); @@ -285,7 +270,7 @@ public class CollaborationResource extends try { session.sendObjectToPeer(session.getCurrentDataProvider(), needEvent); - data.waitingOnFrames.add(objectId); + displayData.waitingOnFrames.add(objectId); } catch (CollaborationException e) { Activator.statusHandler.handle(Priority.PROBLEM, "Error sending message to data provider", e); @@ -330,34 +315,39 @@ public class CollaborationResource extends @Subscribe public void renderFrameEvent(RenderFrameEvent event) { - DisplayData data = getDisplayData(event.getDisplayId()); - currentData = data; + if (event.getDisplayId() != resourceData.getDisplayId()) { + return; + } if (event instanceof UpdateRenderFrameEvent == false) { // Not an update event, new frame int objectId = event.getObjectId(); for (IRenderEvent re : event.getRenderEvents()) { renderableArrived((AbstractRemoteGraphicsEvent) re.clone()); } - data.dataManager.putRenderableObject(objectId, event); + displayData.dataManager.putRenderableObject(objectId, event); } issueRefresh(); } @Subscribe public void disposeRenderFrame(FrameDisposed event) { - DisplayData data = getDisplayData(event.getDisplayId()); - data.waitingOnFrames.remove(event.getObjectId()); - data.dataManager.dispose(event.getObjectId()); + if (event.getDisplayId() != resourceData.getDisplayId()) { + return; + } + displayData.waitingOnFrames.remove(event.getObjectId()); + displayData.dataManager.dispose(event.getObjectId()); } @Subscribe public void persitableArrived(final IPersistedEvent event) { + if (event.getDisplayId() != resourceData.getDisplayId()) { + return; + } retrievePool.schedule(new Runnable() { @Override public void run() { try { - DisplayData data = getDisplayData(event.getDisplayId()); - AbstractDispatchingObjectEvent objectEvent = data.dataManager + AbstractDispatchingObjectEvent objectEvent = displayData.dataManager .retrieveEvent(event); if (objectEvent != null) { renderableArrived(objectEvent); @@ -371,31 +361,30 @@ public class CollaborationResource extends } public void postObjectEvent(AbstractDispatchingObjectEvent event) { - DisplayData data = getDisplayData(event.getDisplayId()); - synchronized (data.renderingRouter) { - data.renderingRouter.post(event); + synchronized (displayData.renderingRouter) { + displayData.renderingRouter.post(event); } } @Subscribe public void renderableArrived(AbstractRemoteGraphicsEvent event) { - if (event instanceof IRenderFrameEvent) { + if (event.getDisplayId() != resourceData.getDisplayId() + || event instanceof IRenderFrameEvent) { // Skip IRenderFrameEvents, not applicable here return; } - DisplayData data = getDisplayData(event.getDisplayId()); if (event instanceof IRenderEvent) { // Render based event if (event instanceof BeginFrameEvent) { // If begin frame event, clear current active renderables - data.activeRenderables.clear(); - data.activeRenderables.add((IRenderEvent) event); + displayData.activeRenderables.clear(); + displayData.activeRenderables.add((IRenderEvent) event); } else if (event instanceof EndFrameEvent) { - synchronized (data.currentRenderables) { + synchronized (displayData.currentRenderables) { IExtent current = null; - data.currentRenderables.clear(); + displayData.currentRenderables.clear(); // Frame over, process BeginFrameEvent now to keep in sync - for (IRenderEvent renderable : data.activeRenderables) { + for (IRenderEvent renderable : displayData.activeRenderables) { if (renderable instanceof BeginFrameEvent) { // Handle begin frame event immediately before next // paint occurs @@ -403,7 +392,7 @@ public class CollaborationResource extends .getRenderableDisplay(); final BeginFrameEvent bfe = (BeginFrameEvent) renderable; display.setBackgroundColor(bfe.getColor()); - final CollaborationEditor editor = SharedDisplaySessionMgr + final ICollaborationEditor editor = SharedDisplaySessionMgr .getSessionContainer( resourceData.getSession() .getSessionId()) @@ -414,7 +403,9 @@ public class CollaborationResource extends VizApp.runAsync(new Runnable() { @Override public void run() { - editor.setCanvasSize(bfe.getBounds()); + editor.setCanvasBounds( + bfe.getDisplayId(), + bfe.getBounds()); display.getView().setExtent( bfe.getExtent()); } @@ -425,25 +416,25 @@ public class CollaborationResource extends current = bfe.getExtent(); } else { // Add to list for processing in paintInternal - data.currentRenderables.add(renderable); + displayData.currentRenderables.add(renderable); } } - data.activeRenderables.clear(); - data.renderableMap - .put(current, new ArrayList( - data.currentRenderables)); + displayData.activeRenderables.clear(); + displayData.renderableMap.put(current, + new ArrayList( + displayData.currentRenderables)); } issueRefresh(); } else if (event instanceof MouseLocationEvent) { - data.latestMouseLocation = (MouseLocationEvent) event; + displayData.latestMouseLocation = (MouseLocationEvent) event; issueRefresh(); } else { - data.activeRenderables.add((IRenderEvent) event); + displayData.activeRenderables.add((IRenderEvent) event); } } else if (event instanceof AbstractDispatchingObjectEvent) { // If not IRenderEvent, event modifies data object - synchronized (data.dataChangeEvents) { - data.dataChangeEvents + synchronized (displayData.dataChangeEvents) { + displayData.dataChangeEvents .add((AbstractDispatchingObjectEvent) event); } issueRefresh(); diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/CollaborationResourceData.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/CollaborationResourceData.java similarity index 89% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/CollaborationResourceData.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/CollaborationResourceData.java index c7781a4e7c..c923a3a57b 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/CollaborationResourceData.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/CollaborationResourceData.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.rsc; +package com.raytheon.uf.viz.collaboration.display.rsc; import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession; import com.raytheon.uf.viz.core.drawables.IDescriptor; @@ -48,6 +48,18 @@ public class CollaborationResourceData extends AbstractResourceData { private ISharedDisplaySession session; + private int displayId; + + /** + * @param session2 + * @param displayId2 + */ + public CollaborationResourceData(ISharedDisplaySession session, + int displayId) { + this.session = session; + this.displayId = displayId; + } + /* * (non-Javadoc) * @@ -108,11 +120,10 @@ public class CollaborationResourceData extends AbstractResourceData { } /** - * @param session - * the session to set + * @return the displayId */ - public void setSession(ISharedDisplaySession session) { - this.session = session; + public int getDisplayId() { + return displayId; } } diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/CollaborationWrapperResource.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/CollaborationWrapperResource.java similarity index 99% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/CollaborationWrapperResource.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/CollaborationWrapperResource.java index 16ef8d37f3..b46f5f3f25 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/CollaborationWrapperResource.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/CollaborationWrapperResource.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.rsc; +package com.raytheon.uf.viz.collaboration.display.rsc; import java.util.Map; diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/CollaborationWrapperResourceData.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/CollaborationWrapperResourceData.java similarity index 98% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/CollaborationWrapperResourceData.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/CollaborationWrapperResourceData.java index 180c853803..31a95ab0a2 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/CollaborationWrapperResourceData.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/CollaborationWrapperResourceData.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.rsc; +package com.raytheon.uf.viz.collaboration.display.rsc; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/ParticipantInitializedEvent.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/ParticipantInitializedEvent.java similarity index 96% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/ParticipantInitializedEvent.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/ParticipantInitializedEvent.java index edce6fa0cb..226849ea4f 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/ParticipantInitializedEvent.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/ParticipantInitializedEvent.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.rsc; +package com.raytheon.uf.viz.collaboration.display.rsc; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/SelfAddingSystemResourceListener.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/SelfAddingSystemResourceListener.java new file mode 100644 index 0000000000..0e8bba11e2 --- /dev/null +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/SelfAddingSystemResourceListener.java @@ -0,0 +1,89 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.collaboration.display.rsc; + +import com.raytheon.uf.viz.core.drawables.IDescriptor; +import com.raytheon.uf.viz.core.drawables.ResourcePair; +import com.raytheon.uf.viz.core.exception.VizException; +import com.raytheon.uf.viz.core.rsc.AbstractResourceData; +import com.raytheon.uf.viz.core.rsc.ResourceList; +import com.raytheon.uf.viz.core.rsc.ResourceList.RemoveListener; + +/** + * Listener that manages a system resource and readds it when it is removed + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 13, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ + +public class SelfAddingSystemResourceListener implements RemoveListener { + + protected IDescriptor descriptor; + + private ResourcePair resource; + + public SelfAddingSystemResourceListener(AbstractResourceData resourceData, + IDescriptor descriptor) throws VizException { + this.descriptor = descriptor; + addResource(resourceData); + descriptor.getResourceList().addPostRemoveListener(this); + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.viz.core.rsc.ResourceList.RemoveListener#notifyRemove + * (com.raytheon.uf.viz.core.drawables.ResourcePair) + */ + @Override + public void notifyRemove(ResourcePair rp) throws VizException { + if (rp == resource) { + addResource(rp.getResourceData()); + } + } + + /** + * + */ + private void addResource(AbstractResourceData resourceData) + throws VizException { + resource = ResourcePair.constructSystemResourcePair(resourceData); + resource.instantiateResource(descriptor, true); + descriptor.getResourceList().add(resource); + } + + public void dispose() { + ResourceList resourceList = descriptor.getResourceList(); + resourceList.removePostRemoveListener(this); + resourceList.remove(resource); + } + +} diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/editor/SharedResource.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/SharedResource.java similarity index 86% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/editor/SharedResource.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/SharedResource.java index 0fa7935a76..adf454e8f0 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/editor/SharedResource.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/SharedResource.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.editor; +package com.raytheon.uf.viz.collaboration.display.rsc; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; @@ -49,12 +49,30 @@ import com.raytheon.uf.viz.core.drawables.ResourcePair; @XmlRootElement public class SharedResource implements ISerializableObject { + @XmlAttribute + private int displayId; + @XmlAttribute private boolean removeResource = false; @XmlElement private ResourcePair resource; + /** + * @return the displayId + */ + public int getDisplayId() { + return displayId; + } + + /** + * @param displayId + * the displayId to set + */ + public void setDisplayId(int displayId) { + this.displayId = displayId; + } + /** * @return the resource */ diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/CollaborationRenderingDataManager.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/rendering/CollaborationRenderingDataManager.java similarity index 93% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/CollaborationRenderingDataManager.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/rendering/CollaborationRenderingDataManager.java index 4e3c552538..0f8b393f3b 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/CollaborationRenderingDataManager.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/rendering/CollaborationRenderingDataManager.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.rsc.rendering; +package com.raytheon.uf.viz.collaboration.display.rsc.rendering; import java.util.ArrayList; import java.util.Arrays; @@ -38,11 +38,11 @@ import com.google.common.eventbus.EventBus; import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException; import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession; -import com.raytheon.uf.viz.collaboration.ui.Activator; -import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.CollaborationObjectEventStorage; -import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.IObjectEventRetrieval; -import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event.IPersistedEvent; -import com.raytheon.uf.viz.collaboration.ui.rsc.CollaborationResource; +import com.raytheon.uf.viz.collaboration.comm.storage.CollaborationObjectEventStorage; +import com.raytheon.uf.viz.collaboration.comm.storage.IObjectEventRetrieval; +import com.raytheon.uf.viz.collaboration.comm.storage.IPersistedEvent; +import com.raytheon.uf.viz.collaboration.display.Activator; +import com.raytheon.uf.viz.collaboration.display.rsc.CollaborationResource; import com.raytheon.uf.viz.core.IGraphicsTarget; import com.raytheon.uf.viz.core.drawables.PaintProperties; import com.raytheon.uf.viz.remote.graphics.events.AbstractDispatchingObjectEvent; @@ -66,7 +66,7 @@ import com.raytheon.uf.viz.remote.graphics.events.AbstractDispatchingObjectEvent public class CollaborationRenderingDataManager implements IObjectEventRetrieval { - private static final String RENDERING_EXTENSION = "com.raytheon.uf.viz.collaboration.ui.renderingExtension"; + private static final String RENDERING_EXTENSION = "com.raytheon.uf.viz.collaboration.display.renderingExtension"; private static Collection handlerElements = new LinkedList(); @@ -188,7 +188,7 @@ public class CollaborationRenderingDataManager implements IObjectEventRetrieval } } else if (retrieve) { try { - resource.lockObject(displayId, objectId); + resource.lockObject(objectId); AbstractDispatchingObjectEvent[] events = retrieveObjectEvents(objectId); for (AbstractDispatchingObjectEvent event : events) { resource.postObjectEvent(event); @@ -200,7 +200,7 @@ public class CollaborationRenderingDataManager implements IObjectEventRetrieval "Error retrieving object events: " + e.getLocalizedMessage(), e); } finally { - resource.unlockObject(displayId, objectId); + resource.unlockObject(objectId); } } return obj; diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/CollaborationRenderingHandler.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/rendering/CollaborationRenderingHandler.java similarity index 96% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/CollaborationRenderingHandler.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/rendering/CollaborationRenderingHandler.java index d20d937a16..165f625c50 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/CollaborationRenderingHandler.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/rendering/CollaborationRenderingHandler.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.rsc.rendering; +package com.raytheon.uf.viz.collaboration.display.rsc.rendering; import com.raytheon.uf.viz.core.IGraphicsTarget; import com.raytheon.uf.viz.core.drawables.PaintProperties; diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/GeneralRenderingHandler.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/rendering/GeneralRenderingHandler.java similarity index 95% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/GeneralRenderingHandler.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/rendering/GeneralRenderingHandler.java index 5423367881..1692ec79cb 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/GeneralRenderingHandler.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/rendering/GeneralRenderingHandler.java @@ -17,14 +17,14 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.rsc.rendering; +package com.raytheon.uf.viz.collaboration.display.rsc.rendering; import org.eclipse.swt.graphics.RGB; import com.google.common.eventbus.Subscribe; import com.raytheon.uf.common.status.UFStatus.Priority; -import com.raytheon.uf.viz.collaboration.ui.Activator; -import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event.MouseLocationEvent; +import com.raytheon.uf.viz.collaboration.display.Activator; +import com.raytheon.uf.viz.collaboration.display.roles.dataprovider.event.MouseLocationEvent; import com.raytheon.uf.viz.core.DrawableCircle; import com.raytheon.uf.viz.core.IGraphicsTarget; import com.raytheon.uf.viz.core.PixelExtent; diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/ImagingRenderingHandler.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/rendering/ImagingRenderingHandler.java similarity index 99% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/ImagingRenderingHandler.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/rendering/ImagingRenderingHandler.java index 23ff540595..abf471828b 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/ImagingRenderingHandler.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/rendering/ImagingRenderingHandler.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.rsc.rendering; +package com.raytheon.uf.viz.collaboration.display.rsc.rendering; import java.awt.image.RenderedImage; import java.util.ArrayList; @@ -26,7 +26,7 @@ import java.util.List; import com.google.common.eventbus.Subscribe; import com.raytheon.uf.common.colormap.IColorMap; import com.raytheon.uf.common.status.UFStatus.Priority; -import com.raytheon.uf.viz.collaboration.ui.Activator; +import com.raytheon.uf.viz.collaboration.display.Activator; import com.raytheon.uf.viz.core.DrawableImage; import com.raytheon.uf.viz.core.IGraphicsTarget; import com.raytheon.uf.viz.core.IMesh; diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/OffscreenRenderingHandler.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/rendering/OffscreenRenderingHandler.java similarity index 97% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/OffscreenRenderingHandler.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/rendering/OffscreenRenderingHandler.java index f62c55ea11..470a31a5d8 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/OffscreenRenderingHandler.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/rendering/OffscreenRenderingHandler.java @@ -17,13 +17,13 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.rsc.rendering; +package com.raytheon.uf.viz.collaboration.display.rsc.rendering; import java.nio.Buffer; import com.google.common.eventbus.Subscribe; import com.raytheon.uf.common.status.UFStatus.Priority; -import com.raytheon.uf.viz.collaboration.ui.Activator; +import com.raytheon.uf.viz.collaboration.display.Activator; import com.raytheon.uf.viz.core.IGraphicsTarget; import com.raytheon.uf.viz.core.drawables.IImage; import com.raytheon.uf.viz.core.drawables.ext.IOffscreenRenderingExtension; diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/PrimitiveRenderingHandler.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/rendering/PrimitiveRenderingHandler.java similarity index 96% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/PrimitiveRenderingHandler.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/rendering/PrimitiveRenderingHandler.java index 8b4296b176..5833fb668e 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/PrimitiveRenderingHandler.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/rendering/PrimitiveRenderingHandler.java @@ -17,11 +17,11 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.rsc.rendering; +package com.raytheon.uf.viz.collaboration.display.rsc.rendering; import com.google.common.eventbus.Subscribe; import com.raytheon.uf.common.status.UFStatus.Priority; -import com.raytheon.uf.viz.collaboration.ui.Activator; +import com.raytheon.uf.viz.collaboration.display.Activator; import com.raytheon.uf.viz.core.DrawableCircle; import com.raytheon.uf.viz.core.DrawableLine; import com.raytheon.uf.viz.core.IGraphicsTarget; diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/ShapeRenderingHandler.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/rendering/ShapeRenderingHandler.java similarity index 98% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/ShapeRenderingHandler.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/rendering/ShapeRenderingHandler.java index a6aa523295..87ee128095 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/ShapeRenderingHandler.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/rendering/ShapeRenderingHandler.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.rsc.rendering; +package com.raytheon.uf.viz.collaboration.display.rsc.rendering; import java.util.HashMap; @@ -25,7 +25,7 @@ import org.eclipse.swt.graphics.RGB; import com.google.common.eventbus.Subscribe; import com.raytheon.uf.common.status.UFStatus.Priority; -import com.raytheon.uf.viz.collaboration.ui.Activator; +import com.raytheon.uf.viz.collaboration.display.Activator; import com.raytheon.uf.viz.core.IGraphicsTarget; import com.raytheon.uf.viz.core.drawables.IFont; import com.raytheon.uf.viz.core.drawables.IShadedShape; diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/StringRenderingHandler.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/rendering/StringRenderingHandler.java similarity index 97% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/StringRenderingHandler.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/rendering/StringRenderingHandler.java index 875a7d4557..8947ec907b 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/StringRenderingHandler.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/rendering/StringRenderingHandler.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.rsc.rendering; +package com.raytheon.uf.viz.collaboration.display.rsc.rendering; import java.io.File; import java.io.IOException; @@ -25,7 +25,7 @@ import java.io.IOException; import com.google.common.eventbus.Subscribe; import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.util.FileUtil; -import com.raytheon.uf.viz.collaboration.ui.Activator; +import com.raytheon.uf.viz.collaboration.display.Activator; import com.raytheon.uf.viz.core.DrawableString; import com.raytheon.uf.viz.core.IGraphicsTarget; import com.raytheon.uf.viz.core.drawables.IFont; diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/telestrator/event/CollaborationDrawingEvent.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/telestrator/CollaborationDrawingEvent.java similarity index 80% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/telestrator/event/CollaborationDrawingEvent.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/telestrator/CollaborationDrawingEvent.java index 8204e911a8..14f6c59cec 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/telestrator/event/CollaborationDrawingEvent.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/telestrator/CollaborationDrawingEvent.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.telestrator.event; +package com.raytheon.uf.viz.collaboration.display.rsc.telestrator; import java.util.List; @@ -47,9 +47,12 @@ import com.vividsolutions.jts.geom.Coordinate; public class CollaborationDrawingEvent { public static enum CollaborationEventType { - DRAW, ERASE, REDO, UNDO, CLEAR, TOGGLE_LOCK, CLEAR_ALL; + DRAW, ERASE, REDO, UNDO, CLEAR, LOCK_USERS, UNLOCK_USERS, CLEAR_ALL; } + @DynamicSerializeElement + private int displayId; + @DynamicSerializeElement private List coordinates; @@ -59,6 +62,29 @@ public class CollaborationDrawingEvent { @DynamicSerializeElement private CollaborationEventType type; + public CollaborationDrawingEvent() { + + } + + public CollaborationDrawingEvent(int displayId) { + this.displayId = displayId; + } + + /** + * @return the displayId + */ + public int getDisplayId() { + return displayId; + } + + /** + * @param displayId + * the displayId to set + */ + public void setDisplayId(int displayId) { + this.displayId = displayId; + } + /** * @return the coordinates */ diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/telestrator/CollaborationDrawingResource.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/telestrator/CollaborationDrawingResource.java similarity index 85% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/telestrator/CollaborationDrawingResource.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/telestrator/CollaborationDrawingResource.java index e4301aa75f..2050ee60f1 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/telestrator/CollaborationDrawingResource.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/telestrator/CollaborationDrawingResource.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.telestrator; +package com.raytheon.uf.viz.collaboration.display.rsc.telestrator; import java.util.HashMap; import java.util.List; @@ -30,11 +30,10 @@ import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException; import com.raytheon.uf.viz.collaboration.comm.identity.event.IVenueParticipantEvent; import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; -import com.raytheon.uf.viz.collaboration.ui.Activator; -import com.raytheon.uf.viz.collaboration.ui.data.SessionContainer; -import com.raytheon.uf.viz.collaboration.ui.data.SharedDisplaySessionMgr; -import com.raytheon.uf.viz.collaboration.ui.telestrator.event.CollaborationDrawingEvent; -import com.raytheon.uf.viz.collaboration.ui.telestrator.event.CollaborationDrawingEvent.CollaborationEventType; +import com.raytheon.uf.viz.collaboration.display.Activator; +import com.raytheon.uf.viz.collaboration.display.data.SessionContainer; +import com.raytheon.uf.viz.collaboration.display.data.SharedDisplaySessionMgr; +import com.raytheon.uf.viz.collaboration.display.rsc.telestrator.CollaborationDrawingEvent.CollaborationEventType; import com.raytheon.uf.viz.core.IGraphicsTarget; import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle; import com.raytheon.uf.viz.core.drawables.IDescriptor; @@ -88,17 +87,17 @@ public class CollaborationDrawingResource extends */ public CollaborationDrawingResource( CollaborationDrawingResourceData resourceData, - LoadProperties loadProperties) { + LoadProperties loadProperties) throws VizException { super(resourceData, loadProperties); - } + container = SharedDisplaySessionMgr.getSessionContainer(resourceData + .getSessionId()); + if (container == null) { + throw new VizException("Could not find container for sessionId: " + + resourceData.getSessionId()); + } - public CollaborationDrawingResource(CollaborationDrawingResource resource) { - super(resource.getResourceData(), resource.getLoadProperties()); - this.layerMap = new HashMap(resource.layerMap); - resource.layerMap.clear(); - this.myUser = resource.myUser; - this.getCapabilities().addCapability( - resource.getCapability(OutlineCapability.class)); + myUser = container.getSession().getUserID(); + layerMap = new HashMap(); } /* @@ -111,36 +110,32 @@ public class CollaborationDrawingResource extends @Override protected void initInternal(IGraphicsTarget target) throws VizException { EditableManager.makeEditable(this, true); - container = SharedDisplaySessionMgr.getSessionContainer(resourceData - .getSessionId()); - if (container == null) { - throw new VizException("Could not find container for sessionId: " - + resourceData.getSessionId()); + if (layerMap == null) { + layerMap = new HashMap(); } - if (layerMap == null) { - // Don't reinitialized - myUser = container.getSession().getUserID(); - layerMap = new HashMap(); + OutlineCapability outline = getCapability(OutlineCapability.class); + outline.setLineStyle(LineStyle.SOLID); + outline.setOutlineWidth(4); + outline.setSuppressingMenuItems(true); - OutlineCapability outline = getCapability(OutlineCapability.class); - outline.setLineStyle(LineStyle.SOLID); - outline.setOutlineWidth(4); - outline.setSuppressingMenuItems(true); + ColorableCapability colorable = getCapability(ColorableCapability.class); + colorable.setSuppressingMenuItems(true); - ColorableCapability colorable = getCapability(ColorableCapability.class); - colorable.setSuppressingMenuItems(true); - - if (isSessionLeader()) { - CollaborationDrawingEvent event = new CollaborationDrawingEvent(); - event.setUserName(myUser); - event.setType(CollaborationEventType.CLEAR_ALL); - sendEvent(event); - } + if (isSessionLeader()) { + CollaborationDrawingEvent event = new CollaborationDrawingEvent( + resourceData.getDisplayId()); + event.setUserName(myUser); + event.setType(CollaborationEventType.CLEAR_ALL); + sendEvent(event); } manager = new CollaborationDrawingUIManager(this); container.getSession().registerEventHandler(this); + + getDrawingLayerFor(getMyUser()).setDrawMode( + resourceData.getResourceMode()); + setLockingDrawing(resourceData.isLocking()); } /* @@ -273,12 +268,17 @@ public class CollaborationDrawingResource extends } public void setLockingDrawing(boolean lockingDrawing) { - this.lockingDrawing = lockingDrawing; - if (isSessionLeader()) { - CollaborationDrawingEvent event = new CollaborationDrawingEvent(); - event.setUserName(myUser); - event.setType(CollaborationEventType.TOGGLE_LOCK); - sendEvent(event); + if (this.lockingDrawing != lockingDrawing) { + resourceData.setLocking(lockingDrawing); + this.lockingDrawing = lockingDrawing; + if (isSessionLeader()) { + CollaborationDrawingEvent event = new CollaborationDrawingEvent( + resourceData.getDisplayId()); + event.setUserName(myUser); + event.setType(lockingDrawing ? CollaborationEventType.LOCK_USERS + : CollaborationEventType.UNLOCK_USERS); + sendEvent(event); + } } } @@ -314,7 +314,8 @@ public class CollaborationDrawingResource extends @Subscribe public void handleDrawEvent(CollaborationDrawingEvent event) { UserId user = event.getUserName(); - if (user.equals(myUser)) { + if (event.getDisplayId() != resourceData.getDisplayId() + || user.equals(myUser)) { // Early exit case, don't process my own events twice issueRefresh(); return; @@ -327,9 +328,13 @@ public class CollaborationDrawingResource extends case CLEAR: layer.clear(); break; - case TOGGLE_LOCK: - // Toggle locking - setLockingDrawing(!isLockingDrawing()); + case LOCK_USERS: + // lock + setLockingDrawing(true); + break; + case UNLOCK_USERS: + // unlock + setLockingDrawing(false); break; case DRAW: layer.setDrawMode(DrawMode.DRAW); diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/telestrator/CollaborationDrawingResourceData.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/telestrator/CollaborationDrawingResourceData.java similarity index 71% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/telestrator/CollaborationDrawingResourceData.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/telestrator/CollaborationDrawingResourceData.java index ae436b172f..7c2948b7e5 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/telestrator/CollaborationDrawingResourceData.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/telestrator/CollaborationDrawingResourceData.java @@ -17,16 +17,18 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.telestrator; +package com.raytheon.uf.viz.collaboration.display.rsc.telestrator; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; import com.raytheon.uf.viz.core.drawables.IDescriptor; import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.rsc.AbstractResourceData; import com.raytheon.uf.viz.core.rsc.LoadProperties; +import com.raytheon.uf.viz.drawing.DrawingToolLayer.DrawMode; /** * Resource data for the CollaborationDrawingResource @@ -50,6 +52,15 @@ public class CollaborationDrawingResourceData extends AbstractResourceData { @XmlAttribute private String sessionId; + @XmlAttribute + private int displayId; + + @XmlElement + private DrawMode resourceMode = DrawMode.NONE; + + @XmlAttribute + private boolean locking = false; + /* * (non-Javadoc) * @@ -80,6 +91,51 @@ public class CollaborationDrawingResourceData extends AbstractResourceData { this.sessionId = sessionId; } + /** + * @return the displayId + */ + public int getDisplayId() { + return displayId; + } + + /** + * @param displayId + * the displayId to set + */ + public void setDisplayId(int displayId) { + this.displayId = displayId; + } + + /** + * @return the resourceMode + */ + public DrawMode getResourceMode() { + return resourceMode; + } + + /** + * @param resourceMode + * the resourceMode to set + */ + public void setResourceMode(DrawMode resourceMode) { + this.resourceMode = resourceMode; + } + + /** + * @return the locking + */ + public boolean isLocking() { + return locking; + } + + /** + * @param locking + * the locking to set + */ + public void setLocking(boolean locking) { + this.locking = locking; + } + /* * (non-Javadoc) * diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/telestrator/CollaborationDrawingToolLayer.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/telestrator/CollaborationDrawingToolLayer.java similarity index 85% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/telestrator/CollaborationDrawingToolLayer.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/telestrator/CollaborationDrawingToolLayer.java index b6d82c7bac..33e6716cd0 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/telestrator/CollaborationDrawingToolLayer.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/telestrator/CollaborationDrawingToolLayer.java @@ -17,15 +17,14 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.telestrator; +package com.raytheon.uf.viz.collaboration.display.rsc.telestrator; import java.util.ArrayList; import java.util.List; import org.geotools.coverage.grid.GeneralGridGeometry; -import com.raytheon.uf.viz.collaboration.ui.telestrator.event.CollaborationDrawingEvent; -import com.raytheon.uf.viz.collaboration.ui.telestrator.event.CollaborationDrawingEvent.CollaborationEventType; +import com.raytheon.uf.viz.collaboration.display.rsc.telestrator.CollaborationDrawingEvent.CollaborationEventType; import com.raytheon.uf.viz.drawing.DrawingToolLayer; import com.vividsolutions.jts.geom.Coordinate; @@ -62,6 +61,19 @@ public class CollaborationDrawingToolLayer extends DrawingToolLayer { this.resource = resource; } + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.viz.drawing.DrawingToolLayer#setDrawMode(com.raytheon + * .uf.viz.drawing.DrawingToolLayer.DrawMode) + */ + @Override + public void setDrawMode(DrawMode drawMode) { + super.setDrawMode(drawMode); + resource.getResourceData().setResourceMode(drawMode); + } + /* * (non-Javadoc) * @@ -131,7 +143,8 @@ public class CollaborationDrawingToolLayer extends DrawingToolLayer { } private void sendCoordinateEvent(CollaborationEventType type) { - CollaborationDrawingEvent event = new CollaborationDrawingEvent(); + CollaborationDrawingEvent event = new CollaborationDrawingEvent( + resource.getResourceData().getDisplayId()); event.setType(type); event.setUserName(resource.getMyUser()); event.setCoordinates(new ArrayList(coordinates)); @@ -140,7 +153,8 @@ public class CollaborationDrawingToolLayer extends DrawingToolLayer { } private void sendSimpleEvent(CollaborationEventType type) { - CollaborationDrawingEvent event = new CollaborationDrawingEvent(); + CollaborationDrawingEvent event = new CollaborationDrawingEvent( + resource.getResourceData().getDisplayId()); event.setType(type); event.setUserName(resource.getMyUser()); resource.sendEvent(event); diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/telestrator/CollaborationDrawingUIManager.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/telestrator/CollaborationDrawingUIManager.java similarity index 59% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/telestrator/CollaborationDrawingUIManager.java rename to cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/telestrator/CollaborationDrawingUIManager.java index 577cd600fc..501ee9c89d 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/telestrator/CollaborationDrawingUIManager.java +++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/telestrator/CollaborationDrawingUIManager.java @@ -17,14 +17,8 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.telestrator; +package com.raytheon.uf.viz.collaboration.display.rsc.telestrator; -import org.eclipse.ui.IViewReference; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.PlatformUI; - -import com.raytheon.uf.viz.collaboration.ui.session.CollaborationSessionView; -import com.raytheon.uf.viz.core.VizApp; import com.raytheon.uf.viz.drawing.DrawingToolUIManager; /** @@ -49,25 +43,10 @@ public class CollaborationDrawingUIManager extends DrawingToolUIManager { private CollaborationDrawingResource resource; - private CollaborationSessionView view; - public CollaborationDrawingUIManager(CollaborationDrawingResource resource) { super(resource.getDrawingLayerFor(resource.getMyUser()), resource .getResourceContainer()); this.resource = resource; - VizApp.runAsync(new Runnable() { - @Override - public void run() { - CollaborationDrawingResource resource = CollaborationDrawingUIManager.this.resource; - IWorkbenchPage page = PlatformUI.getWorkbench() - .getActiveWorkbenchWindow().getActivePage(); - IViewReference viewRef = page.findViewReference( - CollaborationSessionView.ID, resource.getContainer() - .getSessionId()); - view = (CollaborationSessionView) viewRef.getPart(false); - view.updateToolItems(); - } - }); } /* @@ -90,19 +69,4 @@ public class CollaborationDrawingUIManager extends DrawingToolUIManager { return super.canTellestrate(mouseButton) && resource.canTellestrate(); } - /* - * (non-Javadoc) - * - * @see com.raytheon.uf.viz.drawing.DrawingToolUIManager#handleMouseUp(int, - * int, int) - */ - @Override - public boolean handleMouseUp(int x, int y, int mouseButton) { - boolean rval = super.handleMouseUp(x, y, mouseButton); - if (rval) { - view.updateToolItems(); - } - return rval; - } - } diff --git a/cave/com.raytheon.uf.viz.collaboration.feature/feature.xml b/cave/com.raytheon.uf.viz.collaboration.feature/feature.xml index e41a916ce4..331eba0e08 100644 --- a/cave/com.raytheon.uf.viz.collaboration.feature/feature.xml +++ b/cave/com.raytheon.uf.viz.collaboration.feature/feature.xml @@ -122,13 +122,6 @@ version="0.0.0" unpack="false"/> - - + point="com.raytheon.uf.viz.collaboration.display.renderingExtension"> diff --git a/cave/com.raytheon.uf.viz.collaboration.pointdata/src/com/raytheon/uf/viz/collaboration/pointdata/rendering/PointImageRenderingHandler.java b/cave/com.raytheon.uf.viz.collaboration.pointdata/src/com/raytheon/uf/viz/collaboration/pointdata/rendering/PointImageRenderingHandler.java index 862a37136a..eea86f3402 100644 --- a/cave/com.raytheon.uf.viz.collaboration.pointdata/src/com/raytheon/uf/viz/collaboration/pointdata/rendering/PointImageRenderingHandler.java +++ b/cave/com.raytheon.uf.viz.collaboration.pointdata/src/com/raytheon/uf/viz/collaboration/pointdata/rendering/PointImageRenderingHandler.java @@ -25,10 +25,10 @@ import java.util.Set; import com.google.common.eventbus.Subscribe; import com.raytheon.uf.common.status.UFStatus.Priority; +import com.raytheon.uf.viz.collaboration.display.Activator; +import com.raytheon.uf.viz.collaboration.display.rsc.rendering.CollaborationRenderingHandler; import com.raytheon.uf.viz.collaboration.pointdata.image.DrawPointImagesEvent; import com.raytheon.uf.viz.collaboration.pointdata.image.PointImageEvent; -import com.raytheon.uf.viz.collaboration.ui.Activator; -import com.raytheon.uf.viz.collaboration.ui.rsc.rendering.CollaborationRenderingHandler; import com.raytheon.uf.viz.core.IGraphicsTarget; import com.raytheon.uf.viz.core.drawables.IImage; import com.raytheon.uf.viz.core.drawables.PaintProperties; diff --git a/cave/com.raytheon.uf.viz.collaboration.radar/META-INF/MANIFEST.MF b/cave/com.raytheon.uf.viz.collaboration.radar/META-INF/MANIFEST.MF index c8659bb06f..49d59f37e1 100644 --- a/cave/com.raytheon.uf.viz.collaboration.radar/META-INF/MANIFEST.MF +++ b/cave/com.raytheon.uf.viz.collaboration.radar/META-INF/MANIFEST.MF @@ -14,7 +14,7 @@ Require-Bundle: org.eclipse.core.runtime, com.raytheon.uf.common.geospatial;bundle-version="1.12.1174", org.geotools;bundle-version="2.6.4", com.raytheon.uf.common.colormap;bundle-version="1.12.1174", - com.raytheon.uf.viz.collaboration.ui;bundle-version="1.0.0", + com.raytheon.uf.viz.collaboration.display;bundle-version="1.0.0", com.raytheon.uf.viz.collaboration.comm;bundle-version="1.0.0", com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174" Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/cave/com.raytheon.uf.viz.collaboration.radar/plugin.xml b/cave/com.raytheon.uf.viz.collaboration.radar/plugin.xml index 2f7d3ff262..2d6ea90e01 100644 --- a/cave/com.raytheon.uf.viz.collaboration.radar/plugin.xml +++ b/cave/com.raytheon.uf.viz.collaboration.radar/plugin.xml @@ -30,7 +30,7 @@ + point="com.raytheon.uf.viz.collaboration.display.renderingExtension"> diff --git a/cave/com.raytheon.uf.viz.collaboration.radar/src/com/raytheon/uf/viz/collaboration/radar/rendering/RadarGraphicsExtRenderingHandler.java b/cave/com.raytheon.uf.viz.collaboration.radar/src/com/raytheon/uf/viz/collaboration/radar/rendering/RadarGraphicsExtRenderingHandler.java index 606bb12ac1..83c6676bf8 100644 --- a/cave/com.raytheon.uf.viz.collaboration.radar/src/com/raytheon/uf/viz/collaboration/radar/rendering/RadarGraphicsExtRenderingHandler.java +++ b/cave/com.raytheon.uf.viz.collaboration.radar/src/com/raytheon/uf/viz/collaboration/radar/rendering/RadarGraphicsExtRenderingHandler.java @@ -21,13 +21,13 @@ package com.raytheon.uf.viz.collaboration.radar.rendering; import com.google.common.eventbus.Subscribe; import com.raytheon.uf.common.status.UFStatus.Priority; +import com.raytheon.uf.viz.collaboration.display.Activator; +import com.raytheon.uf.viz.collaboration.display.rsc.rendering.CollaborationRenderingHandler; +import com.raytheon.uf.viz.collaboration.display.rsc.rendering.ImagingRenderingHandler; import com.raytheon.uf.viz.collaboration.radar.mesh.CreateRadarRadialMesh; import com.raytheon.uf.viz.collaboration.radar.mosaic.CreateMosaicImageEvent; import com.raytheon.uf.viz.collaboration.radar.mosaic.UpdateImagesToMosaic; import com.raytheon.uf.viz.collaboration.radar.mosaic.UpdateMosaicExtent; -import com.raytheon.uf.viz.collaboration.ui.Activator; -import com.raytheon.uf.viz.collaboration.ui.rsc.rendering.CollaborationRenderingHandler; -import com.raytheon.uf.viz.collaboration.ui.rsc.rendering.ImagingRenderingHandler; import com.raytheon.uf.viz.core.IExtent; import com.raytheon.uf.viz.core.IGraphicsTarget; import com.raytheon.uf.viz.core.drawables.ColorMapParameters; diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/META-INF/MANIFEST.MF b/cave/com.raytheon.uf.viz.collaboration.ui/META-INF/MANIFEST.MF index 5b57730529..e0375313ac 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/META-INF/MANIFEST.MF +++ b/cave/com.raytheon.uf.viz.collaboration.ui/META-INF/MANIFEST.MF @@ -6,8 +6,7 @@ Bundle-Version: 1.0.0.qualifier Bundle-Activator: com.raytheon.uf.viz.collaboration.ui.Activator Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Eclipse-RegisterBuddy: com.raytheon.uf.viz.core -Export-Package: com.raytheon.uf.viz.collaboration.ui, - com.raytheon.uf.viz.collaboration.ui.rsc.rendering +Export-Package: com.raytheon.uf.viz.collaboration.ui Require-Bundle: com.raytheon.viz.ui, org.eclipse.ui, org.eclipse.core.runtime, @@ -18,20 +17,8 @@ Require-Bundle: com.raytheon.viz.ui, org.geotools;bundle-version="2.6.4", com.raytheon.viz.core;bundle-version="1.12.1174", com.raytheon.uf.viz.drawing;bundle-version="1.0.0", - com.raytheon.uf.viz.remote.graphics;bundle-version="1.0.0", com.raytheon.uf.common.comm;bundle-version="1.12.1174", com.raytheon.uf.common.colormap;bundle-version="1.12.1174", - com.raytheon.uf.viz.notification;bundle-version="1.0.0", com.raytheon.uf.viz.collaboration.display;bundle-version="1.0.0", - gov.noaa.nws.ncep.ui.pgen;bundle-version="1.0.0", - gov.noaa.nws.ncep.staticdataprovider;bundle-version="1.0.0", - gov.noaa.nws.ncep.common.staticdata;bundle-version="1.0.0", - org.eclipse.ecf.presence -Import-Package: com.raytheon.uf.common.status, - com.raytheon.uf.viz.core.maps.display, - com.raytheon.uf.viz.core.maps.rsc, - com.raytheon.uf.viz.drawing, - com.raytheon.viz.awipstools.ui.display, - org.eclipse.ecf.presence, - org.eclipse.ecf.presence.roster + org.eclipse.ecf.presence;bundle-version="2.0.0" Bundle-ActivationPolicy: lazy diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject b/cave/com.raytheon.uf.viz.collaboration.ui/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject deleted file mode 100644 index d498aafc80..0000000000 --- a/cave/com.raytheon.uf.viz.collaboration.ui/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject +++ /dev/null @@ -1,5 +0,0 @@ -com.raytheon.uf.viz.collaboration.ui.editor.SharedResource -com.raytheon.uf.viz.collaboration.ui.rsc.CollaborationResourceData -com.raytheon.uf.viz.collaboration.ui.rsc.DataProviderRscData -com.raytheon.uf.viz.collaboration.ui.rsc.CollaborationWrapperResourceData -com.raytheon.uf.viz.collaboration.ui.telestrator.CollaborationDrawingResourceData \ No newline at end of file diff --git a/cave/com.raytheon.uf.viz.collaboration.display/icons/messages.gif b/cave/com.raytheon.uf.viz.collaboration.ui/icons/collab_editor.gif similarity index 100% rename from cave/com.raytheon.uf.viz.collaboration.display/icons/messages.gif rename to cave/com.raytheon.uf.viz.collaboration.ui/icons/collab_editor.gif diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/icons/remove_editor.gif b/cave/com.raytheon.uf.viz.collaboration.ui/icons/remove_editor.gif new file mode 100644 index 0000000000000000000000000000000000000000..28fc79fadc233de036f4b2901e58d57c30334b06 GIT binary patch literal 91 zcmZ?wbhEHb6krfw_{7GrfPrBJ1H(E7hFuH{&lniqGBEuA|9|zGwTeGk7#SGY8FUzc u0Hl_IS)pRroqqQnV@07m^d%v07K5}O<_9cP3AH%SOWmT)g2)K literal 0 HcmV?d00001 diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/plugin.xml b/cave/com.raytheon.uf.viz.collaboration.ui/plugin.xml index 2fe2423bb2..91f771f516 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/plugin.xml +++ b/cave/com.raytheon.uf.viz.collaboration.ui/plugin.xml @@ -20,8 +20,6 @@ --> - - - - - - - - - - - - - - - - + + @@ -234,4 +216,14 @@ + + + + diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/CollaborationGroupView.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/CollaborationGroupView.java index c9ff191421..2da130a0d1 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/CollaborationGroupView.java +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/CollaborationGroupView.java @@ -109,11 +109,13 @@ import com.raytheon.uf.viz.collaboration.comm.identity.user.IQualifiedID; import com.raytheon.uf.viz.collaboration.comm.provider.session.CollaborationConnection; import com.raytheon.uf.viz.collaboration.comm.provider.user.IDConverter; import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; -import com.raytheon.uf.viz.collaboration.display.editor.CollaborationEditor; +import com.raytheon.uf.viz.collaboration.display.data.SessionContainer; +import com.raytheon.uf.viz.collaboration.display.data.SharedDisplaySessionMgr; +import com.raytheon.uf.viz.collaboration.display.editor.ICollaborationEditor; import com.raytheon.uf.viz.collaboration.ui.data.AlertWordWrapper; import com.raytheon.uf.viz.collaboration.ui.data.CollaborationGroupContainer; import com.raytheon.uf.viz.collaboration.ui.data.SessionGroupContainer; -import com.raytheon.uf.viz.collaboration.ui.data.SharedDisplaySessionMgr; +import com.raytheon.uf.viz.collaboration.ui.editor.CollaborationEditor; import com.raytheon.uf.viz.collaboration.ui.login.ChangeStatusDialog; import com.raytheon.uf.viz.collaboration.ui.login.LoginDialog; import com.raytheon.uf.viz.collaboration.ui.prefs.CollabPrefConstants; @@ -1546,8 +1548,8 @@ public class CollaborationGroupView extends CaveFloatingView implements if (linkToEditorAction.isChecked()) { IWorkbenchPage page = PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getActivePage(); - if (part instanceof CollaborationEditor) { - String sessionId = ((CollaborationEditor) part).getSessionId(); + if (part instanceof ICollaborationEditor) { + String sessionId = ((ICollaborationEditor) part).getSessionId(); for (IViewReference ref : page.getViewReferences()) { if (ref.getPart(false) instanceof CollaborationSessionView) { CollaborationSessionView view = (CollaborationSessionView) ref @@ -1561,7 +1563,7 @@ public class CollaborationGroupView extends CaveFloatingView implements } else if (part instanceof CollaborationSessionView) { String sessionId = ((CollaborationSessionView) part) .getSessionId(); - CollaborationEditor editor = SharedDisplaySessionMgr + ICollaborationEditor editor = SharedDisplaySessionMgr .getSessionContainer(sessionId) .getCollaborationEditor(); if (editor != null) { diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/ConnectionSubscriber.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/ConnectionSubscriber.java index 8012897695..fcd3a778ba 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/ConnectionSubscriber.java +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/ConnectionSubscriber.java @@ -48,7 +48,8 @@ import com.raytheon.uf.viz.collaboration.comm.identity.user.SharedDisplayRole; import com.raytheon.uf.viz.collaboration.comm.provider.TextMessage; import com.raytheon.uf.viz.collaboration.comm.provider.session.CollaborationConnection; import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; -import com.raytheon.uf.viz.collaboration.ui.data.SharedDisplaySessionMgr; +import com.raytheon.uf.viz.collaboration.display.data.SessionColorManager; +import com.raytheon.uf.viz.collaboration.display.data.SharedDisplaySessionMgr; import com.raytheon.uf.viz.collaboration.ui.prefs.CollabPrefConstants; import com.raytheon.uf.viz.collaboration.ui.session.CollaborationSessionView; import com.raytheon.uf.viz.collaboration.ui.session.PeerToPeerView; diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/CreateSessionDialog.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/CreateSessionDialog.java index 9429ef3690..c7aeed1b61 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/CreateSessionDialog.java +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/CreateSessionDialog.java @@ -49,7 +49,7 @@ import com.raytheon.uf.viz.collaboration.comm.identity.IVenueSession; import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenueInfo; import com.raytheon.uf.viz.collaboration.comm.identity.user.SharedDisplayRole; import com.raytheon.uf.viz.collaboration.comm.provider.session.CollaborationConnection; -import com.raytheon.uf.viz.collaboration.ui.data.SharedDisplaySessionMgr; +import com.raytheon.uf.viz.collaboration.display.data.SharedDisplaySessionMgr; import com.raytheon.uf.viz.collaboration.ui.prefs.CollabPrefConstants; import com.raytheon.viz.ui.dialogs.CaveSWTDialog; diff --git a/cave/com.raytheon.uf.viz.notification/src/com/raytheon/uf/viz/notification/notifier/PopupNotifier.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/actions/PopupNotifier.java similarity index 96% rename from cave/com.raytheon.uf.viz.notification/src/com/raytheon/uf/viz/notification/notifier/PopupNotifier.java rename to cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/actions/PopupNotifier.java index 798f446ccf..efabded33d 100644 --- a/cave/com.raytheon.uf.viz.notification/src/com/raytheon/uf/viz/notification/notifier/PopupNotifier.java +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/actions/PopupNotifier.java @@ -1,4 +1,4 @@ -package com.raytheon.uf.viz.notification.notifier; +package com.raytheon.uf.viz.collaboration.ui.actions; import java.util.ArrayList; import java.util.Collections; diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/actions/ShareEditorAction.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/actions/ShareEditorAction.java index abdcfd4032..3899ce37e8 100755 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/actions/ShareEditorAction.java +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/actions/ShareEditorAction.java @@ -19,14 +19,31 @@ **/ package com.raytheon.uf.viz.collaboration.ui.actions; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.MessageBox; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import org.eclipse.jface.action.Action; +import org.eclipse.jface.action.ActionContributionItem; +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.action.IMenuCreator; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Menu; + +import com.raytheon.uf.common.status.UFStatus.Priority; +import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException; +import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession; +import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenueInfo; +import com.raytheon.uf.viz.collaboration.display.data.SessionContainer; +import com.raytheon.uf.viz.collaboration.display.data.SharedDisplaySessionMgr; +import com.raytheon.uf.viz.collaboration.display.roles.dataprovider.SharedEditorsManager; +import com.raytheon.uf.viz.collaboration.ui.Activator; +import com.raytheon.viz.ui.EditorUtil; import com.raytheon.viz.ui.actions.ContributedEditorMenuAction; +import com.raytheon.viz.ui.editor.AbstractEditor; /** - * TODO Add Description + * Action to share an editor with a chosen session * *
  * 
@@ -42,28 +59,135 @@ import com.raytheon.viz.ui.actions.ContributedEditorMenuAction;
  * @version 1.0
  */
 
-public class ShareEditorAction extends ContributedEditorMenuAction {
+public class ShareEditorAction extends ContributedEditorMenuAction implements
+        IMenuCreator {
+
+    private Menu menu;
+
+    public ShareEditorAction() {
+        super("Share with", IAction.AS_DROP_DOWN_MENU);
+    }
 
     @Override
     public boolean shouldBeVisible() {
-        // TODO only return true if you are the DataProvider on a session AND
-        // the editor is not already shared
-        if (true) {
-            return true;
+        return getActiveSharableEditor() != null && getSessions().size() > 0;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.jface.action.IMenuCreator#dispose()
+     */
+    @Override
+    public void dispose() {
+        if (menu != null) {
+            menu.dispose();
+        }
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets
+     * .Control)
+     */
+    @Override
+    public Menu getMenu(Control parent) {
+        if (menu != null) {
+            menu.dispose();
         }
 
-        return true;
+        menu = new Menu(parent);
+
+        fillMenu(menu);
+        return menu;
     }
 
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets
+     * .Menu)
+     */
     @Override
-    public void run() {
-        // TODO need to add this editor to the list of editors associated with
-        // the collaboration session
-        // remove the message box and the not yet implemented message
-        MessageBox messageBox = new MessageBox(Display.getCurrent()
-                .getActiveShell(), SWT.ICON_INFORMATION);
-        messageBox.setText("Not Yet Implemented");
-        messageBox.setMessage("Share Editor is not yet implemented");
-        messageBox.open();
+    public Menu getMenu(Menu parent) {
+        if (menu != null) {
+            menu.dispose();
+        }
+
+        menu = new Menu(parent);
+
+        fillMenu(menu);
+
+        return menu;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.jface.action.Action#getMenuCreator()
+     */
+    @Override
+    public IMenuCreator getMenuCreator() {
+        return this;
+    }
+
+    /**
+     * @param menu2
+     */
+    private void fillMenu(Menu menu) {
+        final AbstractEditor editor = getActiveSharableEditor();
+        if (editor != null) {
+            List sessions = getSessions();
+            for (final ISharedDisplaySession session : sessions) {
+                final IVenueInfo sessionInfo = session.getVenue().getInfo();
+                ActionContributionItem aci = new ActionContributionItem(
+                        new Action(sessionInfo.getVenueDescription()) {
+                            @Override
+                            public void run() {
+                                try {
+                                    SharedEditorsManager.getManager(session)
+                                            .shareEditor(editor);
+                                } catch (CollaborationException e) {
+                                    Activator.statusHandler.handle(
+                                            Priority.PROBLEM,
+                                            e.getLocalizedMessage(), e);
+                                }
+                            }
+                        });
+                aci.fill(menu, -1);
+            }
+        }
+    }
+
+    private AbstractEditor getActiveSharableEditor() {
+        AbstractEditor editor = EditorUtil
+                .getActiveEditorAs(AbstractEditor.class);
+        if (editor != null
+                && SharedEditorsManager.isBeingShared(editor) == false) {
+            return editor;
+        }
+        return null;
+    }
+
+    private List getSessions() {
+        Collection sessionIds = SharedDisplaySessionMgr
+                .getActiveSessionIds();
+        List sessions = new ArrayList();
+        for (String sessionId : sessionIds) {
+            SessionContainer container = SharedDisplaySessionMgr
+                    .getSessionContainer(sessionId);
+            if (container != null) {
+                ISharedDisplaySession session = container.getSession();
+                if (session != null
+                        && session.getUserID() == session
+                                .getCurrentDataProvider()) {
+                    sessions.add(container.getSession());
+                }
+            }
+        }
+        return sessions;
     }
 }
diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/actions/UnshareEditorAction.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/actions/UnshareEditorAction.java
new file mode 100644
index 0000000000..5da303d8da
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/actions/UnshareEditorAction.java
@@ -0,0 +1,91 @@
+/**
+ * This software was developed and / or modified by Raytheon Company,
+ * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
+ * 
+ * U.S. EXPORT CONTROLLED TECHNICAL DATA
+ * This software product contains export-restricted data whose
+ * export/transfer/disclosure is restricted by U.S. law. Dissemination
+ * to non-U.S. persons whether in the United States or abroad requires
+ * an export license or other authorization.
+ * 
+ * Contractor Name:        Raytheon Company
+ * Contractor Address:     6825 Pine Street, Suite 340
+ *                         Mail Stop B8
+ *                         Omaha, NE 68106
+ *                         402.291.0100
+ * 
+ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
+ * further licensing information.
+ **/
+package com.raytheon.uf.viz.collaboration.ui.actions;
+
+import com.raytheon.uf.common.status.UFStatus.Priority;
+import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
+import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession;
+import com.raytheon.uf.viz.collaboration.display.roles.dataprovider.SharedEditorsManager;
+import com.raytheon.uf.viz.collaboration.ui.Activator;
+import com.raytheon.viz.ui.EditorUtil;
+import com.raytheon.viz.ui.actions.ContributedEditorMenuAction;
+import com.raytheon.viz.ui.editor.AbstractEditor;
+
+/**
+ * Action to remove an editor from being shared
+ * 
+ * 
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 11, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ + +public class UnshareEditorAction extends ContributedEditorMenuAction { + + public UnshareEditorAction() { + super("Unshare"); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.jface.action.Action#run() + */ + @Override + public void run() { + AbstractEditor editor = EditorUtil + .getActiveEditorAs(AbstractEditor.class); + SharedEditorsManager manager = getActiveSharedEditorManager(editor); + if (manager != null) { + try { + manager.removeEditor(editor); + } catch (CollaborationException e) { + Activator.statusHandler.handle(Priority.PROBLEM, + e.getLocalizedMessage(), e); + } + } + } + + @Override + public boolean shouldBeVisible() { + AbstractEditor editor = EditorUtil + .getActiveEditorAs(AbstractEditor.class); + return getActiveSharedEditorManager(editor) != null; + } + + private SharedEditorsManager getActiveSharedEditorManager( + AbstractEditor editor) { + SharedEditorsManager manager = null; + ISharedDisplaySession session = SharedEditorsManager + .getSharedEditorSession(editor); + if (session != null) { + manager = SharedEditorsManager.getManager(session); + } + return manager; + } +} diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/editor/CollaborationEditor.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/editor/CollaborationEditor.java new file mode 100644 index 0000000000..0d1044be69 --- /dev/null +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/editor/CollaborationEditor.java @@ -0,0 +1,404 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.collaboration.ui.editor; + +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.Map; +import java.util.Set; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.swt.graphics.Rectangle; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IEditorSite; +import org.eclipse.ui.ISaveablePart2; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.part.EditorPart; + +import com.google.common.eventbus.Subscribe; +import com.raytheon.uf.common.status.UFStatus.Priority; +import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException; +import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession; +import com.raytheon.uf.viz.collaboration.display.data.SharedDisplaySessionMgr; +import com.raytheon.uf.viz.collaboration.display.editor.ActivateRemoteDisplay; +import com.raytheon.uf.viz.collaboration.display.editor.CollaborationEditorInput; +import com.raytheon.uf.viz.collaboration.display.editor.CreateRemoteDisplay; +import com.raytheon.uf.viz.collaboration.display.editor.DisposeRemoteDisplay; +import com.raytheon.uf.viz.collaboration.display.editor.ICollaborationEditor; +import com.raytheon.uf.viz.collaboration.display.editor.RemoteDisplayRequested; +import com.raytheon.uf.viz.collaboration.display.editor.ReprojectRemoteDisplay; +import com.raytheon.uf.viz.collaboration.display.rsc.CollaborationResourceData; +import com.raytheon.uf.viz.collaboration.display.rsc.SharedResource; +import com.raytheon.uf.viz.collaboration.ui.Activator; +import com.raytheon.uf.viz.core.IDisplayPane; +import com.raytheon.uf.viz.core.VizApp; +import com.raytheon.uf.viz.core.drawables.IDescriptor; +import com.raytheon.uf.viz.core.drawables.IRenderableDisplay; +import com.raytheon.uf.viz.core.drawables.ResourcePair; +import com.raytheon.uf.viz.core.exception.VizException; +import com.raytheon.viz.ui.input.InputManager; + +/** + * A collaboration editor that displays the display of an editor shared by the + * Data Provider. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 16, 2012            njensen     Initial creation
+ * 
+ * 
+ * + * @author njensen + * @version 1.0 + */ + +public class CollaborationEditor extends EditorPart implements + ICollaborationEditor, ISaveablePart2 { + + private ISharedDisplaySession session; + + private CollaborationPaneManager paneManager; + + private Map displayMap = new LinkedHashMap( + 5, 1.25f, true); + + private int currentActiveDisplay = -1; + + private Set listeners = new LinkedHashSet(); + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.part.EditorPart#init(org.eclipse.ui.IEditorSite, + * org.eclipse.ui.IEditorInput) + */ + @Override + public void init(IEditorSite site, IEditorInput input) + throws PartInitException { + setInput(input); + setSite(site); + CollaborationEditorInput cei = (CollaborationEditorInput) input; + setPartName(cei.getName()); + session = SharedDisplaySessionMgr.getSessionContainer( + cei.getSessionId()).getSession(); + session.registerEventHandler(this); + paneManager = new CollaborationPaneManager(); + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets + * .Composite) + */ + @Override + public void createPartControl(Composite parent) { + paneManager.initializeComponents(paneManager, parent); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.part.WorkbenchPart#dispose() + */ + @Override + public void dispose() { + super.dispose(); + session.unregisterEventHandler(this); + } + + @Subscribe + public void createRemoteDisplay(CreateRemoteDisplay event) { + int displayId = event.getDisplayId(); + IRenderableDisplay display = displayMap.get(displayId); + if (display == null) { + display = event.getDisplay(); + for (ResourcePair rp : display.getDescriptor().getResourceList()) { + rp.getProperties().setSystemResource(true); + } + CollaborationResourceData crd = new CollaborationResourceData( + session, displayId); + ResourcePair rp = ResourcePair.constructSystemResourcePair(crd); + display.getDescriptor().getResourceList().add(rp); + display.getDescriptor().getResourceList() + .instantiateResources(display.getDescriptor(), true); + displayMap.put(displayId, display); + + fireListeners(displayId, display, RemoteDisplayChangeType.CREATED); + if (currentActiveDisplay == displayId) { + ActivateRemoteDisplay activate = new ActivateRemoteDisplay(); + activate.setDisplayId(displayId); + activateRemoteDisplay(activate); + } + } + } + + @Subscribe + public void activateRemoteDisplay(ActivateRemoteDisplay event) { + currentActiveDisplay = event.getDisplayId(); + final IRenderableDisplay display = displayMap.get(currentActiveDisplay); + if (display == null) { + RemoteDisplayRequested request = new RemoteDisplayRequested(); + request.setDisplayId(currentActiveDisplay); + request.setUserId(session.getUserID().getFQName()); + try { + session.sendObjectToPeer(session.getCurrentDataProvider(), + request); + } catch (CollaborationException e) { + Activator.statusHandler.handle(Priority.PROBLEM, + e.getLocalizedMessage(), e); + } + } else { + fireListeners(currentActiveDisplay, display, + RemoteDisplayChangeType.ACTIVATED); + VizApp.runAsync(new Runnable() { + @Override + public void run() { + paneManager.activateDisplay(currentActiveDisplay, display); + } + }); + } + } + + @Subscribe + public void disposeRemoteDisplay(DisposeRemoteDisplay event) { + final IRenderableDisplay display = displayMap.remove(event + .getDisplayId()); + if (display != null) { + fireListeners(event.getDisplayId(), display, + RemoteDisplayChangeType.DISPOSED); + VizApp.runAsync(new Runnable() { + @Override + public void run() { + paneManager.dispose(display); + for (Integer id : displayMap.keySet()) { + ActivateRemoteDisplay event = new ActivateRemoteDisplay(); + event.setDisplayId(id); + activateRemoteDisplay(event); + break; + } + + } + }); + } + } + + @Subscribe + public void reprojectRemoteDisplay(ReprojectRemoteDisplay event) { + IRenderableDisplay display = displayMap.get(event.getDisplayId()); + if (display != null) { + IDescriptor descriptor = display.getDescriptor(); + try { + descriptor.setGridGeometry(event.getTargetGeometry()); + Rectangle bounds = paneManager.getCanvasSize(display); + if (bounds != null) { + display.scaleToClientArea(bounds); + display.refresh(); + } + } catch (VizException e) { + Activator.statusHandler.handle(Priority.PROBLEM, + e.getLocalizedMessage(), e); + } + } + } + + @Subscribe + public void sharedResourceEvent(SharedResource event) { + IRenderableDisplay display = displayMap.get(event.getDisplayId()); + if (display != null) { + IDescriptor descriptor = display.getDescriptor(); + event.getResource().getProperties().setSystemResource(true); + if (event.isRemoveResource()) { + descriptor.getResourceList().remove(event.getResource()); + } else { + descriptor.getResourceList().add(event.getResource()); + descriptor.getResourceList().instantiateResources(descriptor, + true); + } + } + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.viz.collaboration.display.editor.ICollaborationEditor + * #setCanvasBounds(org.eclipse.swt.graphics.Rectangle) + */ + @Override + public void setCanvasBounds(int displayId, Rectangle canvasBounds) { + IRenderableDisplay display = displayMap.get(displayId); + if (display != null) { + paneManager.setCanvasSize(display, canvasBounds); + } + } + + public InputManager getInputManager() { + return paneManager.getMouseManager(); + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.viz.collaboration.display.editor.ICollaborationEditor + * #getSessionId() + */ + @Override + public String getSessionId() { + return session.getSessionId(); + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.viz.collaboration.display.editor.ICollaborationEditor + * #getActiveDisplayPane() + */ + @Override + public IDisplayPane getActiveDisplayPane() { + return paneManager.getActiveDisplayPane(); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.part.EditorPart#isDirty() + */ + @Override + public boolean isDirty() { + return true; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime. + * IProgressMonitor) + */ + @Override + public void doSave(IProgressMonitor monitor) { + + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.part.EditorPart#doSaveAs() + */ + @Override + public void doSaveAs() { + + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed() + */ + @Override + public boolean isSaveAsAllowed() { + return false; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.part.WorkbenchPart#setFocus() + */ + @Override + public void setFocus() { + paneManager.setFocus(); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.ISaveablePart2#promptToSaveOnClose() + */ + @Override + public int promptToSaveOnClose() { + // Let the user know why we refuse to close the editor + MessageDialog.openError(getSite().getShell(), "Closing Disabled", + "Please close the \"" + getPartName() + + "\" chat to exit the session."); + // Cancel the clsoe + return ISaveablePart2.CANCEL; + } + + /* + * (non-Javadoc) + * + * @see com.raytheon.uf.viz.collaboration.display.IRemoteDisplayContainer# + * addRemoteDisplayChangedListener + * (com.raytheon.uf.viz.collaboration.display. + * IRemoteDisplayContainer.IRemoteDisplayChangedListener) + */ + @Override + public void addRemoteDisplayChangedListener( + IRemoteDisplayChangedListener listener) { + listeners.add(listener); + } + + /* + * (non-Javadoc) + * + * @see com.raytheon.uf.viz.collaboration.display.IRemoteDisplayContainer# + * removeRemoteDisplayChangedListener + * (com.raytheon.uf.viz.collaboration.display + * .IRemoteDisplayContainer.IRemoteDisplayChangedListener) + */ + @Override + public void removeRemoteDisplayChangedListener( + IRemoteDisplayChangedListener listener) { + listeners.remove(listener); + } + + private void fireListeners(int displayId, IRenderableDisplay display, + RemoteDisplayChangeType changeType) { + for (IRemoteDisplayChangedListener listener : listeners) { + listener.remoteDisplayChanged( + new RemoteDisplay(displayId, display), changeType); + } + } + + /* + * (non-Javadoc) + * + * @see com.raytheon.uf.viz.collaboration.display.IRemoteDisplayContainer# + * getActiveDisplay() + */ + @Override + public RemoteDisplay getActiveDisplay() { + IRenderableDisplay display = displayMap.get(currentActiveDisplay); + if (display == null) { + return null; + } + return new RemoteDisplay(currentActiveDisplay, display); + } +} diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/editor/CollaborationPaneManager.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/editor/CollaborationPaneManager.java new file mode 100644 index 0000000000..a8b953e6cd --- /dev/null +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/editor/CollaborationPaneManager.java @@ -0,0 +1,247 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.collaboration.ui.editor; + +import java.util.IdentityHashMap; +import java.util.Map; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.ScrolledComposite; +import org.eclipse.swt.graphics.Rectangle; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.swt.widgets.ScrollBar; + +import com.raytheon.uf.common.status.UFStatus.Priority; +import com.raytheon.uf.viz.collaboration.ui.Activator; +import com.raytheon.uf.viz.core.IDisplayPane; +import com.raytheon.uf.viz.core.IDisplayPaneContainer; +import com.raytheon.uf.viz.core.datastructure.LoopProperties; +import com.raytheon.uf.viz.core.drawables.IRenderableDisplay; +import com.raytheon.viz.ui.panes.PaneManager; +import com.raytheon.viz.ui.panes.VizDisplayPane; + +/** + * PaneManager for the CollaborationEditor + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 7, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ + +public class CollaborationPaneManager extends PaneManager { + + private static class DisplayData { + + private IDisplayPane pane; + + private Composite wrapperComp; + + private Composite canvasComp; + + private ScrolledComposite scrollable; + + private Rectangle scrollableBounds; + + private Rectangle canvasBounds; + + } + + private Map displayMap = new IdentityHashMap(); + + private DisplayData activeData; + + private LoopProperties loopProperties = new LoopProperties(); + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.viz.ui.panes.PaneManager#initializeComponents(com.raytheon + * .uf.viz.core.IDisplayPaneContainer, org.eclipse.swt.widgets.Composite) + */ + @Override + public void initializeComponents(IDisplayPaneContainer container, + Composite comp) { + super.initializeComponents(container, comp); + adjustPaneLayout(1); + } + + public IDisplayPane activateDisplay(int displayId, + final IRenderableDisplay renderableDisplay) { + DisplayData data = displayMap.get(renderableDisplay); + if (data == null) { + data = new DisplayData(); + final DisplayData finalData = data; + // // scrollable composite + data.scrollable = new ScrolledComposite(composite, SWT.H_SCROLL + | SWT.V_SCROLL); + data.scrollable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, + true, true)); + + // Composite for canvas comp + data.wrapperComp = new Composite(data.scrollable, SWT.NONE); + GridLayout gl = new GridLayout(1, false); + gl.marginHeight = 0; + gl.marginWidth = 0; + // Sets background color of wrapper composite to white + data.wrapperComp.setBackground(data.wrapperComp.getDisplay() + .getSystemColor(SWT.COLOR_WHITE)); + data.wrapperComp.setSize(1, 1); + + data.canvasComp = new Composite(data.wrapperComp, SWT.NONE); + data.canvasComp.setLayout(gl); + data.canvasComp.setSize(1, 1); + + // Set canvasComp as content on scrollable + data.scrollable.setContent(data.wrapperComp); + data.scrollable.addListener(SWT.Resize, new Listener() { + @Override + public void handleEvent(Event event) { + finalData.scrollableBounds = ((Composite) event.widget) + .getBounds(); + setCanvasSize(renderableDisplay, finalData.canvasBounds); + } + }); + + try { + data.pane = createNewPane(renderableDisplay, data.canvasComp); + registerHandlers(data.pane); + data.canvasComp.layout(); + data.scrollableBounds = data.scrollable.getBounds(); + data.canvasBounds = data.canvasComp.getBounds(); + displayMap.put(renderableDisplay, data); + } catch (Exception e) { + Activator.statusHandler.handle(Priority.PROBLEM, + e.getLocalizedMessage(), e); + return null; + } + } + + if (activeData != null) { + setExclude(activeData, true); + } + setExclude(data, false); + activeData = data; + composite.layout(); + activatedPane = activeData.pane; + displayPanes.clear(); + displayPanes.add((VizDisplayPane) activatedPane); + return activeData.pane; + } + + /** + * @param display + */ + public void dispose(IRenderableDisplay display) { + DisplayData data = displayMap.remove(display); + if (data != null) { + data.pane.dispose(); + data.scrollable.dispose(); + if (activeData == data) { + activeData = null; + activatedPane = null; + displayPanes.clear(); + } + } + } + + /* + * (non-Javadoc) + * + * @see com.raytheon.viz.ui.panes.PaneManager#getLoopProperties() + */ + @Override + public LoopProperties getLoopProperties() { + return loopProperties; + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.viz.ui.panes.PaneManager#setLoopProperties(com.raytheon. + * uf.viz.core.datastructure.LoopProperties) + */ + @Override + public void setLoopProperties(LoopProperties loopProperties) { + this.loopProperties = loopProperties; + } + + public Rectangle getCanvasSize(IRenderableDisplay display) { + Rectangle bounds = null; + DisplayData data = displayMap.get(display); + if (data != null) { + bounds = data.canvasBounds; + } + return bounds; + } + + public void setCanvasSize(IRenderableDisplay display, Rectangle bounds) { + DisplayData data = displayMap.get(display); + if (data == null) { + return; + } + data.canvasBounds = bounds; + data.canvasComp.setSize(bounds.width, bounds.height); + + Rectangle scrollableBounds = new Rectangle(data.scrollableBounds.x, + data.scrollableBounds.y, data.scrollableBounds.width, + data.scrollableBounds.height); + + // Subtract size of scroll bars if visible + ScrollBar vertical = data.scrollable.getVerticalBar(); + ScrollBar horizon = data.scrollable.getHorizontalBar(); + if (scrollableBounds.width <= data.canvasBounds.width) { + scrollableBounds.height -= horizon.getSize().y; + } + if (scrollableBounds.height <= data.canvasBounds.height) { + scrollableBounds.width -= vertical.getSize().x; + } + + data.wrapperComp.setSize( + Math.max(data.canvasBounds.width, scrollableBounds.width), + Math.max(data.canvasBounds.height, scrollableBounds.height)); + data.canvasComp.setLocation( + Math.max(0, (scrollableBounds.width - bounds.width) / 2), + Math.max(0, (scrollableBounds.height - bounds.height) / 2)); + data.wrapperComp.layout(); + data.canvasComp.layout(); + } + + private void setExclude(DisplayData data, boolean exclude) { + GridData gd = (GridData) data.scrollable.getLayoutData(); + data.scrollable.setVisible(!exclude); + gd.exclude = exclude; + } + +} diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/editor/EditorSetup.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/editor/EditorSetup.java deleted file mode 100644 index 8d687326d7..0000000000 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/editor/EditorSetup.java +++ /dev/null @@ -1,158 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.viz.collaboration.ui.editor; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.ui.PartInitException; - -import com.raytheon.uf.common.status.UFStatus.Priority; -import com.raytheon.uf.viz.collaboration.display.editor.CollaborationEditor; -import com.raytheon.uf.viz.collaboration.display.editor.CollaborationEditorInput; -import com.raytheon.uf.viz.collaboration.display.editor.SharedEditorData; -import com.raytheon.uf.viz.collaboration.ui.Activator; -import com.raytheon.uf.viz.collaboration.ui.rsc.CollaborationWrapperResource; -import com.raytheon.uf.viz.collaboration.ui.rsc.CollaborationWrapperResourceData; -import com.raytheon.uf.viz.core.IExtent; -import com.raytheon.uf.viz.core.PixelExtent; -import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay; -import com.raytheon.uf.viz.core.drawables.IDescriptor; -import com.raytheon.uf.viz.core.drawables.IRenderableDisplay; -import com.raytheon.uf.viz.core.drawables.ResourcePair; -import com.raytheon.uf.viz.core.rsc.ResourceList; -import com.raytheon.viz.ui.VizWorkbenchManager; -import com.raytheon.viz.ui.editor.AbstractEditor; -import com.vividsolutions.jts.geom.Envelope; - -/** - * Utilities for setting up collaboration editors. - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Mar 19, 2012            njensen     Initial creation
- * 
- * 
- * - * @author njensen - * @version 1.0 - */ - -public class EditorSetup { - - /** - * Extracts a SharedEditorData object from the editor passed in. - * - * @param editor - * the editor to extract a shared editor for. - * @return - */ - public static SharedEditorData extractSharedEditorData(AbstractEditor editor) { - SharedEditorData se = new SharedEditorData(); - - IRenderableDisplay display = editor.getActiveDisplayPane() - .getRenderableDisplay(); - if (display instanceof AbstractRenderableDisplay) { - AbstractRenderableDisplay clonedDisplay = ((AbstractRenderableDisplay) display) - .cloneDisplay(); - List toKeep = new ArrayList(); - for (ResourcePair rp : display.getDescriptor().getResourceList()) { - if (rp.getResource() instanceof CollaborationWrapperResource) { - CollaborationWrapperResource resource = (CollaborationWrapperResource) rp - .getResource(); - ResourcePair copy = new ResourcePair(); - copy.setLoadProperties(rp.getLoadProperties()); - copy.setProperties(rp.getProperties()); - copy.setResourceData(resource.getWrapperResourceData()); - toKeep.add(copy); - } - } - ResourceList list = clonedDisplay.getDescriptor().getResourceList(); - list.clear(); - list.addAll(toKeep); - se.setDisplay(clonedDisplay); - } - // extract grid geometry - IDescriptor desc = display.getDescriptor(); - se.setGeometry(desc.getGridGeometry()); - - // extract extent to get the proper zoom/pan - IExtent extent = editor.getActiveDisplayPane().getRenderableDisplay() - .getExtent(); - se.setEnvelope(new Envelope(extent.getMinX(), extent.getMaxX(), extent - .getMinY(), extent.getMaxY())); - - // Set current size - Rectangle bounds = display.getBounds(); - se.setWidth(bounds.width); - se.setHeight(bounds.height); - - return se; - } - - /** - * Creates and opens a CollaborationEditor based on the SharedEditorData. - * - * @param sharedEditor - * the data necessary to create the editor - * @return - */ - public static CollaborationEditor createEditor( - SharedEditorData sharedEditor, String sessionId, String title) { - CollaborationEditor editor = null; - AbstractRenderableDisplay disp = sharedEditor.getDisplay(); - PixelExtent extent = new PixelExtent(sharedEditor.getEnvelope() - .getMinX(), sharedEditor.getEnvelope().getMaxX(), sharedEditor - .getEnvelope().getMinY(), sharedEditor.getEnvelope().getMaxY()); - disp.setExtent(extent); - - List toRemove = new ArrayList(); - ResourceList list = disp.getDescriptor().getResourceList(); - for (ResourcePair rp : list) { - if (rp.getResourceData() instanceof CollaborationWrapperResourceData) { - rp.setResourceData(((CollaborationWrapperResourceData) rp - .getResourceData()).getWrappedResourceData()); - } else { - toRemove.add(rp); - } - } - list.removeAll(toRemove); - - try { - CollaborationEditorInput input = new CollaborationEditorInput(disp, - sessionId, title); - editor = (CollaborationEditor) VizWorkbenchManager.getInstance() - .getCurrentWindow().getActivePage() - .openEditor(input, CollaborationEditor.EDITOR_ID); - editor.setCanvasSize(new Rectangle(0, 0, sharedEditor.getWidth(), - sharedEditor.getHeight())); - } catch (PartInitException e) { - Activator.statusHandler.handle(Priority.PROBLEM, - "Error opening collaboration participant editor", e); - } - return editor; - } - -} diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/DataProviderEventController.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/DataProviderEventController.java deleted file mode 100644 index b01f790e90..0000000000 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/DataProviderEventController.java +++ /dev/null @@ -1,536 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.viz.collaboration.ui.role; - -import java.util.List; -import java.util.concurrent.CopyOnWriteArrayList; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.widgets.Event; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.PlatformUI; - -import com.google.common.eventbus.Subscribe; -import com.raytheon.uf.common.status.IUFStatusHandler; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; -import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException; -import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession; -import com.raytheon.uf.viz.collaboration.comm.identity.event.IVenueParticipantEvent; -import com.raytheon.uf.viz.collaboration.comm.identity.event.ParticipantEventType; -import com.raytheon.uf.viz.collaboration.comm.identity.user.SharedDisplayRole; -import com.raytheon.uf.viz.collaboration.comm.provider.TransferRoleCommand; -import com.raytheon.uf.viz.collaboration.display.editor.ReprojectEditor; -import com.raytheon.uf.viz.collaboration.display.editor.SharedEditorData; -import com.raytheon.uf.viz.collaboration.ui.Activator; -import com.raytheon.uf.viz.collaboration.ui.ColorChangeEvent; -import com.raytheon.uf.viz.collaboration.ui.SessionColorManager; -import com.raytheon.uf.viz.collaboration.ui.data.SessionContainer; -import com.raytheon.uf.viz.collaboration.ui.data.SharedDisplaySessionMgr; -import com.raytheon.uf.viz.collaboration.ui.editor.EditorSetup; -import com.raytheon.uf.viz.collaboration.ui.editor.SharedResource; -import com.raytheon.uf.viz.collaboration.ui.editor.event.InputEvent; -import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.CollaborationDispatcher; -import com.raytheon.uf.viz.collaboration.ui.rsc.CollaborationWrapperResource; -import com.raytheon.uf.viz.collaboration.ui.rsc.CollaborationWrapperResourceData; -import com.raytheon.uf.viz.collaboration.ui.rsc.DataProviderRscData; -import com.raytheon.uf.viz.core.IDisplayPane; -import com.raytheon.uf.viz.core.IRenderableDisplayChangedListener; -import com.raytheon.uf.viz.core.VizApp; -import com.raytheon.uf.viz.core.drawables.IRenderableDisplay; -import com.raytheon.uf.viz.core.drawables.ResourcePair; -import com.raytheon.uf.viz.core.exception.VizException; -import com.raytheon.uf.viz.core.rsc.ResourceList; -import com.raytheon.uf.viz.core.rsc.ResourceList.AddListener; -import com.raytheon.uf.viz.core.rsc.ResourceList.RemoveListener; -import com.raytheon.uf.viz.remote.graphics.Dispatcher; -import com.raytheon.uf.viz.remote.graphics.DispatcherFactory; -import com.raytheon.uf.viz.remote.graphics.DispatchingGraphicsFactory; -import com.raytheon.viz.ui.EditorUtil; -import com.raytheon.viz.ui.editor.AbstractEditor; - -/** - * TODO: This class is in severe need of a refactor! - * - * Handles the events of a session that are specific to the Data Provider role. - * - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Mar 26, 2012            njensen     Initial creation
- * 
- * 
- * - * @author njensen - * @version 1.0 - */ - -public class DataProviderEventController extends AbstractRoleEventController - implements IRenderableDisplayChangedListener { - - private static final transient IUFStatusHandler statusHandler = UFStatus - .getHandler(DataProviderEventController.class); - - private ResourceWrapperListener wrappingListener; - - private DispatcherFactory factory = new DispatcherFactory() { - @Override - public Dispatcher createNewDispatcher(IRenderableDisplay display) - throws InstantiationException { - try { - CollaborationDispatcher dispatcher = new CollaborationDispatcher( - session, display); - dispatchers.add(dispatcher); - dispatcher.setActiveDisplay(activeDisplay); - return dispatcher; - } catch (CollaborationException e) { - throw new InstantiationException( - "Error constructing collaboration dispatcher: " - + e.getLocalizedMessage()); - } - } - }; - - private List dispatchers = new CopyOnWriteArrayList(); - - private IRenderableDisplay activeDisplay; - - private String tabTitleSuffix; - - public DataProviderEventController(ISharedDisplaySession session) { - super(session); - tabTitleSuffix = " (" - + session.getVenue().getInfo().getVenueDescription() + ")"; - } - - @Subscribe - public void participantChanged(IVenueParticipantEvent event) { - if (event.getEventType().equals(ParticipantEventType.ARRIVED) - && !event.getParticipant().equals(session.getUserID())) { - // TODO send over the one that is currently active, not the one - SharedDisplaySessionMgr - .getSessionContainer(this.session.getSessionId()) - .getSharedEditors().get(0); - AbstractEditor editor = EditorUtil - .getActiveEditorAs(AbstractEditor.class); - SharedEditorData se = EditorSetup.extractSharedEditorData(editor); - - // new color for each user - SessionColorManager manager = SharedDisplaySessionMgr - .getSessionContainer(session.getSessionId()) - .getColorManager(); - RGB color = manager.getColorFromUser(event.getParticipant()); - - ColorChangeEvent cce = new ColorChangeEvent(event.getParticipant(), - color); - try { - session.sendObjectToVenue(cce); - session.sendObjectToPeer(event.getParticipant(), se); - } catch (CollaborationException e) { - statusHandler.handle(Priority.PROBLEM, - "Error sending initialization data to new participant " - + event.getParticipant().getName(), e); - } - - } - } - - @Subscribe - public void roleTransferred(TransferRoleCommand cmd) { - if (cmd.getRole() == SharedDisplayRole.SESSION_LEADER) { - session.setCurrentSessionLeader(cmd.getUser()); - if (cmd.getUser().getFQName() - .equals(session.getUserID().getFQName())) { - // this cave should assume session leader control - InputUtil.enableDataProviderInput(session.getSessionId()); - } else if (session.getCurrentSessionLeader().getFQName() - .equals(session.getUserID().getFQName()) - && !session.getCurrentSessionLeader().getFQName() - .equals(cmd.getUser().getFQName())) { - // this cave should release session leader control - InputUtil.disableDataProviderInput(session.getSessionId()); - } - } - } - - @Subscribe - public void sessionLeaderInput(InputEvent event) { - // TODO needs to be based on the editor that is both shared and active - final AbstractEditor editor = SharedDisplaySessionMgr - .getSessionContainer(session.getSessionId()).getSharedEditors() - .get(0); - IDisplayPane pane = editor.getDisplayPanes()[0]; - final Event swtEvent = new Event(); - swtEvent.display = editor.getActiveDisplayPane().getDisplay(); - - // translate event type - switch (event.getType()) { - case MOUSE_DOWN: - swtEvent.type = SWT.MouseDown; - break; - case MOUSE_UP: - swtEvent.type = SWT.MouseUp; - break; - case MOUSE_DOWN_MOVE: - case MOUSE_MOVE: - swtEvent.type = SWT.MouseMove; - break; - case DOUBLE_CLICK: - swtEvent.type = SWT.MouseDoubleClick; - break; - case MOUSE_HOVER: - swtEvent.type = SWT.MouseHover; - break; - case MOUSE_WHEEL: - swtEvent.type = SWT.MouseWheel; - break; - case KEY_DOWN: - swtEvent.type = SWT.KeyDown; - break; - case KEY_UP: - swtEvent.type = SWT.KeyUp; - break; - } - - // translate coordinates of event - switch (event.getType()) { - case MOUSE_DOWN: - case MOUSE_DOWN_MOVE: - case MOUSE_UP: - case MOUSE_HOVER: - case MOUSE_MOVE: - case MOUSE_WHEEL: - case DOUBLE_CLICK: - double[] screen = pane.gridToScreen(new double[] { event.getX(), - event.getY(), 0.0 }); - swtEvent.x = (int) Math.round(screen[0]); - swtEvent.y = (int) Math.round(screen[1]); - break; - } - - // translate specific metadata - switch (event.getType()) { - case MOUSE_DOWN: - case MOUSE_DOWN_MOVE: - case MOUSE_UP: - case DOUBLE_CLICK: - swtEvent.button = event.getEventData(); - break; - case MOUSE_WHEEL: - swtEvent.count = event.getEventData(); - break; - case KEY_DOWN: - case KEY_UP: - swtEvent.keyCode = event.getEventData(); - break; - } - - VizApp.runAsync(new Runnable() { - - @Override - public void run() { - editor.getMouseManager().handleEvent(swtEvent); - } - }); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.viz.collaboration.ui.role.AbstractRoleEventController - * #startup() - */ - @Override - public void startup() { - super.startup(); - - SessionContainer sessionContainer = SharedDisplaySessionMgr - .getSessionContainer(session.getSessionId()); - SessionColorManager manager = sessionContainer.getColorManager(); - manager.addUser(session.getCurrentDataProvider()); - wrappingListener = new ResourceWrapperListener(); - for (AbstractEditor editor : sessionContainer.getSharedEditors()) { - super.activateResources(editor); - - // Replace pane resources that will be shared with - // CollaborationWrapperResource objects - for (IDisplayPane pane : editor.getDisplayPanes()) { - handleNewDisplay(pane); - setActiveDisplay(pane.getRenderableDisplay()); - } - - editor.addRenderableDisplayChangedListener(this); - editor.setTabTitle(editor.getPartName() + tabTitleSuffix); - } - } - - private void setActiveDisplay(IRenderableDisplay display) { - this.activeDisplay = display; - for (CollaborationDispatcher dispatcher : dispatchers) { - dispatcher.setActiveDisplay(display); - } - ReprojectEditor event = new ReprojectEditor(); - event.setTargetGeometry(display.getDescriptor().getGridGeometry()); - try { - session.sendObjectToVenue(event); - } catch (CollaborationException e) { - Activator.statusHandler.handle( - Priority.PROBLEM, - "Error sending reprojection event: " - + e.getLocalizedMessage(), e); - } - } - - /** - * Handles a new display pane - * - * @param pane - * @return true if the pane is not currently being handled by the controller - */ - private boolean handleNewDisplay(IDisplayPane pane) { - boolean newDisplay = false; - for (CollaborationDispatcher dispatcher : dispatchers) { - if (dispatcher.getDisplay() == pane.getRenderableDisplay()) { - // We already have a dispatcher for this display - return false; - } - } - try { - if (DispatchingGraphicsFactory.injectRemoteFunctionality(pane, - factory)) { - // If we injected successfully, do resource management - ResourceList list = pane.getDescriptor().getResourceList(); - for (ResourcePair rp : pane.getDescriptor().getResourceList()) { - wrapResourcePair(rp); - } - list.addPreAddListener(wrappingListener); - list.addPostRemoveListener(wrappingListener); - newDisplay = true; - } - } catch (InstantiationException e) { - statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); - } - return newDisplay; - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.viz.collaboration.ui.role.AbstractRoleEventController - * #getResourcesToAdd() - */ - @Override - protected List getResourcesToAdd() { - List resources = super.getResourcesToAdd(); - DataProviderRscData resourceData = new DataProviderRscData(); - resourceData.setSessionId(session.getSessionId()); - resources.add(ResourcePair.constructSystemResourcePair(resourceData)); - return resources; - } - - private void sendSharedResource(ResourcePair rp, boolean remove) { - // Send event to venue to load resource - SharedResource sr = new SharedResource(); - ResourcePair copy = new ResourcePair(); - copy.setLoadProperties(rp.getLoadProperties()); - copy.setProperties(rp.getProperties()); - if (rp.getResourceData() instanceof CollaborationWrapperResourceData) { - copy.setResourceData(((CollaborationWrapperResourceData) rp - .getResourceData()).getWrappedResourceData()); - } else if (rp.getResource() instanceof CollaborationWrapperResource) { - copy.setResourceData(rp.getResource().getResourceData()); - } - sr.setResource(copy); - sr.setRemoveResource(remove); - try { - session.sendObjectToVenue(sr); - } catch (CollaborationException e) { - statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); - } - } - - /** - * Wraps ResourcePair in collaboration wrapper resource if resource should - * be loaded on locally for every user in venue - * - * @param rp - * @return true if ResourcePair was wrapped, false otherwise - */ - private boolean wrapResourcePair(ResourcePair rp) { - if (rp.getProperties() != null && rp.getProperties().isMapLayer() - && (rp.getResource() != null || rp.getResourceData() != null)) { - CollaborationWrapperResourceData wrapperRscData = new CollaborationWrapperResourceData(); - if (rp.getResource() != null) { - wrapperRscData.setWrappedResourceData(rp.getResource() - .getResourceData()); - rp.setResource(new CollaborationWrapperResource(wrapperRscData, - rp.getLoadProperties(), rp.getResource())); - } else { - wrapperRscData.setWrappedResourceData(rp.getResourceData()); - } - - if (rp.getResourceData() != null) { - rp.setResourceData(wrapperRscData); - } - return true; - } - return false; - } - - private void unwrapResourcePair(ResourcePair rp) { - if (rp.getResource() instanceof CollaborationWrapperResource) { - rp.setResource(((CollaborationWrapperResource) rp.getResource()) - .getWrappedResource()); - rp.setResourceData(rp.getResource().getResourceData()); - } else if (rp.getResourceData() instanceof CollaborationWrapperResourceData) { - rp.setResourceData(((CollaborationWrapperResourceData) rp - .getResourceData()).getWrappedResourceData()); - } - - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.viz.collaboration.ui.role.AbstractRoleEventController - * #shutdown() - */ - @Override - public void shutdown() { - // Dispatchers created are responsible for display extraction - for (CollaborationDispatcher dispatcher : dispatchers) { - disposeDispatcher(dispatcher); - } - - super.shutdown(); - SessionContainer sc = SharedDisplaySessionMgr - .getSessionContainer(session.getSessionId()); - if (sc != null) { - for (AbstractEditor editor : sc.getSharedEditors()) { - partClosed(editor); - } - } - } - - private void disposeDispatcher(CollaborationDispatcher dispatcher) { - dispatcher.dispose(); - if (PlatformUI.getWorkbench().isClosing() == false) { - // Extract the remote functionality - IRenderableDisplay display = dispatcher.getDisplay(); - for (IDisplayPane pane : display.getContainer().getDisplayPanes()) { - if (pane.getRenderableDisplay() == display) { - super.deactivateResources(display); - ResourceList list = pane.getDescriptor().getResourceList(); - for (ResourcePair rp : list) { - unwrapResourcePair(rp); - } - list.removePreAddListener(wrappingListener); - list.removePostRemoveListener(wrappingListener); - DispatchingGraphicsFactory.extractRemoteFunctionality(pane); - break; - } - } - } - dispatchers.remove(dispatcher); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.viz.collaboration.ui.role.AbstractRoleEventController - * #partClosed(org.eclipse.ui.IWorkbenchPart) - */ - @Override - public void partClosed(IWorkbenchPart part) { - super.partClosed(part); - if (part instanceof AbstractEditor) { - AbstractEditor editor = (AbstractEditor) part; - editor.removeRenderableDisplayChangedListener(this); - String partName = editor.getPartName(); - if (partName.endsWith(tabTitleSuffix)) { - editor.setTabTitle(partName.substring(0, partName.length() - - tabTitleSuffix.length())); - } - for (IDisplayPane pane : editor.getDisplayPanes()) { - for (CollaborationDispatcher dispatcher : dispatchers) { - if (pane.getRenderableDisplay() == dispatcher.getDisplay()) { - disposeDispatcher(dispatcher); - return; - } - } - } - } - } - - private class ResourceWrapperListener implements AddListener, - RemoveListener { - @Override - public void notifyAdd(ResourcePair rp) throws VizException { - if (wrapResourcePair(rp)) { - // Send event to venue to load - sendSharedResource(rp, false); - } - } - - @Override - public void notifyRemove(ResourcePair rp) throws VizException { - if (rp.getResource() instanceof CollaborationWrapperResource) { - // Send event to venue to unload - sendSharedResource(rp, true); - } - } - } - - /* - * (non-Javadoc) - * - * @see com.raytheon.uf.viz.core.IRenderableDisplayChangedListener# - * renderableDisplayChanged(com.raytheon.uf.viz.core.IDisplayPane, - * com.raytheon.uf.viz.core.drawables.IRenderableDisplay, - * com.raytheon.uf.viz - * .core.IRenderableDisplayChangedListener.DisplayChangeType) - */ - @Override - public void renderableDisplayChanged(IDisplayPane pane, - IRenderableDisplay newRenderableDisplay, DisplayChangeType type) { - if (type == DisplayChangeType.ADD) { - if (handleNewDisplay(pane)) { - activateResources(newRenderableDisplay); - } - if (newRenderableDisplay.getGraphicsAdapter() instanceof DispatchingGraphicsFactory) { - for (CollaborationDispatcher dispatcher : dispatchers) { - if (dispatcher.getDisplay() == newRenderableDisplay) { - setActiveDisplay(newRenderableDisplay); - break; - } - } - } - } - } -} diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/InputUtil.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/InputUtil.java deleted file mode 100644 index 7f2da9d00e..0000000000 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/InputUtil.java +++ /dev/null @@ -1,170 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.viz.collaboration.ui.role; - -import java.util.List; - -import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession; -import com.raytheon.uf.viz.collaboration.display.editor.CollaborationEditor; -import com.raytheon.uf.viz.collaboration.display.editor.input.CollaborationInputHandler; -import com.raytheon.uf.viz.collaboration.ui.data.SharedDisplaySessionMgr; -import com.raytheon.uf.viz.collaboration.ui.editor.event.EventForwardingInputHandler; -import com.raytheon.uf.viz.core.IDisplayPane; -import com.raytheon.uf.viz.core.rsc.IInputHandler; -import com.raytheon.uf.viz.core.rsc.IInputHandler.InputPriority; -import com.raytheon.viz.ui.editor.AbstractEditor; - -/** - * TODO Add Description - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Apr 9, 2012            njensen     Initial creation
- * 
- * 
- * - * @author njensen - * @version 1.0 - */ - -public class InputUtil { - - /** - * Gets the CollaborationInputHandler associated with an editor. - * - * @param editor - * @return - */ - public static CollaborationInputHandler getCollaborationInputHandler( - CollaborationEditor editor) { - CollaborationInputHandler handler = null; - IInputHandler[] array = editor.getInputManager() - .getHandlersForPriority(InputPriority.SYSTEM_RESOURCE); - for (IInputHandler h : array) { - if (h instanceof CollaborationInputHandler) { - handler = (CollaborationInputHandler) h; - break; - } - } - - return handler; - } - - /** - * Gets the CollaborationInputHandler associated with an editor. - * - * @param editor - * @return - */ - public static CollaborationInputHandler getCollaborationInputHandler( - AbstractEditor editor) { - CollaborationInputHandler handler = null; - IInputHandler[] array = editor.getMouseManager() - .getHandlersForPriority(InputPriority.SYSTEM_RESOURCE); - for (IInputHandler h : array) { - if (h instanceof CollaborationInputHandler) { - handler = (CollaborationInputHandler) h; - break; - } - } - - return handler; - } - - /** - * Disables the data provider's input on the actively shared editors by - * adding a CollaborationInputHandler that disables other inputs. - * - * @param sessionId - * the session to disable input for - */ - public static void disableDataProviderInput(String sessionId) { - List list = SharedDisplaySessionMgr - .getSessionContainer(sessionId).getSharedEditors(); - for (AbstractEditor editor : list) { - CollaborationInputHandler handler = getCollaborationInputHandler(editor); - if (handler == null) { - handler = new CollaborationInputHandler(); - editor.registerMouseHandler(handler, - InputPriority.SYSTEM_RESOURCE); - } - List handlers = handler.getRegisteredHandlers(); - for (IInputHandler input : handlers) { - handler.unregisterInputHandler(input); - } - // TODO need to leave telestrator power in the editor - } - } - - /** - * Enables the standard input on editors for a data provider by removing a - * CollaborationInputHandler on the shared editors. - * - * @param sessionId - * the session to enable the input on editors - */ - public static void enableDataProviderInput(String sessionId) { - List list = SharedDisplaySessionMgr - .getSessionContainer(sessionId).getSharedEditors(); - for (AbstractEditor editor : list) { - CollaborationInputHandler handler = getCollaborationInputHandler(editor); - if (handler != null) { - editor.unregisterMouseHandler(handler); - } - } - } - - /** - * Enables a session leader's input on a CollaborationEditor by adding an - * EventForwardingInputHandler that sends events back to the Data Provider. - * - * @param editor - * the editor to enable input for - */ - public static void enableSessionLeaderInput(CollaborationEditor editor) { - IDisplayPane pane = editor.getActiveDisplayPane(); - ISharedDisplaySession session = SharedDisplaySessionMgr - .getSessionContainer(editor.getSessionId()).getSession(); - CollaborationInputHandler handler = getCollaborationInputHandler(editor); - EventForwardingInputHandler mouseHandler = new EventForwardingInputHandler( - session, pane); - handler.registerInputHandler(mouseHandler); - } - - /** - * Disables a session leader's input on the CollaborationEditor by removing - * the EventForwardingInputHandler. - * - * @param editor - * the editor to disable input for - */ - public static void disableSessionLeaderInput(CollaborationEditor editor) { - CollaborationInputHandler handler = getCollaborationInputHandler(editor); - for (IInputHandler h : handler.getRegisteredHandlers()) { - handler.unregisterInputHandler(h); - } - // TODO need to leave telestrator power in the editor - } - -} diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/ParticipantEventController.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/ParticipantEventController.java deleted file mode 100644 index 90a89f03a5..0000000000 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/ParticipantEventController.java +++ /dev/null @@ -1,207 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.viz.collaboration.ui.role; - -import com.google.common.eventbus.Subscribe; -import com.raytheon.uf.common.status.IUFStatusHandler; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; -import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession; -import com.raytheon.uf.viz.collaboration.comm.identity.user.SharedDisplayRole; -import com.raytheon.uf.viz.collaboration.comm.provider.TransferRoleCommand; -import com.raytheon.uf.viz.collaboration.display.editor.CollaborationEditor; -import com.raytheon.uf.viz.collaboration.display.editor.ReprojectEditor; -import com.raytheon.uf.viz.collaboration.display.editor.SharedEditorData; -import com.raytheon.uf.viz.collaboration.ui.data.SessionContainer; -import com.raytheon.uf.viz.collaboration.ui.data.SharedDisplaySessionMgr; -import com.raytheon.uf.viz.collaboration.ui.editor.EditorSetup; -import com.raytheon.uf.viz.collaboration.ui.editor.SharedResource; -import com.raytheon.uf.viz.collaboration.ui.rsc.CollaborationResourceData; -import com.raytheon.uf.viz.core.IDisplayPane; -import com.raytheon.uf.viz.core.VizApp; -import com.raytheon.uf.viz.core.drawables.AbstractDescriptor; -import com.raytheon.uf.viz.core.drawables.IDescriptor; -import com.raytheon.uf.viz.core.drawables.ResourcePair; -import com.raytheon.uf.viz.core.exception.VizException; -import com.raytheon.uf.viz.core.rsc.ResourceProperties; - -/** - * Handles the events of a session that are specific to the Participant role. - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Mar 26, 2012            njensen     Initial creation
- * 
- * 
- * - * @author njensen - * @version 1.0 - */ - -public class ParticipantEventController extends AbstractRoleEventController { - - private static final transient IUFStatusHandler statusHandler = UFStatus - .getHandler(ParticipantEventController.class); - - public ParticipantEventController(ISharedDisplaySession session) { - super(session); - } - - @Subscribe - public void editorDataArrived(final SharedEditorData se) { - // TODO need to detect if we already have a CollaborationEditor for - // this session. If so, that implies DataProvider changed and we - // should reuse the editor, reinitializing the descriptor and - // renderable display but keeping the drawing and telestrator - VizApp.runSync(new Runnable() { - - @Override - public void run() { - String sessionId = ParticipantEventController.this.session - .getSessionId(); - SessionContainer container = SharedDisplaySessionMgr - .getSessionContainer(sessionId); - String title = session.getVenue().getInfo() - .getVenueDescription(); - - // initialize and open editor - CollaborationEditor editor = EditorSetup.createEditor(se, - sessionId, title); - container.setCollaborationEditor(editor); - initializeResources(editor.getDisplay().getDescriptor()); - activateResources(editor.getDisplay()); - } - }); - } - - @Subscribe - public void reprojectEditor(final ReprojectEditor event) { - VizApp.runAsync(new Runnable() { - @Override - public void run() { - CollaborationEditor editor = SharedDisplaySessionMgr - .getSessionContainer(session.getSessionId()) - .getCollaborationEditor(); - if (editor != null) { - // Only reproject if editor has been created - IDisplayPane pane = editor.getActiveDisplayPane(); - IDescriptor desc = pane.getDescriptor(); - if (desc instanceof AbstractDescriptor) { - try { - ((AbstractDescriptor) desc).setGridGeometry(event - .getTargetGeometry()); - } catch (VizException e) { - statusHandler.handle(Priority.PROBLEM, - "Error reprojecting collaboration display: " - + e.getLocalizedMessage(), e); - } - } - pane.setZoomLevel(1.0); - pane.scaleToClientArea(); - pane.refresh(); - } - } - }); - } - - @Subscribe - public void resourceDataArrived(SharedResource sr) { - ResourcePair rp = sr.getResource(); - // TODO: Need to tie shared resource adding to a displayId so we add it - // to the correct editor/pane - CollaborationEditor editor = SharedDisplaySessionMgr - .getSessionContainer(session.getSessionId()) - .getCollaborationEditor(); - IDescriptor affectedDescriptor = editor.getActiveDisplayPane() - .getDescriptor(); - if (sr.isRemoveResource()) { - affectedDescriptor.getResourceList().remove( - convertToLocalResourcePair(rp)); - } else { - affectedDescriptor.getResourceList().add( - convertToLocalResourcePair(rp)); - affectedDescriptor.getResourceList().instantiateResources( - affectedDescriptor, true); - } - } - - private ResourcePair convertToLocalResourcePair(ResourcePair rp) { - if (rp.getProperties() != null) { - rp.getProperties().setSystemResource(true); - } else { - ResourceProperties props = new ResourceProperties(); - props.setSystemResource(true); - rp.setProperties(props); - } - return rp; - } - - private void initializeResources(IDescriptor desc) { - CollaborationResourceData crd = new CollaborationResourceData(); - crd.setSession(session); - ResourcePair rp = ResourcePair.constructSystemResourcePair(crd); - desc.getResourceList().add(rp); - desc.getResourceList().instantiateResources(desc, true); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.viz.collaboration.ui.role.AbstractRoleEventController - * #shutdown() - */ - @Override - public void shutdown() { - super.shutdown(); - SessionContainer container = SharedDisplaySessionMgr - .getSessionContainer(session.getSessionId()); - if (container != null) { - super.deactivateResources(container.getCollaborationEditor() - .getDisplay()); - } - } - - @Subscribe - public void roleTransferred(TransferRoleCommand cmd) { - if (cmd.getRole() == SharedDisplayRole.SESSION_LEADER) { - session.setCurrentSessionLeader(cmd.getUser()); - if (cmd.getUser().getFQName() - .equals(session.getUserID().getFQName())) { - // this cave should assume session leader control - InputUtil.enableSessionLeaderInput(SharedDisplaySessionMgr - .getSessionContainer(session.getSessionId()) - .getCollaborationEditor()); - } else if (session.getCurrentSessionLeader().getFQName() - .equals(session.getUserID().getFQName()) - && !session.getCurrentSessionLeader().getFQName() - .equals(cmd.getUser().getFQName())) { - // this cave should release session leader control - InputUtil.disableSessionLeaderInput(SharedDisplaySessionMgr - .getSessionContainer(session.getSessionId()) - .getCollaborationEditor()); - } - } - } -} diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/session/AbstractSessionView.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/session/AbstractSessionView.java index f919e75941..8e3ea45043 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/session/AbstractSessionView.java +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/session/AbstractSessionView.java @@ -67,10 +67,10 @@ import com.raytheon.uf.viz.collaboration.comm.provider.session.CollaborationConn import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; import com.raytheon.uf.viz.collaboration.ui.Activator; import com.raytheon.uf.viz.collaboration.ui.CollaborationUtils; +import com.raytheon.uf.viz.collaboration.ui.actions.PopupNotifier; import com.raytheon.uf.viz.collaboration.ui.data.AlertWord; import com.raytheon.uf.viz.core.VizApp; import com.raytheon.uf.viz.core.icon.IconUtil; -import com.raytheon.uf.viz.notification.notifier.PopupNotifier; import com.raytheon.viz.ui.views.CaveFloatingView; /** diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/session/CollaborationSessionView.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/session/CollaborationSessionView.java index f521c5d928..941d6e538e 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/session/CollaborationSessionView.java +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/session/CollaborationSessionView.java @@ -21,7 +21,9 @@ package com.raytheon.uf.viz.collaboration.ui.session; **/ import java.util.ArrayList; +import java.util.IdentityHashMap; import java.util.List; +import java.util.Map; import org.eclipse.ecf.presence.roster.IRosterEntry; import org.eclipse.jface.action.Action; @@ -57,26 +59,31 @@ import com.raytheon.uf.viz.collaboration.comm.provider.TransferRoleCommand; import com.raytheon.uf.viz.collaboration.comm.provider.session.CollaborationConnection; import com.raytheon.uf.viz.collaboration.comm.provider.user.IDConverter; import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; -import com.raytheon.uf.viz.collaboration.display.editor.CollaborationEditor; +import com.raytheon.uf.viz.collaboration.display.IRemoteDisplayContainer; +import com.raytheon.uf.viz.collaboration.display.IRemoteDisplayContainer.IRemoteDisplayChangedListener; +import com.raytheon.uf.viz.collaboration.display.IRemoteDisplayContainer.RemoteDisplay; +import com.raytheon.uf.viz.collaboration.display.IRemoteDisplayContainer.RemoteDisplayChangeType; +import com.raytheon.uf.viz.collaboration.display.data.ColorChangeEvent; +import com.raytheon.uf.viz.collaboration.display.data.SessionContainer; +import com.raytheon.uf.viz.collaboration.display.data.SharedDisplaySessionMgr; +import com.raytheon.uf.viz.collaboration.display.editor.ICollaborationEditor; +import com.raytheon.uf.viz.collaboration.display.roles.dataprovider.SharedEditorsManager; +import com.raytheon.uf.viz.collaboration.display.rsc.SelfAddingSystemResourceListener; +import com.raytheon.uf.viz.collaboration.display.rsc.telestrator.CollaborationDrawingEvent; +import com.raytheon.uf.viz.collaboration.display.rsc.telestrator.CollaborationDrawingResource; +import com.raytheon.uf.viz.collaboration.display.rsc.telestrator.CollaborationDrawingResourceData; import com.raytheon.uf.viz.collaboration.ui.Activator; -import com.raytheon.uf.viz.collaboration.ui.ColorChangeEvent; -import com.raytheon.uf.viz.collaboration.ui.data.SessionContainer; -import com.raytheon.uf.viz.collaboration.ui.data.SharedDisplaySessionMgr; -import com.raytheon.uf.viz.collaboration.ui.telestrator.CollaborationDrawingResource; -import com.raytheon.uf.viz.collaboration.ui.telestrator.event.CollaborationDrawingEvent; -import com.raytheon.uf.viz.collaboration.ui.telestrator.event.CollaborationDrawingEvent.CollaborationEventType; import com.raytheon.uf.viz.core.ContextManager; import com.raytheon.uf.viz.core.VizApp; import com.raytheon.uf.viz.core.drawables.IRenderableDisplay; +import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.icon.IconUtil; -import com.raytheon.uf.viz.core.rsc.ResourceList; import com.raytheon.uf.viz.drawing.DrawingToolLayer; import com.raytheon.uf.viz.drawing.DrawingToolLayer.DrawMode; import com.raytheon.viz.ui.VizWorkbenchManager; -import com.raytheon.viz.ui.editor.AbstractEditor; /** - * TODO Add Description + * View class for a collaboration session * *
  * 
@@ -92,7 +99,7 @@ import com.raytheon.viz.ui.editor.AbstractEditor;
  * @version 1.0
  */
 public class CollaborationSessionView extends SessionView implements
-        IPartListener {
+        IPartListener, IRemoteDisplayChangedListener {
     public static final String ID = "com.raytheon.uf.viz.collaboration.CollaborationSession";
 
     private static final transient IUFStatusHandler statusHandler = UFStatus
@@ -100,6 +107,13 @@ public class CollaborationSessionView extends SessionView implements
 
     private static final String COLLABORATION_SESSION_IMAGE_NAME = "messages.gif";
 
+    private Runnable actionUpdater = new Runnable() {
+        @Override
+        public void run() {
+            updateToolItems();
+        }
+    };
+
     private Action colorChangeAction;
 
     private ActionContributionItem drawAction;
@@ -116,39 +130,33 @@ public class CollaborationSessionView extends SessionView implements
 
     private ISharedDisplaySession session;
 
-    private CollaborationDrawingResource getCurrentResource() {
-        CollaborationDrawingResource resource = null;
-        SessionContainer sc = SharedDisplaySessionMgr
-                .getSessionContainer(sessionId);
-        List displays = new ArrayList();
-        if (sc.getCollaborationEditor() == null) {
-            for (AbstractEditor editor : sc.getSharedEditors()) {
-                ResourceList list = editor.getActiveDisplayPane()
-                        .getDescriptor().getResourceList();
-                resource = getCurrentResource(list);
-                if (resource != null) {
-                    break;
-                }
+    private IRemoteDisplayContainer container;
+
+    private IRenderableDisplay currentDisplay;
+
+    private boolean locked = false;
+
+    private DrawMode drawMode = DrawMode.NONE;
+
+    private Map listeners = new IdentityHashMap();
+
+    public CollaborationDrawingResource getCurrentDrawingResource() {
+        CollaborationDrawingResource currentResource = null;
+        if (currentDisplay != null) {
+            for (CollaborationDrawingResource resource : currentDisplay
+                    .getDescriptor()
+                    .getResourceList()
+                    .getResourcesByTypeAsType(
+                            CollaborationDrawingResource.class)) {
+                currentResource = resource;
+                break;
             }
-        } else {
-            resource = getCurrentResource(SharedDisplaySessionMgr
-                    .getSessionContainer(sessionId).getCollaborationEditor()
-                    .getDisplay().getDescriptor().getResourceList());
         }
-
-        return resource;
-    }
-
-    private CollaborationDrawingResource getCurrentResource(ResourceList rl) {
-        for (CollaborationDrawingResource resource : rl
-                .getResourcesByTypeAsType(CollaborationDrawingResource.class)) {
-            return resource;
-        }
-        return null;
+        return currentResource;
     }
 
     private DrawingToolLayer getCurrentLayer() {
-        CollaborationDrawingResource resource = getCurrentResource();
+        CollaborationDrawingResource resource = getCurrentDrawingResource();
         if (resource != null) {
             return resource.getDrawingLayerFor(resource.getMyUser());
         }
@@ -164,6 +172,22 @@ public class CollaborationSessionView extends SessionView implements
     public void init(IViewSite site) throws PartInitException {
         super.init(site);
         site.getPage().addPartListener(this);
+        SessionContainer sc = SharedDisplaySessionMgr
+                .getSessionContainer(sessionId);
+        if (sc != null) {
+            session = sc.getSession();
+            if (sc.getCollaborationEditor() != null) {
+                container = sc.getCollaborationEditor();
+            } else {
+                container = SharedEditorsManager.getManager(session);
+            }
+            container.addRemoteDisplayChangedListener(this);
+            RemoteDisplay remoteDisplay = container.getActiveDisplay();
+            if (remoteDisplay != null) {
+                remoteDisplayChanged(container.getActiveDisplay(),
+                        RemoteDisplayChangeType.ACTIVATED);
+            }
+        }
     }
 
     protected void createActions() {
@@ -204,10 +228,13 @@ public class CollaborationSessionView extends SessionView implements
             @Override
             public void run() {
                 DrawingToolLayer layer = getCurrentLayer();
-                if (layer.getDrawMode() == DrawMode.DRAW) {
-                    layer.setDrawMode(DrawMode.NONE);
-                } else {
-                    layer.setDrawMode(DrawMode.DRAW);
+                if (layer != null) {
+                    if (layer.getDrawMode() == DrawMode.DRAW) {
+                        layer.setDrawMode(DrawMode.NONE);
+                    } else {
+                        layer.setDrawMode(DrawMode.DRAW);
+                    }
+                    drawMode = layer.getDrawMode();
                 }
                 updateToolItems();
             }
@@ -258,6 +285,7 @@ public class CollaborationSessionView extends SessionView implements
                             } else {
                                 layer.setDrawMode(DrawMode.ERASE);
                             }
+                            drawMode = layer.getDrawMode();
                         }
                         updateToolItems();
                     }
@@ -284,10 +312,11 @@ public class CollaborationSessionView extends SessionView implements
         lockAction = new ActionContributionItem(new Action(
                 "Lock Collaborators", SWT.TOGGLE) {
             public void run() {
-                CollaborationDrawingResource resource = getCurrentResource();
+                CollaborationDrawingResource resource = getCurrentDrawingResource();
                 if (resource != null) {
                     resource.setLockingDrawing(((ToolItem) lockAction
                             .getWidget()).getSelection());
+                    locked = resource.isLockingDrawing();
                     updateToolItems();
                 }
             };
@@ -305,11 +334,20 @@ public class CollaborationSessionView extends SessionView implements
         mgr.insert(mgr.getSize() - 1, eraseAction);
         mgr.insert(mgr.getSize() - 1, lockAction);
         mgr.insert(mgr.getSize() - 1, new Separator());
+
+        updateToolItems();
     }
 
     public void updateToolItems() {
-        DrawingToolLayer layer = getCurrentLayer();
-        if (layer != null) {
+        CollaborationDrawingResource currentResource = getCurrentDrawingResource();
+        DrawingToolLayer layer = null;
+        if (currentResource != null) {
+            layer = currentResource.getDrawingLayerFor(currentResource
+                    .getMyUser());
+        }
+        if (layer != null
+                && (currentResource.isLockingDrawing() == false || currentResource
+                        .isSessionLeader())) {
             drawAction.getAction().setEnabled(true);
             undoAction.getAction().setEnabled(layer.canUndo());
             redoAction.getAction().setEnabled(layer.canRedo());
@@ -329,10 +367,15 @@ public class CollaborationSessionView extends SessionView implements
                 eraseAction.getAction().setChecked(false);
                 break;
             }
-            CollaborationDrawingResource resource = getCurrentResource();
-            if (resource != null && !resource.isSessionLeader()) {
-                lockAction.getAction().setEnabled(false);
-            }
+            lockAction.getAction().setChecked(
+                    currentResource.isLockingDrawing());
+        } else {
+            drawAction.getAction().setEnabled(false);
+            undoAction.getAction().setEnabled(false);
+            redoAction.getAction().setEnabled(false);
+            clearAction.getAction().setEnabled(false);
+            eraseAction.getAction().setEnabled(false);
+            lockAction.getAction().setEnabled(false);
         }
     }
 
@@ -432,21 +475,8 @@ public class CollaborationSessionView extends SessionView implements
     }
 
     @Subscribe
-    public void receiveLocking(CollaborationDrawingEvent event) {
-        if (event.getType() == CollaborationEventType.TOGGLE_LOCK) {
-            CollaborationDrawingResource resource = getCurrentResource();
-            if (resource != null && !resource.isSessionLeader()) {
-                if (drawAction.getAction().isEnabled()) {
-                    drawAction.getAction().setEnabled(false);
-                    undoAction.getAction().setEnabled(false);
-                    redoAction.getAction().setEnabled(false);
-                    clearAction.getAction().setEnabled(false);
-                    eraseAction.getAction().setEnabled(false);
-                } else {
-                    updateToolItems();
-                }
-            }
-        }
+    public void collaborationEvent(CollaborationDrawingEvent event) {
+        VizApp.runAsync(actionUpdater);
     }
 
     /*
@@ -467,20 +497,13 @@ public class CollaborationSessionView extends SessionView implements
         label.setText(labelInfo.toString());
     }
 
-    @Override
-    protected void setSession(String sessionId) {
-        super.setSession(sessionId);
-        this.session = (ISharedDisplaySession) CollaborationConnection
-                .getConnection().getSession(sessionId);
-    }
-
     public String getSessionId() {
         return session.getSessionId();
     }
 
     @Override
     public void dispose() {
-        CollaborationEditor assocEditor = SharedDisplaySessionMgr
+        ICollaborationEditor assocEditor = SharedDisplaySessionMgr
                 .getSessionContainer(session.getSessionId())
                 .getCollaborationEditor();
         if (assocEditor != null) {
@@ -494,6 +517,9 @@ public class CollaborationSessionView extends SessionView implements
         session.close();
         super.dispose();
         getSite().getPage().removePartListener(this);
+        if (container != null) {
+            container.removeRemoteDisplayChangedListener(this);
+        }
     }
 
     // =================== Context activation code ===================
@@ -506,14 +532,17 @@ public class CollaborationSessionView extends SessionView implements
      */
     @Override
     public void partActivated(IWorkbenchPart part) {
-        // do this only if we care about the part being activated
+        // only done if we care about the part that was activated
         SessionContainer sc = SharedDisplaySessionMgr
                 .getSessionContainer(sessionId);
         List editors = new ArrayList();
-        editors.add(sc.getCollaborationEditor());
-        if (sc.getSharedEditors() != null) {
-            editors.addAll(sc.getSharedEditors());
+        if (sc.getCollaborationEditor() == null) {
+            editors.addAll(SharedEditorsManager.getManager(sc.getSession())
+                    .getSharedEditors());
+        } else {
+            editors.add(sc.getCollaborationEditor());
         }
+
         if (this == part || editors.contains(part)) {
             ContextManager
                     .getInstance(getSite().getPage().getWorkbenchWindow())
@@ -555,10 +584,13 @@ public class CollaborationSessionView extends SessionView implements
         SessionContainer sc = SharedDisplaySessionMgr
                 .getSessionContainer(sessionId);
         List editors = new ArrayList();
-        editors.add(sc.getCollaborationEditor());
-        if (sc.getSharedEditors() != null) {
-            editors.addAll(sc.getSharedEditors());
+        if (sc.getCollaborationEditor() == null) {
+            editors.addAll(SharedEditorsManager.getManager(sc.getSession())
+                    .getSharedEditors());
+        } else {
+            editors.add(sc.getCollaborationEditor());
         }
+
         if (this == part || editors.contains(part)) {
             ContextManager
                     .getInstance(getSite().getPage().getWorkbenchWindow())
@@ -576,4 +608,63 @@ public class CollaborationSessionView extends SessionView implements
     public void partOpened(IWorkbenchPart part) {
     }
 
+    /*
+     * (non-Javadoc)
+     * 
+     * @see com.raytheon.uf.viz.collaboration.display.IRemoteDisplayContainer.
+     * IRemoteDisplayChangedListener
+     * #remoteDisplayChanged(com.raytheon.uf.viz.core
+     * .drawables.IRenderableDisplay,
+     * com.raytheon.uf.viz.collaboration.display.IRemoteDisplayContainer
+     * .RemoteDisplayChangeType)
+     */
+    @Override
+    public void remoteDisplayChanged(RemoteDisplay remoteDisplay,
+            RemoteDisplayChangeType changeType) {
+        IRenderableDisplay display = remoteDisplay.getDisplay();
+        int displayId = remoteDisplay.getDisplayId();
+        switch (changeType) {
+        case CREATED:
+            if (listeners.containsKey(display) == false) {
+                CollaborationDrawingResourceData resourceData = new CollaborationDrawingResourceData();
+                resourceData.setSessionId(sessionId);
+                resourceData.setDisplayId(displayId);
+                try {
+                    listeners.put(display,
+                            new SelfAddingSystemResourceListener(resourceData,
+                                    display.getDescriptor()));
+                    display.refresh();
+                } catch (VizException e) {
+                    Activator.statusHandler.handle(Priority.PROBLEM,
+                            e.getLocalizedMessage(), e);
+                }
+            }
+            break;
+        case ACTIVATED:
+            if (listeners.containsKey(display) == false) {
+                remoteDisplayChanged(remoteDisplay,
+                        RemoteDisplayChangeType.CREATED);
+            }
+            currentDisplay = display;
+            CollaborationDrawingResource resource = getCurrentDrawingResource();
+            if (resource != null && resource.isSessionLeader()) {
+                resource.setLockingDrawing(locked);
+                resource.getDrawingLayerFor(resource.getMyUser()).setDrawMode(
+                        drawMode);
+            }
+            VizApp.runAsync(actionUpdater);
+            break;
+        case DISPOSED:
+            SelfAddingSystemResourceListener listener = listeners
+                    .remove(display);
+            if (listener != null) {
+                listener.dispose();
+            }
+            if (display == currentDisplay) {
+                currentDisplay = null;
+                VizApp.runAsync(actionUpdater);
+            }
+            break;
+        }
+    }
 }
diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/session/ParticipantsLabelProvider.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/session/ParticipantsLabelProvider.java
index 68511660df..39aa5f5fd7 100644
--- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/session/ParticipantsLabelProvider.java
+++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/session/ParticipantsLabelProvider.java
@@ -43,8 +43,8 @@ import com.raytheon.uf.viz.collaboration.comm.provider.session.CollaborationConn
 import com.raytheon.uf.viz.collaboration.comm.provider.session.SharedDisplaySession;
 import com.raytheon.uf.viz.collaboration.comm.provider.user.IDConverter;
 import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
+import com.raytheon.uf.viz.collaboration.display.data.SessionColorManager;
 import com.raytheon.uf.viz.collaboration.ui.CollaborationUtils;
-import com.raytheon.uf.viz.collaboration.ui.SessionColorManager;
 
 /**
  * Generate the Participant's label and icon image.
diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/session/SessionView.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/session/SessionView.java
index a51d617b13..689869a6d3 100644
--- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/session/SessionView.java
+++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/session/SessionView.java
@@ -55,6 +55,7 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.IViewSite;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
@@ -73,7 +74,7 @@ import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenueInfo;
 import com.raytheon.uf.viz.collaboration.comm.provider.session.CollaborationConnection;
 import com.raytheon.uf.viz.collaboration.comm.provider.user.IDConverter;
 import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
-import com.raytheon.uf.viz.collaboration.ui.SessionColorManager;
+import com.raytheon.uf.viz.collaboration.display.data.SessionColorManager;
 import com.raytheon.uf.viz.core.VizApp;
 
 /**
@@ -577,6 +578,19 @@ public class SessionView extends AbstractSessionView {
         label.setText(labelInfo.toString());
     }
 
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.ui.part.ViewPart#init(org.eclipse.ui.IViewSite)
+     */
+    @Override
+    public void init(IViewSite site) throws PartInitException {
+        super.init(site);
+        this.sessionId = site.getSecondaryId();
+        this.session = (IVenueSession) CollaborationConnection.getConnection()
+                .getSession(this.sessionId);
+    }
+
     /*
      * (non-Javadoc)
      * 
@@ -585,19 +599,12 @@ public class SessionView extends AbstractSessionView {
      */
     @Override
     protected String getSessionName() {
-        setSession(getViewSite().getSecondaryId());
         if (session == null) {
             return sessionId;
         }
         return session.getVenue().getInfo().getVenueDescription();
     }
 
-    protected void setSession(String sessionId) {
-        this.sessionId = sessionId;
-        this.session = (IVenueSession) CollaborationConnection.getConnection()
-                .getSession(this.sessionId);
-    }
-
     @Subscribe
     public void participantHandler(IVenueParticipantEvent event)
             throws Exception {
diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/telestrator/handlers/UndoRedoHandler.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/telestrator/handlers/UndoRedoHandler.java
index 850ede7ecd..84c1efaced 100644
--- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/telestrator/handlers/UndoRedoHandler.java
+++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/telestrator/handlers/UndoRedoHandler.java
@@ -19,23 +19,21 @@
  **/
 package com.raytheon.uf.viz.collaboration.ui.telestrator.handlers;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IViewReference;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.handlers.HandlerUtil;
 
+import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession;
+import com.raytheon.uf.viz.collaboration.display.editor.ICollaborationEditor;
+import com.raytheon.uf.viz.collaboration.display.roles.dataprovider.SharedEditorsManager;
+import com.raytheon.uf.viz.collaboration.display.rsc.telestrator.CollaborationDrawingResource;
 import com.raytheon.uf.viz.collaboration.ui.session.CollaborationSessionView;
-import com.raytheon.uf.viz.collaboration.ui.telestrator.CollaborationDrawingResource;
-import com.raytheon.uf.viz.core.IDisplayPane;
-import com.raytheon.uf.viz.core.IDisplayPaneContainer;
 import com.raytheon.uf.viz.drawing.DrawingToolLayer;
-import com.raytheon.viz.ui.EditorUtil;
+import com.raytheon.viz.ui.editor.AbstractEditor;
 
 /**
  * Action for invoking undo/redo on the CollaborationDrawingToolbar
@@ -73,43 +71,43 @@ public class UndoRedoHandler extends AbstractHandler {
     public Object execute(ExecutionEvent event) throws ExecutionException {
         IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
         if (window != null) {
-            IDisplayPaneContainer container = EditorUtil.getActiveEditorAs(
-                    window, IDisplayPaneContainer.class);
-            if (container != null) {
-                Map viewMap = new HashMap();
-                for (IViewReference view : window.getActivePage()
-                        .getViewReferences()) {
-                    if (CollaborationSessionView.ID.equals(view.getId())) {
-                        CollaborationSessionView csv = (CollaborationSessionView) view
-                                .getPart(false);
-                        viewMap.put(csv.getSessionId(), csv);
-                    }
+            String sessionId = null;
+            IEditorPart editor = HandlerUtil.getActiveEditor(event);
+            if (editor instanceof ICollaborationEditor) {
+                sessionId = ((ICollaborationEditor) editor).getSessionId();
+            } else if (editor instanceof AbstractEditor) {
+                ISharedDisplaySession session = SharedEditorsManager
+                        .getSharedEditorSession((AbstractEditor) editor);
+                if (session != null) {
+                    sessionId = session.getSessionId();
                 }
-
-                for (IDisplayPane pane : container.getDisplayPanes()) {
-                    List resources = pane
-                            .getDescriptor()
-                            .getResourceList()
-                            .getResourcesByTypeAsType(
-                                    CollaborationDrawingResource.class);
-                    for (CollaborationDrawingResource resource : resources) {
-                        DrawingToolLayer layer = resource
-                                .getDrawingLayerFor(resource.getMyUser());
-                        String action = event.getParameter(ACTION_ID);
-                        if (UNDO_ID.equals(action)) {
-                            layer.undo();
-                        } else if (REDO_ID.equals(action)) {
-                            layer.redo();
-                        }
-                        CollaborationSessionView view = viewMap.get(resource
-                                .getResourceData().getSessionId());
-                        if (view != null) {
-                            view.updateToolItems();
+            }
+            if (sessionId != null) {
+                for (IViewReference ref : window.getActivePage()
+                        .getViewReferences()) {
+                    if (CollaborationSessionView.ID.equals(ref.getId())) {
+                        CollaborationSessionView view = (CollaborationSessionView) ref
+                                .getView(false);
+                        if (sessionId.equals(view.getSessionId())) {
+                            CollaborationDrawingResource resource = view
+                                    .getCurrentDrawingResource();
+                            if (resource != null) {
+                                DrawingToolLayer layer = resource
+                                        .getDrawingLayerFor(resource
+                                                .getMyUser());
+                                String action = event.getParameter(ACTION_ID);
+                                if (UNDO_ID.equals(action)) {
+                                    layer.undo();
+                                } else if (REDO_ID.equals(action)) {
+                                    layer.redo();
+                                }
+                                view.updateToolItems();
+                                break;
+                            }
                         }
                     }
                 }
             }
-
         }
         return null;
     }
diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/drawables/AbstractDescriptor.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/drawables/AbstractDescriptor.java
index dd88f71a0f..4ee16a1847 100644
--- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/drawables/AbstractDescriptor.java
+++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/drawables/AbstractDescriptor.java
@@ -754,16 +754,17 @@ public abstract class AbstractDescriptor extends ResourceGroup implements
         return gridGeometry;
     }
 
-    /**
-     * Set the grid geometry
+    /*
+     * (non-Javadoc)
      * 
-     * @param gridGeometry
-     *            the gridGeometry to set
-     * @throws VizException
+     * @see
+     * com.raytheon.uf.viz.core.drawables.IDescriptor#setGridGeometry(org.geotools
+     * .coverage.grid.GeneralGridGeometry)
      */
-    public void setGridGeometry(GeneralGridGeometry gridGeometry)
+    @Override
+    public void setGridGeometry(GeneralGridGeometry geometry)
             throws VizException {
-        this.gridGeometry = gridGeometry;
+        this.gridGeometry = geometry;
         init();
     }
 
diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/drawables/IDescriptor.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/drawables/IDescriptor.java
index 4199dc8ffc..88bbfd79b2 100644
--- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/drawables/IDescriptor.java
+++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/drawables/IDescriptor.java
@@ -26,6 +26,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
 
 import com.raytheon.uf.common.time.DataTime;
 import com.raytheon.uf.viz.core.AbstractTimeMatcher;
+import com.raytheon.uf.viz.core.exception.VizException;
 import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
 import com.raytheon.uf.viz.core.rsc.IResourceGroup;
 
@@ -320,6 +321,15 @@ public interface IDescriptor extends IResourceGroup {
      */
     public abstract GeneralGridGeometry getGridGeometry();
 
+    /**
+     * Set the geometry for the descriptor
+     * 
+     * @param geometry
+     * @throws VizException
+     */
+    public abstract void setGridGeometry(GeneralGridGeometry geometry)
+            throws VizException;
+
     /**
      * DEPRECATED, use getFrameCoordinator().changeFrame(...) with
      * IFrameCoordinator.FrameChangeOperation/FrameChangeMode
diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/map/IMapDescriptor.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/map/IMapDescriptor.java
index 813f62e3bb..69893d4fca 100644
--- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/map/IMapDescriptor.java
+++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/map/IMapDescriptor.java
@@ -20,7 +20,6 @@
 
 package com.raytheon.uf.viz.core.map;
 
-import org.geotools.coverage.grid.GeneralGridGeometry;
 import org.opengis.referencing.FactoryException;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
 import org.opengis.referencing.operation.TransformException;
@@ -141,16 +140,6 @@ public interface IMapDescriptor extends IDescriptor {
             Coordinate ur) throws FactoryException, TransformException,
             VizException;
 
-    /**
-     * Set the grid geometry
-     * 
-     * @param gridGeometry
-     *            the gridGeometry to set
-     * @throws VizException
-     */
-    public abstract void setGridGeometry(GeneralGridGeometry gridGeometry)
-            throws VizException;
-
     /**
      * Get the current map width
      * 
diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/rsc/AbstractVizResource.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/rsc/AbstractVizResource.java
index fdd69a4fe5..36db035863 100644
--- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/rsc/AbstractVizResource.java
+++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/rsc/AbstractVizResource.java
@@ -351,10 +351,12 @@ public abstract class AbstractVizResource implements
                 // eat exception
             }
         }
+
+        synchronized (resourcesToInstantiate) {
+            resourcesToInstantiate.clear();
+        }
     }
 
     /*
diff --git a/cave/com.raytheon.uf.viz.drawing/src/com/raytheon/uf/viz/drawing/DrawingToolLayer.java b/cave/com.raytheon.uf.viz.drawing/src/com/raytheon/uf/viz/drawing/DrawingToolLayer.java
index 110c94ccd0..0b1633348c 100644
--- a/cave/com.raytheon.uf.viz.drawing/src/com/raytheon/uf/viz/drawing/DrawingToolLayer.java
+++ b/cave/com.raytheon.uf.viz.drawing/src/com/raytheon/uf/viz/drawing/DrawingToolLayer.java
@@ -442,9 +442,8 @@ public class DrawingToolLayer implements IRenderable {
                     UFStatus.getHandler().handle(Priority.PROBLEM,
                             "Could not add line, bad geometry", e);
                 }
-
-                currentDrawingLine = null;
             }
+            currentDrawingLine = null;
         }
     }
 
diff --git a/cave/com.raytheon.uf.viz.drawing/src/com/raytheon/uf/viz/drawing/DrawingToolUIManager.java b/cave/com.raytheon.uf.viz.drawing/src/com/raytheon/uf/viz/drawing/DrawingToolUIManager.java
index 7df0d8e798..544e4fa722 100644
--- a/cave/com.raytheon.uf.viz.drawing/src/com/raytheon/uf/viz/drawing/DrawingToolUIManager.java
+++ b/cave/com.raytheon.uf.viz.drawing/src/com/raytheon/uf/viz/drawing/DrawingToolUIManager.java
@@ -99,6 +99,9 @@ public class DrawingToolUIManager extends InputAdapter {
         pencil.dispose();
 
         container.unregisterMouseHandler(this);
+        if (currentShell != null) {
+            currentShell.setCursor(null);
+        }
     }
 
     /*
diff --git a/cave/com.raytheon.uf.viz.notification/.classpath b/cave/com.raytheon.uf.viz.notification/.classpath
deleted file mode 100644
index ad32c83a78..0000000000
--- a/cave/com.raytheon.uf.viz.notification/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-	
-	
-	
-	
-
diff --git a/cave/com.raytheon.uf.viz.notification/.settings/org.eclipse.jdt.core.prefs b/cave/com.raytheon.uf.viz.notification/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index c50f642c70..0000000000
--- a/cave/com.raytheon.uf.viz.notification/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,8 +0,0 @@
-#Thu Apr 26 12:40:33 CDT 2012
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/cave/com.raytheon.uf.viz.notification/META-INF/MANIFEST.MF b/cave/com.raytheon.uf.viz.notification/META-INF/MANIFEST.MF
deleted file mode 100644
index 671cb3a22e..0000000000
--- a/cave/com.raytheon.uf.viz.notification/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,14 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Notification
-Bundle-SymbolicName: com.raytheon.uf.viz.notification
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: com.raytheon.uf.viz.notification.Activator
-Bundle-Vendor: RAYTHEON
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- com.raytheon.uf.viz.core;bundle-version="1.12.1174"
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Bundle-ActivationPolicy: lazy
-Export-Package: com.raytheon.uf.viz.notification,
- com.raytheon.uf.viz.notification.notifier
diff --git a/cave/com.raytheon.uf.viz.notification/build.properties b/cave/com.raytheon.uf.viz.notification/build.properties
deleted file mode 100644
index 34d2e4d2da..0000000000
--- a/cave/com.raytheon.uf.viz.notification/build.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
-               .
diff --git a/cave/com.raytheon.uf.viz.notification/src/com/raytheon/uf/viz/notification/Activator.java b/cave/com.raytheon.uf.viz.notification/src/com/raytheon/uf/viz/notification/Activator.java
deleted file mode 100644
index 3a1a315300..0000000000
--- a/cave/com.raytheon.uf.viz.notification/src/com/raytheon/uf/viz/notification/Activator.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package com.raytheon.uf.viz.notification;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
-	// The plug-in ID
-	public static final String PLUGIN_ID = "com.raytheon.uf.viz.notification"; //$NON-NLS-1$
-
-	// The shared instance
-	private static Activator plugin;
-	
-	/**
-	 * The constructor
-	 */
-	public Activator() {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
-	 */
-	public void start(BundleContext context) throws Exception {
-		super.start(context);
-		plugin = this;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
-	 */
-	public void stop(BundleContext context) throws Exception {
-		plugin = null;
-		super.stop(context);
-	}
-
-	/**
-	 * Returns the shared instance
-	 *
-	 * @return the shared instance
-	 */
-	public static Activator getDefault() {
-		return plugin;
-	}
-
-}
diff --git a/cave/com.raytheon.uf.viz.npp.viirs/.pydevproject b/cave/com.raytheon.uf.viz.npp.viirs/.pydevproject
deleted file mode 100644
index a9cca037b3..0000000000
--- a/cave/com.raytheon.uf.viz.npp.viirs/.pydevproject
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-Default
-python 2.7
-
diff --git a/cave/com.raytheon.viz.spi/src/com/raytheon/viz/spi/SPIResource.java b/cave/com.raytheon.viz.spi/src/com/raytheon/viz/spi/SPIResource.java
index 5e283a7671..bc29673368 100644
--- a/cave/com.raytheon.viz.spi/src/com/raytheon/viz/spi/SPIResource.java
+++ b/cave/com.raytheon.viz.spi/src/com/raytheon/viz/spi/SPIResource.java
@@ -74,9 +74,6 @@ public class SPIResource extends
     /** The line color */
     private static final RGB DEFAULT_COLOR = new RGB(155, 155, 155);
 
-    /** Whether the resource is ready to be drawn */
-    private boolean ready = false;
-
     private int maxLen = 0;
 
     HashMap entries;
@@ -98,12 +95,12 @@ public class SPIResource extends
         if (!this.getCapabilities().hasCapability(ColorableCapability.class)) {
             getCapability(ColorableCapability.class).setColor(DEFAULT_COLOR);
         }
-        resourceData.addChangeListener(this);
     }
 
     @Override
     protected void initInternal(IGraphicsTarget target) throws VizException {
         super.initInternal(target);
+        resourceData.addChangeListener(this);
         getCapability(LabelableCapability.class).setAvailableLabelFields(
                 "Label");
         getCapability(LabelableCapability.class).setLabelField("Label");
@@ -130,85 +127,80 @@ public class SPIResource extends
 
         }
         project(this.descriptor.getCRS());
-        ready = true;
+
+        font = target.initializeFont(target.getDefaultFont().getFontName(), 10,
+                null);
     }
 
     @Override
     protected void paintInternal(IGraphicsTarget target,
             PaintProperties paintProps) throws VizException {
+        int displayWidth = (int) (this.descriptor.getMapWidth() * paintProps
+                .getZoomLevel());
 
-        if (ready) {
-            int displayWidth = (int) (this.descriptor.getMapWidth() * paintProps
-                    .getZoomLevel());
+        double metersPerPixel = displayWidth
+                / paintProps.getCanvasBounds().width;
 
-            double metersPerPixel = displayWidth
-                    / paintProps.getCanvasBounds().width;
+        double screenToWorldRatio = paintProps.getCanvasBounds().width
+                / paintProps.getView().getExtent().getWidth();
 
-            double screenToWorldRatio = paintProps.getCanvasBounds().width
-                    / paintProps.getView().getExtent().getWidth();
+        float magnification = getCapability(MagnificationCapability.class)
+                .getMagnification().floatValue();
+        font.setMagnification(magnification);
+        Rectangle2D charSize = target.getStringBounds(font, "N");
+        double charWidth = charSize.getWidth();
+        double charHeight = charSize.getHeight();
 
-            double magnification = getCapability(MagnificationCapability.class)
-                    .getMagnification();
-            if (font == null) {
-                font = target.initializeFont(target.getDefaultFont()
-                        .getFontName(), (float) (10 * magnification), null);
-            }
-            Rectangle2D charSize = target.getStringBounds(font, "N");
-            double charWidth = charSize.getWidth();
-            double charHeight = charSize.getHeight();
+        double displayHintSize = this.pixelSizeHint * magnification;
+        double minSepDist = (displayHintSize * (metersPerPixel / 1000.0))
+                / getCapability(DensityCapability.class).getDensity();
+        ;
 
-            double displayHintSize = this.pixelSizeHint * magnification;
-            double minSepDist = (displayHintSize * (metersPerPixel / 1000.0))
-                    / getCapability(DensityCapability.class).getDensity();
-            ;
+        RGB color = getCapability(ColorableCapability.class).getColor();
+        double offsetX = charWidth / 2.0 / screenToWorldRatio;
+        double offsetY = charHeight / screenToWorldRatio;
+        HorizontalAlignment align = HorizontalAlignment.LEFT;
 
-            RGB color = getCapability(ColorableCapability.class).getColor();
-            double offsetX = charWidth / 2.0 / screenToWorldRatio;
-            double offsetY = charHeight / screenToWorldRatio;
-            HorizontalAlignment align = HorizontalAlignment.LEFT;
+        PointStyle pointStyle = getCapability(PointCapability.class)
+                .getPointStyle();
+        if (pointStyle.equals(PointStyle.NONE)) {
+            offsetX = 0;
+            offsetY = 0;
+            align = HorizontalAlignment.CENTER;
+        }
+        offsetX += getCapability(LabelableCapability.class).getxOffset()
+                / screenToWorldRatio;
+        offsetY -= getCapability(LabelableCapability.class).getyOffset()
+                / screenToWorldRatio;
 
-            PointStyle pointStyle = getCapability(PointCapability.class)
-                    .getPointStyle();
-            if (pointStyle.equals(PointStyle.NONE)) {
-                offsetX = 0;
-                offsetY = 0;
-                align = HorizontalAlignment.CENTER;
-            }
-            offsetX += getCapability(LabelableCapability.class).getxOffset()
-                    / screenToWorldRatio;
-            offsetY -= getCapability(LabelableCapability.class).getyOffset()
-                    / screenToWorldRatio;
+        boolean isLabeled = getCapability(LabelableCapability.class)
+                .getLabelField() != null;
 
-            boolean isLabeled = getCapability(LabelableCapability.class)
-                    .getLabelField() != null;
+        String key = null;
+        SPIEntry entry = null;
+        List strings = new ArrayList();
+        List points = new ArrayList();
+        for (Iterator iterator = entries.keySet().iterator(); iterator
+                .hasNext();) {
+            key = iterator.next();
+            entry = entries.get(key);
 
-            String key = null;
-            SPIEntry entry = null;
-            List strings = new ArrayList();
-            List points = new ArrayList();
-            for (Iterator iterator = entries.keySet().iterator(); iterator
-                    .hasNext();) {
-                key = iterator.next();
-                entry = entries.get(key);
-
-                if (entry.pixel != null
-                        && paintProps.getView().isVisible(entry.pixel)
-                        && (entry.distance >= minSepDist)) {
-                    points.add(entry.pixel);
-                    if (isLabeled && (magnification > 0.0)) {
-                        DrawableString string = new DrawableString(key, color);
-                        string.font = font;
-                        string.setCoordinates(entry.pixel[0] + offsetX,
-                                entry.pixel[1] + offsetY, 0.0);
-                        string.horizontalAlignment = align;
-                        strings.add(string);
-                    }
+            if (entry.pixel != null
+                    && paintProps.getView().isVisible(entry.pixel)
+                    && (entry.distance >= minSepDist)) {
+                points.add(entry.pixel);
+                if (isLabeled && (magnification > 0.0)) {
+                    DrawableString string = new DrawableString(key, color);
+                    string.font = font;
+                    string.setCoordinates(entry.pixel[0] + offsetX,
+                            entry.pixel[1] + offsetY, 0.0);
+                    string.horizontalAlignment = align;
+                    strings.add(string);
                 }
             }
-            target.drawStrings(strings);
-            target.drawPoints(points, color, pointStyle, 1.0f);
-
         }
+        target.drawStrings(strings);
+        target.drawPoints(points, color, pointStyle, 1.0f);
     }
 
     @Override
@@ -225,9 +217,7 @@ public class SPIResource extends
     @Override
     protected void disposeInternal() {
         resourceData.removeChangeListener(this);
-        if (font != null) {
-            font.dispose();
-        }
+        font.dispose();
     }
 
     /*
diff --git a/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/actions/ContributedEditorMenuAction.java b/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/actions/ContributedEditorMenuAction.java
index 1f46e54a15..3d3a410911 100755
--- a/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/actions/ContributedEditorMenuAction.java
+++ b/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/actions/ContributedEditorMenuAction.java
@@ -20,6 +20,7 @@
 package com.raytheon.viz.ui.actions;
 
 import org.eclipse.jface.action.Action;
+import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.ui.internal.presentations.ISelfUpdatingAction;
 import org.eclipse.ui.presentations.IPresentablePart;
 
@@ -47,10 +48,33 @@ public class ContributedEditorMenuAction extends Action implements
     private IPresentablePart part;
 
     /**
- * 
- */
+     * 
+     */
     public ContributedEditorMenuAction() {
-        // TODO Auto-generated constructor stub
+        super();
+    }
+
+    /**
+     * @param text
+     * @param image
+     */
+    public ContributedEditorMenuAction(String text, ImageDescriptor image) {
+        super(text, image);
+    }
+
+    /**
+     * @param text
+     * @param style
+     */
+    public ContributedEditorMenuAction(String text, int style) {
+        super(text, style);
+    }
+
+    /**
+     * @param text
+     */
+    public ContributedEditorMenuAction(String text) {
+        super(text);
     }
 
     @Override
diff --git a/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/panes/PaneManager.java b/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/panes/PaneManager.java
index 79e1d40884..2acb011996 100644
--- a/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/panes/PaneManager.java
+++ b/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/panes/PaneManager.java
@@ -30,10 +30,6 @@ import java.util.Map;
 import java.util.Set;
 
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseTrackListener;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
@@ -97,7 +93,7 @@ public class PaneManager extends InputAdapter implements IMultiPaneEditor {
     protected Map selectedPanes = null;
 
     /** The pane that is currently used as the basis for the mouse cursor */
-    protected VizDisplayPane currentMouseHoverPane;
+    protected IDisplayPane currentMouseHoverPane;
 
     protected IDisplayPaneContainer paneContainer;
 
@@ -157,7 +153,7 @@ public class PaneManager extends InputAdapter implements IMultiPaneEditor {
         displayPanes.clear();
     }
 
-    protected void registerHandlers(IDisplayPane pane) {
+    protected void registerHandlers(final IDisplayPane pane) {
         pane.addListener(SWT.MouseUp, inputManager);
         pane.addListener(SWT.MouseDown, inputManager);
         pane.addListener(SWT.MouseMove, inputManager);
@@ -169,6 +165,20 @@ public class PaneManager extends InputAdapter implements IMultiPaneEditor {
         pane.addListener(SWT.MenuDetect, inputManager);
         pane.addListener(SWT.MouseExit, inputManager);
         pane.addListener(SWT.MouseEnter, inputManager);
+
+        pane.addListener(SWT.FocusIn, new Listener() {
+            @Override
+            public void handleEvent(Event event) {
+                activatedPane = pane;
+            }
+        });
+
+        pane.addListener(SWT.MouseEnter, new Listener() {
+            @Override
+            public void handleEvent(Event event) {
+                currentMouseHoverPane = activatedPane = pane;
+            }
+        });
     }
 
     public void setFocus() {
@@ -500,67 +510,6 @@ public class PaneManager extends InputAdapter implements IMultiPaneEditor {
         try {
             pane = (VizDisplayPane) createNewPane(renderableDisplay, canvasComp);
             registerHandlers(pane);
-
-            final VizDisplayPane thisPane = pane;
-            pane.addFocusListener(new FocusListener() {
-                /*
-                 * (non-Javadoc)
-                 * 
-                 * @see
-                 * org.eclipse.swt.events.FocusListener#focusGained(org.eclipse
-                 * .swt.events.FocusEvent)
-                 */
-                public void focusGained(FocusEvent e) {
-                    activatedPane = thisPane;
-                }
-
-                /*
-                 * (non-Javadoc)
-                 * 
-                 * @see
-                 * org.eclipse.swt.events.FocusListener#focusLost(org.eclipse
-                 * .swt.events.FocusEvent)
-                 */
-                public void focusLost(FocusEvent e) {
-                    // Ignore
-                }
-            });
-
-            pane.addMouseTrackListener(new MouseTrackListener() {
-                /*
-                 * (non-Javadoc)
-                 * 
-                 * @see
-                 * org.eclipse.swt.events.MouseTrackListener#mouseEnter(org.
-                 * eclipse.swt.events.MouseEvent)
-                 */
-                public void mouseEnter(MouseEvent e) {
-                    activatedPane = thisPane;
-                    currentMouseHoverPane = thisPane;
-                }
-
-                /*
-                 * (non-Javadoc)
-                 * 
-                 * @see
-                 * org.eclipse.swt.events.MouseTrackListener#mouseExit(org.eclipse
-                 * .swt.events.MouseEvent)
-                 */
-                public void mouseExit(MouseEvent e) {
-                    // no op
-                }
-
-                /*
-                 * (non-Javadoc)
-                 * 
-                 * @see
-                 * org.eclipse.swt.events.MouseTrackListener#mouseHover(org.
-                 * eclipse.swt.events.MouseEvent)
-                 */
-                public void mouseHover(MouseEvent e) {
-                    // no op
-                }
-            });
         } catch (VizException e) {
             statusHandler.handle(Priority.PROBLEM, "Error adding pane", e);
             if (pane != null) {
diff --git a/cave/com.raytheon.uf.viz.notification/.project b/cots/org.jboss.cache/.project
similarity index 92%
rename from cave/com.raytheon.uf.viz.notification/.project
rename to cots/org.jboss.cache/.project
index 60e746d60b..75314af2ea 100644
--- a/cave/com.raytheon.uf.viz.notification/.project
+++ b/cots/org.jboss.cache/.project
@@ -1,6 +1,6 @@
 
 
-	com.raytheon.uf.viz.notification
+	org.jboss.cache
 	
 	
 	
diff --git a/edexOsgi/com.raytheon.uf.common.geospatial/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.common.geospatial/META-INF/MANIFEST.MF
index 9f69db0e6f..2e24eba947 100644
--- a/edexOsgi/com.raytheon.uf.common.geospatial/META-INF/MANIFEST.MF
+++ b/edexOsgi/com.raytheon.uf.common.geospatial/META-INF/MANIFEST.MF
@@ -7,7 +7,7 @@ Bundle-Vendor: RAYTHEON
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Eclipse-BuddyPolicy: ext, registered, global
 Eclipse-RegisterBuddy: com.raytheon.viz.core
-Require-Bundle: org.geotools;bundle-version="2.5.2",
+Require-Bundle: org.geotools;bundle-version="2.5.2";visibility:=reexport,
  org.apache.commons.collections;bundle-version="3.2.0",
  org.apache.commons.lang;bundle-version="2.3.0",
  javax.measure;bundle-version="1.0.0",