();
+ IRoster roster = CollaborationConnection.getConnection()
+ .getRosterManager().getRoster();
+ for (Object item : roster.getItems()) {
+ if (item instanceof IRosterGroup) {
+ IRosterGroup group = (IRosterGroup) item;
+ } else if (item instanceof IRosterEntry) {
+ IRosterEntry entry = (IRosterEntry) item;
+ }
+ }
+ }
+
+ private void fillContextMenu(IMenuManager mgr) {
+ // TODO: Fill context menu based on selected tree items
+ }
+
+ /**
+ *
+ */
+ private void createFilterText(Composite parent) {
+ Composite comp = new Composite(parent, SWT.BORDER);
+ comp.setBackground(Display.getCurrent().getSystemColor(
+ SWT.COLOR_LIST_BACKGROUND));
+ GridLayout layout = new GridLayout(2, false);
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ comp.setLayout(layout);
+ GridData gd = new GridData(SWT.FILL, SWT.NONE, true, false);
+ comp.setLayoutData(gd);
+
+ filterText = new Text(comp, SWT.SINGLE | SWT.NONE);
+ GridData data = new GridData(SWT.FILL, SWT.NONE, true, false);
+ filterText.setLayoutData(data);
+ filterText.addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyReleased(KeyEvent e) {
+ filter();
+ }
+ });
+
+ // Load icons to be used for label button
+ final Image inactiveImage = AbstractUIPlugin.imageDescriptorFromPlugin(
+ PlatformUI.PLUGIN_ID, "$nl$/icons/full/dtool16/clear_co.gif")
+ .createImage();
+ final Image activeImage = AbstractUIPlugin.imageDescriptorFromPlugin(
+ PlatformUI.PLUGIN_ID, "$nl$/icons/full/etool16/clear_co.gif")
+ .createImage();
+
+ final Label clearButton = new Label(comp, SWT.NONE);
+ clearButton.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER,
+ false, false));
+ clearButton.setImage(inactiveImage);
+ clearButton.setBackground(parent.getDisplay().getSystemColor(
+ SWT.COLOR_LIST_BACKGROUND));
+ clearButton.setToolTipText("Clear text");
+ // Add listener for enter/exit changing icon
+ clearButton.addMouseTrackListener(new MouseTrackAdapter() {
+ public void mouseEnter(MouseEvent e) {
+ clearButton.setImage(activeImage);
+ }
+
+ public void mouseExit(MouseEvent e) {
+ clearButton.setImage(inactiveImage);
+ }
+ });
+ // Add mouse listener for clear pressed
+ clearButton.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseUp(MouseEvent e) {
+ filterText.setText("");
+ filter();
+ }
+ });
+ // Add dispose listener
+ clearButton.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ inactiveImage.dispose();
+ activeImage.dispose();
+ }
+ });
+ }
+
+ private void createMainMenu() {
+ // TODO: Populate the main menu
+ }
+
+ /**
+ * Get the {@link Tree} object that contains user information for the
+ * control
+ *
+ * @return
+ */
+ public Tree getUserTree() {
+ return usersTreeViewer.getTree();
+ }
+
+ /**
+ * Gets the contribution items for the group main menu
+ *
+ * @return
+ */
+ public IContributionItem[] getMainMenuItems() {
+ return mainMenu.getItems();
+ }
+
+ /**
+ * Filters the group view based on the text
+ *
+ * @param text
+ */
+ private void filter() {
+ String currText = filterText.getText();
+ // TODO: Filter the visible tree objects
+ }
+
+ @Subscribe
+ public void handleRosterChangeEvent(IRosterChangeEvent rosterChangeEvent) {
+ // TODO: Handle roster events
+ switch (rosterChangeEvent.getType()) {
+ case ADD:
+ break;
+ case MODIFY:
+ break;
+ case DELETE:
+ break;
+ case PRESENCE:
+ break;
+ }
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/CollaborationIconFactory.java b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/CollaborationIconFactory.java
new file mode 100644
index 0000000000..fb27f67295
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/CollaborationIconFactory.java
@@ -0,0 +1,55 @@
+/**
+ * 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.core.ui;
+
+import java.io.File;
+import java.net.URL;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.resource.ImageDescriptor;
+
+/**
+ * TODO Add Description
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 27, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public class CollaborationIconFactory {
+
+ public static ImageDescriptor getIconImage(String iconName) {
+ String path = "icons" + File.separator + iconName;
+ URL url = FileLocator.find(Activator.getDefault().getBundle(),
+ new Path(path), null);
+ return ImageDescriptor.createFromURL(url);
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/ICollaborationUIManager.java b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/ICollaborationUIManager.java
new file mode 100644
index 0000000000..4066c51462
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/ICollaborationUIManager.java
@@ -0,0 +1,47 @@
+/**
+ * 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.core.ui;
+
+import com.raytheon.uf.viz.collaboration.comm.provider.session.CollaborationConnection;
+
+/**
+ * TODO Add Description
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 26, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public interface ICollaborationUIManager {
+
+ public CollaborationConnection getConnection();
+
+ public void logout();
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/AbstractCollaborationAction.java b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/AbstractCollaborationAction.java
new file mode 100644
index 0000000000..4d4d31dd10
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/AbstractCollaborationAction.java
@@ -0,0 +1,63 @@
+/**
+ * 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.core.ui.action;
+
+import org.eclipse.jface.action.Action;
+
+import com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl;
+
+/**
+ * TODO Add Description
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 26, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public abstract class AbstractCollaborationAction extends Action {
+
+ protected CollaborationGroupControl control;
+
+ void setControl(CollaborationGroupControl control) {
+ this.control = control;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.action.Action#run()
+ */
+ @Override
+ public final void run() {
+ run(control);
+ }
+
+ public abstract void run(CollaborationGroupControl control);
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/AliasAction.java b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/AliasAction.java
new file mode 100644
index 0000000000..6cf069b021
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/AliasAction.java
@@ -0,0 +1,52 @@
+/**
+ * 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.core.ui.action;
+
+import com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl;
+
+/**
+ * TODO Add Description
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 26, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public class AliasAction extends AbstractCollaborationAction {
+
+ /* (non-Javadoc)
+ * @see com.raytheon.uf.viz.collaboration.core.ui.action.AbstractCollaborationAction#run(com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl)
+ */
+ @Override
+ public void run(CollaborationGroupControl control) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/ChangeFontAction.java b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/ChangeFontAction.java
new file mode 100644
index 0000000000..95dcf6172d
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/ChangeFontAction.java
@@ -0,0 +1,52 @@
+/**
+ * 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.core.ui.action;
+
+import com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl;
+
+/**
+ * TODO Add Description
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 26, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public class ChangeFontAction extends AbstractCollaborationAction {
+
+ /* (non-Javadoc)
+ * @see com.raytheon.uf.viz.collaboration.core.ui.action.AbstractCollaborationAction#run(com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl)
+ */
+ @Override
+ public void run(CollaborationGroupControl control) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/ChangePasswordAction.java b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/ChangePasswordAction.java
new file mode 100644
index 0000000000..224e1e524a
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/ChangePasswordAction.java
@@ -0,0 +1,52 @@
+/**
+ * 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.core.ui.action;
+
+import com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl;
+
+/**
+ * TODO Add Description
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 26, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public class ChangePasswordAction extends AbstractCollaborationAction {
+
+ /* (non-Javadoc)
+ * @see com.raytheon.uf.viz.collaboration.core.ui.action.AbstractCollaborationAction#run(com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl)
+ */
+ @Override
+ public void run(CollaborationGroupControl control) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/ChangeStatusMessageAction.java b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/ChangeStatusMessageAction.java
new file mode 100644
index 0000000000..aafd665442
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/ChangeStatusMessageAction.java
@@ -0,0 +1,52 @@
+/**
+ * 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.core.ui.action;
+
+import com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl;
+
+/**
+ * TODO Add Description
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 26, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public class ChangeStatusMessageAction extends AbstractCollaborationAction {
+
+ /* (non-Javadoc)
+ * @see com.raytheon.uf.viz.collaboration.core.ui.action.AbstractCollaborationAction#run(com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl)
+ */
+ @Override
+ public void run(CollaborationGroupControl control) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/ChooseRoleAction.java b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/ChooseRoleAction.java
new file mode 100644
index 0000000000..cabb0ba9d8
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/ChooseRoleAction.java
@@ -0,0 +1,52 @@
+/**
+ * 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.core.ui.action;
+
+import com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl;
+
+/**
+ * TODO Add Description
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 26, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public class ChooseRoleAction extends AbstractCollaborationAction {
+
+ /* (non-Javadoc)
+ * @see com.raytheon.uf.viz.collaboration.core.ui.action.AbstractCollaborationAction#run(com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl)
+ */
+ @Override
+ public void run(CollaborationGroupControl control) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/ChooseSiteAction.java b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/ChooseSiteAction.java
new file mode 100644
index 0000000000..0819c6b65d
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/ChooseSiteAction.java
@@ -0,0 +1,52 @@
+/**
+ * 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.core.ui.action;
+
+import com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl;
+
+/**
+ * TODO Add Description
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 26, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public class ChooseSiteAction extends AbstractCollaborationAction {
+
+ /* (non-Javadoc)
+ * @see com.raytheon.uf.viz.collaboration.core.ui.action.AbstractCollaborationAction#run(com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl)
+ */
+ @Override
+ public void run(CollaborationGroupControl control) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/ChooseStatusAction.java b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/ChooseStatusAction.java
new file mode 100644
index 0000000000..417606938a
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/ChooseStatusAction.java
@@ -0,0 +1,55 @@
+/**
+ * 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.core.ui.action;
+
+import com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl;
+
+/**
+ * TODO Add Description
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 26, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public class ChooseStatusAction extends AbstractCollaborationAction {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.raytheon.uf.viz.collaboration.core.ui.action.AbstractCollaborationAction
+ * #run(com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl)
+ */
+ @Override
+ public void run(CollaborationGroupControl control) {
+
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/CollaborationActionFactory.java b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/CollaborationActionFactory.java
new file mode 100644
index 0000000000..97002f81e1
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/CollaborationActionFactory.java
@@ -0,0 +1,163 @@
+/**
+ * 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.core.ui.action;
+
+import static com.raytheon.uf.viz.collaboration.core.ui.CollaborationIconFactory.getIconImage;
+
+import org.eclipse.jface.action.Action;
+
+import com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl;
+
+/**
+ * Factory for constructing core collaboration ui functionality actions
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 26, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public class CollaborationActionFactory {
+
+ public static Action createAliasAction(CollaborationGroupControl control) {
+ AbstractCollaborationAction action = new AliasAction();
+ action.setControl(control);
+ action.setText("Alias...");
+ // TODO: Find Alias image
+ action.setImageDescriptor(getIconImage("alias.gif"));
+ return action;
+ }
+
+ public static Action createChangeFontAction(
+ CollaborationGroupControl control) {
+ AbstractCollaborationAction action = new ChangeFontAction();
+ action.setControl(control);
+ action.setText("Change Font...");
+ action.setImageDescriptor(getIconImage("font.gif"));
+ return action;
+ }
+
+ public static Action createChangePasswordAction(
+ CollaborationGroupControl control) {
+ AbstractCollaborationAction action = new ChangePasswordAction();
+ action.setControl(control);
+ action.setText("Change Password...");
+ return action;
+ }
+
+ public static Action createChooseRoleAction(
+ CollaborationGroupControl control) {
+ AbstractCollaborationAction action = new ChooseRoleAction();
+ action.setControl(control);
+ action.setText("Change Role");
+ return action;
+ }
+
+ public static Action createChooseSiteAction(
+ CollaborationGroupControl control) {
+ AbstractCollaborationAction action = new ChooseSiteAction();
+ action.setControl(control);
+ action.setText("Change Site");
+ return action;
+ }
+
+ public static Action createChooseStatusAction(
+ CollaborationGroupControl control) {
+ AbstractCollaborationAction action = new ChooseStatusAction();
+ action.setControl(control);
+ action.setText("Change Status");
+ return action;
+ }
+
+ public static Action createCollapseAllAction(
+ CollaborationGroupControl control) {
+ AbstractCollaborationAction action = new CollapseAllAction();
+ action.setControl(control);
+ action.setText("Collapse All...");
+ action.setImageDescriptor(getIconImage("collapseall.gif"));
+ return action;
+ }
+
+ public static Action createCreateGroupAction(
+ CollaborationGroupControl control) {
+ AbstractCollaborationAction action = new CreateGroupAction();
+ action.setControl(control);
+ action.setText("Create Group...");
+ action.setImageDescriptor(getIconImage("group.gif"));
+ return action;
+ }
+
+ public static Action createCreateSessionAction(
+ CollaborationGroupControl control) {
+ AbstractCollaborationAction action = new CreateSessionAction();
+ action.setControl(control);
+ action.setText("Create Session...");
+ action.setImageDescriptor(getIconImage("add_collaborate.gif"));
+ return action;
+ }
+
+ public static Action createLoginAction(CollaborationGroupControl control) {
+ AbstractCollaborationAction action = new LogoutAction();
+ action.setControl(control);
+ action.setText("Login");
+ action.setImageDescriptor(getIconImage("login.gif"));
+ return action;
+ }
+
+ public static Action createLogoutAction(CollaborationGroupControl control) {
+ AbstractCollaborationAction action = new LogoutAction();
+ action.setControl(control);
+ action.setText("Logout");
+ action.setImageDescriptor(getIconImage("logout.gif"));
+ return action;
+ }
+
+ public static Action createP2PChatAction(CollaborationGroupControl control) {
+ AbstractCollaborationAction action = new P2PChatAction();
+ action.setControl(control);
+ action.setText("Chat...");
+ action.setImageDescriptor(getIconImage("chats.gif"));
+ return action;
+ }
+
+ public static Action createShowFeedAction(CollaborationGroupControl control) {
+ AbstractCollaborationAction action = new ShowFeedAction();
+ action.setControl(control);
+ action.setText("Display Feed...");
+ action.setImageDescriptor(getIconImage("feed.gif"));
+ return action;
+ }
+
+ public static Action createViewLogAction(CollaborationGroupControl control) {
+ AbstractCollaborationAction action = new ViewLogAction();
+ action.setControl(control);
+ action.setText("View Log...");
+ action.setImageDescriptor(getIconImage("log.gif"));
+ return action;
+ }
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/CollapseAllAction.java b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/CollapseAllAction.java
new file mode 100644
index 0000000000..5a3ee3bf75
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/CollapseAllAction.java
@@ -0,0 +1,52 @@
+/**
+ * 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.core.ui.action;
+
+import com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl;
+
+/**
+ * TODO Add Description
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 26, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public class CollapseAllAction extends AbstractCollaborationAction {
+
+ /* (non-Javadoc)
+ * @see com.raytheon.uf.viz.collaboration.core.ui.action.AbstractCollaborationAction#run(com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl)
+ */
+ @Override
+ public void run(CollaborationGroupControl control) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/CreateGroupAction.java b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/CreateGroupAction.java
new file mode 100644
index 0000000000..8c74a626ae
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/CreateGroupAction.java
@@ -0,0 +1,52 @@
+/**
+ * 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.core.ui.action;
+
+import com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl;
+
+/**
+ * TODO Add Description
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 26, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public class CreateGroupAction extends AbstractCollaborationAction {
+
+ /* (non-Javadoc)
+ * @see com.raytheon.uf.viz.collaboration.core.ui.action.AbstractCollaborationAction#run(com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl)
+ */
+ @Override
+ public void run(CollaborationGroupControl control) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/CreateSessionAction.java b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/CreateSessionAction.java
new file mode 100644
index 0000000000..d9bcb797c8
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/CreateSessionAction.java
@@ -0,0 +1,55 @@
+/**
+ * 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.core.ui.action;
+
+import com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl;
+
+/**
+ * TODO Add Description
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 26, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public class CreateSessionAction extends AbstractCollaborationAction {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.raytheon.uf.viz.collaboration.core.ui.action.AbstractCollaborationAction
+ * #run(com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl)
+ */
+ @Override
+ public void run(CollaborationGroupControl control) {
+ // TODO Create session
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/LoginAction.java b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/LoginAction.java
new file mode 100644
index 0000000000..9fd81c100e
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/LoginAction.java
@@ -0,0 +1,52 @@
+/**
+ * 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.core.ui.action;
+
+import com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl;
+
+/**
+ * TODO Add Description
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 26, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public class LoginAction extends AbstractCollaborationAction {
+
+ /* (non-Javadoc)
+ * @see com.raytheon.uf.viz.collaboration.core.ui.action.AbstractCollaborationAction#run(com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl)
+ */
+ @Override
+ public void run(CollaborationGroupControl control) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/LogoutAction.java b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/LogoutAction.java
new file mode 100644
index 0000000000..df1680ae2a
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/LogoutAction.java
@@ -0,0 +1,52 @@
+/**
+ * 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.core.ui.action;
+
+import com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl;
+
+/**
+ * TODO Add Description
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 26, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public class LogoutAction extends AbstractCollaborationAction {
+
+ /* (non-Javadoc)
+ * @see com.raytheon.uf.viz.collaboration.core.ui.action.AbstractCollaborationAction#run(com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl)
+ */
+ @Override
+ public void run(CollaborationGroupControl control) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/P2PChatAction.java b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/P2PChatAction.java
new file mode 100644
index 0000000000..71485560e7
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/P2PChatAction.java
@@ -0,0 +1,52 @@
+/**
+ * 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.core.ui.action;
+
+import com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl;
+
+/**
+ * TODO Add Description
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 26, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public class P2PChatAction extends AbstractCollaborationAction {
+
+ /* (non-Javadoc)
+ * @see com.raytheon.uf.viz.collaboration.core.ui.action.AbstractCollaborationAction#run(com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl)
+ */
+ @Override
+ public void run(CollaborationGroupControl control) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/ShowFeedAction.java b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/ShowFeedAction.java
new file mode 100644
index 0000000000..d1e80bc5dc
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/ShowFeedAction.java
@@ -0,0 +1,52 @@
+/**
+ * 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.core.ui.action;
+
+import com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl;
+
+/**
+ * TODO Add Description
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 26, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public class ShowFeedAction extends AbstractCollaborationAction {
+
+ /* (non-Javadoc)
+ * @see com.raytheon.uf.viz.collaboration.core.ui.action.AbstractCollaborationAction#run(com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl)
+ */
+ @Override
+ public void run(CollaborationGroupControl control) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/ViewLogAction.java b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/ViewLogAction.java
new file mode 100644
index 0000000000..e754eaf91f
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/action/ViewLogAction.java
@@ -0,0 +1,52 @@
+/**
+ * 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.core.ui.action;
+
+import com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl;
+
+/**
+ * TODO Add Description
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 26, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public class ViewLogAction extends AbstractCollaborationAction {
+
+ /* (non-Javadoc)
+ * @see com.raytheon.uf.viz.collaboration.core.ui.action.AbstractCollaborationAction#run(com.raytheon.uf.viz.collaboration.core.ui.CollaborationGroupControl)
+ */
+ @Override
+ public void run(CollaborationGroupControl control) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/data/ActiveSessionsTreeData.java b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/data/ActiveSessionsTreeData.java
new file mode 100644
index 0000000000..e20c522d8d
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/data/ActiveSessionsTreeData.java
@@ -0,0 +1,41 @@
+/**
+ * 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.core.ui.data;
+
+/**
+ * TODO Add Description
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 26, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public class ActiveSessionsTreeData {
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/data/MyUserTreeData.java b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/data/MyUserTreeData.java
new file mode 100644
index 0000000000..fc781860da
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/data/MyUserTreeData.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.core.ui.data;
+
+import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
+
+/**
+ * TODO Add Description
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 26, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public class MyUserTreeData {
+
+ private UserId user;
+
+ public MyUserTreeData(UserId user) {
+ this.user = user;
+ }
+
+ /**
+ * @return the user
+ */
+ public UserId getUser() {
+ return user;
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/data/UserGroupTreeData.java b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/data/UserGroupTreeData.java
new file mode 100644
index 0000000000..f58665d83d
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/data/UserGroupTreeData.java
@@ -0,0 +1,83 @@
+/**
+ * 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.core.ui.data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.ecf.presence.roster.IRosterEntry;
+import org.eclipse.ecf.presence.roster.IRosterGroup;
+
+import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
+
+/**
+ * TODO Add Description
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 26, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public class UserGroupTreeData {
+
+ private String groupName;
+
+ private IRosterGroup group;
+
+ private List groupUsers;
+
+ public UserGroupTreeData(String groupName, IRosterGroup group) {
+ this.groupName = groupName;
+ this.group = group;
+ this.groupUsers = new ArrayList();
+ }
+
+ /**
+ * @return the groupName
+ */
+ public String getGroupName() {
+ return groupName;
+ }
+
+ /**
+ * @return the groupUsers
+ */
+ public List getGroupUsers() {
+ return new ArrayList(groupUsers);
+ }
+
+ /**
+ * Adds a user to this group
+ *
+ * @param user
+ */
+ public void addUserToGroup(UserId user, IRosterEntry entry) {
+ groupUsers.add(new UserTreeData(user, entry));
+ }
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/data/UserTreeData.java b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/data/UserTreeData.java
new file mode 100644
index 0000000000..0fe6606411
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/data/UserTreeData.java
@@ -0,0 +1,61 @@
+/**
+ * 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.core.ui.data;
+
+import org.eclipse.ecf.presence.roster.IRosterEntry;
+
+import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
+
+/**
+ * TODO Add Description
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 26, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public class UserTreeData {
+
+ private UserId user;
+
+ private IRosterEntry userEntry;
+
+ public UserTreeData(UserId user, IRosterEntry userEntry) {
+ this.user = user;
+ this.userEntry = userEntry;
+ }
+
+ /**
+ * @return the user
+ */
+ public UserId getUser() {
+ return user;
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/tree/UsersTreeContentProvider.java b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/tree/UsersTreeContentProvider.java
new file mode 100644
index 0000000000..f7aaf71e6a
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/tree/UsersTreeContentProvider.java
@@ -0,0 +1,114 @@
+/**
+ * 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.core.ui.tree;
+
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+/**
+ * TODO Add Description
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 27, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public class UsersTreeContentProvider implements ITreeContentProvider {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+ */
+ @Override
+ public void dispose() {
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface
+ * .viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.viewers.ITreeContentProvider#getElements(java.lang.
+ * Object)
+ */
+ @Override
+ public Object[] getElements(Object inputElement) {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.
+ * Object)
+ */
+ @Override
+ public Object[] getChildren(Object parentElement) {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object
+ * )
+ */
+ @Override
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.
+ * Object)
+ */
+ @Override
+ public boolean hasChildren(Object element) {
+ return false;
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/tree/UsersTreeLabelProvider.java b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/tree/UsersTreeLabelProvider.java
new file mode 100644
index 0000000000..2f66a248b4
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.core.ui/src/com/raytheon/uf/viz/collaboration/core/ui/tree/UsersTreeLabelProvider.java
@@ -0,0 +1,110 @@
+/**
+ * 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.core.ui.tree;
+
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.swt.graphics.Image;
+
+import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfigInformation;
+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.core.ui.data.ActiveSessionsTreeData;
+import com.raytheon.uf.viz.collaboration.core.ui.data.MyUserTreeData;
+import com.raytheon.uf.viz.collaboration.core.ui.data.UserGroupTreeData;
+import com.raytheon.uf.viz.collaboration.core.ui.data.UserTreeData;
+
+/**
+ * TODO Add Description
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 27, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public class UsersTreeLabelProvider extends ColumnLabelProvider {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.viewers.ColumnLabelProvider#getImage(java.lang.Object)
+ */
+ @Override
+ public Image getImage(Object element) {
+ Image image = null;
+ if (element instanceof UserTreeData) {
+
+ } else if (element instanceof MyUserTreeData) {
+
+ } else if (element instanceof UserGroupTreeData) {
+
+ } else if (element instanceof ActiveSessionsTreeData) {
+
+ }
+ return image;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.viewers.ColumnLabelProvider#getText(java.lang.Object)
+ */
+ @Override
+ public String getText(Object element) {
+ String text = null;
+ if (element instanceof UserTreeData) {
+ text = formatUserId(((UserTreeData) element).getUser());
+ } else if (element instanceof MyUserTreeData) {
+ text = formatUserId(((UserTreeData) element).getUser())
+ + " - "
+ + CollaborationConnection.getConnection()
+ .getConnectionData().getServer();
+ } else if (element instanceof UserGroupTreeData) {
+ text = ((UserGroupTreeData) element).getGroupName();
+ } else if (element instanceof ActiveSessionsTreeData) {
+ text = "Active Sessions";
+ }
+ return text;
+ }
+
+ public static String formatUserId(UserId user) {
+ Object site = user.getProperties().get(SiteConfigInformation.SITE_NAME);
+ Object role = user.getProperties().get(SiteConfigInformation.ROLE_NAME);
+ String name = (user.getAlias() != null ? user.getAlias() : user
+ .getName());
+ if (site != null) {
+ name += " - " + site;
+ }
+ if (role != null) {
+ name += " - " + role;
+ }
+ return name;
+ }
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/.classpath b/cave/com.raytheon.uf.viz.collaboration.display/.classpath
new file mode 100644
index 0000000000..ad32c83a78
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/.classpath
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/.project b/cave/com.raytheon.uf.viz.collaboration.display/.project
new file mode 100644
index 0000000000..20968cc23f
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/.project
@@ -0,0 +1,28 @@
+
+
+ com.raytheon.uf.viz.collaboration.display
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.pde.ManifestBuilder
+
+
+
+
+ org.eclipse.pde.SchemaBuilder
+
+
+
+
+
+ org.eclipse.pde.PluginNature
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/.settings/org.eclipse.jdt.core.prefs b/cave/com.raytheon.uf.viz.collaboration.display/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..c94506db44
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Fri Apr 27 11:08:58 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.collaboration.display/META-INF/MANIFEST.MF b/cave/com.raytheon.uf.viz.collaboration.display/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..0c69688b99
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/META-INF/MANIFEST.MF
@@ -0,0 +1,35 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Display
+Bundle-SymbolicName: com.raytheon.uf.viz.collaboration.display;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: com.raytheon.uf.viz.collaboration.display.Activator
+Bundle-Vendor: RAYTHEON
+Eclipse-RegisterBuddy: com.raytheon.uf.viz.core
+Require-Bundle: org.eclipse.core.runtime,
+ com.raytheon.uf.viz.core,
+ com.raytheon.viz.ui,
+ org.eclipse.ui;bundle-version="3.6.1",
+ 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,
+ 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.event,
+ 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
new file mode 100644
index 0000000000..90d61b4ecf
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject
@@ -0,0 +1,7 @@
+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.event.SharedResource
+com.raytheon.uf.viz.collaboration.display.rsc.event.ResourceCapabilityChanged
+com.raytheon.uf.viz.collaboration.display.rsc.event.ResourcePropertiesChanged
+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/build.properties b/cave/com.raytheon.uf.viz.collaboration.display/build.properties
new file mode 100644
index 0000000000..e9863e281e
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/plugin.xml b/cave/com.raytheon.uf.viz.collaboration.display/plugin.xml
new file mode 100644
index 0000000000..b77d894ab6
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/plugin.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/schema/renderingExtension.exsd b/cave/com.raytheon.uf.viz.collaboration.display/schema/renderingExtension.exsd
new file mode 100644
index 0000000000..f4b4fa245a
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/schema/renderingExtension.exsd
@@ -0,0 +1,102 @@
+
+
+
+
+
+
+
+
+ Defines rendering handler objects that use @Subscribe tags to handle render events
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [Enter the first release in which this extension point appears.]
+
+
+
+
+
+
+
+
+ [Enter extension point usage example here.]
+
+
+
+
+
+
+
+
+ [Enter API information here.]
+
+
+
+
+
+
+
+
+ [Enter information about supplied implementation of this extension point.]
+
+
+
+
+
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
new file mode 100644
index 0000000000..18bcb0917d
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/Activator.java
@@ -0,0 +1,49 @@
+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;
+import com.raytheon.uf.viz.core.jobs.StatsJob;
+
+public class Activator implements BundleActivator {
+
+ public static final IUFStatusHandler statusHandler = UFStatus
+ .getHandler(Activator.class);
+
+ private static BundleContext context;
+
+ private StatsJob statsJob = new StatsJob(
+ "Collaboration Network Statistics",
+ com.raytheon.uf.viz.collaboration.comm.Activator.getDefault()
+ .getNetworkStats());
+
+ static BundleContext getContext() {
+ return context;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext
+ * )
+ */
+ public void start(BundleContext bundleContext) throws Exception {
+ Activator.context = bundleContext;
+ statsJob.schedule();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext bundleContext) throws Exception {
+ Activator.context = null;
+ statsJob.shutdown();
+ }
+
+}
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..9accc6236a
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/IRemoteDisplayContainer.java
@@ -0,0 +1,95 @@
+/**
+ * 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 org.eclipse.ui.IEditorPart;
+
+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();
+
+ public IEditorPart getActiveDisplayEditor();
+
+ public void disposeContainer();
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/data/ColorChangeEvent.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/data/ColorChangeEvent.java
new file mode 100644
index 0000000000..f3809f7681
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/data/ColorChangeEvent.java
@@ -0,0 +1,153 @@
+/**
+ * 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.data;
+
+import org.eclipse.swt.graphics.RGB;
+
+import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
+import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
+import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
+
+/**
+ * Event for when a new user enters and a color is added
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 11, 2012 mnash Initial creation
+ *
+ *
+ *
+ * @author mnash
+ * @version 1.0
+ */
+
+@DynamicSerialize
+public class ColorChangeEvent {
+ @DynamicSerializeElement
+ private UserId userName;
+
+ @DynamicSerializeElement
+ private Integer red;
+
+ @DynamicSerializeElement
+ private Integer green;
+
+ @DynamicSerializeElement
+ private Integer blue;
+
+ public ColorChangeEvent() {
+ }
+
+ public ColorChangeEvent(UserId user, RGB color) {
+ this.userName = user;
+ if (color != null) {
+ red = color.red;
+ green = color.green;
+ blue = color.blue;
+ }
+ }
+
+ /**
+ * @param userName
+ * the userName to set
+ */
+ public void setUserName(UserId userName) {
+ this.userName = userName;
+ }
+
+ /**
+ * @return the userName
+ */
+ public UserId getUserName() {
+ return userName;
+ }
+
+ /**
+ * @param color
+ * the color to set
+ */
+ public void setColor(RGB color) {
+ if (color != null) {
+ red = color.red;
+ green = color.green;
+ blue = color.blue;
+ }
+ }
+
+ /**
+ * @return the color
+ */
+ public RGB getColor() {
+ RGB color = null;
+ if (red != null && green != null && blue != null) {
+ color = new RGB(red, green, blue);
+ }
+ return color;
+ }
+
+ /**
+ * @return the red
+ */
+ public Integer getRed() {
+ return red;
+ }
+
+ /**
+ * @param red
+ * the red to set
+ */
+ public void setRed(Integer red) {
+ this.red = red;
+ }
+
+ /**
+ * @return the green
+ */
+ public Integer getGreen() {
+ return green;
+ }
+
+ /**
+ * @param green
+ * the green to set
+ */
+ public void setGreen(Integer green) {
+ this.green = green;
+ }
+
+ /**
+ * @return the blue
+ */
+ public Integer getBlue() {
+ return blue;
+ }
+
+ /**
+ * @param blue
+ * the blue to set
+ */
+ public void setBlue(Integer blue) {
+ this.blue = blue;
+ }
+}
\ No newline at end of file
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/data/SessionColorManager.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/data/SessionColorManager.java
new file mode 100644
index 0000000000..7b7ec4b08c
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/data/SessionColorManager.java
@@ -0,0 +1,102 @@
+/**
+ * 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.data;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.swt.graphics.RGB;
+
+import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
+import com.raytheon.viz.core.ColorUtil;
+
+/**
+ *
+ * Manages colors of different users for a session
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 3, 2012 mnash Initial creation
+ *
+ *
+ *
+ * @author mnash
+ * @version 1.0
+ */
+
+public class SessionColorManager {
+
+ private Map colors;
+
+ private static RGB[] rgbPresets = null;
+
+ /**
+ *
+ */
+ public SessionColorManager() {
+ if (colors == null) {
+ colors = new HashMap();
+ rgbPresets = ColorUtil.getResourceColorPresets();
+ }
+ }
+
+ /**
+ * @return the colors
+ */
+ public Map getColors() {
+ return colors;
+ }
+
+ public void setColors(Map map) {
+ colors = map;
+ }
+
+ public RGB getColorFromUser(UserId user) {
+ if (colors.get(user) == null) {
+ addUser(user);
+ }
+ return colors.get(user);
+ }
+
+ public void setColorForUser(UserId id, RGB rgb) {
+ colors.put(id, rgb);
+ }
+
+ /**
+ * Add a user with a new color value
+ *
+ * @param user
+ */
+ public void addUser(UserId user) {
+ int count = colors.size();
+ if (rgbPresets.length <= count) {
+ count = count % rgbPresets.length;
+ }
+ colors.put(user, rgbPresets[count]);
+ }
+
+ public void clearColors() {
+ colors.clear();
+ }
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/data/SessionContainer.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/data/SessionContainer.java
new file mode 100644
index 0000000000..479d16b7ba
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/data/SessionContainer.java
@@ -0,0 +1,115 @@
+/**
+ * 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.data;
+
+import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession;
+import com.raytheon.uf.viz.collaboration.display.IRemoteDisplayContainer;
+import com.raytheon.uf.viz.collaboration.display.roles.IRoleEventController;
+
+/**
+ * A container holding an underlying session and associated data for a shared
+ * display session.
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 16, 2012 njensen Initial creation
+ *
+ *
+ *
+ * @author njensen
+ * @version 1.0
+ */
+
+public class SessionContainer {
+
+ /** the session id **/
+ private String sessionId;
+
+ /** the underlying session object **/
+ private ISharedDisplaySession session;
+
+ /** subscribes to events related to the session based on role **/
+ private IRoleEventController roleEventController;
+
+ private SessionColorManager colorManager;
+
+ private IRemoteDisplayContainer displayContainer;
+
+ public ISharedDisplaySession getSession() {
+ return session;
+ }
+
+ public void setSession(ISharedDisplaySession session) {
+ this.session = session;
+ }
+
+ public IRoleEventController getRoleEventController() {
+ return roleEventController;
+ }
+
+ public void setRoleEventController(IRoleEventController roleEventController) {
+ this.roleEventController = roleEventController;
+ }
+
+ /**
+ * @return the displayContainer
+ */
+ public IRemoteDisplayContainer getDisplayContainer() {
+ return displayContainer;
+ }
+
+ /**
+ * @param displayContainer
+ * the displayContainer to set
+ */
+ public void setDisplayContainer(IRemoteDisplayContainer displayContainer) {
+ this.displayContainer = displayContainer;
+ }
+
+ public String getSessionId() {
+ return sessionId;
+ }
+
+ public void setSessionId(String sessionId) {
+ this.sessionId = sessionId;
+ }
+
+ /**
+ * @return the colorManager
+ */
+ public SessionColorManager getColorManager() {
+ if (colorManager == null) {
+ colorManager = new SessionColorManager();
+ }
+ return colorManager;
+ }
+
+ /**
+ * @param colorManager
+ * the colorManager to set
+ */
+ public void setColorManager(SessionColorManager colorManager) {
+ this.colorManager = colorManager;
+ }
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/data/SharedDisplaySessionMgr.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/data/SharedDisplaySessionMgr.java
new file mode 100644
index 0000000000..1f5ea8d8f2
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/data/SharedDisplaySessionMgr.java
@@ -0,0 +1,107 @@
+/**
+ * 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.data;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+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.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
+ * SessionContainers that contain the data related to those sessions.
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 16, 2012 njensen Initial creation
+ *
+ *
+ *
+ * @author njensen
+ * @version 1.0
+ */
+
+public class SharedDisplaySessionMgr {
+
+ private static Map sharedDisplaySessionMap = new HashMap();
+
+ public static SessionContainer getSessionContainer(String sessionId) {
+ return sharedDisplaySessionMap.get(sessionId);
+ }
+
+ public static Set getActiveSessionIds() {
+ return sharedDisplaySessionMap.keySet();
+ }
+
+ public static void joinSession(ISharedDisplaySession session,
+ SharedDisplayRole initialRole, SessionColorManager colors)
+ throws CollaborationException {
+ SessionContainer container = new SessionContainer();
+ container.setSessionId(session.getSessionId());
+ container.setSession(session);
+
+ IRoleEventController rec = null;
+ switch (initialRole) {
+ case DATA_PROVIDER:
+ rec = new DataProviderEventController(session);
+ break;
+ case PARTICIPANT:
+ rec = new ParticipantEventController(session);
+ break;
+ default:
+ throw new IllegalArgumentException(
+ "ParticipantRole must be DataProvider or Participant for initialization");
+ }
+ container.setRoleEventController(rec);
+ if (colors != null) {
+ container.setColorManager(colors);
+ }
+ sharedDisplaySessionMap.put(session.getSessionId(), container);
+
+ rec.startup();
+ }
+
+ /**
+ * Removes a session from the manager.
+ *
+ * @param sessionId
+ */
+ public static void exitSession(String sessionId) {
+ SessionContainer container = sharedDisplaySessionMap.get(sessionId);
+ if (container != null) {
+ container.getRoleEventController().shutdown();
+
+ // remove after shutting down event controller
+ sharedDisplaySessionMap.remove(sessionId);
+ }
+ }
+}
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/CollaborationEditorInput.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/CollaborationEditorInput.java
new file mode 100644
index 0000000000..1ff5bc246f
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/CollaborationEditorInput.java
@@ -0,0 +1,121 @@
+/**
+ * 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.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+
+/**
+ * Editor input for CollaborationEditor
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 7, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public class CollaborationEditorInput implements IEditorInput {
+
+ private String title;
+
+ private String sessionId;
+
+ public CollaborationEditorInput(String sessionId, String title) {
+ this.sessionId = sessionId;
+ this.title = title;
+ }
+
+ /**
+ * @return the sessionId
+ */
+ public String getSessionId() {
+ return sessionId;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+ */
+ @Override
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IEditorInput#exists()
+ */
+ @Override
+ public boolean exists() {
+ return true;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
+ */
+ @Override
+ public ImageDescriptor getImageDescriptor() {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IEditorInput#getName()
+ */
+ @Override
+ public String getName() {
+ return title;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IEditorInput#getPersistable()
+ */
+ @Override
+ public IPersistableElement getPersistable() {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IEditorInput#getToolTipText()
+ */
+ @Override
+ public String getToolTipText() {
+ return getName();
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/CreateRemoteDisplay.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/CreateRemoteDisplay.java
new file mode 100644
index 0000000000..5e664237f3
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/CreateRemoteDisplay.java
@@ -0,0 +1,90 @@
+/**
+ * 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 javax.xml.bind.annotation.XmlAccessType;
+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 com.raytheon.uf.common.serialization.ISerializableObject;
+import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay;
+
+/**
+ * A SharedEditorData is a POJO to be sent out by the Data Provider that
+ * contains enough information to create the CollaborationEditor for the
+ * participants.
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 16, 2012 njensen Initial creation
+ *
+ *
+ *
+ * @author njensen
+ * @version 1.0
+ */
+
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlRootElement
+public class CreateRemoteDisplay implements ISerializableObject {
+
+ @XmlAttribute
+ private int displayId;
+
+ @XmlElement
+ private AbstractRenderableDisplay display;
+
+ /**
+ * @return the displayId
+ */
+ public int getDisplayId() {
+ return displayId;
+ }
+
+ /**
+ * @param displayId
+ * the displayId to set
+ */
+ public void setDisplayId(int displayId) {
+ this.displayId = displayId;
+ }
+
+ /**
+ * @return the display
+ */
+ public AbstractRenderableDisplay getDisplay() {
+ return display;
+ }
+
+ /**
+ * @param display
+ * the display to set
+ */
+ public void setDisplay(AbstractRenderableDisplay display) {
+ this.display = display;
+ }
+
+}
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/ReprojectRemoteDisplay.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/ReprojectRemoteDisplay.java
new file mode 100644
index 0000000000..5e16bc85d5
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/editor/ReprojectRemoteDisplay.java
@@ -0,0 +1,82 @@
+/**
+ * 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.geotools.coverage.grid.GeneralGridGeometry;
+
+import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
+import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
+
+/**
+ * Collaboration event to reproject the viewing editor
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 18, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+@DynamicSerialize
+public class ReprojectRemoteDisplay {
+
+ @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
+ */
+ public GeneralGridGeometry getTargetGeometry() {
+ return targetGeometry;
+ }
+
+ /**
+ * @param targetGeometry
+ * the targetGeometry to set
+ */
+ public void setTargetGeometry(GeneralGridGeometry targetGeometry) {
+ this.targetGeometry = targetGeometry;
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/AbstractRoleEventController.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/AbstractRoleEventController.java
new file mode 100644
index 0000000000..bc63d528f8
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/AbstractRoleEventController.java
@@ -0,0 +1,73 @@
+/**
+ * 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 com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession;
+import com.raytheon.uf.viz.collaboration.display.IRemoteDisplayContainer;
+import com.raytheon.uf.viz.collaboration.display.data.SessionContainer;
+import com.raytheon.uf.viz.collaboration.display.data.SharedDisplaySessionMgr;
+
+/**
+ * Abstract role event controller that shares fields and methods that are common
+ * to other event controllers.
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 26, 2012 njensen Initial creation
+ *
+ *
+ *
+ * @author njensen
+ * @version 1.0
+ */
+
+public abstract class AbstractRoleEventController
+ implements IRoleEventController {
+
+ protected ISharedDisplaySession session;
+
+ protected T container;
+
+ protected AbstractRoleEventController(ISharedDisplaySession session) {
+ this.session = session;
+ }
+
+ @Override
+ public void startup() {
+ session.registerEventHandler(this);
+ SessionContainer sc = SharedDisplaySessionMgr
+ .getSessionContainer(session.getSessionId());
+ container = createDisplayContainer();
+ sc.setDisplayContainer(container);
+ }
+
+ @Override
+ public void shutdown() {
+ session.unregisterEventHandler(this);
+ container.disposeContainer();
+ }
+
+ protected abstract T createDisplayContainer();
+
+}
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..039560dc94
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/DataProviderEventController.java
@@ -0,0 +1,142 @@
+/**
+ * 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.comm.identity.invite.ColorPopulator;
+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 {
+ AbstractEditor active = container.getActiveSharedEditor();
+ if (active != null) {
+ IDisplayPane activePane = active.getActiveDisplayPane();
+ if (activePane != null) {
+ ActivateRemoteDisplay arde = new ActivateRemoteDisplay();
+ arde.setDisplayId(container.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.sendObjectToPeer(event.getParticipant(),
+ new ColorPopulator(scm.getColors()));
+ 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 {
+ container.shareEditor(active);
+ } catch (CollaborationException e) {
+ statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
+ e);
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.raytheon.uf.viz.collaboration.display.roles.AbstractRoleEventController
+ * #createDisplayContainer()
+ */
+ @Override
+ protected SharedEditorsManager createDisplayContainer() {
+ return SharedEditorsManager.getManager(session);
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/IRoleEventController.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/IRoleEventController.java
new file mode 100644
index 0000000000..51acfea11a
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/IRoleEventController.java
@@ -0,0 +1,46 @@
+/**
+ * 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;
+
+/**
+ * Interface for an event controller. Starting up an IRoleEventController is
+ * akin to subscribing to events specific to that specific role.
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 26, 2012 njensen Initial creation
+ *
+ *
+ *
+ * @author njensen
+ * @version 1.0
+ */
+
+public interface IRoleEventController {
+
+ public void startup();
+
+ public void shutdown();
+
+}
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..849bf891d9
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/ParticipantEventController.java
@@ -0,0 +1,73 @@
+/**
+ * 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.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.display.roles.AbstractRoleEventController
+ * #createDisplayContainer()
+ */
+ @Override
+ protected ICollaborationEditor createDisplayContainer() {
+ CollaborationEditorInput input = new CollaborationEditorInput(
+ session.getSessionId(), session.getVenue().getInfo()
+ .getVenueDescription());
+ try {
+ return (ICollaborationEditor) VizWorkbenchManager.getInstance()
+ .getCurrentWindow().getActivePage()
+ .openEditor(input, ICollaborationEditor.EDITOR_ID);
+ } catch (PartInitException e) {
+ throw new RuntimeException("Error opening collaboration editor", e);
+ }
+ }
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/CollaborationDispatcher.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/CollaborationDispatcher.java
new file mode 100644
index 0000000000..f568b70a2e
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/CollaborationDispatcher.java
@@ -0,0 +1,333 @@
+/**
+ * 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.ArrayDeque;
+import java.util.Arrays;
+import java.util.Deque;
+
+import org.eclipse.swt.widgets.Event;
+
+import com.google.common.eventbus.Subscribe;
+import com.raytheon.uf.common.serialization.SerializationUtil;
+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.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.event.ParticipantInitializedEvent;
+import com.raytheon.uf.viz.collaboration.display.storage.CollaborationObjectEventStorage;
+import com.raytheon.uf.viz.collaboration.display.storage.IObjectEventPersistance;
+import com.raytheon.uf.viz.collaboration.display.storage.IPersistedEvent;
+import com.raytheon.uf.viz.core.IDisplayPane;
+import com.raytheon.uf.viz.core.IDisplayPaneContainer;
+import com.raytheon.uf.viz.core.drawables.IRenderableDisplay;
+import com.raytheon.uf.viz.core.jobs.JobPool;
+import com.raytheon.uf.viz.core.rsc.IInputHandler;
+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.AbstractRemoteGraphicsEvent;
+import com.raytheon.uf.viz.remote.graphics.events.ICreationEvent;
+import com.raytheon.uf.viz.remote.graphics.events.rendering.BeginFrameEvent;
+import com.raytheon.uf.viz.remote.graphics.events.rendering.EndFrameEvent;
+import com.raytheon.uf.viz.remote.graphics.events.rendering.IRenderEvent;
+import com.raytheon.viz.ui.input.InputAdapter;
+
+/**
+ * Dispatches graphics objects to participants in the collaboration session
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 19, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public class CollaborationDispatcher extends Dispatcher {
+
+ private static JobPool persistPool = new JobPool("Persister", 1, true);
+
+ private static final int IMMEDIATE_SEND_SIZE = 1024;
+
+ private static final int MAX_PREV_FRAMES = 10;
+
+ private ISharedDisplaySession session;
+
+ private IObjectEventPersistance persistance;
+
+ private Deque previousFrames = new ArrayDeque();
+
+ private RenderFrame currentFrame;
+
+ private IInputHandler mouseCapturer = new InputAdapter() {
+
+ private double[] mouseLocation;
+
+ @Override
+ public boolean handleMouseMove(int x, int y) {
+ IDisplayPaneContainer container = display.getContainer();
+ for (IDisplayPane pane : container.getDisplayPanes()) {
+ if (pane.getRenderableDisplay() == display) {
+ update(display.screenToGrid(x, y, 1.0, pane.getTarget()));
+ break;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean handleMouseExit(Event event) {
+ update(null);
+ return false;
+ }
+
+ @Override
+ public boolean handleMouseEnter(Event event) {
+ handleMouseMove(event.x, event.y);
+ return false;
+ }
+
+ private void update(double[] mouseLocation) {
+ if (!Arrays.equals(mouseLocation, this.mouseLocation)) {
+ this.mouseLocation = mouseLocation;
+ MouseLocationEvent event = new MouseLocationEvent();
+ event.setDisplayId(getDispatcherId());
+ event.setMouseLocation(mouseLocation);
+ send(event);
+ }
+ }
+ };
+
+ private IRenderableDisplay display;
+
+ private IRenderableDisplay activeDisplay;
+
+ private boolean disposed = false;
+
+ public CollaborationDispatcher(ISharedDisplaySession session,
+ IRenderableDisplay display) throws CollaborationException {
+ this.session = session;
+ this.display = display;
+ this.persistance = CollaborationObjectEventStorage
+ .createPersistanceObject(session, this);
+ session.registerEventHandler(this);
+ // TODO:
+ // Not sure if we should show mouse location or not due to
+ // bandwidth, messages are very small but frequent
+ // display.getContainer().registerMouseHandler(mouseCapturer);
+ }
+
+ /**
+ * Update the active display to render for
+ *
+ * @param display
+ */
+ public void setActiveDisplay(IRenderableDisplay active) {
+ if (display != active) {
+ disposeFrames();
+ }
+ this.activeDisplay = active;
+ display.refresh();
+ }
+
+ @Subscribe
+ public void handleNeedsRenderFrameEvent(RenderFrameNeededEvent event) {
+ synchronized (previousFrames) {
+ RenderFrame needed = null;
+ for (RenderFrame prevFrame : previousFrames) {
+ if (prevFrame.getObjectId() == event.getObjectId()) {
+ needed = prevFrame;
+ }
+ }
+ if (needed != null) {
+ // Remove and dispose to reset frame
+ previousFrames.remove(needed);
+ needed.dispose();
+ display.refresh();
+ }
+ }
+ }
+
+ @Subscribe
+ public void handleParticipantInitialized(ParticipantInitializedEvent event) {
+ // Force repaint when participant initializes
+ display.refresh();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.raytheon.uf.viz.remote.graphics.Dispatcher#dispatch(com.raytheon.
+ * uf.viz.remote.graphics.AbstractRemoteGraphicsEvent)
+ */
+ @Override
+ public void dispatch(AbstractRemoteGraphicsEvent eventObject) {
+ if (eventObject instanceof IRenderFrameEvent) {
+ if (activeDisplay == display) {
+ // Only dispatch render frame events IF we are active
+ send(eventObject);
+ }
+ return;
+ }
+ // Set PERSISTENCE to true if testing persisting capabilities
+ if (eventObject instanceof AbstractDispatchingObjectEvent
+ && eventObject instanceof IRenderEvent == false) {
+ boolean immediateSend = true;
+ if (eventObject instanceof ICreationEvent == false) {
+ // Not a creation event, check event size. All creation events
+ // are sent immediately to avoid false negatives
+ try {
+ byte[] data = CompressionUtil.compress(SerializationUtil
+ .transformToThrift(eventObject));
+ if (data.length > IMMEDIATE_SEND_SIZE) {
+ immediateSend = false;
+ }
+ } catch (Exception e) {
+ Activator.statusHandler.handle(Priority.PROBLEM,
+ "Error determing size of eventObject: "
+ + eventObject, e);
+ }
+ }
+ final AbstractDispatchingObjectEvent toPersist = (AbstractDispatchingObjectEvent) eventObject;
+ final boolean[] sendPersisted = new boolean[] { !immediateSend };
+ persistPool.schedule(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ synchronized (persistance) {
+ if (!disposed) {
+ IPersistedEvent event = persistance
+ .persistEvent(toPersist);
+ // If was no immediateSend, send now
+ if (sendPersisted[0]) {
+ send(event);
+ }
+ }
+ }
+ } catch (CollaborationException e) {
+ Activator.statusHandler.handle(Priority.PROBLEM,
+ e.getLocalizedMessage(), e);
+ }
+ }
+ });
+ // Need to immediately send eventObject
+ if (immediateSend) {
+ send(eventObject);
+ }
+ } else if (eventObject instanceof IRenderEvent) {
+ if (eventObject instanceof BeginFrameEvent && currentFrame == null) {
+ currentFrame = new RenderFrame(this);
+ }
+
+ currentFrame.addEvent((IRenderEvent) eventObject);
+ if (eventObject instanceof EndFrameEvent) {
+ synchronized (previousFrames) {
+ // End frame, do some smart rendering
+ RenderFrame mergeWith = null;
+ for (RenderFrame prevFrame : previousFrames) {
+ // Try and find a previous frame with same number of
+ // frames
+ if (prevFrame.size() == currentFrame.size()) {
+ mergeWith = prevFrame;
+ break;
+ }
+ }
+
+ boolean merged = false;
+ if (mergeWith != null) {
+ // Move merge frame to front of queue
+ previousFrames.remove(mergeWith);
+ previousFrames.addFirst(mergeWith);
+
+ if (mergeWith.merge(currentFrame)) {
+ // Mark successfull merge
+ merged = true;
+ // Reset current frame
+ currentFrame.clear();
+ }
+ }
+
+ if (!merged) {
+ // Send full frame if no merge happened
+ if (mergeWith != null) {
+ // Notify we tried to merge but failed
+ Activator.statusHandler.handle(Priority.PROBLEM,
+ "Attempted merge did not succeed");
+ }
+
+ // Send current frame
+ currentFrame.sendFrame();
+ if (previousFrames.size() == MAX_PREV_FRAMES) {
+ // Too many frames, remove and dispose last
+ previousFrames.removeLast().dispose();
+ }
+ previousFrames.addFirst(currentFrame);
+ currentFrame = new RenderFrame(this);
+ }
+ }
+ }
+ } else {
+ Activator.statusHandler.handle(Priority.PROBLEM,
+ "Unable to handle event type: " + eventObject);
+ }
+ }
+
+ private void send(Object obj) {
+ try {
+ session.sendObjectToVenue(obj);
+ } catch (CollaborationException e) {
+ Activator.statusHandler.handle(Priority.PROBLEM,
+ e.getLocalizedMessage(), e);
+ }
+ }
+
+ public void dispose() {
+ disposed = true;
+ try {
+ synchronized (persistance) {
+ persistance.dispose();
+ }
+ } catch (CollaborationException e) {
+ Activator.statusHandler.handle(Priority.PROBLEM,
+ e.getLocalizedMessage(), e);
+ }
+ disposeFrames();
+ session.unregisterEventHandler(this);
+ }
+
+ private void disposeFrames() {
+ for (RenderFrame frame : previousFrames) {
+ frame.dispose();
+ }
+ previousFrames.clear();
+ }
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/ISharedEditorsManagerListener.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/ISharedEditorsManagerListener.java
new file mode 100644
index 0000000000..0143b283ed
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/ISharedEditorsManagerListener.java
@@ -0,0 +1,46 @@
+/**
+ * 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 com.raytheon.viz.ui.editor.AbstractEditor;
+
+/**
+ * Listener for SharedEditorsManager events.
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Aug 6, 2012 bgonzale Initial creation
+ *
+ *
+ *
+ * @author bgonzale
+ * @version 1.0
+ */
+public interface ISharedEditorsManagerListener {
+
+ public void removeEditor(AbstractEditor editor);
+
+ public void shareEditor(AbstractEditor editor);
+
+}
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..ca4bcdc6d9
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/SharedEditorsManager.java
@@ -0,0 +1,934 @@
+/**
+ * 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.IEditorPart;
+import org.eclipse.ui.IEditorReference;
+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.event.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;
+ break;
+ }
+ }
+ if (user != null) {
+ int displayId = event.getDisplayId();
+ RemoteDisplay requested = null;
+ for (DisplayData data : displayData.values()) {
+ if (data.displayId == displayId) {
+ requested = new RemoteDisplay(data.displayId,
+ data.display);
+ break;
+ }
+ }
+ if (requested == null) {
+ requested = getActiveDisplay();
+ if (requested != null) {
+ ActivateRemoteDisplay activate = new ActivateRemoteDisplay();
+ activate.setDisplayId(requested.getDisplayId());
+ sendEvent(activate);
+ }
+ } else {
+ CreateRemoteDisplay creation = new CreateRemoteDisplay();
+ creation.setDisplayId(requested.getDisplayId());
+ creation.setDisplay(createRemoteDisplay(requested
+ .getDisplay()));
+ sendEvent(creation);
+ }
+ }
+ }
+ }
+
+ 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 UnsharedEditorDisplayChangedListener implements
+ IRenderableDisplayChangedListener {
+
+ /*
+ * (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) {
+ // An unshared editor had the renderable display changed, check if
+ // newRenderableDisplay is being shared by a manager
+ if (type == DisplayChangeType.ADD
+ && displayData.containsKey(newRenderableDisplay)) {
+ AbstractEditor editor = (AbstractEditor) newRenderableDisplay
+ .getContainer();
+ if (allSharedEditors.contains(editor) == false) {
+ try {
+ shareEditor(editor);
+ } 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) {
+ for (IEditorReference ref : page.getEditorReferences()) {
+ partOpened(ref.getEditor(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);
+ } else if (part instanceof IEditorPart) {
+ deactivateEditors();
+ }
+ }
+
+ @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) {
+
+ }
+
+ @Override
+ public void partOpened(IWorkbenchPart part) {
+ if (part instanceof AbstractEditor) {
+ AbstractEditor editor = (AbstractEditor) part;
+ editor.addRenderableDisplayChangedListener(unsharedEditorListener);
+ }
+ }
+
+ @Override
+ public void partBroughtToTop(IWorkbenchPart part) {
+ if (activeSharedEditor == null && sharedEditors.contains(part)) {
+ activateEditor((AbstractEditor) part);
+ }
+ }
+ }
+
+ 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) {
+ InstantiationException ie = new InstantiationException(
+ "Error creating new dispatcher: "
+ + e.getLocalizedMessage());
+ ie.initCause(e);
+ throw ie;
+ }
+ }
+ }
+
+ 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;
+ }
+
+ /**
+ * Returns the shared display id for the renderable display. Returns -1 if
+ * display not shared
+ *
+ * @param display
+ * @return
+ */
+ public static int getSharedDisplayId(IRenderableDisplay display) {
+ for (SharedEditorsManager manager : managerMap.values()) {
+ if (manager.displayData.containsKey(display)) {
+ return manager.displayData.get(display).displayId;
+ }
+ }
+ return -1;
+ }
+
+ public static boolean isBeingShared(AbstractEditor editor) {
+ return allSharedEditors.contains(editor);
+ }
+
+ public static boolean isBeingShared(IRenderableDisplay display) {
+ return getSharedDisplayId(display) != -1;
+ }
+
+ private DispatcherFactory factory = new SharedEditorDispatcherFactory();
+
+ private SharedEditorPartListener partListener = new SharedEditorPartListener();
+
+ private Map listenerMap = new IdentityHashMap();
+
+ private List sharedEditors = new LinkedList();
+
+ private IRenderableDisplayChangedListener unsharedEditorListener = new UnsharedEditorDisplayChangedListener();
+
+ private Map displayData = new IdentityHashMap();
+
+ private Set listeners = new LinkedHashSet();
+
+ private SharedEditorsManagerListenerHandler sharedEditorsManagerListenerHandler = new SharedEditorsManagerListenerHandler();
+
+ 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 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);
+
+ editor.removeRenderableDisplayChangedListener(unsharedEditorListener);
+
+ try {
+ for (IDisplayPane pane : editor.getDisplayPanes()) {
+ shareDisplay(pane);
+ }
+ } catch (CollaborationException e) {
+ Activator.statusHandler.handle(Priority.PROBLEM,
+ "Error sharing editor: " + e.getLocalizedMessage(),
+ e);
+ removeEditor(editor);
+ 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);
+ }
+ sharedEditorsManagerListenerHandler.fireEditorShared(editor);
+ } else {
+ throw new CollaborationException(
+ "Cannot shared editor already being shared with another session");
+ }
+ } else {
+ System.out.println("Unable to share editor!");
+ Thread.dumpStack();
+ 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();
+ int endIndex = (name.length() < editorTitleSuffix.length()) ? name
+ .length() : name.length() - editorTitleSuffix.length();
+ editor.setTabTitle(name.substring(0, endIndex));
+
+ sharedEditors.remove(editor);
+ partListener.removePage(editor.getSite().getPage());
+
+ for (IDisplayPane pane : editor.getDisplayPanes()) {
+ removeDisplay(pane);
+ }
+
+ // This will trigger the editor to have the unshared editor listener
+ // added and support swapping in
+ partListener.partOpened(editor);
+ allSharedEditors.remove(editor);
+
+ sharedEditorsManagerListenerHandler.fireEditorRemoved(editor);
+ } else {
+ throw new CollaborationException(
+ "Cannot unshare editor that isn't being shared by session");
+ }
+ }
+
+ @Override
+ public void disposeContainer() {
+ // Copy because remove will be called in the loop and we don't want
+ // concurrent modification.
+ 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
+ // Copy because remove will be called in the loop and we don't want
+ // concurrent modification.
+ Collection data = new ArrayList(
+ this.displayData.values());
+ for (DisplayData d : data) {
+ IRenderableDisplay display = d.display;
+ IDisplayPaneContainer container = display.getContainer();
+ for (IDisplayPane pane : container.getDisplayPanes()) {
+ if (pane.getRenderableDisplay() == display) {
+ removeDisplay(pane);
+ break;
+ }
+ }
+ }
+
+ session.unregisterEventHandler(eventHandler);
+ managerMap.remove(session.getSessionId());
+ }
+
+ /**
+ * 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 (displayData.containsKey(display) == false
+ && 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.setSession(session);
+ 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 an event to the venue indicating that no shared displaysa re
+ * currently active.
+ *
+ * @param editor
+ */
+ private void deactivateEditors() {
+ if (activeSharedEditor != null) {
+ activeSharedEditor = null;
+ for (DisplayData d : displayData.values()) {
+ d.dispatcher.setActiveDisplay(null);
+ }
+ fireListeners(null, RemoteDisplayChangeType.ACTIVATED);
+ ActivateRemoteDisplay event = new ActivateRemoteDisplay();
+ event.setDisplayId(-1);
+ 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().clone());
+ AbstractResourceData resourceData = rp.getResourceData();
+ if (resourceData instanceof CollaborationWrapperResourceData) {
+ resourceData = ((CollaborationWrapperResourceData) resourceData)
+ .getWrappedResourceData();
+ } else if (rp.getResource() instanceof CollaborationWrapperResource) {
+ copy.setResourceData(rp.getResource().getResourceData());
+ }
+ 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) {
+ RemoteDisplay rd = null;
+ if (data != null) {
+ rd = new RemoteDisplay(data.displayId, data.display);
+ }
+ for (IRemoteDisplayChangedListener listener : listeners) {
+ listener.remoteDisplayChanged(rd, 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);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.raytheon.uf.viz.collaboration.display.IRemoteDisplayContainer#
+ * getActiveDisplayEditor()
+ */
+ @Override
+ public IEditorPart getActiveDisplayEditor() {
+ return activeSharedEditor;
+ }
+
+ public void addListener(ISharedEditorsManagerListener listener) {
+ sharedEditorsManagerListenerHandler.addListener(listener);
+ }
+
+ public void removeListener(ISharedEditorsManagerListener listener) {
+ sharedEditorsManagerListenerHandler.removeListener(listener);
+ }
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/SharedEditorsManagerListenerHandler.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/SharedEditorsManagerListenerHandler.java
new file mode 100644
index 0000000000..1c35d1db34
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/SharedEditorsManagerListenerHandler.java
@@ -0,0 +1,96 @@
+/**
+ * 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.LinkedHashSet;
+import java.util.Set;
+
+import com.raytheon.viz.ui.editor.AbstractEditor;
+
+/**
+ * Manages Listeners for SharedEditorsManager events.
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Aug 6, 2012 bgonzale Initial creation
+ *
+ *
+ *
+ * @author bgonzale
+ * @version 1.0
+ */
+public class SharedEditorsManagerListenerHandler {
+
+ Set listeners = new LinkedHashSet();
+
+ /**
+ * Event for an editor unshared.
+ *
+ * @param editor
+ */
+ public void fireEditorRemoved(AbstractEditor editor) {
+ ISharedEditorsManagerListener[] temp;
+
+ synchronized (listeners) {
+ temp = listeners
+ .toArray(new ISharedEditorsManagerListener[listeners.size()]);
+ }
+ if (temp != null) {
+ for (ISharedEditorsManagerListener listener : temp) {
+ listener.removeEditor(editor);
+ }
+ }
+ }
+
+ /**
+ * Event for an editor shared.
+ *
+ * @param editor
+ */
+ public void fireEditorShared(AbstractEditor editor) {
+ ISharedEditorsManagerListener[] temp;
+
+ synchronized (listeners) {
+ temp = listeners
+ .toArray(new ISharedEditorsManagerListener[listeners.size()]);
+ }
+ if (temp != null) {
+ for (ISharedEditorsManagerListener listener : temp) {
+ listener.shareEditor(editor);
+ }
+ }
+ }
+
+ public void addListener(ISharedEditorsManagerListener listener) {
+ synchronized (listener) {
+ listeners.add(listener);
+ }
+ }
+
+ public void removeListener(ISharedEditorsManagerListener listener) {
+ synchronized (listener) {
+ listeners.remove(listener);
+ }
+ }
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/FrameDisposed.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/FrameDisposed.java
new file mode 100644
index 0000000000..ce464b9040
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/FrameDisposed.java
@@ -0,0 +1,45 @@
+/**
+ * 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.event;
+
+import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
+import com.raytheon.uf.viz.remote.graphics.events.DisposeObjectEvent;
+
+/**
+ * Special dispose event for RenderFrame objects
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 27, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+@DynamicSerialize
+public class FrameDisposed extends DisposeObjectEvent implements
+ IRenderFrameEvent {
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/IRenderFrameEvent.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/IRenderFrameEvent.java
new file mode 100644
index 0000000000..0d24da5282
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/IRenderFrameEvent.java
@@ -0,0 +1,42 @@
+/**
+ * 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.event;
+
+/**
+ * Special interface for distinguishing IRenderFrameEvents from other render
+ * events
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 27, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public interface IRenderFrameEvent {
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/MouseLocationEvent.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/MouseLocationEvent.java
new file mode 100644
index 0000000000..469585b402
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/MouseLocationEvent.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.dataprovider.event;
+
+import java.util.Arrays;
+
+import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
+import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
+import com.raytheon.uf.viz.remote.graphics.events.rendering.AbstractRemoteGraphicsRenderEvent;
+import com.raytheon.uf.viz.remote.graphics.events.rendering.IRenderEvent;
+
+/**
+ * Collaboration mouse location event, contains mouse coordinates of data
+ * provider
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * May 2, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+@DynamicSerialize
+public class MouseLocationEvent extends AbstractRemoteGraphicsRenderEvent {
+
+ @DynamicSerializeElement
+ private double[] mouseLocation;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.raytheon.uf.viz.remote.graphics.events.rendering.EndFrameEvent#
+ * applyDiffObject
+ * (com.raytheon.uf.viz.remote.graphics.events.rendering.IRenderEvent)
+ */
+ @Override
+ public void applyDiffObject(IRenderEvent diffEvent) {
+ mouseLocation = ((MouseLocationEvent) diffEvent).mouseLocation;
+ }
+
+ /**
+ * @return the mouseLocation
+ */
+ public double[] getMouseLocation() {
+ return mouseLocation;
+ }
+
+ /**
+ * @param mouseLocation
+ * the mouseLocation to set
+ */
+ public void setMouseLocation(double[] mouseLocation) {
+ this.mouseLocation = mouseLocation;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ MouseLocationEvent other = (MouseLocationEvent) obj;
+ if (!Arrays.equals(mouseLocation, other.mouseLocation))
+ return false;
+ return true;
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/RenderFrame.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/RenderFrame.java
new file mode 100644
index 0000000000..1b4c2f2f74
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/RenderFrame.java
@@ -0,0 +1,124 @@
+/**
+ * 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.event;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import com.raytheon.uf.viz.remote.graphics.Dispatcher;
+import com.raytheon.uf.viz.remote.graphics.DispatchingObject;
+import com.raytheon.uf.viz.remote.graphics.events.RemoteGraphicsEventFactory;
+import com.raytheon.uf.viz.remote.graphics.events.rendering.IRenderEvent;
+
+/**
+ * RenderFrame object, tracks IRenderEvents and dispatches changes
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 27, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public class RenderFrame extends DispatchingObject {
+
+ private List renderEvents = new LinkedList();
+
+ /**
+ * @param targetObject
+ * @param dispatcher
+ */
+ public RenderFrame(Dispatcher dispatcher) {
+ super(null, dispatcher);
+ }
+
+ public void addEvent(IRenderEvent event) {
+ renderEvents.add(event);
+ }
+
+ public boolean merge(RenderFrame existingFrame) {
+ if (existingFrame.renderEvents.size() != renderEvents.size()) {
+ return false;
+ }
+
+ UpdateRenderFrameEvent updateEvent = RemoteGraphicsEventFactory
+ .createEvent(UpdateRenderFrameEvent.class, this);
+ Iterator myIter = renderEvents.iterator();
+ Iterator newIter = existingFrame.renderEvents.iterator();
+ boolean changes = false;
+ while (myIter.hasNext() && newIter.hasNext()) {
+ IRenderEvent myEvent = myIter.next();
+ IRenderEvent newEvent = newIter.next();
+ IRenderEvent update = null;
+ if (myEvent.getClass().equals(newEvent.getClass())) {
+ // Same type, check equality
+ if (myEvent.equals(newEvent) == false) {
+ // Not equal, create diff object
+ update = myEvent.createDiffObject(newEvent);
+ changes = true;
+ }
+ } else {
+ // Not compatible, full replace
+ update = newEvent;
+ changes = true;
+ }
+ updateEvent.addEvent(update);
+ }
+
+ renderEvents.clear();
+ renderEvents.addAll(existingFrame.renderEvents);
+
+ if (changes == false) {
+ updateEvent.getRenderEvents().clear();
+ }
+ // Send update event
+ dispatch(updateEvent);
+ return true;
+ }
+
+ public void sendFrame() {
+ RenderFrameEvent event = RemoteGraphicsEventFactory.createEvent(
+ RenderFrameEvent.class, this);
+ event.setRenderEvents(new ArrayList(renderEvents));
+ dispatch(event);
+ }
+
+ public void dispose() {
+ dispatch(RemoteGraphicsEventFactory.createEvent(FrameDisposed.class,
+ this));
+ }
+
+ public void clear() {
+ renderEvents.clear();
+ }
+
+ public int size() {
+ return renderEvents.size();
+ }
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/RenderFrameEvent.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/RenderFrameEvent.java
new file mode 100644
index 0000000000..21afce366d
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/RenderFrameEvent.java
@@ -0,0 +1,68 @@
+/**
+ * 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.event;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
+import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
+import com.raytheon.uf.viz.remote.graphics.events.AbstractDispatchingObjectEvent;
+import com.raytheon.uf.viz.remote.graphics.events.rendering.IRenderEvent;
+
+/**
+ * Event for specifying a new RenderFrame object
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 24, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+@DynamicSerialize
+public class RenderFrameEvent extends AbstractDispatchingObjectEvent implements
+ IRenderFrameEvent {
+
+ @DynamicSerializeElement
+ private List renderEvents = new LinkedList();
+
+ /**
+ * @return the renderEvents
+ */
+ public List getRenderEvents() {
+ return renderEvents;
+ }
+
+ /**
+ * @param renderEvents
+ * the renderEvents to set
+ */
+ public void setRenderEvents(List renderEvents) {
+ this.renderEvents = renderEvents;
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/RenderFrameNeededEvent.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/RenderFrameNeededEvent.java
new file mode 100644
index 0000000000..358ee0abad
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/RenderFrameNeededEvent.java
@@ -0,0 +1,46 @@
+/**
+ * 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.event;
+
+import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
+import com.raytheon.uf.viz.remote.graphics.events.AbstractDispatchingObjectEvent;
+
+/**
+ * Event for participants to tell the data provider they do not have a specific
+ * RenderFrame so the data provider will send it the next time it is painted
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 25, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+@DynamicSerialize
+public class RenderFrameNeededEvent extends AbstractDispatchingObjectEvent
+ implements IRenderFrameEvent {
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/UpdateRenderFrameEvent.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/UpdateRenderFrameEvent.java
new file mode 100644
index 0000000000..dcf4e4faa3
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/event/UpdateRenderFrameEvent.java
@@ -0,0 +1,48 @@
+/**
+ * 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.event;
+
+import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
+import com.raytheon.uf.viz.remote.graphics.events.rendering.IRenderEvent;
+
+/**
+ * Event to update an existing RenderFrame
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 25, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+@DynamicSerialize
+public class UpdateRenderFrameEvent extends RenderFrameEvent {
+
+ public void addEvent(IRenderEvent event) {
+ getRenderEvents().add(event);
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/rsc/DataProviderRsc.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/rsc/DataProviderRsc.java
new file mode 100644
index 0000000000..138b856611
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/rsc/DataProviderRsc.java
@@ -0,0 +1,172 @@
+/**
+ * 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.rsc;
+
+import org.eclipse.swt.graphics.RGB;
+import org.opengis.referencing.crs.CoordinateReferenceSystem;
+
+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.Activator;
+import com.raytheon.uf.viz.collaboration.display.data.SessionColorManager;
+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.DrawableString;
+import com.raytheon.uf.viz.core.IExtent;
+import com.raytheon.uf.viz.core.IGraphicsTarget;
+import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment;
+import com.raytheon.uf.viz.core.IGraphicsTarget.TextStyle;
+import com.raytheon.uf.viz.core.IGraphicsTarget.VerticalAlignment;
+import com.raytheon.uf.viz.core.drawables.IDescriptor;
+import com.raytheon.uf.viz.core.drawables.IFont;
+import com.raytheon.uf.viz.core.drawables.PaintProperties;
+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.remote.graphics.DispatchGraphicsTarget;
+
+/**
+ * A resource that is added to an editor that the Data Provider is sharing. It
+ * captures some events and also displays to the Data Provider that the editor
+ * is currently shared.
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 13, 2012 njensen Initial creation
+ *
+ *
+ *
+ * @author njensen
+ * @version 1.0
+ */
+
+public class DataProviderRsc extends
+ AbstractVizResource {
+
+ private String roomName;
+
+ private String subject;
+
+ private ISharedDisplaySession session;
+
+ private SessionColorManager colorManager;
+
+ private IFont font;
+
+ public DataProviderRsc(DataProviderRscData resourceData,
+ LoadProperties loadProperties) {
+ super(resourceData, loadProperties);
+ SessionContainer container = SharedDisplaySessionMgr
+ .getSessionContainer(resourceData.getSessionId());
+ if (container != null) {
+ session = container.getSession();
+ colorManager = container.getColorManager();
+ IVenueInfo info = session.getVenue().getInfo();
+ roomName = info.getVenueDescription();
+ subject = info.getVenueSubject();
+ }
+ }
+
+ @Override
+ protected void disposeInternal() {
+ font.dispose();
+ }
+
+ @Override
+ protected void paintInternal(IGraphicsTarget target,
+ PaintProperties paintProps) throws VizException {
+ if (target instanceof DispatchGraphicsTarget) {
+ target = ((DispatchGraphicsTarget) target).getWrappedObject();
+ }
+ target.clearClippingPlane();
+ IExtent extent = paintProps.getView().getExtent();
+ RGB color = colorManager.getColorFromUser(session.getUserID());
+ target.drawRect(extent, color, 3.0f, 1.0f);
+
+ DrawableString string = new DrawableString(getName(), color);
+ string.horizontalAlignment = HorizontalAlignment.CENTER;
+ string.verticallAlignment = VerticalAlignment.BOTTOM;
+ string.setCoordinates(extent.getMinX() + extent.getWidth() / 2,
+ extent.getMaxY());
+ string.font = font;
+ string.textStyle = TextStyle.BLANKED;
+ target.drawStrings(string);
+
+ target.setupClippingPlane(paintProps.getClippingPane());
+ }
+
+ @Override
+ protected void initInternal(IGraphicsTarget target) throws VizException {
+ if (target instanceof DispatchGraphicsTarget) {
+ target = ((DispatchGraphicsTarget) target).getWrappedObject();
+ }
+ font = target.getDefaultFont().deriveWithSize(11.0f);
+ font.setScaleFont(true);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.raytheon.uf.viz.core.rsc.AbstractVizResource#project(org.opengis.
+ * referencing.crs.CoordinateReferenceSystem)
+ */
+ @Override
+ public void project(CoordinateReferenceSystem crs) throws VizException {
+ ReprojectRemoteDisplay event = new ReprojectRemoteDisplay();
+ event.setTargetGeometry(descriptor.getGridGeometry());
+ event.setDisplayId(resourceData.getDisplayId());
+ try {
+ session.sendObjectToVenue(event);
+ } catch (CollaborationException e) {
+ Activator.statusHandler.handle(
+ Priority.PROBLEM,
+ "Error sending reprojection event: "
+ + e.getLocalizedMessage(), e);
+ }
+ }
+
+ public String getName() {
+ String text = "Sharing with " + roomName;
+ if (subject.isEmpty() == false) {
+ text += " (" + subject + ")";
+ }
+ return text;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.raytheon.uf.viz.core.rsc.AbstractVizResource#okToUnload()
+ */
+ @Override
+ public boolean okToUnload() {
+ // Though I hate this methods exists, it serves its purpose
+ return false;
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/rsc/DataProviderRscData.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/rsc/DataProviderRscData.java
new file mode 100644
index 0000000000..fef1939fe1
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/roles/dataprovider/rsc/DataProviderRscData.java
@@ -0,0 +1,137 @@
+/**
+ * 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.rsc;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+
+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;
+
+/**
+ * Resource data for the dataprovider resource
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * May 25, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+@XmlAccessorType(XmlAccessType.NONE)
+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)
+ *
+ * @see
+ * com.raytheon.uf.viz.core.rsc.AbstractResourceData#construct(com.raytheon
+ * .uf.viz.core.rsc.LoadProperties,
+ * com.raytheon.uf.viz.core.drawables.IDescriptor)
+ */
+ @Override
+ public DataProviderRsc construct(LoadProperties loadProperties,
+ IDescriptor descriptor) throws VizException {
+ 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
+ */
+ public String getSessionId() {
+ return sessionId;
+ }
+
+ /**
+ * @param sessionId
+ * the sessionId to set
+ */
+ public void setSessionId(String sessionId) {
+ this.sessionId = sessionId;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.raytheon.uf.viz.core.rsc.AbstractResourceData#update(java.lang.Object
+ * )
+ */
+ @Override
+ public void update(Object updateData) {
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ return true;
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/CollaborationResource.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/CollaborationResource.java
new file mode 100644
index 0000000000..df925b1934
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/CollaborationResource.java
@@ -0,0 +1,471 @@
+/**
+ * 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 java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.swt.graphics.Rectangle;
+
+import com.google.common.eventbus.EventBus;
+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.Activator;
+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.event.ParticipantInitializedEvent;
+import com.raytheon.uf.viz.collaboration.display.rsc.event.ReentrantEventHandler;
+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.collaboration.display.storage.IPersistedEvent;
+import com.raytheon.uf.viz.core.IExtent;
+import com.raytheon.uf.viz.core.IGraphicsTarget;
+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.PaintProperties;
+import com.raytheon.uf.viz.core.exception.VizException;
+import com.raytheon.uf.viz.core.jobs.JobPool;
+import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
+import com.raytheon.uf.viz.core.rsc.LoadProperties;
+import com.raytheon.uf.viz.core.rsc.RenderingOrderFactory.ResourceOrder;
+import com.raytheon.uf.viz.remote.graphics.events.AbstractDispatchingObjectEvent;
+import com.raytheon.uf.viz.remote.graphics.events.AbstractRemoteGraphicsEvent;
+import com.raytheon.uf.viz.remote.graphics.events.rendering.BeginFrameEvent;
+import com.raytheon.uf.viz.remote.graphics.events.rendering.EndFrameEvent;
+import com.raytheon.uf.viz.remote.graphics.events.rendering.IRenderEvent;
+import com.raytheon.viz.ui.cmenu.IContextMenuProvider;
+
+/**
+ * A resource for displaying rendered data that is received from the Data
+ * Provider.
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 3, 2012 njensen Initial creation
+ *
+ *
+ *
+ * @author njensen
+ * @version 1.0
+ */
+
+public class CollaborationResource extends
+ AbstractVizResource implements
+ IContextMenuProvider {
+
+ private static JobPool retrievePool = new JobPool("Retriever", 1, true);
+
+ private static class DisplayData {
+ /** List of objects rendered in paint */
+ private List currentRenderables;
+
+ /** Active list of renderable events to add to */
+ private List activeRenderables;
+
+ /** Queue of graphics data update events to process in paint */
+ private List dataChangeEvents;
+
+ /** Internal rendering event object router */
+ private EventBus renderingRouter;
+
+ private CollaborationRenderingDataManager dataManager;
+
+ private MouseLocationEvent latestMouseLocation;
+
+ private Set waitingOnObjects = new HashSet();
+
+ private Set waitingOnFrames = new HashSet();
+
+ private Map> renderableMap = new LinkedHashMap>() {
+
+ private static final long serialVersionUID = 1L;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * java.util.LinkedHashMap#removeEldestEntry(java.util.Map.Entry)
+ */
+ @Override
+ protected boolean removeEldestEntry(
+ Entry> eldest) {
+ if (size() > 10) {
+ return true;
+ }
+ return false;
+ }
+ };
+
+ private DisplayData(int displayId, ISharedDisplaySession session,
+ CollaborationResource resource) {
+ dataChangeEvents = new LinkedList();
+ currentRenderables = new LinkedList();
+ activeRenderables = new LinkedList();
+ renderingRouter = new ReentrantEventHandler();
+
+ dataManager = new CollaborationRenderingDataManager(session,
+ resource, displayId);
+ for (CollaborationRenderingHandler handler : CollaborationRenderingDataManager
+ .createRenderingHandlers(dataManager)) {
+ renderingRouter.register(handler);
+ }
+ }
+
+ private void dispose() {
+ dataManager.dispose();
+ renderingRouter = null;
+ }
+ }
+
+ private Rectangle previousBounds = null;
+
+ private DisplayData displayData;
+
+ public CollaborationResource(CollaborationResourceData resourceData,
+ LoadProperties loadProperties) {
+ super(resourceData, loadProperties);
+ }
+
+ @Override
+ protected void disposeInternal() {
+ resourceData.getSession().unregisterEventHandler(this);
+ displayData.dispose();
+ }
+
+ @Override
+ protected void paintInternal(IGraphicsTarget target,
+ PaintProperties paintProps) throws VizException {
+ if (displayData == null) {
+ return;
+ }
+
+ 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;
+ synchronized (renderableMap) {
+ currentRenderables = renderableMap.get(paintProps.getView()
+ .getExtent());
+ if (currentRenderables == null) {
+ synchronized (displayData.currentRenderables) {
+ currentRenderables = new ArrayList(
+ displayData.currentRenderables);
+ }
+ }
+ }
+
+ List currentDataChangeEvents = new LinkedList();
+ synchronized (dataChangeEvents) {
+ if (waitingOnObjects.size() == 0) {
+ currentDataChangeEvents.addAll(dataChangeEvents);
+ dataChangeEvents.clear();
+ } else {
+ for (AbstractDispatchingObjectEvent dcEvent : dataChangeEvents) {
+ if (waitingOnObjects.contains(dcEvent.getObjectId()) == false) {
+ currentDataChangeEvents.add(dcEvent);
+ }
+ }
+ dataChangeEvents.removeAll(currentDataChangeEvents);
+ }
+ }
+
+ displayData.dataManager.beginRender(target, paintProps);
+
+ synchronized (renderingRouter) {
+ for (AbstractRemoteGraphicsEvent event : currentDataChangeEvents) {
+ renderingRouter.post(event);
+ }
+
+ for (IRenderEvent event : currentRenderables) {
+ renderingRouter.post(event);
+ }
+ if (displayData.latestMouseLocation != null) {
+ renderingRouter.post(displayData.latestMouseLocation);
+ }
+ }
+ }
+
+ public void lockObject(int objectId) {
+ synchronized (displayData.dataChangeEvents) {
+ displayData.waitingOnObjects.add(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 {
+ session.registerEventHandler(this);
+ session.sendObjectToPeer(session.getCurrentDataProvider(), event);
+ } catch (CollaborationException e) {
+ Activator.statusHandler.handle(Priority.PROBLEM,
+ e.getLocalizedMessage(), e);
+ }
+ }
+
+ @Subscribe
+ public void updateRenderFrameEvent(UpdateRenderFrameEvent event) {
+ if (event.getDisplayId() != resourceData.getDisplayId()) {
+ return;
+ }
+ int objectId = event.getObjectId();
+ RenderFrameEvent frame = displayData.dataManager.getRenderableObject(
+ objectId, RenderFrameEvent.class, false);
+ if (frame == null) {
+ if (displayData.waitingOnFrames.contains(objectId) == false) {
+ RenderFrameNeededEvent needEvent = new RenderFrameNeededEvent();
+ needEvent.setDisplayId(event.getDisplayId());
+ needEvent.setObjectId(objectId);
+ ISharedDisplaySession session = resourceData.getSession();
+ try {
+ session.sendObjectToPeer(session.getCurrentDataProvider(),
+ needEvent);
+ displayData.waitingOnFrames.add(objectId);
+ } catch (CollaborationException e) {
+ Activator.statusHandler.handle(Priority.PROBLEM,
+ "Error sending message to data provider", e);
+ }
+ }
+ } else {
+ // We have the frame, apply update
+ RenderFrameEvent updated = null;
+ if (event.getRenderEvents().size() > 0) {
+ updated = new RenderFrameEvent();
+ updated.setDisplayId(frame.getDisplayId());
+ updated.setObjectId(objectId);
+ List events = new LinkedList();
+ Iterator currIter = frame.getRenderEvents()
+ .iterator();
+ Iterator updateIter = event.getRenderEvents()
+ .iterator();
+ while (currIter.hasNext() && updateIter.hasNext()) {
+ IRenderEvent curr = currIter.next();
+ IRenderEvent update = updateIter.next();
+ IRenderEvent toUse = null;
+ if (update != null) {
+ if (update.getClass().equals(curr.getClass())) {
+ curr.applyDiffObject(update);
+ toUse = curr;
+ } else {
+ toUse = update;
+ }
+ } else {
+ toUse = curr;
+ }
+ events.add(toUse);
+ }
+ updated.setRenderEvents(events);
+ } else {
+ updated = frame;
+ }
+ // Render updated data
+ renderFrameEvent(updated);
+ }
+ }
+
+ @Subscribe
+ public void renderFrameEvent(RenderFrameEvent event) {
+ 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());
+ }
+ displayData.dataManager.putRenderableObject(objectId, event);
+ }
+ issueRefresh();
+ }
+
+ @Subscribe
+ public void disposeRenderFrame(FrameDisposed event) {
+ 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 {
+ AbstractDispatchingObjectEvent objectEvent = displayData.dataManager
+ .retrieveEvent(event);
+ if (objectEvent != null) {
+ renderableArrived(objectEvent);
+ }
+ } catch (CollaborationException e) {
+ Activator.statusHandler.handle(Priority.PROBLEM,
+ e.getLocalizedMessage(), e);
+ }
+ }
+ });
+ }
+
+ public void postObjectEvent(AbstractDispatchingObjectEvent event) {
+ synchronized (displayData.renderingRouter) {
+ displayData.renderingRouter.post(event);
+ }
+ }
+
+ @Subscribe
+ public void renderableArrived(AbstractRemoteGraphicsEvent event) {
+ if (event.getDisplayId() != resourceData.getDisplayId()
+ || event instanceof IRenderFrameEvent) {
+ // Skip IRenderFrameEvents, not applicable here
+ return;
+ }
+ if (event instanceof IRenderEvent) {
+ // Render based event
+ if (event instanceof BeginFrameEvent) {
+ // If begin frame event, clear current active renderables
+ displayData.activeRenderables.clear();
+ displayData.activeRenderables.add((IRenderEvent) event);
+ } else if (event instanceof EndFrameEvent) {
+ synchronized (displayData.currentRenderables) {
+ IExtent current = null;
+ displayData.currentRenderables.clear();
+ // Frame over, process BeginFrameEvent now to keep in sync
+ for (IRenderEvent renderable : displayData.activeRenderables) {
+ if (renderable instanceof BeginFrameEvent) {
+ // Handle begin frame event immediately before next
+ // paint occurs
+ final IRenderableDisplay display = descriptor
+ .getRenderableDisplay();
+ final BeginFrameEvent bfe = (BeginFrameEvent) renderable;
+ display.setBackgroundColor(bfe.getColor());
+ if (previousBounds == null
+ || previousBounds.equals(bfe.getBounds()) == false) {
+ previousBounds = bfe.getBounds();
+ VizApp.runAsync(new Runnable() {
+ @Override
+ public void run() {
+ resourceData.getEditor()
+ .setCanvasBounds(
+ bfe.getDisplayId(),
+ bfe.getBounds());
+ display.getView().setExtent(
+ bfe.getExtent());
+ }
+ });
+ } else {
+ display.getView().setExtent(bfe.getExtent());
+ }
+ current = bfe.getExtent();
+ } else {
+ // Add to list for processing in paintInternal
+ displayData.currentRenderables.add(renderable);
+ }
+ }
+ displayData.activeRenderables.clear();
+ displayData.renderableMap.put(current,
+ new ArrayList(
+ displayData.currentRenderables));
+ }
+ issueRefresh();
+ } else if (event instanceof MouseLocationEvent) {
+ displayData.latestMouseLocation = (MouseLocationEvent) event;
+ issueRefresh();
+ } else {
+ displayData.activeRenderables.add((IRenderEvent) event);
+ }
+ } else if (event instanceof AbstractDispatchingObjectEvent) {
+ // If not IRenderEvent, event modifies data object
+ synchronized (displayData.dataChangeEvents) {
+ displayData.dataChangeEvents
+ .add((AbstractDispatchingObjectEvent) event);
+ }
+ issueRefresh();
+ } else {
+ Activator.statusHandler.handle(Priority.PROBLEM,
+ "Could not handle event type: "
+ + event.getClass().getSimpleName());
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.raytheon.uf.viz.core.rsc.AbstractVizResource#getResourceOrder()
+ */
+ @Override
+ public ResourceOrder getResourceOrder() {
+ return ResourceOrder.LOWEST;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.raytheon.viz.ui.cmenu.IContextMenuProvider#provideContextMenuItems
+ * (org.eclipse.jface.action.IMenuManager, int, int)
+ */
+ @Override
+ public void provideContextMenuItems(IMenuManager menuManager, int x, int y) {
+ menuManager.add(new Action("Quit Session") {
+ @Override
+ public void run() {
+ System.out.println("TODO: Quit session");
+ }
+ });
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/CollaborationResourceData.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/CollaborationResourceData.java
new file mode 100644
index 0000000000..30a73bb510
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/CollaborationResourceData.java
@@ -0,0 +1,140 @@
+/**
+ * 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.collaboration.comm.identity.ISharedDisplaySession;
+import com.raytheon.uf.viz.collaboration.display.editor.ICollaborationEditor;
+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.AbstractVizResource;
+import com.raytheon.uf.viz.core.rsc.IResourceDataChanged.ChangeType;
+import com.raytheon.uf.viz.core.rsc.LoadProperties;
+
+/**
+ * Resource data for a CollaborationResource.
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 3, 2012 njensen Initial creation
+ *
+ *
+ *
+ * @author njensen
+ * @version 1.0
+ */
+
+public class CollaborationResourceData extends AbstractResourceData {
+
+ private ICollaborationEditor editor;
+
+ private ISharedDisplaySession session;
+
+ private int displayId;
+
+ /**
+ * @param session2
+ * @param displayId2
+ */
+ public CollaborationResourceData(ICollaborationEditor editor,
+ ISharedDisplaySession session, int displayId) {
+ this.session = session;
+ this.displayId = displayId;
+ this.editor = editor;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.raytheon.uf.viz.core.rsc.AbstractResourceData#construct(com.raytheon
+ * .uf.viz.core.rsc.LoadProperties,
+ * com.raytheon.uf.viz.core.drawables.IDescriptor)
+ */
+ @Override
+ public AbstractVizResource, ?> construct(LoadProperties loadProperties,
+ IDescriptor descriptor) throws VizException {
+ return new CollaborationResource(this, loadProperties);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.raytheon.uf.viz.core.rsc.AbstractResourceData#update(java.lang.Object
+ * )
+ */
+ @Override
+ public void update(Object updateData) {
+ fireChangeListeners(ChangeType.DATA_UPDATE, updateData);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ return 31;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ return true;
+ }
+
+ /**
+ * @return the editor
+ */
+ public ICollaborationEditor getEditor() {
+ return editor;
+ }
+
+ /**
+ * @return the session
+ */
+ public ISharedDisplaySession getSession() {
+ return session;
+ }
+
+ /**
+ * @return the displayId
+ */
+ public int getDisplayId() {
+ return displayId;
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/CollaborationWrapperResource.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/CollaborationWrapperResource.java
new file mode 100644
index 0000000000..bb6c36bff9
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/CollaborationWrapperResource.java
@@ -0,0 +1,388 @@
+/**
+ * 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 java.util.Map;
+
+import org.opengis.referencing.crs.CoordinateReferenceSystem;
+
+import com.raytheon.uf.common.geospatial.ReferencedCoordinate;
+import com.raytheon.uf.common.status.UFStatus.Priority;
+import com.raytheon.uf.common.time.DataTime;
+import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
+import com.raytheon.uf.viz.collaboration.display.Activator;
+import com.raytheon.uf.viz.collaboration.display.roles.dataprovider.SharedEditorsManager;
+import com.raytheon.uf.viz.collaboration.display.rsc.event.ResourceCapabilityChanged;
+import com.raytheon.uf.viz.collaboration.display.rsc.event.ResourcePropertiesChanged;
+import com.raytheon.uf.viz.core.IDisplayPaneContainer;
+import com.raytheon.uf.viz.core.IGraphicsTarget;
+import com.raytheon.uf.viz.core.drawables.IDescriptor;
+import com.raytheon.uf.viz.core.drawables.PaintProperties;
+import com.raytheon.uf.viz.core.exception.VizException;
+import com.raytheon.uf.viz.core.rsc.AbstractResourceData;
+import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
+import com.raytheon.uf.viz.core.rsc.IRefreshListener;
+import com.raytheon.uf.viz.core.rsc.IResourceDataChanged;
+import com.raytheon.uf.viz.core.rsc.LoadProperties;
+import com.raytheon.uf.viz.core.rsc.RenderingOrderFactory.ResourceOrder;
+import com.raytheon.uf.viz.core.rsc.ResourceProperties;
+import com.raytheon.uf.viz.core.rsc.capabilities.AbstractCapability;
+import com.raytheon.uf.viz.core.rsc.capabilities.Capabilities;
+import com.raytheon.uf.viz.remote.graphics.DispatchGraphicsTarget;
+
+/**
+ * Collaboration resource that wraps an existing resource and extracts the
+ * proper target to use since the wrapped resource will not be sending paint
+ * events
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 10, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public class CollaborationWrapperResource extends
+ AbstractVizResource implements
+ IResourceDataChanged {
+
+ private AbstractVizResource, ?> wrappedResource;
+
+ /** This listener exists to avoid .equals conflicts in listener list */
+ private IResourceDataChanged capabilityChangeListener = new IResourceDataChanged() {
+ @Override
+ public void resourceChanged(ChangeType type, Object object) {
+ CollaborationWrapperResource.this.resourceChanged(type, object);
+ }
+ };
+
+ /**
+ * @param resourceData
+ * @param loadProperties
+ */
+ public CollaborationWrapperResource(
+ CollaborationWrapperResourceData resourceData,
+ LoadProperties loadProperties,
+ AbstractVizResource, ?> wrappedResource) {
+ super(resourceData, loadProperties);
+ this.wrappedResource = wrappedResource;
+ wrappedResource.registerListener(new IRefreshListener() {
+ @Override
+ public void refresh() {
+ issueRefresh();
+ }
+ });
+ }
+
+ /**
+ * @return the wrappedResource
+ */
+ public AbstractVizResource, ?> getWrappedResource() {
+ return wrappedResource;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.raytheon.uf.viz.core.rsc.AbstractVizResource#disposeInternal()
+ */
+ @Override
+ protected void disposeInternal() {
+ getResourceData().removeChangeListener(capabilityChangeListener);
+ getWrapperResourceData().removeChangeListener(capabilityChangeListener);
+ if (wrappedResource.getStatus() != ResourceStatus.DISPOSED) {
+ wrappedResource.dispose();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.raytheon.uf.viz.core.rsc.AbstractVizResource#paintInternal(com.raytheon
+ * .uf.viz.core.IGraphicsTarget,
+ * com.raytheon.uf.viz.core.drawables.PaintProperties)
+ */
+ @Override
+ protected void paintInternal(IGraphicsTarget target,
+ PaintProperties paintProps) throws VizException {
+ if (target instanceof DispatchGraphicsTarget) {
+ target = ((DispatchGraphicsTarget) target).getWrappedObject();
+ }
+ wrappedResource.paint(target, paintProps);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.raytheon.uf.viz.core.rsc.AbstractVizResource#initInternal(com.raytheon
+ * .uf.viz.core.IGraphicsTarget)
+ */
+ @Override
+ protected void initInternal(IGraphicsTarget target) throws VizException {
+ getResourceData().addChangeListener(capabilityChangeListener);
+ getWrapperResourceData().addChangeListener(capabilityChangeListener);
+ if (wrappedResource.getStatus() == ResourceStatus.NEW) {
+ if (target instanceof DispatchGraphicsTarget) {
+ target = ((DispatchGraphicsTarget) target).getWrappedObject();
+ }
+ wrappedResource.init(target);
+ }
+ }
+
+ /**
+ * @param
+ * @param capability
+ * @return
+ * @see com.raytheon.uf.viz.core.rsc.AbstractVizResource#getCapability(java.lang.Class)
+ */
+ public C getCapability(Class capability) {
+ return wrappedResource.getCapability(capability);
+ }
+
+ /**
+ * @return
+ * @see com.raytheon.uf.viz.core.rsc.AbstractVizResource#getCapabilities()
+ */
+ public Capabilities getCapabilities() {
+ return wrappedResource.getCapabilities();
+ }
+
+ /**
+ * @return
+ * @see com.raytheon.uf.viz.core.rsc.AbstractVizResource#getDescriptor()
+ */
+ public IDescriptor getDescriptor() {
+ return wrappedResource.getDescriptor();
+ }
+
+ /**
+ * @return
+ * @see com.raytheon.uf.viz.core.rsc.AbstractVizResource#getDataTimes()
+ */
+ public DataTime[] getDataTimes() {
+ return wrappedResource.getDataTimes();
+ }
+
+ /**
+ * @return
+ * @see com.raytheon.uf.viz.core.rsc.AbstractVizResource#getLoadProperties()
+ */
+ public LoadProperties getLoadProperties() {
+ return wrappedResource.getLoadProperties();
+ }
+
+ /**
+ * @return
+ * @see com.raytheon.uf.viz.core.rsc.AbstractVizResource#getResourceData()
+ */
+ public AbstractResourceData getResourceData() {
+ return wrappedResource.getResourceData();
+ }
+
+ public CollaborationWrapperResourceData getWrapperResourceData() {
+ return (CollaborationWrapperResourceData) resourceData;
+ }
+
+ /**
+ * @param capability
+ * @return
+ * @see com.raytheon.uf.viz.core.rsc.AbstractVizResource#hasCapability(java.lang.Class)
+ */
+ public boolean hasCapability(Class extends AbstractCapability> capability) {
+ return wrappedResource.hasCapability(capability);
+ }
+
+ /**
+ * @return
+ * @see com.raytheon.uf.viz.core.rsc.AbstractVizResource#getName()
+ */
+ public String getName() {
+ return wrappedResource.getName();
+ }
+
+ /**
+ * @param coord
+ * @return
+ * @throws VizException
+ * @see com.raytheon.uf.viz.core.rsc.AbstractVizResource#inspect(com.raytheon.uf.common.geospatial.ReferencedCoordinate)
+ */
+ public String inspect(ReferencedCoordinate coord) throws VizException {
+ return wrappedResource.inspect(coord);
+ }
+
+ /**
+ * @param coord
+ * @return
+ * @throws VizException
+ * @see com.raytheon.uf.viz.core.rsc.AbstractVizResource#interrogate(com.raytheon.uf.common.geospatial.ReferencedCoordinate)
+ */
+ public Map interrogate(ReferencedCoordinate coord)
+ throws VizException {
+ return wrappedResource.interrogate(coord);
+ }
+
+ /**
+ * @return
+ * @see com.raytheon.uf.viz.core.rsc.AbstractVizResource#getStatus()
+ */
+ public ResourceStatus getStatus() {
+ return wrappedResource.getStatus();
+ }
+
+ /**
+ * @return
+ * @see com.raytheon.uf.viz.core.rsc.AbstractVizResource#getResourceOrder()
+ */
+ public ResourceOrder getResourceOrder() {
+ return wrappedResource.getResourceOrder();
+ }
+
+ /**
+ * @return
+ * @see com.raytheon.uf.viz.core.rsc.AbstractVizResource#isTimeAgnostic()
+ */
+ public boolean isTimeAgnostic() {
+ return wrappedResource.isTimeAgnostic();
+ }
+
+ /**
+ * @return
+ * @see com.raytheon.uf.viz.core.rsc.AbstractVizResource#getProperties()
+ */
+ public ResourceProperties getProperties() {
+ return wrappedResource.getProperties();
+ }
+
+ /**
+ * @return
+ * @see com.raytheon.uf.viz.core.rsc.AbstractVizResource#getResourceContainer()
+ */
+ public IDisplayPaneContainer getResourceContainer() {
+ return wrappedResource.getResourceContainer();
+ }
+
+ /**
+ * @return
+ * @see java.lang.Object#hashCode()
+ */
+ public int hashCode() {
+ return wrappedResource.hashCode();
+ }
+
+ /**
+ * @param obj
+ * @return
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ public boolean equals(Object obj) {
+ if (super.equals(obj)) {
+ return true;
+ }
+ return wrappedResource.equals(obj);
+ }
+
+ /**
+ * @param dataTime
+ * @see com.raytheon.uf.viz.core.rsc.AbstractVizResource#remove(com.raytheon.uf.common.time.DataTime)
+ */
+ public void remove(DataTime dataTime) {
+ wrappedResource.remove(dataTime);
+ }
+
+ /**
+ * @return
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ return wrappedResource.toString();
+ }
+
+ /**
+ * @param crs
+ * @throws VizException
+ * @see com.raytheon.uf.viz.core.rsc.AbstractVizResource#project(org.opengis.referencing.crs.CoordinateReferenceSystem)
+ */
+ public void project(CoordinateReferenceSystem crs) throws VizException {
+ wrappedResource.project(crs);
+ }
+
+ /**
+ * @return
+ * @see com.raytheon.uf.viz.core.rsc.AbstractVizResource#okToUnload()
+ */
+ public boolean okToUnload() {
+ return wrappedResource.okToUnload();
+ }
+
+ /**
+ * @param updatedProps
+ * @see com.raytheon.uf.viz.core.rsc.AbstractVizResource#propertiesChanged(com.raytheon.uf.viz.core.rsc.ResourceProperties)
+ */
+ public void propertiesChanged(ResourceProperties updatedProps) {
+ wrappedResource.propertiesChanged(updatedProps);
+ try {
+ ResourcePropertiesChanged event = new ResourcePropertiesChanged();
+ event.setDisplayId(SharedEditorsManager
+ .getSharedDisplayId(getDescriptor().getRenderableDisplay()));
+ event.setResourceData(getResourceData());
+ event.setProperties(updatedProps);
+ getWrapperResourceData().getSession().sendObjectToVenue(event);
+ } catch (CollaborationException e) {
+ Activator.statusHandler.handle(Priority.PROBLEM,
+ e.getLocalizedMessage(), e);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.raytheon.uf.viz.core.rsc.IResourceDataChanged#resourceChanged(com
+ * .raytheon.uf.viz.core.rsc.IResourceDataChanged.ChangeType,
+ * java.lang.Object)
+ */
+ @Override
+ public void resourceChanged(ChangeType type, Object object) {
+ if (type == ChangeType.CAPABILITY
+ && object instanceof AbstractCapability) {
+ try {
+ ResourceCapabilityChanged event = new ResourceCapabilityChanged();
+ event.setDisplayId(SharedEditorsManager
+ .getSharedDisplayId(getDescriptor()
+ .getRenderableDisplay()));
+ event.setResourceData(getResourceData());
+ event.setCapability((AbstractCapability) object);
+ getWrapperResourceData().getSession().sendObjectToVenue(event);
+ } catch (CollaborationException e) {
+ Activator.statusHandler.handle(Priority.PROBLEM,
+ e.getLocalizedMessage(), e);
+ }
+ }
+ }
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/CollaborationWrapperResourceData.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/CollaborationWrapperResourceData.java
new file mode 100644
index 0000000000..232d542861
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/CollaborationWrapperResourceData.java
@@ -0,0 +1,146 @@
+/**
+ * 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 javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+
+import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession;
+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.AbstractVizResource;
+import com.raytheon.uf.viz.core.rsc.LoadProperties;
+
+/**
+ * Collaboration resource data that wraps an existing resource data and
+ * constructs CollaborationWrapperResource which wraps the resource created by
+ * the wrapped resource data
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 10, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+@XmlAccessorType(XmlAccessType.NONE)
+public class CollaborationWrapperResourceData extends AbstractResourceData {
+
+ @XmlElement
+ private AbstractResourceData wrappedResourceData;
+
+ private ISharedDisplaySession session;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.raytheon.uf.viz.core.rsc.AbstractResourceData#construct(com.raytheon
+ * .uf.viz.core.rsc.LoadProperties,
+ * com.raytheon.uf.viz.core.drawables.IDescriptor)
+ */
+ @Override
+ public AbstractVizResource, ?> construct(LoadProperties loadProperties,
+ IDescriptor descriptor) throws VizException {
+ return new CollaborationWrapperResource(this, loadProperties,
+ wrappedResourceData.construct(loadProperties, descriptor));
+ }
+
+ /**
+ * @return the session
+ */
+ public ISharedDisplaySession getSession() {
+ return session;
+ }
+
+ /**
+ * @param session
+ * the session to set
+ */
+ public void setSession(ISharedDisplaySession session) {
+ this.session = session;
+ }
+
+ public AbstractResourceData getWrappedResourceData() {
+ return wrappedResourceData;
+ }
+
+ /**
+ * @param wrappedResourceData
+ * the wrappedResourceData to set
+ */
+ public void setWrappedResourceData(AbstractResourceData wrappedResourceData) {
+ this.wrappedResourceData = wrappedResourceData;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.raytheon.uf.viz.core.rsc.AbstractResourceData#update(java.lang.Object
+ * )
+ */
+ @Override
+ public void update(Object updateData) {
+ wrappedResourceData.update(updateData);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ return wrappedResourceData.hashCode();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass()) {
+ return wrappedResourceData.equals(obj);
+ }
+ CollaborationWrapperResourceData other = (CollaborationWrapperResourceData) obj;
+ if (wrappedResourceData == null) {
+ if (other.wrappedResourceData != null)
+ return false;
+ } else if (!wrappedResourceData.equals(other.wrappedResourceData))
+ return false;
+ return true;
+ }
+
+}
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.display/src/com/raytheon/uf/viz/collaboration/display/rsc/event/AbstractResourceChangedEvent.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/event/AbstractResourceChangedEvent.java
new file mode 100644
index 0000000000..219ed3fb58
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/event/AbstractResourceChangedEvent.java
@@ -0,0 +1,85 @@
+/**
+ * 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.event;
+
+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.rsc.AbstractResourceData;
+
+/**
+ * Abstract resource changed event object, contains resource data of changed
+ * resource and displayId resource is on
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Sep 28, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+@XmlAccessorType(XmlAccessType.NONE)
+public class AbstractResourceChangedEvent {
+
+ @XmlAttribute
+ private int displayId;
+
+ @XmlElement
+ private AbstractResourceData resourceData;
+
+ /**
+ * @return the displayId
+ */
+ public int getDisplayId() {
+ return displayId;
+ }
+
+ /**
+ * @param displayId
+ * the displayId to set
+ */
+ public void setDisplayId(int displayId) {
+ this.displayId = displayId;
+ }
+
+ /**
+ * @return the resourceData
+ */
+ public AbstractResourceData getResourceData() {
+ return resourceData;
+ }
+
+ /**
+ * @param resourceData
+ * the resourceData to set
+ */
+ public void setResourceData(AbstractResourceData resourceData) {
+ this.resourceData = resourceData;
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/event/ParticipantInitializedEvent.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/event/ParticipantInitializedEvent.java
new file mode 100644
index 0000000000..fe60427007
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/event/ParticipantInitializedEvent.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.rsc.event;
+
+import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
+import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
+
+/**
+ * Event stating the participant has initialized and is ready for rendering
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * May 14, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+@DynamicSerialize
+public class ParticipantInitializedEvent {
+
+ @DynamicSerializeElement
+ private String userId;
+
+ /**
+ * @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/rsc/event/ReentrantEventHandler.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/event/ReentrantEventHandler.java
new file mode 100644
index 0000000000..13ba8f4cd6
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/event/ReentrantEventHandler.java
@@ -0,0 +1,201 @@
+/**
+ * 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.event;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import com.google.common.eventbus.EventBus;
+import com.google.common.eventbus.Subscribe;
+import com.raytheon.uf.common.status.UFStatus.Priority;
+import com.raytheon.uf.viz.collaboration.display.Activator;
+
+/**
+ * An implementation of EventBus that posts all events to listeners immediately.
+ * The major difference between this implementation and the default
+ * implementation is that it allows reentrant posts, that is if you call post
+ * from within a handler it will immediately post the event while the default
+ * implementation will add the new event to a queue. Because EventBus is not
+ * designed for extension this is basically a reimplementation from scratch
+ * using the EventBus as an interface.
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jul 13, 2012 bsteffen Initial creation
+ *
+ *
+ *
+ * @author bsteffen
+ * @version 1.0
+ */
+
+public class ReentrantEventHandler extends EventBus {
+
+ private static class EventHandler {
+
+ public final Method method;
+
+ public final Object obj;
+
+ public EventHandler(Method method, Object obj) {
+ this.method = method;
+ this.obj = obj;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + ((method == null) ? 0 : method.hashCode());
+ result = prime * result + ((obj == null) ? 0 : obj.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ EventHandler other = (EventHandler) obj;
+ if (method == null) {
+ if (other.method != null)
+ return false;
+ } else if (!method.equals(other.method))
+ return false;
+ // If obj.equals(other.obj) we still want the two ahndlers to be
+ // treated as different so we are only equal if obj == other.obj.
+ if (this.obj != other.obj)
+ return false;
+ return true;
+ }
+
+ }
+
+ private Map, Set> handlers = new HashMap, Set>();
+
+ @Override
+ public void post(Object obj) {
+ for (Class> clazz : getClassHierarchy(obj.getClass())) {
+ Set handlers = this.handlers.get(clazz);
+ if (handlers == null) {
+ return;
+ }
+ for (EventHandler handler : handlers) {
+ try {
+ handler.method.invoke(handler.obj, new Object[] { obj });
+ } catch (IllegalAccessException e) {
+ Activator.statusHandler.handle(Priority.PROBLEM,
+ e.getLocalizedMessage(), e);
+ } catch (InvocationTargetException e) {
+ Activator.statusHandler.handle(Priority.PROBLEM,
+ e.getLocalizedMessage(), e);
+ }
+ }
+ }
+ }
+
+ private List> getClassHierarchy(Class> clazz) {
+ List> result = new ArrayList>();
+ while (clazz != null) {
+ result.add(clazz);
+ result.addAll(Arrays.asList(clazz.getInterfaces()));
+ clazz = clazz.getSuperclass();
+ }
+ return result;
+ }
+
+ @Override
+ public void register(Object object) {
+ Class> objClazz = object.getClass();
+ for (Class> clazz : getClassHierarchy(objClazz)) {
+ for (Method method : clazz.getMethods()) {
+ if (method.isAnnotationPresent(Subscribe.class)) {
+ Class>[] types = method.getParameterTypes();
+ if (types.length != 1) {
+ throw new IllegalStateException(method.getName()
+ + " has the wrong number of arguments");
+ }
+ Class> type = types[0];
+ Set handlers = this.handlers.get(type);
+ if (handlers == null) {
+ handlers = new HashSet();
+ this.handlers.put(type, handlers);
+ }
+ try {
+ // get the actual method from the obj so that if there
+ // are any overrides they are handled correctly.
+ Method objMethod = objClazz.getMethod(method.getName(),
+ method.getParameterTypes());
+ handlers.add(new EventHandler(objMethod, object));
+ } catch (NoSuchMethodException e) {
+ // This method will exist, this exception will never
+ // happen.
+ Activator.statusHandler.handle(Priority.PROBLEM,
+ e.getLocalizedMessage(), e);
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public void unregister(Object object) {
+ // This is a brute force algorithm, more efficient algorithms could be
+ // written but are currently not needed
+ boolean removed = false;
+ Iterator, Set>> entryItr = handlers
+ .entrySet().iterator();
+ while (entryItr.hasNext()) {
+ Set handlers = entryItr.next().getValue();
+ Iterator handlerItr = handlers.iterator();
+ while (handlerItr.hasNext()) {
+ if (handlerItr.next().obj == object) {
+ handlerItr.remove();
+ removed = true;
+ }
+ }
+ if (handlers.isEmpty()) {
+ entryItr.remove();
+ }
+ }
+ if (!removed) {
+ throw new IllegalArgumentException("Object was never registered: "
+ + object);
+ }
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/event/ResourceCapabilityChanged.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/event/ResourceCapabilityChanged.java
new file mode 100644
index 0000000000..32abfae367
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/event/ResourceCapabilityChanged.java
@@ -0,0 +1,69 @@
+/**
+ * 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.event;
+
+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 com.raytheon.uf.common.serialization.ISerializableObject;
+import com.raytheon.uf.viz.core.rsc.capabilities.AbstractCapability;
+
+/**
+ * Event to notify a shared resource capability changed
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Sep 26, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlRootElement
+public class ResourceCapabilityChanged extends AbstractResourceChangedEvent
+ implements ISerializableObject {
+
+ @XmlElement
+ private AbstractCapability capability;
+
+ /**
+ * @return the capability
+ */
+ public AbstractCapability getCapability() {
+ return capability;
+ }
+
+ /**
+ * @param capability
+ * the capability to set
+ */
+ public void setCapability(AbstractCapability capability) {
+ this.capability = capability;
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/event/ResourcePropertiesChanged.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/event/ResourcePropertiesChanged.java
new file mode 100644
index 0000000000..ae34a57068
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/event/ResourcePropertiesChanged.java
@@ -0,0 +1,69 @@
+/**
+ * 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.event;
+
+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 com.raytheon.uf.common.serialization.ISerializableObject;
+import com.raytheon.uf.viz.core.rsc.ResourceProperties;
+
+/**
+ * Event class for notifying changes to a shared resources' properties
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Sep 28, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlRootElement
+public class ResourcePropertiesChanged extends AbstractResourceChangedEvent
+ implements ISerializableObject {
+
+ @XmlElement
+ private ResourceProperties properties;
+
+ /**
+ * @return the properties
+ */
+ public ResourceProperties getProperties() {
+ return properties;
+ }
+
+ /**
+ * @param properties
+ * the properties to set
+ */
+ public void setProperties(ResourceProperties properties) {
+ this.properties = properties;
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/event/SharedResource.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/event/SharedResource.java
new file mode 100644
index 0000000000..1dc49e6913
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/event/SharedResource.java
@@ -0,0 +1,109 @@
+/**
+ * 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.event;
+
+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 javax.xml.bind.annotation.XmlRootElement;
+
+import com.raytheon.uf.common.serialization.ISerializableObject;
+import com.raytheon.uf.viz.core.drawables.ResourcePair;
+
+/**
+ * Shared resource object, specifies a resource shared by all users in the
+ * venue. Can send command to add resource or remove
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 10, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+@XmlAccessorType(XmlAccessType.NONE)
+@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
+ */
+ public ResourcePair getResource() {
+ return resource;
+ }
+
+ /**
+ * @param resource
+ * the resource to set
+ */
+ public void setResource(ResourcePair resource) {
+ this.resource = resource;
+ }
+
+ /**
+ * Returns true if the SharedResource represents a resource removal, false
+ * if addition
+ *
+ * @return the remove
+ */
+ public boolean isRemoveResource() {
+ return removeResource;
+ }
+
+ /**
+ * @param remove
+ * the remove to set
+ */
+ public void setRemoveResource(boolean remove) {
+ this.removeResource = remove;
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/rendering/CollaborationRenderingDataManager.java b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/rendering/CollaborationRenderingDataManager.java
new file mode 100644
index 0000000000..6799ada04c
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.collaboration.display/src/com/raytheon/uf/viz/collaboration/display/rsc/rendering/CollaborationRenderingDataManager.java
@@ -0,0 +1,292 @@
+/**
+ * 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.rendering;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
+
+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.display.Activator;
+import com.raytheon.uf.viz.collaboration.display.rsc.CollaborationResource;
+import com.raytheon.uf.viz.collaboration.display.storage.CollaborationObjectEventStorage;
+import com.raytheon.uf.viz.collaboration.display.storage.IObjectEventRetrieval;
+import com.raytheon.uf.viz.collaboration.display.storage.IPersistedEvent;
+import com.raytheon.uf.viz.core.IGraphicsTarget;
+import com.raytheon.uf.viz.core.drawables.PaintProperties;
+import com.raytheon.uf.viz.remote.graphics.events.AbstractDispatchingObjectEvent;
+
+/**
+ * Collaboration rendering data manager, manages render data and render handlers
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 16, 2012 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public class CollaborationRenderingDataManager implements IObjectEventRetrieval {
+
+ private static final String RENDERING_EXTENSION = "com.raytheon.uf.viz.collaboration.display.renderingExtension";
+
+ private static Collection handlerElements = new LinkedList();
+
+ static {
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ if (registry != null) {
+ IExtensionPoint point = registry
+ .getExtensionPoint(RENDERING_EXTENSION);
+ if (point != null) {
+ IExtension[] extensions = point.getExtensions();
+
+ for (IExtension ext : extensions) {
+ IConfigurationElement[] config = ext
+ .getConfigurationElements();
+ handlerElements.addAll(Arrays.asList(config));
+ }
+ }
+ }
+ }
+
+ private Map renderableObjectMap = new HashMap