From 001c52bd3af9b03d3cf93d9a1f588bd5b1918384 Mon Sep 17 00:00:00 2001 From: Max Schenkelberg Date: Wed, 25 Apr 2012 11:27:19 -0500 Subject: [PATCH] #Issue 239 Got bulk event sending and only sending events when previous frame changes. Former-commit-id: 4ac2f1ac53970f57936d3b8cd5dfcd90f718c6ce --- .../radar/mosaic/DispatchingMosaicImage.java | 22 +- .../ui/role/DataProviderEventController.java | 2 +- .../dataprovider/CollaborationDispatcher.java | 200 ++++++++++++++++++ .../CollaborationObjectEventStorage.java | 43 ++-- .../IObjectEventPersistance.java | 3 +- .../IObjectEventRetrieval.java | 3 +- .../event/IPersistedEvent.java | 2 +- .../dataprovider/event/RenderFrameEvent.java | 93 ++++++++ .../role/event/CollaborationDispatcher.java | 123 ----------- .../ui/rsc/CollaborationResource.java | 21 +- .../CollaborationRenderingDataManager.java | 6 +- .../graphics/AbstractRemoteGraphicsEvent.java | 2 +- .../remote/graphics/DispatchingObject.java | 3 +- .../graphics/events/BeginFrameEvent.java | 24 +++ .../remote/graphics/events/EndFrameEvent.java | 16 ++ .../remote/graphics/events/IRenderEvent.java | 5 +- .../events/imagery/PaintImageEvent.java | 44 ++++ .../events/imagery/PaintImagesEvent.java | 24 +++ .../offscreen/RenderOffscreenEvent.java | 21 ++ .../events/offscreen/RenderOnscreenEvent.java | 16 ++ .../wireframe/RenderWireframeShapeEvent.java | 48 +++++ 21 files changed, 568 insertions(+), 153 deletions(-) create mode 100644 cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/CollaborationDispatcher.java rename cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/{event => dataprovider}/CollaborationObjectEventStorage.java (85%) rename cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/{event => dataprovider}/IObjectEventPersistance.java (90%) rename cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/{event => dataprovider}/IObjectEventRetrieval.java (91%) rename cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/{ => dataprovider}/event/IPersistedEvent.java (94%) create mode 100644 cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/RenderFrameEvent.java delete mode 100644 cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/event/CollaborationDispatcher.java diff --git a/cave/com.raytheon.uf.viz.collaboration.radar/src/com/raytheon/uf/viz/collaboration/radar/mosaic/DispatchingMosaicImage.java b/cave/com.raytheon.uf.viz.collaboration.radar/src/com/raytheon/uf/viz/collaboration/radar/mosaic/DispatchingMosaicImage.java index 53503b1cda..ef62a14dbb 100644 --- a/cave/com.raytheon.uf.viz.collaboration.radar/src/com/raytheon/uf/viz/collaboration/radar/mosaic/DispatchingMosaicImage.java +++ b/cave/com.raytheon.uf.viz.collaboration.radar/src/com/raytheon/uf/viz/collaboration/radar/mosaic/DispatchingMosaicImage.java @@ -19,12 +19,15 @@ **/ package com.raytheon.uf.viz.collaboration.radar.mosaic; +import java.util.Arrays; + import com.raytheon.uf.viz.core.DrawableImage; import com.raytheon.uf.viz.core.IExtent; import com.raytheon.uf.viz.core.drawables.ColorMapParameters; import com.raytheon.uf.viz.core.drawables.ext.IImagingExtension; import com.raytheon.uf.viz.remote.graphics.Dispatcher; import com.raytheon.uf.viz.remote.graphics.events.RemoteGraphicsEventFactory; +import com.raytheon.uf.viz.remote.graphics.events.imagery.PaintImageEvent; import com.raytheon.uf.viz.remote.graphics.events.imagery.PaintImagesEvent; import com.raytheon.uf.viz.remote.graphics.objects.DispatchingColormappedImage; import com.raytheon.viz.radar.rsc.mosaic.ext.IRadarMosaicImageExtension.IMosaicImage; @@ -50,6 +53,8 @@ import com.raytheon.viz.radar.rsc.mosaic.ext.IRadarMosaicImageExtension.IMosaicI public class DispatchingMosaicImage extends DispatchingColormappedImage implements IMosaicImage { + private PaintImageEvent[] imagesToMosaic; + /** * @param targetObject * @param extensionClass @@ -70,12 +75,17 @@ public class DispatchingMosaicImage extends */ @Override public void setImagesToMosaic(DrawableImage... images) { - UpdateImagesToMosaic event = RemoteGraphicsEventFactory.createEvent( - UpdateImagesToMosaic.class, this); - event.setImagesToMosaic(PaintImagesEvent.toPaintEvents(images)); - wrappedObject.setImagesToMosaic(PaintImagesEvent - .extractTargetImages(images)); - dispatch(event); + PaintImageEvent[] imagesToMosaic = PaintImagesEvent + .toPaintEvents(images); + if (Arrays.equals(imagesToMosaic, this.imagesToMosaic) == false) { + this.imagesToMosaic = imagesToMosaic; + UpdateImagesToMosaic event = RemoteGraphicsEventFactory + .createEvent(UpdateImagesToMosaic.class, this); + event.setImagesToMosaic(imagesToMosaic); + wrappedObject.setImagesToMosaic(PaintImagesEvent + .extractTargetImages(images)); + dispatch(event); + } } /* diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/DataProviderEventController.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/DataProviderEventController.java index 25c09bad26..ee0c00d927 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/DataProviderEventController.java +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/DataProviderEventController.java @@ -45,7 +45,7 @@ import com.raytheon.uf.viz.collaboration.ui.editor.EditorSetup; import com.raytheon.uf.viz.collaboration.ui.editor.SharedEditorData; import com.raytheon.uf.viz.collaboration.ui.editor.SharedResource; import com.raytheon.uf.viz.collaboration.ui.editor.event.InputEvent; -import com.raytheon.uf.viz.collaboration.ui.role.event.CollaborationDispatcher; +import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.CollaborationDispatcher; import com.raytheon.uf.viz.collaboration.ui.rsc.CollaborationWrapperResource; import com.raytheon.uf.viz.collaboration.ui.rsc.CollaborationWrapperResourceData; import com.raytheon.uf.viz.core.IDisplayPane; diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/CollaborationDispatcher.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/CollaborationDispatcher.java new file mode 100644 index 0000000000..2d1c08c1dd --- /dev/null +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/CollaborationDispatcher.java @@ -0,0 +1,200 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.collaboration.ui.role.dataprovider; + +import java.util.ArrayList; + +import com.raytheon.uf.common.serialization.SerializationUtil; +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.Tools; +import com.raytheon.uf.viz.collaboration.ui.Activator; +import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event.IPersistedEvent; +import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event.RenderFrameEvent; +import com.raytheon.uf.viz.core.jobs.JobPool; +import com.raytheon.uf.viz.remote.graphics.AbstractRemoteGraphicsEvent; +import com.raytheon.uf.viz.remote.graphics.Dispatcher; +import com.raytheon.uf.viz.remote.graphics.DispatchingObject; +import com.raytheon.uf.viz.remote.graphics.events.AbstractDispatchingObjectEvent; +import com.raytheon.uf.viz.remote.graphics.events.BeginFrameEvent; +import com.raytheon.uf.viz.remote.graphics.events.EndFrameEvent; +import com.raytheon.uf.viz.remote.graphics.events.ICreationEvent; +import com.raytheon.uf.viz.remote.graphics.events.IRenderEvent; +import com.raytheon.uf.viz.remote.graphics.events.RemoteGraphicsEventFactory; + +/** + * 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 boolean PERSISTENCE = true; + + private static final int IMMEDIATE_SEND_SIZE = 1024; + + private ISharedDisplaySession session; + + private IObjectEventPersistance persistance; + + private DispatchingObject frameObject; + + private RenderFrameEvent previousFrame; + + private RenderFrameEvent currentFrame; + + public CollaborationDispatcher(ISharedDisplaySession session) + throws CollaborationException { + this.session = session; + this.persistance = CollaborationObjectEventStorage + .createPersistanceObject(session); + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.viz.remote.graphics.Dispatcher#dispatch(com.raytheon. + * uf.viz.remote.graphics.AbstractRemoteGraphicsEvent) + */ + @Override + public void dispatch(AbstractRemoteGraphicsEvent eventObject) { + // Set PERSISTENCE to true if testing persisting capabilities + if (PERSISTENCE + && 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 = Tools.compress(SerializationUtil + .transformToThrift(eventObject)); + if (data.length > IMMEDIATE_SEND_SIZE) { + System.err.println("Object: " + + eventObject.getClass().getSimpleName() + + " is too large to send immediately, size is " + + data.length + " bytes"); + immediateSend = false; + } else { + System.out + .println("Object: " + + eventObject.getClass() + .getSimpleName() + + " is small enough to send immediately, size is " + + data.length + " bytes"); + } + } 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 { + 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) { + frameObject = new DispatchingObject(null, this); + currentFrame = RemoteGraphicsEventFactory.createEvent( + RenderFrameEvent.class, frameObject); + } + + currentFrame.addEvent((IRenderEvent) eventObject); + if (eventObject instanceof EndFrameEvent) { + if (currentFrame.equals(previousFrame)) { + // No change in render, send event to render + send(createRenderFrameEvent()); + currentFrame.getRenderEvents().clear(); + } else { + // New info, send current frame with new render events as + // new object to avoid unwanted data pointer manipulation + RenderFrameEvent frameEvent = RemoteGraphicsEventFactory + .createEvent(RenderFrameEvent.class, frameObject); + frameEvent.setRenderEvents(new ArrayList( + currentFrame.getRenderEvents())); + send(frameEvent); + previousFrame = currentFrame; + currentFrame = createRenderFrameEvent(); + } + } + } else { + Activator.statusHandler.handle(Priority.PROBLEM, + "Unable to handle event type: " + eventObject); + } + } + + private RenderFrameEvent createRenderFrameEvent() { + return RemoteGraphicsEventFactory.createEvent(RenderFrameEvent.class, + frameObject); + } + + private void send(Object obj) { + try { + session.sendObjectToVenue(obj); + } catch (CollaborationException e) { + Activator.statusHandler.handle(Priority.PROBLEM, + e.getLocalizedMessage(), e); + } + } + + public void dispose() { + try { + persistance.dispose(); + } catch (CollaborationException e) { + Activator.statusHandler.handle(Priority.PROBLEM, + e.getLocalizedMessage(), e); + } + } +} diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/event/CollaborationObjectEventStorage.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/CollaborationObjectEventStorage.java similarity index 85% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/event/CollaborationObjectEventStorage.java rename to cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/CollaborationObjectEventStorage.java index 5fb531a3c9..d9fb5e7030 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/event/CollaborationObjectEventStorage.java +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/CollaborationObjectEventStorage.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.role.event; +package com.raytheon.uf.viz.collaboration.ui.role.dataprovider; import java.net.URI; @@ -37,6 +37,9 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; 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.Tools; +import com.raytheon.uf.viz.collaboration.ui.Activator; +import com.raytheon.uf.viz.collaboration.ui.prefs.CollabPrefConstants; +import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event.IPersistedEvent; import com.raytheon.uf.viz.remote.graphics.events.AbstractDispatchingObjectEvent; import com.raytheon.uf.viz.remote.graphics.events.DisposeObjectEvent; import com.raytheon.uf.viz.remote.graphics.events.ICreationEvent; @@ -61,6 +64,10 @@ import com.raytheon.uf.viz.remote.graphics.events.ICreationEvent; public class CollaborationObjectEventStorage implements IObjectEventPersistance, IObjectEventRetrieval { + private static final String SESSION_DATA_URL_FORMAT_STRING = "http://%s:%d/session_data/"; + + private static final int SESSION_DATA_PORT = 80; + private volatile long EVENT_ID_COUNTER = 0; public static IObjectEventPersistance createPersistanceObject( @@ -78,8 +85,7 @@ public class CollaborationObjectEventStorage implements private ISharedDisplaySession session; - // TODO: Get Collaboration server to build URL - private String baseUrl = "http://edexproxy:9582/collab/"; + private String sessionDataURL; private HttpClient client; @@ -89,9 +95,18 @@ public class CollaborationObjectEventStorage implements } private void setupStorage() throws CollaborationException { - createFolder(session.getSessionId()); - // Successful creation of session folder, add to base url - baseUrl += session.getSessionId() + "/"; + String collaborationServer = Activator.getDefault() + .getPreferenceStore().getString(CollabPrefConstants.P_SERVER); + if (collaborationServer != null) { + sessionDataURL = String.format(SESSION_DATA_URL_FORMAT_STRING, + collaborationServer, SESSION_DATA_PORT); + createFolder(session.getSessionId()); + // Successful creation of session folder, add to base url + sessionDataURL += session.getSessionId() + "/"; + } else { + throw new CollaborationException( + "Could not retrieve collaboration server from preferences"); + } } /* @@ -108,7 +123,8 @@ public class CollaborationObjectEventStorage implements if (event instanceof ICreationEvent) { createFolder(String.valueOf(event.getObjectId())); } else if (event instanceof DisposeObjectEvent) { - deleteResource(URI.create(baseUrl + event.getObjectId() + "/")); + deleteResource(URI.create(sessionDataURL + event.getObjectId() + + "/")); CollaborationWrappedEvent wrapped = new CollaborationWrappedEvent(); wrapped.setEvent(event); return wrapped; @@ -116,9 +132,10 @@ public class CollaborationObjectEventStorage implements try { CollaborationHttpPersistedEvent wrapped = new CollaborationHttpPersistedEvent(); - String eventObjectURL = baseUrl + event.getObjectId() + "/" + String eventObjectURL = sessionDataURL + event.getObjectId() + "/" + (++EVENT_ID_COUNTER) + ".obj"; HttpPut put = new HttpPut(eventObjectURL); + put.setEntity(new ByteArrayEntity(Tools.compress(SerializationUtil .transformToThrift(event)))); HttpClientResponse response = executeRequest(put); @@ -146,7 +163,7 @@ public class CollaborationObjectEventStorage implements */ @Override public void dispose() throws CollaborationException { - deleteResource(URI.create(baseUrl)); + deleteResource(URI.create(sessionDataURL)); } /* @@ -208,7 +225,7 @@ public class CollaborationObjectEventStorage implements return "MKCOL"; } }; - mkcol.setURI(URI.create(baseUrl + folderPath)); + mkcol.setURI(URI.create(sessionDataURL + folderPath)); HttpClientResponse rsp = executeRequest(mkcol); if (rsp.code != 201) { throw new CollaborationException("Folder creation failed for " @@ -218,8 +235,10 @@ public class CollaborationObjectEventStorage implements private void deleteResource(URI uri) throws CollaborationException { HttpClientResponse rsp = executeRequest(new HttpDelete(uri)); - // Valid DELETE return codes are 200, 202, and 204 - if (rsp.code != 200 && rsp.code != 202 && rsp.code != 204) { + // Valid DELETE return codes are 200, 202, and 204, 404 means resource + // has already been deleted + if (rsp.code != 200 && rsp.code != 202 && rsp.code != 204 + && rsp.code != 404) { throw new CollaborationException("Folder creation failed for " + uri + ": " + new String(rsp.data)); } diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/event/IObjectEventPersistance.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/IObjectEventPersistance.java similarity index 90% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/event/IObjectEventPersistance.java rename to cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/IObjectEventPersistance.java index 70016226df..a2be7e3105 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/event/IObjectEventPersistance.java +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/IObjectEventPersistance.java @@ -17,9 +17,10 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.role.event; +package com.raytheon.uf.viz.collaboration.ui.role.dataprovider; import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException; +import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event.IPersistedEvent; import com.raytheon.uf.viz.remote.graphics.events.AbstractDispatchingObjectEvent; /** diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/event/IObjectEventRetrieval.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/IObjectEventRetrieval.java similarity index 91% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/event/IObjectEventRetrieval.java rename to cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/IObjectEventRetrieval.java index 02fd763d7b..feef2b81f9 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/event/IObjectEventRetrieval.java +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/IObjectEventRetrieval.java @@ -17,9 +17,10 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.role.event; +package com.raytheon.uf.viz.collaboration.ui.role.dataprovider; import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException; +import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event.IPersistedEvent; import com.raytheon.uf.viz.remote.graphics.events.AbstractDispatchingObjectEvent; /** diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/event/IPersistedEvent.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/IPersistedEvent.java similarity index 94% rename from cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/event/IPersistedEvent.java rename to cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/IPersistedEvent.java index 4dd2e78a62..aaf58bbb93 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/event/IPersistedEvent.java +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/IPersistedEvent.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.collaboration.ui.role.event; +package com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event; /** * Interface for distinguishing events that are persisted and should be diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/RenderFrameEvent.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/RenderFrameEvent.java new file mode 100644 index 0000000000..bbf54f54e9 --- /dev/null +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/dataprovider/event/RenderFrameEvent.java @@ -0,0 +1,93 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.collaboration.ui.role.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.IRenderEvent; + +/** + * TODO Add Description + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 24, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ +@DynamicSerialize +public class RenderFrameEvent extends AbstractDispatchingObjectEvent { + + @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; + } + + public void addEvent(IRenderEvent event) { + renderEvents.add(event); + } + + /* + * (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; + RenderFrameEvent other = (RenderFrameEvent) obj; + if (renderEvents == null) { + if (other.renderEvents != null) + return false; + } else if (!renderEvents.equals(other.renderEvents)) + return false; + return true; + } + +} diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/event/CollaborationDispatcher.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/event/CollaborationDispatcher.java deleted file mode 100644 index dabfd06992..0000000000 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/event/CollaborationDispatcher.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.viz.collaboration.ui.role.event; - -import com.raytheon.uf.common.status.UFStatus.Priority; -import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException; -import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession; -import com.raytheon.uf.viz.collaboration.ui.Activator; -import com.raytheon.uf.viz.core.jobs.JobPool; -import com.raytheon.uf.viz.remote.graphics.AbstractRemoteGraphicsEvent; -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.ICreationEvent; -import com.raytheon.uf.viz.remote.graphics.events.IRenderEvent; - -/** - * 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 ISharedDisplaySession session; - - private IObjectEventPersistance persistance; - - public CollaborationDispatcher(ISharedDisplaySession session) - throws CollaborationException { - this.session = session; - this.persistance = CollaborationObjectEventStorage - .createPersistanceObject(session); - } - - private static final boolean PERSISTENCE = false; - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.viz.remote.graphics.Dispatcher#dispatch(com.raytheon. - * uf.viz.remote.graphics.AbstractRemoteGraphicsEvent) - */ - @Override - public void dispatch(AbstractRemoteGraphicsEvent eventObject) { - // Set PERSISTENCE to true if testing persisting capabilities - if (PERSISTENCE - && eventObject instanceof AbstractDispatchingObjectEvent - && eventObject instanceof IRenderEvent == false) { - final AbstractDispatchingObjectEvent toPersist = (AbstractDispatchingObjectEvent) eventObject; - persistPool.schedule(new Runnable() { - @Override - public void run() { - try { - IPersistedEvent event = persistance - .persistEvent(toPersist); - // Creation events are sent immediately to avoid false - // negatives - if (toPersist instanceof ICreationEvent == false) { - send(event); - } - } catch (CollaborationException e) { - Activator.statusHandler.handle(Priority.PROBLEM, - e.getLocalizedMessage(), e); - } - } - }); - if (eventObject instanceof ICreationEvent) { - send(eventObject); - } - } else { - send(eventObject); - } - } - - private void send(Object obj) { - try { - session.sendObjectToVenue(obj); - } catch (CollaborationException e) { - Activator.statusHandler.handle(Priority.PROBLEM, - e.getLocalizedMessage(), e); - } - } - - public void dispose() { - try { - persistance.dispose(); - } catch (CollaborationException e) { - Activator.statusHandler.handle(Priority.PROBLEM, - e.getLocalizedMessage(), e); - } - } -} diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/CollaborationResource.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/CollaborationResource.java index 03b2a8360f..921c376747 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/CollaborationResource.java +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/CollaborationResource.java @@ -30,7 +30,8 @@ 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.ui.Activator; -import com.raytheon.uf.viz.collaboration.ui.role.event.IPersistedEvent; +import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event.IPersistedEvent; +import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event.RenderFrameEvent; import com.raytheon.uf.viz.collaboration.ui.rsc.rendering.CollaborationRenderingDataManager; import com.raytheon.uf.viz.collaboration.ui.rsc.rendering.CollaborationRenderingHandler; import com.raytheon.uf.viz.core.IGraphicsTarget; @@ -142,6 +143,24 @@ public class CollaborationResource extends } } + @Subscribe + public void renderFrameEvent(RenderFrameEvent event) { + List eventList = event.getRenderEvents(); + if (eventList == null) { + // Check for previous event list + event = dataManager.getRenderableObject(event.getObjectId(), + RenderFrameEvent.class); + } else { + dataManager.putRenderableObject(event.getObjectId(), event); + } + if (event != null) { + for (IRenderEvent re : event.getRenderEvents()) { + // TODO: Unsafe casting, figure better way + renderableArrived((AbstractRemoteGraphicsEvent) re); + } + } + } + @Subscribe public void persitableArrived(final IPersistedEvent event) { retrievePool.schedule(new Runnable() { diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/CollaborationRenderingDataManager.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/CollaborationRenderingDataManager.java index 0d22020249..c10d6eec61 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/CollaborationRenderingDataManager.java +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/CollaborationRenderingDataManager.java @@ -39,9 +39,9 @@ import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException; import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession; import com.raytheon.uf.viz.collaboration.ui.Activator; -import com.raytheon.uf.viz.collaboration.ui.role.event.CollaborationObjectEventStorage; -import com.raytheon.uf.viz.collaboration.ui.role.event.IObjectEventRetrieval; -import com.raytheon.uf.viz.collaboration.ui.role.event.IPersistedEvent; +import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.CollaborationObjectEventStorage; +import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.IObjectEventRetrieval; +import com.raytheon.uf.viz.collaboration.ui.role.dataprovider.event.IPersistedEvent; import com.raytheon.uf.viz.core.IGraphicsTarget; import com.raytheon.uf.viz.core.drawables.PaintProperties; import com.raytheon.uf.viz.remote.graphics.events.AbstractDispatchingObjectEvent; diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/AbstractRemoteGraphicsEvent.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/AbstractRemoteGraphicsEvent.java index ac85d1f1b5..0f635f1aa0 100644 --- a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/AbstractRemoteGraphicsEvent.java +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/AbstractRemoteGraphicsEvent.java @@ -39,7 +39,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * @version 1.0 */ @DynamicSerialize -public class AbstractRemoteGraphicsEvent { +public abstract class AbstractRemoteGraphicsEvent { @DynamicSerializeElement private int displayId; diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/DispatchingObject.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/DispatchingObject.java index eba4906c77..12f140959a 100644 --- a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/DispatchingObject.java +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/DispatchingObject.java @@ -19,7 +19,6 @@ **/ package com.raytheon.uf.viz.remote.graphics; - /** * TODO Add Description * @@ -45,7 +44,7 @@ public class DispatchingObject { protected T wrappedObject; - protected DispatchingObject(T targetObject, Dispatcher dispatcher) { + public DispatchingObject(T targetObject, Dispatcher dispatcher) { this.wrappedObject = targetObject; this.dispatcher = dispatcher; objectId = dispatcher.newObjectId(); diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/BeginFrameEvent.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/BeginFrameEvent.java index 4997d4f0d7..5aca1090d1 100644 --- a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/BeginFrameEvent.java +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/BeginFrameEvent.java @@ -19,6 +19,8 @@ **/ package com.raytheon.uf.viz.remote.graphics.events; +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.AbstractRemoteGraphicsEvent; @@ -79,4 +81,26 @@ public class BeginFrameEvent extends AbstractRemoteGraphicsEvent implements this.extentCenter = extentCenter; } + /* + * (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; + BeginFrameEvent other = (BeginFrameEvent) obj; + if (!Arrays.equals(extentCenter, other.extentCenter)) + return false; + if (Double.doubleToLongBits(extentFactor) != Double + .doubleToLongBits(other.extentFactor)) + return false; + return true; + } + } diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/EndFrameEvent.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/EndFrameEvent.java index 117de65636..7768e6415e 100644 --- a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/EndFrameEvent.java +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/EndFrameEvent.java @@ -42,4 +42,20 @@ import com.raytheon.uf.viz.remote.graphics.AbstractRemoteGraphicsEvent; public class EndFrameEvent extends AbstractRemoteGraphicsEvent implements IRenderEvent { + /* + * (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.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/IRenderEvent.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/IRenderEvent.java index 8f853610ec..458413ca6b 100644 --- a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/IRenderEvent.java +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/IRenderEvent.java @@ -22,7 +22,7 @@ package com.raytheon.uf.viz.remote.graphics.events; /** * Interface for objects that events for actually rendering an object. These * types of events can be skipped over unlike data events which are required to - * execute at some point + * execute at some point. Render events must implements equals * *
  * 
@@ -40,4 +40,7 @@ package com.raytheon.uf.viz.remote.graphics.events;
 
 public interface IRenderEvent {
 
+    @Override
+    public abstract boolean equals(Object obj);
+
 }
diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/imagery/PaintImageEvent.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/imagery/PaintImageEvent.java
index 2c32602515..cbd8c393dd 100644
--- a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/imagery/PaintImageEvent.java
+++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/imagery/PaintImageEvent.java
@@ -142,4 +142,48 @@ public class PaintImageEvent extends AbstractDispatchingObjectEvent implements
         this.ur = coverage.getUr();
         this.ul = coverage.getUl();
     }
+
+    /*
+     * (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;
+        PaintImageEvent other = (PaintImageEvent) obj;
+        if (meshId == other.meshId && meshId != -1) {
+            // If meshes are set, compare them only
+            return true;
+        } else if (meshId == other.meshId) {
+            // Compare extents if no meshes set (-1)
+            if (ll == null) {
+                if (other.ll != null)
+                    return false;
+            } else if (!ll.equals(other.ll))
+                return false;
+            if (lr == null) {
+                if (other.lr != null)
+                    return false;
+            } else if (!lr.equals(other.lr))
+                return false;
+            if (ul == null) {
+                if (other.ul != null)
+                    return false;
+            } else if (!ul.equals(other.ul))
+                return false;
+            if (ur == null) {
+                if (other.ur != null)
+                    return false;
+            } else if (!ur.equals(other.ur))
+                return false;
+        }
+        return true;
+    }
+
 }
diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/imagery/PaintImagesEvent.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/imagery/PaintImagesEvent.java
index 0cceb0b1c8..37bc5a9c47 100644
--- a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/imagery/PaintImagesEvent.java
+++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/imagery/PaintImagesEvent.java
@@ -19,6 +19,8 @@
  **/
 package com.raytheon.uf.viz.remote.graphics.events.imagery;
 
+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.core.DrawableImage;
@@ -152,4 +154,26 @@ public class PaintImagesEvent extends AbstractRemoteGraphicsEvent implements
         }
         return targeted;
     }
+
+    /*
+     * (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;
+        PaintImagesEvent other = (PaintImagesEvent) obj;
+        if (Float.floatToIntBits(alpha) != Float.floatToIntBits(other.alpha))
+            return false;
+        if (!Arrays.equals(imageEvents, other.imageEvents))
+            return false;
+        return true;
+    }
+
 }
diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/offscreen/RenderOffscreenEvent.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/offscreen/RenderOffscreenEvent.java
index c78f849788..812c70a444 100644
--- a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/offscreen/RenderOffscreenEvent.java
+++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/offscreen/RenderOffscreenEvent.java
@@ -19,6 +19,8 @@
  **/
 package com.raytheon.uf.viz.remote.graphics.events.offscreen;
 
+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.core.IExtent;
@@ -86,4 +88,23 @@ public class RenderOffscreenEvent extends AbstractDispatchingObjectEvent
         }
     }
 
+    /*
+     * (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;
+        RenderOffscreenEvent other = (RenderOffscreenEvent) obj;
+        if (!Arrays.equals(extent, other.extent))
+            return false;
+        return true;
+    }
+
 }
diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/offscreen/RenderOnscreenEvent.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/offscreen/RenderOnscreenEvent.java
index c84384e2e5..c5e3a959c0 100644
--- a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/offscreen/RenderOnscreenEvent.java
+++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/offscreen/RenderOnscreenEvent.java
@@ -43,4 +43,20 @@ import com.raytheon.uf.viz.remote.graphics.events.IRenderEvent;
 public class RenderOnscreenEvent extends AbstractRemoteGraphicsEvent implements
         IRenderEvent {
 
+    /*
+     * (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.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/wireframe/RenderWireframeShapeEvent.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/wireframe/RenderWireframeShapeEvent.java
index 5a94a87a81..f642d1086d 100644
--- a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/wireframe/RenderWireframeShapeEvent.java
+++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/wireframe/RenderWireframeShapeEvent.java
@@ -188,4 +188,52 @@ public class RenderWireframeShapeEvent extends AbstractDispatchingObjectEvent
         }
         return color;
     }
+
+    /*
+     * (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;
+        RenderWireframeShapeEvent other = (RenderWireframeShapeEvent) obj;
+        if (alpha == null) {
+            if (other.alpha != null)
+                return false;
+        } else if (!alpha.equals(other.alpha))
+            return false;
+        if (blue == null) {
+            if (other.blue != null)
+                return false;
+        } else if (!blue.equals(other.blue))
+            return false;
+        if (fontId == null) {
+            if (other.fontId != null)
+                return false;
+        } else if (!fontId.equals(other.fontId))
+            return false;
+        if (green == null) {
+            if (other.green != null)
+                return false;
+        } else if (!green.equals(other.green))
+            return false;
+        if (lineStyle != other.lineStyle)
+            return false;
+        if (Float.floatToIntBits(lineWidth) != Float
+                .floatToIntBits(other.lineWidth))
+            return false;
+        if (red == null) {
+            if (other.red != null)
+                return false;
+        } else if (!red.equals(other.red))
+            return false;
+        return true;
+    }
+
 }