From ac1fc79f5b4f3d2eebfb8f21591c3726b1405f62 Mon Sep 17 00:00:00 2001 From: Max Schenkelberg Date: Tue, 3 Apr 2012 15:11:20 -0500 Subject: [PATCH] Issue #239 Start of remote target capabilities Former-commit-id: d2d03e2c64d58a15a131d58484c226dfd4d94625 [formerly 30b76609cff9a737b8e4190bbfebb5a37a259fad] Former-commit-id: 6c411ffb07d5480ec98b7ee8bb518e763f9f6918 --- .../feature.xml | 7 + .../ext/IOffscreenRenderingExtension.java | 10 + .../.classpath | 7 + .../.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 8 + .../META-INF/MANIFEST.MF | 18 + .../build.properties | 4 + .../plugin.xml | 32 + .../graphics/AbstractRemoteGraphicsEvent.java | 62 + .../uf/viz/remote/graphics/Activator.java | 66 + .../graphics/DispatchGraphicsTarget.java | 1158 +++++++++++++++++ .../uf/viz/remote/graphics/Dispatcher.java | 68 + .../remote/graphics/DispatcherFactory.java | 49 + .../graphics/DispatchingGraphicsFactory.java | 182 +++ .../remote/graphics/DispatchingObject.java | 70 + .../AbstractDispatchingObjectEvent.java | 72 + .../graphics/events/BeginFrameEvent.java | 63 + .../graphics/events/DisposeImageEvent.java | 43 + .../remote/graphics/events/EndFrameEvent.java | 44 + .../events/RemoteGraphicsEventFactory.java | 60 + .../graphics/events/RenderedImageEvent.java | 116 ++ .../graphics/events/UpdateImageDataEvent.java | 94 ++ .../events/colormap/ColorMapDataEvent.java | 175 +++ .../colormap/CreateColormappedImageEvent.java | 64 + .../UpdateColorMapParametersEvent.java | 307 +++++ .../graphics/events/mesh/CreateMeshEvent.java | 84 ++ .../events/mesh/DisposeMeshEvent.java | 44 + .../events/mesh/ReprojectMeshEvent.java | 63 + .../offscreen/CreateOffscreenImageEvent.java | 101 ++ .../offscreen/RenderOffscreenEvent.java | 45 + .../events/offscreen/RenderOnscreenEvent.java | 44 + .../events/paint/PaintImageEvent.java | 143 ++ .../events/paint/PaintImagesEvent.java | 63 + .../events/wireframe/AllocatePointsEvent.java | 63 + .../wireframe/CreateWireframeShapeEvent.java | 147 +++ .../wireframe/SimpleWireframeShapeEvent.java | 67 + .../wireframe/UpdateWireframeShapeEvent.java | 63 + .../events/wireframe/WireframeShapeData.java | 139 ++ .../AbstractDispatchingImageExtension.java | 127 ++ .../DispatchColormappedImageExtension.java | 80 ++ .../DispatchingImagingExtension.java | 44 + .../DispatchingMapMeshExtension.java | 106 ++ ...ispatchingOffscreenRenderingExtension.java | 169 +++ .../AbstractDispatchingColormappedImage.java | 100 ++ .../objects/AbstractDispatchingImage.java | 186 +++ .../objects/DispatchingColormappedImage.java | 149 +++ .../graphics/objects/DispatchingImage.java | 89 ++ .../graphics/objects/DispatchingMesh.java | 104 ++ .../objects/DispatchingOffscreenImage.java | 87 ++ .../objects/DispatchingWireframeShape.java | 241 ++++ .../remote/graphics/objects/ViewWrapper.java | 353 +++++ .../gl/ext/GLOffscreenRenderingExtension.java | 21 + .../viz/satellite/rsc/SatBlendedResource.java | 10 +- .../DynamicSerializationManager.java | 6 + .../adapters/GridGeometryAdapter.java | 68 +- 55 files changed, 5806 insertions(+), 7 deletions(-) mode change 100755 => 100644 cave/com.raytheon.uf.viz.collaboration.feature/feature.xml create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/.classpath create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/.project create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/.settings/org.eclipse.jdt.core.prefs create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/META-INF/MANIFEST.MF create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/build.properties create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/plugin.xml create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/AbstractRemoteGraphicsEvent.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/Activator.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/DispatchGraphicsTarget.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/Dispatcher.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/DispatcherFactory.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/DispatchingGraphicsFactory.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/DispatchingObject.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/AbstractDispatchingObjectEvent.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/BeginFrameEvent.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/DisposeImageEvent.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/EndFrameEvent.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/RemoteGraphicsEventFactory.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/RenderedImageEvent.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/UpdateImageDataEvent.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/colormap/ColorMapDataEvent.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/colormap/CreateColormappedImageEvent.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/colormap/UpdateColorMapParametersEvent.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/mesh/CreateMeshEvent.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/mesh/DisposeMeshEvent.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/mesh/ReprojectMeshEvent.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/offscreen/CreateOffscreenImageEvent.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/offscreen/RenderOffscreenEvent.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/offscreen/RenderOnscreenEvent.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/paint/PaintImageEvent.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/paint/PaintImagesEvent.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/wireframe/AllocatePointsEvent.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/wireframe/CreateWireframeShapeEvent.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/wireframe/SimpleWireframeShapeEvent.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/wireframe/UpdateWireframeShapeEvent.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/wireframe/WireframeShapeData.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/extensions/AbstractDispatchingImageExtension.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/extensions/DispatchColormappedImageExtension.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/extensions/DispatchingImagingExtension.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/extensions/DispatchingMapMeshExtension.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/extensions/DispatchingOffscreenRenderingExtension.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/objects/AbstractDispatchingColormappedImage.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/objects/AbstractDispatchingImage.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/objects/DispatchingColormappedImage.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/objects/DispatchingImage.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/objects/DispatchingMesh.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/objects/DispatchingOffscreenImage.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/objects/DispatchingWireframeShape.java create mode 100644 cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/objects/ViewWrapper.java diff --git a/cave/com.raytheon.uf.viz.collaboration.feature/feature.xml b/cave/com.raytheon.uf.viz.collaboration.feature/feature.xml old mode 100755 new mode 100644 index b0c50de749..31a230a6e5 --- a/cave/com.raytheon.uf.viz.collaboration.feature/feature.xml +++ b/cave/com.raytheon.uf.viz.collaboration.feature/feature.xml @@ -114,4 +114,11 @@ version="0.0.0" unpack="false"/> + + diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/drawables/ext/IOffscreenRenderingExtension.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/drawables/ext/IOffscreenRenderingExtension.java index 778028c21f..afd36b1ff3 100644 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/drawables/ext/IOffscreenRenderingExtension.java +++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/drawables/ext/IOffscreenRenderingExtension.java @@ -27,6 +27,16 @@ public interface IOffscreenRenderingExtension extends */ public void renderOnscreen() throws VizException; + /** + * Construct an offscreen image with the specified dimensions. This image + * will be an RGB based image + * + * @param dimensions + * @return + * @throws VizException + */ + public IImage constructOffscreenImage(int[] dimensions) throws VizException; + /** * Construct an offscreen image for given Buffer type and size * diff --git a/cave/com.raytheon.uf.viz.remote.graphics/.classpath b/cave/com.raytheon.uf.viz.remote.graphics/.classpath new file mode 100644 index 0000000000..1fa3e6803d --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/cave/com.raytheon.uf.viz.remote.graphics/.project b/cave/com.raytheon.uf.viz.remote.graphics/.project new file mode 100644 index 0000000000..e4af29ece0 --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/.project @@ -0,0 +1,28 @@ + + + com.raytheon.uf.viz.remote.graphics + + + + + + 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.remote.graphics/.settings/org.eclipse.jdt.core.prefs b/cave/com.raytheon.uf.viz.remote.graphics/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..bb4ea4f95f --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Mon Mar 05 15:58:59 CST 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.remote.graphics/META-INF/MANIFEST.MF b/cave/com.raytheon.uf.viz.remote.graphics/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..dd521c13e0 --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/META-INF/MANIFEST.MF @@ -0,0 +1,18 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Remote Graphics +Bundle-SymbolicName: com.raytheon.uf.viz.remote.graphics;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Activator: com.raytheon.uf.viz.remote.graphics.Activator +Bundle-Vendor: RAYTHEON +Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + com.raytheon.uf.viz.core;bundle-version="1.12.1174", + org.geotools;bundle-version="2.6.4", + com.raytheon.uf.common.colormap;bundle-version="1.12.1174", + com.raytheon.viz.ui;bundle-version="1.12.1174", + javax.vecmath;bundle-version="1.3.1" +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Bundle-ActivationPolicy: lazy +Export-Package: com.raytheon.uf.viz.remote.graphics diff --git a/cave/com.raytheon.uf.viz.remote.graphics/build.properties b/cave/com.raytheon.uf.viz.remote.graphics/build.properties new file mode 100644 index 0000000000..34d2e4d2da --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/build.properties @@ -0,0 +1,4 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + . diff --git a/cave/com.raytheon.uf.viz.remote.graphics/plugin.xml b/cave/com.raytheon.uf.viz.remote.graphics/plugin.xml new file mode 100644 index 0000000000..51fedf2507 --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/plugin.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + \ No newline at end of file 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 new file mode 100644 index 0000000000..ac85d1f1b5 --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/AbstractRemoteGraphicsEvent.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.remote.graphics; + +import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; +import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; + +/** + * TODO Add Description + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 8, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ +@DynamicSerialize +public class AbstractRemoteGraphicsEvent { + + @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.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/Activator.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/Activator.java new file mode 100644 index 0000000000..13f833a4b6 --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/Activator.java @@ -0,0 +1,66 @@ +package com.raytheon.uf.viz.remote.graphics; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +import com.raytheon.uf.common.status.IUFStatusHandler; +import com.raytheon.uf.common.status.UFStatus; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + public static final IUFStatusHandler statusHandler = UFStatus + .getHandler(Activator.class); + + // The plug-in ID + public static final String PLUGIN_ID = "com.raytheon.uf.viz.remote.graphics"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext + * ) + */ + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext + * ) + */ + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + public static IUFStatusHandler getStatusHandler() { + return statusHandler; + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/DispatchGraphicsTarget.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/DispatchGraphicsTarget.java new file mode 100644 index 0000000000..a598380582 --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/DispatchGraphicsTarget.java @@ -0,0 +1,1158 @@ +/** + * 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.remote.graphics; + +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.awt.image.RenderedImage; +import java.io.File; +import java.util.Collection; + +import org.eclipse.swt.graphics.RGB; +import org.geotools.coverage.grid.GeneralGridGeometry; + +import com.raytheon.uf.common.colormap.IColorMap; +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.core.DrawableCircle; +import com.raytheon.uf.viz.core.DrawableColorMap; +import com.raytheon.uf.viz.core.DrawableImage; +import com.raytheon.uf.viz.core.DrawableLine; +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.PixelCoverage; +import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback; +import com.raytheon.uf.viz.core.data.IColormappedDataPreparer; +import com.raytheon.uf.viz.core.data.IDataPreparer; +import com.raytheon.uf.viz.core.data.IImageDataPreparer; +import com.raytheon.uf.viz.core.data.IRenderedImageCallback; +import com.raytheon.uf.viz.core.data.resp.NumericImageData; +import com.raytheon.uf.viz.core.drawables.ColorMapParameters; +import com.raytheon.uf.viz.core.drawables.IDescriptor; +import com.raytheon.uf.viz.core.drawables.IFont; +import com.raytheon.uf.viz.core.drawables.IFont.Style; +import com.raytheon.uf.viz.core.drawables.IImage; +import com.raytheon.uf.viz.core.drawables.IRenderableDisplay; +import com.raytheon.uf.viz.core.drawables.IShadedShape; +import com.raytheon.uf.viz.core.drawables.IWireframeShape; +import com.raytheon.uf.viz.core.drawables.ImagingSupport; +import com.raytheon.uf.viz.core.drawables.PaintProperties; +import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension.IGraphicsExtensionInterface; +import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtensionManager; +import com.raytheon.uf.viz.core.drawables.ext.IOffscreenRenderingExtension; +import com.raytheon.uf.viz.core.drawables.ext.colormap.IColormappedImageExtension; +import com.raytheon.uf.viz.core.exception.VizException; +import com.raytheon.uf.viz.core.geom.PixelCoordinate; +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.RemoteGraphicsEventFactory; +import com.raytheon.uf.viz.remote.graphics.events.wireframe.CreateWireframeShapeEvent; +import com.raytheon.uf.viz.remote.graphics.objects.DispatchingImage; +import com.raytheon.uf.viz.remote.graphics.objects.DispatchingImage.DispatchingRenderedImageCallback; +import com.raytheon.uf.viz.remote.graphics.objects.DispatchingWireframeShape; +import com.vividsolutions.jts.geom.LinearRing; + +/** + * Graphics target that uses a dispatcher for dispatching graphics events. These + * events involve rendering and creating render objects + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Feb 28, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ + +public class DispatchGraphicsTarget extends DispatchingObject + implements IGraphicsTarget { + + private static final transient IUFStatusHandler statusHandler = UFStatus + .getHandler(DispatchGraphicsTarget.class); + + private GraphicsExtensionManager extensionManager; + + public DispatchGraphicsTarget(IGraphicsTarget target, Dispatcher dispatcher) { + super(target, dispatcher); + extensionManager = new GraphicsExtensionManager(this); + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.viz.core.IGraphicsTarget#initializeRaster(com.raytheon + * .uf.viz.core.data.IDataPreparer, + * com.raytheon.uf.viz.core.drawables.ColorMapParameters) + */ + @Override + public IImage initializeRaster(IDataPreparer preparer, + ColorMapParameters optionalParams) { + IImage rval = null; + if (optionalParams == null) { + // Assume IImageDataPreparer + final IImageDataPreparer imagePreparer = (IImageDataPreparer) preparer; + rval = initializeRaster(new IRenderedImageCallback() { + @Override + public RenderedImage getImage() throws VizException { + return imagePreparer.prepareData().getImage(); + } + }); + } else if (preparer instanceof IColormappedDataPreparer) { + try { + IColormappedImageExtension cmapExt = getExtension(IColormappedImageExtension.class); + final IColormappedDataPreparer cmapPreparer = (IColormappedDataPreparer) preparer; + rval = cmapExt.initializeRaster( + new IColorMapDataRetrievalCallback() { + @Override + public ColorMapData getColorMapData() + throws VizException { + NumericImageData oldData = cmapPreparer + .prepareData(); + return new ColorMapData( + oldData.getData(), + new int[] { + oldData.getDatasetBounds().width, + oldData.getDatasetBounds().height }); + } + + }, optionalParams); + } catch (VizException e) { + statusHandler.handle(Priority.PROBLEM, + "Error constructing creating image", e); + } + } + return rval; + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.viz.core.IGraphicsTarget#initializeRaster(com.raytheon + * .uf.viz.core.data.IRenderedImageCallback) + */ + @Override + public IImage initializeRaster(IRenderedImageCallback imageCallback) { + // Create callback wrapper + DispatchingRenderedImageCallback wrappedCallback = new DispatchingRenderedImageCallback( + imageCallback); + // Create image from wrapped target and return DispatchingImage + return new DispatchingImage( + wrappedObject.initializeRaster(wrappedCallback), + wrappedCallback, getDispatcher()); + } + + /** + * @param font + * @return + * @see com.raytheon.uf.viz.core.IGraphicsTarget#initializeFont(java.lang.String) + */ + public IFont initializeFont(String font) { + return wrappedObject.initializeFont(font); + } + + /** + * @param fontName + * @param size + * @param styles + * @return + * @see com.raytheon.uf.viz.core.IGraphicsTarget#initializeFont(java.lang.String, + * float, com.raytheon.uf.viz.core.drawables.IFont.Style[]) + */ + public IFont initializeFont(String fontName, float size, Style[] styles) { + return wrappedObject.initializeFont(fontName, size, styles); + } + + /** + * @param fontFile + * @param size + * @param styles + * @return + * @see com.raytheon.uf.viz.core.IGraphicsTarget#initializeFont(java.io.File, + * float, com.raytheon.uf.viz.core.drawables.IFont.Style[]) + */ + public IFont initializeFont(File fontFile, float size, Style[] styles) { + return wrappedObject.initializeFont(fontFile, size, styles); + } + + /** + * @param image + * @param extent + * @param paintProps + * @return + * @throws VizException + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawRaster(com.raytheon.uf.viz.core.drawables.IImage, + * com.raytheon.uf.viz.core.PixelCoverage, + * com.raytheon.uf.viz.core.drawables.PaintProperties) + */ + public boolean drawRaster(IImage image, PixelCoverage extent, + PaintProperties paintProps) throws VizException { + DrawableImage di = new DrawableImage(image, extent); + return drawRasters(paintProps, di); + } + + /** + * @param paintProps + * @param images + * @return + * @throws VizException + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawRasters(com.raytheon.uf.viz.core.drawables.PaintProperties, + * com.raytheon.uf.viz.core.DrawableImage[]) + */ + public boolean drawRasters(PaintProperties paintProps, + DrawableImage... images) throws VizException { + return ImagingSupport.drawRasters(this, paintProps, images); + } + + /** + * @param image + * @param extent + * @param paintProps + * @param mode + * @return + * @throws VizException + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawRaster(com.raytheon.uf.viz.core.drawables.IImage, + * com.raytheon.uf.viz.core.PixelCoverage, + * com.raytheon.uf.viz.core.drawables.PaintProperties, + * com.raytheon.uf.viz.core.IGraphicsTarget.RasterMode) + */ + public boolean drawRaster(IImage image, PixelCoverage extent, + PaintProperties paintProps, RasterMode mode) throws VizException { + DrawableImage di = new DrawableImage(image, extent); + di.setMode(mode); + return drawRasters(paintProps, di); + } + + /** + * @param parameters + * @throws VizException + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawStrings(com.raytheon.uf.viz.core.DrawableString[]) + */ + public void drawStrings(DrawableString... parameters) throws VizException { + wrappedObject.drawStrings(parameters); + } + + /** + * @param parameters + * @throws VizException + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawStrings(java.util.Collection) + */ + public void drawStrings(Collection parameters) + throws VizException { + wrappedObject.drawStrings(parameters); + } + + /** + * @param parameters + * @return + * @see com.raytheon.uf.viz.core.IGraphicsTarget#getStringsBounds(com.raytheon.uf.viz.core.DrawableString) + */ + public Rectangle2D getStringsBounds(DrawableString parameters) { + return wrappedObject.getStringsBounds(parameters); + } + + /** + * @param parameters + * @param string + * @return + * @see com.raytheon.uf.viz.core.IGraphicsTarget#getStringsBounds(com.raytheon.uf.viz.core.DrawableString, + * java.lang.String) + */ + public Rectangle2D getStringsBounds(DrawableString parameters, String string) { + return wrappedObject.getStringsBounds(parameters, string); + } + + /** + * @param shape + * @param alpha + * @throws VizException + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawShadedShape(com.raytheon.uf.viz.core.drawables.IShadedShape, + * float) + */ + public void drawShadedShape(IShadedShape shape, float alpha) + throws VizException { + wrappedObject.drawShadedShape(shape, alpha); + } + + /** + * @param shape + * @param alpha + * @param brightness + * @throws VizException + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawShadedShape(com.raytheon.uf.viz.core.drawables.IShadedShape, + * float, float) + */ + public void drawShadedShape(IShadedShape shape, float alpha, + float brightness) throws VizException { + wrappedObject.drawShadedShape(shape, alpha, brightness); + } + + /** + * @param alpha + * @param brightness + * @param shapes + * @throws VizException + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawShadedShapes(float, + * float, com.raytheon.uf.viz.core.drawables.IShadedShape[]) + */ + public void drawShadedShapes(float alpha, float brightness, + IShadedShape... shapes) throws VizException { + wrappedObject.drawShadedShapes(alpha, brightness, shapes); + } + + /** + * @param shape + * @param color + * @param lineWidth + * @throws VizException + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawWireframeShape(com.raytheon.uf.viz.core.drawables.IWireframeShape, + * org.eclipse.swt.graphics.RGB, float) + */ + public void drawWireframeShape(IWireframeShape shape, RGB color, + float lineWidth) throws VizException { + wrappedObject.drawWireframeShape(shape, color, lineWidth); + } + + /** + * @param shape + * @param color + * @param lineWidth + * @param lineStyle + * @throws VizException + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawWireframeShape(com.raytheon.uf.viz.core.drawables.IWireframeShape, + * org.eclipse.swt.graphics.RGB, float, + * com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle) + */ + public void drawWireframeShape(IWireframeShape shape, RGB color, + float lineWidth, LineStyle lineStyle) throws VizException { + wrappedObject.drawWireframeShape(shape, color, lineWidth, lineStyle); + } + + /** + * @param shape + * @param color + * @param lineWidth + * @param lineStyle + * @param alpha + * @throws VizException + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawWireframeShape(com.raytheon.uf.viz.core.drawables.IWireframeShape, + * org.eclipse.swt.graphics.RGB, float, + * com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle, float) + */ + public void drawWireframeShape(IWireframeShape shape, RGB color, + float lineWidth, LineStyle lineStyle, float alpha) + throws VizException { + wrappedObject.drawWireframeShape(shape, color, lineWidth, lineStyle, + alpha); + } + + /** + * @param shape + * @param color + * @param lineWidth + * @param lineStyle + * @param font + * @throws VizException + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawWireframeShape(com.raytheon.uf.viz.core.drawables.IWireframeShape, + * org.eclipse.swt.graphics.RGB, float, + * com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle, + * com.raytheon.uf.viz.core.drawables.IFont) + */ + public void drawWireframeShape(IWireframeShape shape, RGB color, + float lineWidth, LineStyle lineStyle, IFont font) + throws VizException { + wrappedObject.drawWireframeShape(shape, color, lineWidth, lineStyle, + font); + } + + /** + * @param shape + * @param color + * @param lineWidth + * @param lineStyle + * @param font + * @param alpha + * @throws VizException + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawWireframeShape(com.raytheon.uf.viz.core.drawables.IWireframeShape, + * org.eclipse.swt.graphics.RGB, float, + * com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle, + * com.raytheon.uf.viz.core.drawables.IFont, float) + */ + public void drawWireframeShape(IWireframeShape shape, RGB color, + float lineWidth, LineStyle lineStyle, IFont font, float alpha) + throws VizException { + wrappedObject.drawWireframeShape(shape, color, lineWidth, lineStyle, + font, alpha); + } + + /** + * @param pe + * @param color + * @param lineWidth + * @param alpha + * @throws VizException + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawRect(com.raytheon.uf.viz.core.IExtent, + * org.eclipse.swt.graphics.RGB, float, double) + */ + public void drawRect(IExtent pe, RGB color, float lineWidth, double alpha) + throws VizException { + wrappedObject.drawRect(pe, color, lineWidth, alpha); + } + + /** + * @param pe + * @param color + * @param alpha + * @param pattern + * @throws VizException + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawShadedRect(com.raytheon.uf.viz.core.IExtent, + * org.eclipse.swt.graphics.RGB, double, byte[]) + */ + public void drawShadedRect(IExtent pe, RGB color, double alpha, + byte[] pattern) throws VizException { + wrappedObject.drawShadedRect(pe, color, alpha, pattern); + } + + /** + * @param poly + * @param color + * @param alpha + * @param pattern + * @throws VizException + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawShadedPolygon(com.vividsolutions.jts.geom.LinearRing, + * org.eclipse.swt.graphics.RGB, double, byte[]) + */ + public void drawShadedPolygon(LinearRing poly, RGB color, double alpha, + byte[] pattern) throws VizException { + wrappedObject.drawShadedPolygon(poly, color, alpha, pattern); + } + + /** + * @param circles + * @throws VizException + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawCircle(com.raytheon.uf.viz.core.DrawableCircle[]) + */ + public void drawCircle(DrawableCircle... circles) throws VizException { + wrappedObject.drawCircle(circles); + } + + /** + * @param lines + * @throws VizException + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawLine(com.raytheon.uf.viz.core.DrawableLine[]) + */ + public void drawLine(DrawableLine... lines) throws VizException { + wrappedObject.drawLine(lines); + } + + /** + * @param x1 + * @param y1 + * @param z1 + * @param radius + * @param color + * @param width + * @param startAzimuth + * @param arcWidth + * @param lineStyle + * @param includeSides + * @throws VizException + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawArc(double, double, + * double, double, org.eclipse.swt.graphics.RGB, float, int, int, + * com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle, boolean) + */ + public void drawArc(double x1, double y1, double z1, double radius, + RGB color, float width, int startAzimuth, int arcWidth, + LineStyle lineStyle, boolean includeSides) throws VizException { + wrappedObject.drawArc(x1, y1, z1, radius, color, width, startAzimuth, + arcWidth, lineStyle, includeSides); + } + + /** + * @param x1 + * @param y1 + * @param z1 + * @param radius + * @param angle + * @return + * @throws VizException + * @see com.raytheon.uf.viz.core.IGraphicsTarget#getPointOnCircle(double, + * double, double, double, double) + */ + public double[] getPointOnCircle(double x1, double y1, double z1, + double radius, double angle) throws VizException { + return wrappedObject.getPointOnCircle(x1, y1, z1, radius, angle); + } + + /** + * @param mutable + * @param descriptor + * @return + * @see com.raytheon.uf.viz.core.IGraphicsTarget#createWireframeShape(boolean, + * com.raytheon.uf.viz.core.drawables.IDescriptor) + */ + public IWireframeShape createWireframeShape(boolean mutable, + IDescriptor descriptor) { + // Create original + IWireframeShape targetShape = wrappedObject.createWireframeShape( + mutable, descriptor); + // Create wrapped + DispatchingWireframeShape dispatching = new DispatchingWireframeShape( + targetShape, getDispatcher(), descriptor.getGridGeometry()); + // Dispatch creation event + sendCreateWireframeShapeEvent(dispatching, mutable, + descriptor.getGridGeometry(), null, null, null); + return dispatching; + } + + /** + * @param mutable + * @param descriptor + * @param simplificationLevel + * @return + * @see com.raytheon.uf.viz.core.IGraphicsTarget#createWireframeShape(boolean, + * com.raytheon.uf.viz.core.drawables.IDescriptor, float) + */ + public IWireframeShape createWireframeShape(boolean mutable, + IDescriptor descriptor, float simplificationLevel) { + return wrappedObject.createWireframeShape(mutable, descriptor, + simplificationLevel); + } + + /** + * @param mutable + * @param descriptor + * @param simplificationLevel + * @param spatialChopFlag + * @param extent + * @return + * @see com.raytheon.uf.viz.core.IGraphicsTarget#createWireframeShape(boolean, + * com.raytheon.uf.viz.core.drawables.IDescriptor, float, boolean, + * com.raytheon.uf.viz.core.IExtent) + */ + public IWireframeShape createWireframeShape(boolean mutable, + IDescriptor descriptor, float simplificationLevel, + boolean spatialChopFlag, IExtent extent) { + return wrappedObject.createWireframeShape(mutable, descriptor, + simplificationLevel, spatialChopFlag, extent); + } + + /** + * @param mutableFlag + * @param geom + * @return + * @see com.raytheon.uf.viz.core.IGraphicsTarget#createWireframeShape(boolean, + * org.geotools.coverage.grid.GeneralGridGeometry) + */ + public IWireframeShape createWireframeShape(boolean mutableFlag, + GeneralGridGeometry geom) { + return wrappedObject.createWireframeShape(mutableFlag, geom); + } + + /** + * @param mutable + * @param geom + * @param simplificationLevel + * @param spatialChopFlag + * @param extent + * @return + * @see com.raytheon.uf.viz.core.IGraphicsTarget#createWireframeShape(boolean, + * org.geotools.coverage.grid.GeneralGridGeometry, float, boolean, + * com.raytheon.uf.viz.core.IExtent) + */ + public IWireframeShape createWireframeShape(boolean mutable, + GeneralGridGeometry geom, float simplificationLevel, + boolean spatialChopFlag, IExtent extent) { + return wrappedObject.createWireframeShape(mutable, geom, + simplificationLevel, spatialChopFlag, extent); + } + + private void sendCreateWireframeShapeEvent(DispatchingWireframeShape shape, + Boolean mutable, GeneralGridGeometry geom, + Float simplificationLevel, Boolean spatialChopFlag, IExtent extent) { + CreateWireframeShapeEvent event = RemoteGraphicsEventFactory + .createEvent(CreateWireframeShapeEvent.class, shape); + event.setGridGeometry(geom); + event.setMutable(mutable); + event.setIExtent(extent); + event.setSimplificationLevel(simplificationLevel); + event.setSpatialChopFlag(spatialChopFlag); + dispatch(event); + } + + /** + * @param mutable + * @param descriptor + * @param tesselate + * @return + * @see com.raytheon.uf.viz.core.IGraphicsTarget#createShadedShape(boolean, + * com.raytheon.uf.viz.core.drawables.IDescriptor, boolean) + */ + public IShadedShape createShadedShape(boolean mutable, + IDescriptor descriptor, boolean tesselate) { + return wrappedObject.createShadedShape(mutable, descriptor, tesselate); + } + + /** + * + * @see com.raytheon.uf.viz.core.IGraphicsTarget#init() + */ + public void init() { + wrappedObject.init(); + } + + private BeginFrameEvent beginFrame = RemoteGraphicsEventFactory + .createEvent(BeginFrameEvent.class, this); + + /** + * @param display + * @param isClearBackground + * @see com.raytheon.uf.viz.core.IGraphicsTarget#beginFrame(com.raytheon.uf.viz.core.drawables.IRenderableDisplay, + * boolean) + */ + public void beginFrame(IRenderableDisplay display, boolean isClearBackground) { + wrappedObject.beginFrame(display, isClearBackground); + beginFrame.setClear(isClearBackground); + dispatch(beginFrame); + } + + private EndFrameEvent endFrame = RemoteGraphicsEventFactory.createEvent( + EndFrameEvent.class, this); + + /** + * + * @see com.raytheon.uf.viz.core.IGraphicsTarget#endFrame() + */ + public void endFrame() { + wrappedObject.endFrame(); + dispatch(endFrame); + } + + /** + * + * @see com.raytheon.uf.viz.core.IGraphicsTarget#resize() + */ + public void resize() { + wrappedObject.resize(); + } + + /** + * + * @see com.raytheon.uf.viz.core.IGraphicsTarget#dispose() + */ + public void dispose() { + wrappedObject.dispose(); + } + + /** + * @return + * @see com.raytheon.uf.viz.core.IGraphicsTarget#screenshot() + */ + public BufferedImage screenshot() { + return wrappedObject.screenshot(); + } + + /** + * @param extent + * @see com.raytheon.uf.viz.core.IGraphicsTarget#setupClippingPlane(com.raytheon.uf.viz.core.IExtent) + */ + public void setupClippingPlane(IExtent extent) { + wrappedObject.setupClippingPlane(extent); + } + + /** + * + * @see com.raytheon.uf.viz.core.IGraphicsTarget#clearClippingPlane() + */ + public void clearClippingPlane() { + wrappedObject.clearClippingPlane(); + } + + /** + * @param needsRefresh + * @see com.raytheon.uf.viz.core.IGraphicsTarget#setNeedsRefresh(boolean) + */ + public void setNeedsRefresh(boolean needsRefresh) { + wrappedObject.setNeedsRefresh(needsRefresh); + } + + /** + * @return + * @see com.raytheon.uf.viz.core.IGraphicsTarget#isNeedsRefresh() + */ + public boolean isNeedsRefresh() { + return wrappedObject.isNeedsRefresh(); + } + + /** + * @param backgroundColor + * @see com.raytheon.uf.viz.core.IGraphicsTarget#setBackgroundColor(org.eclipse.swt.graphics.RGB) + */ + public void setBackgroundColor(RGB backgroundColor) { + wrappedObject.setBackgroundColor(backgroundColor); + } + + /** + * @param isColorbarDisplayed + * @see com.raytheon.uf.viz.core.IGraphicsTarget#setUseBuiltinColorbar(boolean) + */ + public void setUseBuiltinColorbar(boolean isColorbarDisplayed) { + wrappedObject.setUseBuiltinColorbar(isColorbarDisplayed); + } + + /** + * @param colorMap + * @throws VizException + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawColorRamp(com.raytheon.uf.viz.core.DrawableColorMap) + */ + public void drawColorRamp(DrawableColorMap colorMap) throws VizException { + wrappedObject.drawColorRamp(colorMap); + } + + /** + * @return + * @see com.raytheon.uf.viz.core.IGraphicsTarget#getDefaultFont() + */ + public IFont getDefaultFont() { + return wrappedObject.getDefaultFont(); + } + + /** + * @param coord + * @param color + * @param alpha + * @param height + * @param baseRadius + * @param topRadius + * @param sideCount + * @param sliceCount + * @param rotation + * @param lean + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawCylinder(com.raytheon.uf.viz.core.geom.PixelCoordinate, + * org.eclipse.swt.graphics.RGB, float, double, double, double, int, + * int, double, double) + */ + public void drawCylinder(PixelCoordinate coord, RGB color, float alpha, + double height, double baseRadius, double topRadius, int sideCount, + int sliceCount, double rotation, double lean) { + wrappedObject.drawCylinder(coord, color, alpha, height, baseRadius, + topRadius, sideCount, sliceCount, rotation, lean); + } + + /** + * @return + * @see com.raytheon.uf.viz.core.IGraphicsTarget#getViewType() + */ + public String getViewType() { + return wrappedObject.getViewType(); + } + + /** + * @param x + * @param y + * @param z + * @param color + * @param pointStyle + * @throws VizException + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawPoint(double, double, + * double, org.eclipse.swt.graphics.RGB, + * com.raytheon.uf.viz.core.IGraphicsTarget.PointStyle) + */ + public void drawPoint(double x, double y, double z, RGB color, + PointStyle pointStyle) throws VizException { + wrappedObject.drawPoint(x, y, z, color, pointStyle); + } + + /** + * @param locations + * @param color + * @param pointStyle + * @param magnification + * @throws VizException + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawPoints(java.util.Collection, + * org.eclipse.swt.graphics.RGB, + * com.raytheon.uf.viz.core.IGraphicsTarget.PointStyle, float) + */ + public void drawPoints(Collection locations, RGB color, + PointStyle pointStyle, float magnification) throws VizException { + wrappedObject.drawPoints(locations, color, pointStyle, magnification); + } + + /** + * @param x + * @param y + * @param z + * @param color + * @param pointStyle + * @param magnification + * @throws VizException + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawPoint(double, double, + * double, org.eclipse.swt.graphics.RGB, + * com.raytheon.uf.viz.core.IGraphicsTarget.PointStyle, float) + */ + public void drawPoint(double x, double y, double z, RGB color, + PointStyle pointStyle, float magnification) throws VizException { + wrappedObject.drawPoint(x, y, z, color, pointStyle, magnification); + } + + /** + * @param updatedExtent + * @see com.raytheon.uf.viz.core.IGraphicsTarget#updateExtent(com.raytheon.uf.viz.core.IExtent) + */ + public void updateExtent(IExtent updatedExtent) { + wrappedObject.updateExtent(updatedExtent); + } + + /** + * @param offscreenImage + * @throws VizException + * @deprecated + * @see com.raytheon.uf.viz.core.IGraphicsTarget#renderOffscreen(com.raytheon.uf.viz.core.drawables.IImage) + */ + public void renderOffscreen(IImage offscreenImage) throws VizException { + IOffscreenRenderingExtension extension = getExtension(IOffscreenRenderingExtension.class); + extension.renderOffscreen(offscreenImage); + } + + /** + * @throws VizException + * @deprecated + * @see com.raytheon.uf.viz.core.IGraphicsTarget#renderOnscreen() + */ + public void renderOnscreen() throws VizException { + IOffscreenRenderingExtension extension = getExtension(IOffscreenRenderingExtension.class); + extension.renderOnscreen(); + } + + /** + * @param font + * @param text + * @param x + * @param y + * @param z + * @param textStyle + * @param color + * @param horizontalAlignment + * @param verticalAlignment + * @param rotation + * @throws VizException + * @deprecated + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawString(com.raytheon.uf.viz.core.drawables.IFont, + * java.lang.String, double, double, double, + * com.raytheon.uf.viz.core.IGraphicsTarget.TextStyle, + * org.eclipse.swt.graphics.RGB, + * com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment, + * com.raytheon.uf.viz.core.IGraphicsTarget.VerticalAlignment, + * java.lang.Double) + */ + public void drawString(IFont font, String text, double x, double y, + double z, TextStyle textStyle, RGB color, + HorizontalAlignment horizontalAlignment, + VerticalAlignment verticalAlignment, Double rotation) + throws VizException { + wrappedObject.drawString(font, text, x, y, z, textStyle, color, + horizontalAlignment, verticalAlignment, rotation); + } + + /** + * @param font + * @param text + * @param x + * @param y + * @param z + * @param textStyle + * @param color + * @param horizontalAlignment + * @param rotation + * @throws VizException + * @deprecated + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawString(com.raytheon.uf.viz.core.drawables.IFont, + * java.lang.String, double, double, double, + * com.raytheon.uf.viz.core.IGraphicsTarget.TextStyle, + * org.eclipse.swt.graphics.RGB, + * com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment, + * java.lang.Double) + */ + public void drawString(IFont font, String text, double x, double y, + double z, TextStyle textStyle, RGB color, + HorizontalAlignment horizontalAlignment, Double rotation) + throws VizException { + wrappedObject.drawString(font, text, x, y, z, textStyle, color, + horizontalAlignment, rotation); + } + + /** + * @param font + * @param text + * @param x + * @param y + * @param z + * @param textStyle + * @param colors + * @param horizontalAlignment + * @param verticalAlignment + * @throws VizException + * @deprecated + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawStrings(com.raytheon.uf.viz.core.drawables.IFont, + * java.lang.String[], double, double, double, + * com.raytheon.uf.viz.core.IGraphicsTarget.TextStyle, + * org.eclipse.swt.graphics.RGB[], + * com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment, + * com.raytheon.uf.viz.core.IGraphicsTarget.VerticalAlignment) + */ + public void drawStrings(IFont font, String[] text, double x, double y, + double z, TextStyle textStyle, RGB[] colors, + HorizontalAlignment horizontalAlignment, + VerticalAlignment verticalAlignment) throws VizException { + wrappedObject.drawStrings(font, text, x, y, z, textStyle, colors, + horizontalAlignment, verticalAlignment); + } + + /** + * @param font + * @param string + * @param xPos + * @param yPos + * @param zPos + * @param textStyle + * @param color + * @param horizontalAlignment + * @param verticalAlignment + * @param rotation + * @param alpha + * @param magnification + * @throws VizException + * @deprecated + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawString(com.raytheon.uf.viz.core.drawables.IFont, + * java.lang.String, double, double, double, + * com.raytheon.uf.viz.core.IGraphicsTarget.TextStyle, + * org.eclipse.swt.graphics.RGB, + * com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment, + * com.raytheon.uf.viz.core.IGraphicsTarget.VerticalAlignment, + * java.lang.Double, float, double) + */ + public void drawString(IFont font, String string, double xPos, double yPos, + double zPos, TextStyle textStyle, RGB color, + HorizontalAlignment horizontalAlignment, + VerticalAlignment verticalAlignment, Double rotation, float alpha, + double magnification) throws VizException { + wrappedObject.drawString(font, string, xPos, yPos, zPos, textStyle, + color, horizontalAlignment, verticalAlignment, rotation, alpha, + magnification); + } + + /** + * @param font + * @param text + * @return + * @deprecated + * @see com.raytheon.uf.viz.core.IGraphicsTarget#getStringBounds(com.raytheon.uf.viz.core.drawables.IFont, + * java.lang.String) + */ + public Rectangle2D getStringBounds(IFont font, String text) { + return wrappedObject.getStringBounds(font, text); + } + + /** + * @param font + * @param text + * @param style + * @return + * @deprecated + * @see com.raytheon.uf.viz.core.IGraphicsTarget#getStringBounds(com.raytheon.uf.viz.core.drawables.IFont, + * java.lang.String[], + * com.raytheon.uf.viz.core.IGraphicsTarget.TextStyle) + */ + public Rectangle2D getStringBounds(IFont font, String[] text, + TextStyle style) { + return wrappedObject.getStringBounds(font, text, style); + } + + /** + * @param colorMap + * @param pixelExtent + * @param blendAlpha + * @throws VizException + * @deprecated + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawColorRamp(com.raytheon.uf.common.colormap.IColorMap, + * com.raytheon.uf.viz.core.IExtent, float) + */ + public void drawColorRamp(IColorMap colorMap, IExtent pixelExtent, + float blendAlpha) throws VizException { + wrappedObject.drawColorRamp(colorMap, pixelExtent, blendAlpha); + } + + /** + * @param colorMap + * @param pixelExtent + * @param blendAlpha + * @param brightness + * @param contrast + * @throws VizException + * @deprecated + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawColorRamp(com.raytheon.uf.common.colormap.IColorMap, + * com.raytheon.uf.viz.core.IExtent, float, float, float) + */ + public void drawColorRamp(IColorMap colorMap, IExtent pixelExtent, + float blendAlpha, float brightness, float contrast) + throws VizException { + wrappedObject.drawColorRamp(colorMap, pixelExtent, blendAlpha, + brightness, contrast); + } + + /** + * @param colorMapParams + * @param pixelExtent + * @param blendAlpha + * @throws VizException + * @deprecated + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawColorRamp(com.raytheon.uf.viz.core.drawables.ColorMapParameters, + * com.raytheon.uf.viz.core.IExtent, float) + */ + public void drawColorRamp(ColorMapParameters colorMapParams, + IExtent pixelExtent, float blendAlpha) throws VizException { + wrappedObject.drawColorRamp(colorMapParams, pixelExtent, blendAlpha); + } + + /** + * @param colorMapParams + * @param pixelExtent + * @param blendAlpha + * @param brightness + * @param contrast + * @throws VizException + * @deprecated + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawColorRamp(com.raytheon.uf.viz.core.drawables.ColorMapParameters, + * com.raytheon.uf.viz.core.IExtent, float, float, float) + */ + public void drawColorRamp(ColorMapParameters colorMapParams, + IExtent pixelExtent, float blendAlpha, float brightness, + float contrast) throws VizException { + wrappedObject.drawColorRamp(colorMapParams, pixelExtent, blendAlpha, + brightness, contrast); + } + + /** + * @param x1 + * @param y1 + * @param z1 + * @param radius + * @param color + * @param width + * @throws VizException + * @deprecated + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawCircle(double, double, + * double, double, org.eclipse.swt.graphics.RGB, float) + */ + public void drawCircle(double x1, double y1, double z1, double radius, + RGB color, float width) throws VizException { + wrappedObject.drawCircle(x1, y1, z1, radius, color, width); + } + + /** + * @param x + * @param y + * @param z + * @param radius + * @param color + * @throws VizException + * @deprecated + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawFilledCircle(double, + * double, double, double, org.eclipse.swt.graphics.RGB) + */ + public void drawFilledCircle(double x, double y, double z, double radius, + RGB color) throws VizException { + wrappedObject.drawFilledCircle(x, y, z, radius, color); + } + + /** + * @param name + * @return + * @throws VizException + * @deprecated + * @see com.raytheon.uf.viz.core.IGraphicsTarget#buildColorMap(java.lang.String) + */ + public IColorMap buildColorMap(String name) throws VizException { + return wrappedObject.buildColorMap(name); + } + + /** + * @param x1 + * @param y1 + * @param z1 + * @param x2 + * @param y2 + * @param z2 + * @param color + * @param width + * @param lineStyle + * @throws VizException + * @deprecated + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawLine(double, double, + * double, double, double, double, org.eclipse.swt.graphics.RGB, float, + * com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle) + */ + public void drawLine(double x1, double y1, double z1, double x2, double y2, + double z2, RGB color, float width, LineStyle lineStyle) + throws VizException { + wrappedObject.drawLine(x1, y1, z1, x2, y2, z2, color, width, lineStyle); + } + + /** + * @param x1 + * @param y1 + * @param z1 + * @param x2 + * @param y2 + * @param z2 + * @param color + * @param width + * @throws VizException + * @deprecated + * @see com.raytheon.uf.viz.core.IGraphicsTarget#drawLine(double, double, + * double, double, double, double, org.eclipse.swt.graphics.RGB, float) + */ + public void drawLine(double x1, double y1, double z1, double x2, double y2, + double z2, RGB color, float width) throws VizException { + wrappedObject.drawLine(x1, y1, z1, x2, y2, z2, color, width); + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.viz.core.IGraphicsTarget#getExtension(java.lang.Class) + */ + @Override + public T getExtension( + Class extensionClass) throws VizException { + return extensionManager.getExtension(extensionClass); + } + +} diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/Dispatcher.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/Dispatcher.java new file mode 100644 index 0000000000..93e5c672cf --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/Dispatcher.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.remote.graphics; + +/** + * Abstract class that is responsible for dispatching remote graphics events + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Feb 28, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ + +public abstract class Dispatcher { + + private static int dispatcherIdCounter = 0; + + private int objectCounter = 0; + + private int dispatcherId; + + protected Dispatcher() { + dispatcherId = newDispatcherId(); + } + + public static synchronized int newDispatcherId() { + return ++dispatcherIdCounter; + } + + public synchronized int newObjectId() { + return ++objectCounter; + } + + /** + * @return the displayId + */ + public int getDispatcherId() { + return dispatcherId; + } + + public abstract void dispatch(AbstractRemoteGraphicsEvent eventObject); + +} diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/DispatcherFactory.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/DispatcherFactory.java new file mode 100644 index 0000000000..dfd21cbde1 --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/DispatcherFactory.java @@ -0,0 +1,49 @@ +/** + * 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.remote.graphics; + +/** + * Factory for creating Dispatcher objects for dispatching remote graphics + * events + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 8, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ + +public interface DispatcherFactory { + + /** + * Creates a new Dispatcher object for dispatching events + * + * @return + */ + public Dispatcher createNewDispatcher(); + +} diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/DispatchingGraphicsFactory.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/DispatchingGraphicsFactory.java new file mode 100644 index 0000000000..db44cee303 --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/DispatchingGraphicsFactory.java @@ -0,0 +1,182 @@ +/** + * 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.remote.graphics; + +import org.eclipse.swt.graphics.Rectangle; +import org.eclipse.swt.widgets.Canvas; +import org.eclipse.swt.widgets.Composite; +import org.opengis.coverage.grid.GridEnvelope; + +import com.raytheon.uf.viz.core.AbstractGraphicsFactoryAdapter; +import com.raytheon.uf.viz.core.IDisplayPaneContainer; +import com.raytheon.uf.viz.core.IExtent; +import com.raytheon.uf.viz.core.IGraphicsTarget; +import com.raytheon.uf.viz.core.IView; +import com.raytheon.uf.viz.core.exception.VizException; +import com.vividsolutions.jts.geom.Coordinate; + +/** + * Graphics factory for creating graphics objects that forward (dispatch) + * important events for remote processing + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 5, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ + +public class DispatchingGraphicsFactory extends AbstractGraphicsFactoryAdapter { + + private AbstractGraphicsFactoryAdapter delegate; + + private Dispatcher dispatcher; + + private DispatchingGraphicsFactory(AbstractGraphicsFactoryAdapter delegate, + Dispatcher dispatcher) { + this.delegate = delegate; + this.dispatcher = dispatcher; + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.viz.core.AbstractGraphicsFactoryAdapter#constructView() + */ + @Override + public IView constructView() throws VizException { + // TODO: Construct DispatchingView? + return delegate.constructView(); + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.viz.core.AbstractGraphicsFactoryAdapter#constructTarget + * (org.eclipse.swt.widgets.Canvas, float, float) + */ + @Override + public IGraphicsTarget constructTarget(Canvas canvas, float width, + float height) throws VizException { + return new DispatchGraphicsTarget(delegate.constructTarget(canvas, + width, height), dispatcher); + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.viz.core.AbstractGraphicsFactoryAdapter#constructExtent + * (com.vividsolutions.jts.geom.Coordinate[]) + */ + @Override + public IExtent constructExtent(Coordinate[] coords) throws VizException { + return delegate.constructExtent(coords); + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.viz.core.AbstractGraphicsFactoryAdapter#constructExtent + * (double, double, double, double) + */ + @Override + public IExtent constructExtent(double aMinX, double aMaxX, double aMinY, + double aMaxY) throws VizException { + return delegate.constructExtent(aMinX, aMaxX, aMinY, aMaxY); + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.viz.core.AbstractGraphicsFactoryAdapter#constructExtent + * (org.eclipse.swt.graphics.Rectangle) + */ + @Override + public IExtent constructExtent(Rectangle rect) throws VizException { + return delegate.constructExtent(rect); + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.viz.core.AbstractGraphicsFactoryAdapter#constructExtent + * (org.opengis.coverage.grid.GridEnvelope) + */ + @Override + public IExtent constructExtent(GridEnvelope range) throws VizException { + return delegate.constructExtent(range); + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.viz.core.AbstractGraphicsFactoryAdapter#constrcutCanvas + * (org.eclipse.swt.widgets.Composite) + */ + @Override + public Canvas constrcutCanvas(Composite canvasComp) throws VizException { + return delegate.constrcutCanvas(canvasComp); + } + + public static void injectRemoteFunctionality( + IDisplayPaneContainer container, DispatcherFactory factory) { + // TODO: Do this more cleanly and effectively + // for (IDisplayPane pane : container.getDisplayPanes()) { + // Dispatcher dispatcher = factory.createNewDispatcher(); + // + // VizDisplayPane vizPane = (VizDisplayPane) pane; + // + // // Wrap view in dispatching view + // IRenderableDisplay display = pane.getRenderableDisplay(); + // ((AbstractRenderableDisplay) display).setView(new ViewWrapper( + // display.getView())); + // + // // Wrap the graphics adapter in dispatching one + // vizPane.setGraphicsAdapter(new DispatchingGraphicsFactory(vizPane + // .getGraphicsAdapter(), dispatcher)); + // + // // Wrap target in dispatching target + // vizPane.setTarget(new DispatchGraphicsTarget(vizPane.getTarget(), + // dispatcher)); + // display.setup(vizPane.getTarget()); + // + // for (ResourcePair rp : pane.getDescriptor().getResourceList()) { + // if (rp.getResource() != null) { + // rp.getResource().recycle(); + // } + // } + // } + } + +} 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 new file mode 100644 index 0000000000..eba4906c77 --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/DispatchingObject.java @@ -0,0 +1,70 @@ +/** + * 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.remote.graphics; + + +/** + * TODO Add Description + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Feb 28, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ + +public class DispatchingObject { + + private int objectId; + + private Dispatcher dispatcher; + + protected T wrappedObject; + + protected DispatchingObject(T targetObject, Dispatcher dispatcher) { + this.wrappedObject = targetObject; + this.dispatcher = dispatcher; + objectId = dispatcher.newObjectId(); + } + + public int getObjectId() { + return objectId; + } + + public T getWrappedObject() { + return wrappedObject; + } + + public Dispatcher getDispatcher() { + return dispatcher; + } + + public void dispatch(AbstractRemoteGraphicsEvent eventObject) { + dispatcher.dispatch(eventObject); + } + +} diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/AbstractDispatchingObjectEvent.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/AbstractDispatchingObjectEvent.java new file mode 100644 index 0000000000..75528f805a --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/AbstractDispatchingObjectEvent.java @@ -0,0 +1,72 @@ +/** + * 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.remote.graphics.events; + +import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; +import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; +import com.raytheon.uf.viz.remote.graphics.AbstractRemoteGraphicsEvent; + +/** + * TODO Add Description + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 8, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ +@DynamicSerialize +public abstract class AbstractDispatchingObjectEvent extends + AbstractRemoteGraphicsEvent { + + @DynamicSerializeElement + private int objectId; + + public AbstractDispatchingObjectEvent() { + + } + + protected AbstractDispatchingObjectEvent(int objectId) { + this.objectId = objectId; + } + + /** + * @return the objectId + */ + public int getObjectId() { + return objectId; + } + + /** + * @param objectId + * the objectId to set + */ + public void setObjectId(int objectId) { + this.objectId = objectId; + } + +} 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 new file mode 100644 index 0000000000..d7e9a67160 --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/BeginFrameEvent.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.remote.graphics.events; + +import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; +import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; +import com.raytheon.uf.viz.remote.graphics.AbstractRemoteGraphicsEvent; + +/** + * TODO Add Description + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 8, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ +@DynamicSerialize +public class BeginFrameEvent extends AbstractRemoteGraphicsEvent { + + @DynamicSerializeElement + private boolean clear; + + /** + * @return the clear + */ + public boolean isClear() { + return clear; + } + + /** + * @param clear + * the clear to set + */ + public void setClear(boolean clear) { + this.clear = clear; + } + +} diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/DisposeImageEvent.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/DisposeImageEvent.java new file mode 100644 index 0000000000..b730269be8 --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/DisposeImageEvent.java @@ -0,0 +1,43 @@ +/** + * 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.remote.graphics.events; + +import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; + +/** + * Event object for disposing of an image + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 26, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ +@DynamicSerialize +public class DisposeImageEvent extends AbstractDispatchingObjectEvent { + +} 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 new file mode 100644 index 0000000000..3c24509c6b --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/EndFrameEvent.java @@ -0,0 +1,44 @@ +/** + * 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.remote.graphics.events; + +import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; +import com.raytheon.uf.viz.remote.graphics.AbstractRemoteGraphicsEvent; + +/** + * TODO Add Description + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 8, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ +@DynamicSerialize +public class EndFrameEvent extends AbstractRemoteGraphicsEvent { + +} diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/RemoteGraphicsEventFactory.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/RemoteGraphicsEventFactory.java new file mode 100644 index 0000000000..ab9567c044 --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/RemoteGraphicsEventFactory.java @@ -0,0 +1,60 @@ +/** + * 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.remote.graphics.events; + +import com.raytheon.uf.viz.remote.graphics.AbstractRemoteGraphicsEvent; +import com.raytheon.uf.viz.remote.graphics.DispatchingObject; + +/** + * TODO Add Description + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 8, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ + +public class RemoteGraphicsEventFactory { + + public static T createEvent( + Class eventType, DispatchingObject creatingObject) { + T event = null; + try { + event = eventType.newInstance(); + event.setDisplayId(creatingObject.getDispatcher().getDispatcherId()); + if (AbstractDispatchingObjectEvent.class + .isAssignableFrom(eventType)) { + AbstractDispatchingObjectEvent.class.cast(event).setObjectId( + creatingObject.getObjectId()); + } + } catch (Throwable t) { + // TODO: Handle gracefully + } + return event; + } +} diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/RenderedImageEvent.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/RenderedImageEvent.java new file mode 100644 index 0000000000..55dfe83529 --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/RenderedImageEvent.java @@ -0,0 +1,116 @@ +/** + * 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.remote.graphics.events; + +import java.awt.image.RenderedImage; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; + +import javax.media.jai.remote.SerializableRenderedImage; + +import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; +import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; + +/** + * Event that sends a rendered image object for the object id which should be + * treated as an image + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 29, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ +@DynamicSerialize +public class RenderedImageEvent extends AbstractDispatchingObjectEvent { + + @DynamicSerializeElement + private byte[] serializedRenderedImage; + + private RenderedImage renderedImage; + + /** + * @return the renderedImage + */ + public byte[] getSerializedRenderedImage() { + return serializedRenderedImage; + } + + /** + * @param renderedImage + * the renderedImage to set + */ + public void setSerializedRenderedImage(byte[] renderedImage) { + this.serializedRenderedImage = renderedImage; + } + + /** + * @return the renderedImage + */ + public RenderedImage getRenderedImage() { + if (renderedImage == null && serializedRenderedImage != null) { + // deserialize bytes into rendered image + try { + ObjectInputStream oin = new ObjectInputStream( + new ByteArrayInputStream(serializedRenderedImage)); + renderedImage = (RenderedImage) oin.readObject(); + } catch (Exception e) { + throw new RuntimeException( + "Error deserializing rendered image: " + + e.getLocalizedMessage(), e); + } + } + return renderedImage; + } + + /** + * @param renderedImage + * the renderedImage to set + */ + public void setRenderedImage(RenderedImage renderedImage) { + if (this.renderedImage != renderedImage) { + if (renderedImage instanceof SerializableRenderedImage == false) { + renderedImage = new SerializableRenderedImage(renderedImage); + } + this.renderedImage = renderedImage; + // serialize rendered image into bytes + try { + ByteArrayOutputStream bytes = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(bytes); + oos.writeObject(renderedImage); + serializedRenderedImage = bytes.toByteArray(); + } catch (IOException e) { + throw new RuntimeException("Error serializing rendered image", + e); + } + } + } + +} diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/UpdateImageDataEvent.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/UpdateImageDataEvent.java new file mode 100644 index 0000000000..fa53bdfa8b --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/UpdateImageDataEvent.java @@ -0,0 +1,94 @@ +/** + * 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.remote.graphics.events; + +import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; + +/** + * TODO Add Description + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 26, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ +@DynamicSerialize +public class UpdateImageDataEvent extends AbstractDispatchingObjectEvent { + + private boolean interpolated; + + private float brightness; + + private float contrast; + + /** + * @return the interpolated + */ + public boolean isInterpolated() { + return interpolated; + } + + /** + * @param interpolated + * the interpolated to set + */ + public void setInterpolated(boolean interpolated) { + this.interpolated = interpolated; + } + + /** + * @return the brightness + */ + public float getBrightness() { + return brightness; + } + + /** + * @param brightness + * the brightness to set + */ + public void setBrightness(float brightness) { + this.brightness = brightness; + } + + /** + * @return the contrast + */ + public float getContrast() { + return contrast; + } + + /** + * @param contrast + * the contrast to set + */ + public void setContrast(float contrast) { + this.contrast = contrast; + } + +} diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/colormap/ColorMapDataEvent.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/colormap/ColorMapDataEvent.java new file mode 100644 index 0000000000..90746d64cc --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/colormap/ColorMapDataEvent.java @@ -0,0 +1,175 @@ +/** + * 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.remote.graphics.events.colormap; + +import java.nio.Buffer; +import java.nio.ByteBuffer; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import java.nio.ShortBuffer; + +import com.raytheon.uf.common.serialization.IDeserializationContext; +import com.raytheon.uf.common.serialization.ISerializationContext; +import com.raytheon.uf.common.serialization.ISerializationTypeAdapter; +import com.raytheon.uf.common.serialization.SerializationException; +import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; +import com.raytheon.uf.common.serialization.annotations.DynamicSerializeTypeAdapter; +import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback.ColorMapData; +import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback.ColorMapDataType; +import com.raytheon.uf.viz.remote.graphics.events.AbstractDispatchingObjectEvent; +import com.raytheon.uf.viz.remote.graphics.events.colormap.ColorMapDataEvent.ColorMapDataEventAdapter; + +/** + * TODO Add Description + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 9, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ +@DynamicSerialize +@DynamicSerializeTypeAdapter(factory = ColorMapDataEventAdapter.class) +public class ColorMapDataEvent extends AbstractDispatchingObjectEvent { + + public static class ColorMapDataEventAdapter implements + ISerializationTypeAdapter { + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.common.serialization.ISerializationTypeAdapter#serialize + * (com.raytheon.uf.common.serialization.ISerializationContext, + * java.lang.Object) + */ + @Override + public void serialize(ISerializationContext serializer, + ColorMapDataEvent object) throws SerializationException { + serializer.writeI32(object.getDisplayId()); + serializer.writeI32(object.getObjectId()); + ColorMapData colorMapData = object.getColorMapData(); + serializer.writeString(colorMapData.getDataType().name()); + int[] dimensions = colorMapData.getDimensions(); + serializer.writeI32(dimensions[0]); + serializer.writeI32(dimensions[1]); + Buffer buffer = colorMapData.getBuffer(); + serializer.writeBool(buffer.isDirect()); + buffer.position(0); + ByteBuffer bb = null; + byte[] bytes = null; + switch (colorMapData.getDataType()) { + case BYTE: + case SIGNED_BYTE: + bytes = new byte[buffer.capacity()]; + bb = ByteBuffer.wrap(bytes); + bb.put((ByteBuffer) buffer); + break; + case SHORT: + case UNSIGNED_SHORT: + bytes = new byte[2 * buffer.capacity()]; + bb = ByteBuffer.wrap(bytes); + bb.asShortBuffer().put((ShortBuffer) buffer); + break; + case FLOAT: + bytes = new byte[4 * buffer.capacity()]; + bb = ByteBuffer.wrap(bytes); + bb.asFloatBuffer().put((FloatBuffer) buffer); + break; + case INT: + bytes = new byte[4 * buffer.capacity()]; + bb = ByteBuffer.wrap(bytes); + bb.asIntBuffer().put((IntBuffer) buffer); + break; + } + serializer.writeBinary(bb.array()); + } + + /* + * (non-Javadoc) + * + * @see com.raytheon.uf.common.serialization.ISerializationTypeAdapter# + * deserialize + * (com.raytheon.uf.common.serialization.IDeserializationContext) + */ + @Override + public ColorMapDataEvent deserialize( + IDeserializationContext deserializer) + throws SerializationException { + ColorMapDataEvent event = new ColorMapDataEvent(); + event.setDisplayId(deserializer.readI32()); + event.setObjectId(deserializer.readI32()); + ColorMapDataType dataType = ColorMapDataType.valueOf(deserializer + .readString()); + int[] dimensions = new int[] { deserializer.readI32(), + deserializer.readI32() }; + boolean direct = deserializer.readBool(); + byte[] bytes = deserializer.readBinary(); + ByteBuffer buffer = direct ? ByteBuffer + .allocateDirect(bytes.length) : ByteBuffer + .allocate(bytes.length); + Buffer dataBuffer = null; + switch (dataType) { + case BYTE: + case SIGNED_BYTE: + dataBuffer = buffer; + break; + case SHORT: + case UNSIGNED_SHORT: + dataBuffer = buffer.asShortBuffer(); + break; + case INT: + dataBuffer = buffer.asIntBuffer(); + break; + case FLOAT: + dataBuffer = buffer.asFloatBuffer(); + break; + } + event.setColorMapData(new ColorMapData(dataBuffer, dimensions, + dataType)); + return event; + } + } + + private ColorMapData colorMapData; + + /** + * @return the colorMapData + */ + public ColorMapData getColorMapData() { + return colorMapData; + } + + /** + * @param colorMapData + * the colorMapData to set + */ + public void setColorMapData(ColorMapData colorMapData) { + this.colorMapData = colorMapData; + } + +} diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/colormap/CreateColormappedImageEvent.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/colormap/CreateColormappedImageEvent.java new file mode 100644 index 0000000000..be56105a9b --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/colormap/CreateColormappedImageEvent.java @@ -0,0 +1,64 @@ +/** + * 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.remote.graphics.events.colormap; + +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; + +/** + * TODO Add Description + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 8, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ +@DynamicSerialize +public class CreateColormappedImageEvent extends AbstractDispatchingObjectEvent { + + @DynamicSerializeElement + private UpdateColorMapParametersEvent colorMapParameters; + + /** + * @return the colorMapParameters + */ + public UpdateColorMapParametersEvent getColorMapParameters() { + return colorMapParameters; + } + + /** + * @param colorMapParameters + * the colorMapParameters to set + */ + public void setColorMapParameters( + UpdateColorMapParametersEvent colorMapParameters) { + this.colorMapParameters = colorMapParameters; + } + +} \ No newline at end of file diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/colormap/UpdateColorMapParametersEvent.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/colormap/UpdateColorMapParametersEvent.java new file mode 100644 index 0000000000..b3ed6cd185 --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/colormap/UpdateColorMapParametersEvent.java @@ -0,0 +1,307 @@ +/** + * 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.remote.graphics.events.colormap; + +import com.raytheon.uf.common.colormap.IColorMap; +import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; +import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; +import com.raytheon.uf.viz.core.drawables.ColorMapParameters; +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.RemoteGraphicsEventFactory; + +/** + * TODO Add Description + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 8, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ +@DynamicSerialize +public class UpdateColorMapParametersEvent extends + AbstractDispatchingObjectEvent { + + @DynamicSerializeElement + private byte[] alphaMask; + + @DynamicSerializeElement + private float[] red; + + @DynamicSerializeElement + private float[] blue; + + @DynamicSerializeElement + private float[] green; + + @DynamicSerializeElement + private float[] alpha; + + @DynamicSerializeElement + private float colorMapMax; + + @DynamicSerializeElement + private float colorMapMin; + + @DynamicSerializeElement + private float dataMax; + + @DynamicSerializeElement + private float dataMin; + + @DynamicSerializeElement + private boolean logarithmic; + + @DynamicSerializeElement + private float logFactor; + + @DynamicSerializeElement + private boolean mirror; + + @DynamicSerializeElement + private boolean useMask; + + /** + * @return the alphaMask + */ + public byte[] getAlphaMask() { + return alphaMask; + } + + /** + * @param alphaMask + * the alphaMask to set + */ + public void setAlphaMask(byte[] alphaMask) { + this.alphaMask = alphaMask; + } + + /** + * @return the red + */ + public float[] getRed() { + return red; + } + + /** + * @param red + * the red to set + */ + public void setRed(float[] red) { + this.red = red; + } + + /** + * @return the blue + */ + public float[] getBlue() { + return blue; + } + + /** + * @param blue + * the blue to set + */ + public void setBlue(float[] blue) { + this.blue = blue; + } + + /** + * @return the green + */ + public float[] getGreen() { + return green; + } + + /** + * @param green + * the green to set + */ + public void setGreen(float[] green) { + this.green = green; + } + + /** + * @return the alpha + */ + public float[] getAlpha() { + return alpha; + } + + /** + * @param alpha + * the alpha to set + */ + public void setAlpha(float[] alpha) { + this.alpha = alpha; + } + + /** + * @return the colorMapMax + */ + public float getColorMapMax() { + return colorMapMax; + } + + /** + * @param colorMapMax + * the colorMapMax to set + */ + public void setColorMapMax(float colorMapMax) { + this.colorMapMax = colorMapMax; + } + + /** + * @return the colorMapMin + */ + public float getColorMapMin() { + return colorMapMin; + } + + /** + * @param colorMapMin + * the colorMapMin to set + */ + public void setColorMapMin(float colorMapMin) { + this.colorMapMin = colorMapMin; + } + + /** + * @return the dataMax + */ + public float getDataMax() { + return dataMax; + } + + /** + * @param dataMax + * the dataMax to set + */ + public void setDataMax(float dataMax) { + this.dataMax = dataMax; + } + + /** + * @return the dataMin + */ + public float getDataMin() { + return dataMin; + } + + /** + * @param dataMin + * the dataMin to set + */ + public void setDataMin(float dataMin) { + this.dataMin = dataMin; + } + + /** + * @return the logarithmic + */ + public boolean isLogarithmic() { + return logarithmic; + } + + /** + * @param logarithmic + * the logarithmic to set + */ + public void setLogarithmic(boolean logarithmic) { + this.logarithmic = logarithmic; + } + + /** + * @return the logFactor + */ + public float getLogFactor() { + return logFactor; + } + + /** + * @param logFactor + * the logFactor to set + */ + public void setLogFactor(float logFactor) { + this.logFactor = logFactor; + } + + /** + * @return the mirror + */ + public boolean isMirror() { + return mirror; + } + + /** + * @param mirror + * the mirror to set + */ + public void setMirror(boolean mirror) { + this.mirror = mirror; + } + + /** + * @return the useMask + */ + public boolean isUseMask() { + return useMask; + } + + /** + * @param useMask + * the useMask to set + */ + public void setUseMask(boolean useMask) { + this.useMask = useMask; + } + + public static UpdateColorMapParametersEvent createEvent( + DispatchingObject creator, ColorMapParameters parameters) { + UpdateColorMapParametersEvent event = RemoteGraphicsEventFactory + .createEvent(UpdateColorMapParametersEvent.class, creator); + event.setAlphaMask(parameters.getAlphaMask()); + IColorMap cmap = parameters.getColorMap(); + if (cmap != null) { + event.setRed(cmap.getRed()); + event.setBlue(cmap.getBlue()); + event.setGreen(cmap.getGreen()); + event.setAlpha(cmap.getAlpha()); + } + event.setColorMapMin(parameters.getColorMapMin()); + event.setColorMapMax(parameters.getColorMapMax()); + event.setDataMin(parameters.getDataMin()); + event.setDataMax(parameters.getDataMax()); + event.setLogarithmic(parameters.isLogarithmic()); + event.setLogFactor(parameters.getLogFactor()); + event.setMirror(parameters.isMirror()); + event.setUseMask(parameters.isUseMask()); + return event; + } + +} diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/mesh/CreateMeshEvent.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/mesh/CreateMeshEvent.java new file mode 100644 index 0000000000..62d72b341e --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/mesh/CreateMeshEvent.java @@ -0,0 +1,84 @@ +/** + * 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.remote.graphics.events.mesh; + +import org.geotools.coverage.grid.GeneralGridGeometry; +import org.geotools.coverage.grid.GridGeometry2D; + +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; + +/** + * TODO Add Description + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 26, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ +@DynamicSerialize +public class CreateMeshEvent extends AbstractDispatchingObjectEvent { + + @DynamicSerializeElement + private GridGeometry2D imageGeometry; + + @DynamicSerializeElement + private GeneralGridGeometry targetGeometry; + + /** + * @return the imageGeometry + */ + public GridGeometry2D getImageGeometry() { + return imageGeometry; + } + + /** + * @param imageGeometry + * the imageGeometry to set + */ + public void setImageGeometry(GridGeometry2D imageGeometry) { + this.imageGeometry = imageGeometry; + } + + /** + * @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.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/mesh/DisposeMeshEvent.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/mesh/DisposeMeshEvent.java new file mode 100644 index 0000000000..ec5619ea09 --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/mesh/DisposeMeshEvent.java @@ -0,0 +1,44 @@ +/** + * 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.remote.graphics.events.mesh; + +import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; +import com.raytheon.uf.viz.remote.graphics.events.AbstractDispatchingObjectEvent; + +/** + * TODO Add Description + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 26, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ +@DynamicSerialize +public class DisposeMeshEvent extends AbstractDispatchingObjectEvent { + +} diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/mesh/ReprojectMeshEvent.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/mesh/ReprojectMeshEvent.java new file mode 100644 index 0000000000..47dac3dce8 --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/mesh/ReprojectMeshEvent.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.remote.graphics.events.mesh; + +import org.geotools.coverage.grid.GeneralGridGeometry; + +import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; +import com.raytheon.uf.viz.remote.graphics.events.AbstractDispatchingObjectEvent; + +/** + * TODO Add Description + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 26, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ +@DynamicSerialize +public class ReprojectMeshEvent extends AbstractDispatchingObjectEvent { + + private GeneralGridGeometry targetGeometry; + + /** + * @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.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/offscreen/CreateOffscreenImageEvent.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/offscreen/CreateOffscreenImageEvent.java new file mode 100644 index 0000000000..60e60a572c --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/offscreen/CreateOffscreenImageEvent.java @@ -0,0 +1,101 @@ +/** + * 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.remote.graphics.events.offscreen; + +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.colormap.UpdateColorMapParametersEvent; + +/** + * TODO Add Description + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 29, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ +@DynamicSerialize +public class CreateOffscreenImageEvent extends AbstractDispatchingObjectEvent { + + @DynamicSerializeElement + private String bufferType; + + @DynamicSerializeElement + private int[] dimensions; + + @DynamicSerializeElement + private UpdateColorMapParametersEvent colorMapParamters; + + /** + * @return the bufferType + */ + public String getBufferType() { + return bufferType; + } + + /** + * @param bufferType + * the bufferType to set + */ + public void setBufferType(String bufferType) { + this.bufferType = bufferType; + } + + /** + * @return the dimensions + */ + public int[] getDimensions() { + return dimensions; + } + + /** + * @param dimensions + * the dimensions to set + */ + public void setDimensions(int[] dimensions) { + this.dimensions = dimensions; + } + + /** + * @return the colorMapParamters + */ + public UpdateColorMapParametersEvent getColorMapParamters() { + return colorMapParamters; + } + + /** + * @param colorMapParamters + * the colorMapParamters to set + */ + public void setColorMapParamters( + UpdateColorMapParametersEvent colorMapParamters) { + this.colorMapParamters = colorMapParamters; + } + +} 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 new file mode 100644 index 0000000000..f896fd314e --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/offscreen/RenderOffscreenEvent.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.remote.graphics.events.offscreen; + +import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; +import com.raytheon.uf.viz.remote.graphics.events.AbstractDispatchingObjectEvent; + +/** + * Event notifying clients to render the image represented by the object id to + * render offscreen + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 29, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ +@DynamicSerialize +public class RenderOffscreenEvent extends AbstractDispatchingObjectEvent { + +} 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 new file mode 100644 index 0000000000..f583aa00fe --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/offscreen/RenderOnscreenEvent.java @@ -0,0 +1,44 @@ +/** + * 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.remote.graphics.events.offscreen; + +import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; +import com.raytheon.uf.viz.remote.graphics.AbstractRemoteGraphicsEvent; + +/** + * Event letting clients know they can render on screen + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 29, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ +@DynamicSerialize +public class RenderOnscreenEvent extends AbstractRemoteGraphicsEvent { + +} diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/paint/PaintImageEvent.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/paint/PaintImageEvent.java new file mode 100644 index 0000000000..de88bbe147 --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/paint/PaintImageEvent.java @@ -0,0 +1,143 @@ +/** + * 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.remote.graphics.events.paint; + +import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; +import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; +import com.raytheon.uf.viz.core.PixelCoverage; +import com.raytheon.uf.viz.remote.graphics.events.AbstractDispatchingObjectEvent; +import com.vividsolutions.jts.geom.Coordinate; + +/** + * TODO Add Description + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 8, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ +@DynamicSerialize +public class PaintImageEvent extends AbstractDispatchingObjectEvent { + + @DynamicSerializeElement + private int meshId = -1; + + @DynamicSerializeElement + private Coordinate ul; + + @DynamicSerializeElement + private Coordinate ur; + + @DynamicSerializeElement + private Coordinate lr; + + @DynamicSerializeElement + private Coordinate ll; + + /** + * @return the meshId + */ + public int getMeshId() { + return meshId; + } + + /** + * @param meshId + * the meshId to set + */ + public void setMeshId(int meshId) { + this.meshId = meshId; + } + + /** + * @return the ul + */ + public Coordinate getUl() { + return ul; + } + + /** + * @param ul + * the ul to set + */ + public void setUl(Coordinate ul) { + this.ul = ul; + } + + /** + * @return the ur + */ + public Coordinate getUr() { + return ur; + } + + /** + * @param ur + * the ur to set + */ + public void setUr(Coordinate ur) { + this.ur = ur; + } + + /** + * @return the lr + */ + public Coordinate getLr() { + return lr; + } + + /** + * @param lr + * the lr to set + */ + public void setLr(Coordinate lr) { + this.lr = lr; + } + + /** + * @return the ll + */ + public Coordinate getLl() { + return ll; + } + + /** + * @param ll + * the ll to set + */ + public void setLl(Coordinate ll) { + this.ll = ll; + } + + public void setPixelCoverage(PixelCoverage coverage) { + this.ll = coverage.getLl(); + this.lr = coverage.getLr(); + this.ur = coverage.getUr(); + this.ul = coverage.getUl(); + } +} diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/paint/PaintImagesEvent.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/paint/PaintImagesEvent.java new file mode 100644 index 0000000000..b3fa67b476 --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/paint/PaintImagesEvent.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.remote.graphics.events.paint; + +import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; +import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; +import com.raytheon.uf.viz.remote.graphics.AbstractRemoteGraphicsEvent; + +/** + * TODO Add Description + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 8, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ +@DynamicSerialize +public class PaintImagesEvent extends AbstractRemoteGraphicsEvent { + + @DynamicSerializeElement + private PaintImageEvent[] imageEvents; + + /** + * @return the imageEvents + */ + public PaintImageEvent[] getImageEvents() { + return imageEvents; + } + + /** + * @param imageEvents + * the imageEvents to set + */ + public void setImageEvents(PaintImageEvent[] imageEvents) { + this.imageEvents = imageEvents; + } + +} diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/wireframe/AllocatePointsEvent.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/wireframe/AllocatePointsEvent.java new file mode 100644 index 0000000000..51c8258c8f --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/wireframe/AllocatePointsEvent.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.remote.graphics.events.wireframe; + +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; + +/** + * TODO Add Description + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 26, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ +@DynamicSerialize +public class AllocatePointsEvent extends AbstractDispatchingObjectEvent { + + @DynamicSerializeElement + private int numberOfPoints; + + /** + * @return the numberOfPoints + */ + public int getNumberOfPoints() { + return numberOfPoints; + } + + /** + * @param numberOfPoints + * the numberOfPoints to set + */ + public void setNumberOfPoints(int numberOfPoints) { + this.numberOfPoints = numberOfPoints; + } + +} diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/wireframe/CreateWireframeShapeEvent.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/wireframe/CreateWireframeShapeEvent.java new file mode 100644 index 0000000000..e6106f63aa --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/wireframe/CreateWireframeShapeEvent.java @@ -0,0 +1,147 @@ +/** + * 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.remote.graphics.events.wireframe; + +import org.geotools.coverage.grid.GeneralGridGeometry; + +import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; +import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; +import com.raytheon.uf.viz.core.IExtent; +import com.raytheon.uf.viz.core.PixelExtent; +import com.raytheon.uf.viz.remote.graphics.events.AbstractDispatchingObjectEvent; + +/** + * TODO Add Description + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 27, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ +@DynamicSerialize +public class CreateWireframeShapeEvent extends AbstractDispatchingObjectEvent { + + @DynamicSerializeElement + private GeneralGridGeometry gridGeometry; + + @DynamicSerializeElement + private Boolean mutable; + + @DynamicSerializeElement + private Float simplificationLevel; + + @DynamicSerializeElement + private Boolean spatialChopFlag; + + @DynamicSerializeElement + private double[] extent; + + /** + * @return the gridGeometry + */ + public GeneralGridGeometry getGridGeometry() { + return gridGeometry; + } + + /** + * @param gridGeometry + * the gridGeometry to set + */ + public void setGridGeometry(GeneralGridGeometry gridGeometry) { + this.gridGeometry = gridGeometry; + } + + /** + * @return the mutable + */ + public boolean isMutable() { + return mutable; + } + + /** + * @param mutable + * the mutable to set + */ + public void setMutable(boolean mutable) { + this.mutable = mutable; + } + + /** + * @return the simplificationLevel + */ + public float getSimplificationLevel() { + return simplificationLevel; + } + + /** + * @param simplificationLevel + * the simplificationLevel to set + */ + public void setSimplificationLevel(float simplificationLevel) { + this.simplificationLevel = simplificationLevel; + } + + /** + * @return the spatialChopFlag + */ + public boolean isSpatialChopFlag() { + return spatialChopFlag; + } + + /** + * @param spatialChopFlag + * the spatialChopFlag to set + */ + public void setSpatialChopFlag(boolean spatialChopFlag) { + this.spatialChopFlag = spatialChopFlag; + } + + /** + * @return the extent + */ + public double[] getExtent() { + return extent; + } + + /** + * @param extent + * the extent to set + */ + public void setExtent(double[] extent) { + this.extent = extent; + } + + public void setIExtent(IExtent extent) { + setExtent(new double[] { extent.getMinX(), extent.getMaxX(), + extent.getMinY(), extent.getMaxY() }); + } + + public IExtent getIExtent() { + return new PixelExtent(extent[0], extent[1], extent[2], extent[3]); + } +} diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/wireframe/SimpleWireframeShapeEvent.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/wireframe/SimpleWireframeShapeEvent.java new file mode 100644 index 0000000000..085897b939 --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/wireframe/SimpleWireframeShapeEvent.java @@ -0,0 +1,67 @@ +/** + * 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.remote.graphics.events.wireframe; + +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; + +/** + * TODO Add Description + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 26, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ +@DynamicSerialize +public class SimpleWireframeShapeEvent extends AbstractDispatchingObjectEvent { + + public static enum EventAction { + DISPOSE, RESET, CLEAR_LABELS, COMPILE; + } + + @DynamicSerializeElement + private EventAction action; + + /** + * @return the action + */ + public EventAction getAction() { + return action; + } + + /** + * @param action + * the action to set + */ + public void setAction(EventAction action) { + this.action = action; + } + +} diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/wireframe/UpdateWireframeShapeEvent.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/wireframe/UpdateWireframeShapeEvent.java new file mode 100644 index 0000000000..f6dc0dc122 --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/wireframe/UpdateWireframeShapeEvent.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.remote.graphics.events.wireframe; + +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; + +/** + * TODO Add Description + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 29, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ +@DynamicSerialize +public class UpdateWireframeShapeEvent extends AbstractDispatchingObjectEvent { + + @DynamicSerializeElement + private WireframeShapeData wireframeData; + + /** + * @return the wireframeData + */ + public WireframeShapeData getWireframeData() { + return wireframeData; + } + + /** + * @param wireframeData + * the wireframeData to set + */ + public void setWireframeData(WireframeShapeData wireframeData) { + this.wireframeData = wireframeData; + } + +} diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/wireframe/WireframeShapeData.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/wireframe/WireframeShapeData.java new file mode 100644 index 0000000000..c24204af94 --- /dev/null +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/wireframe/WireframeShapeData.java @@ -0,0 +1,139 @@ +/** + * 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.remote.graphics.events.wireframe; + +import java.util.LinkedList; +import java.util.List; + +import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; +import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; + +/** + * TODO Add Description + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 26, 2012            mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ +@DynamicSerialize +public class WireframeShapeData { + + @DynamicSerialize + public static class Label { + + @DynamicSerializeElement + private String text; + + @DynamicSerializeElement + private double[] point; + + private Label(String text, double[] point) { + this.text = text; + this.point = point; + } + + public Label() { + + } + + /** + * @return the text + */ + public String getText() { + return text; + } + + /** + * @param text + * the text to set + */ + public void setText(String text) { + this.text = text; + } + + /** + * @return the point + */ + public double[] getPoint() { + return point; + } + + /** + * @param point + * the point to set + */ + public void setPoint(double[] point) { + this.point = point; + } + } + + @DynamicSerializeElement + private List coordinates = new LinkedList(); + + @DynamicSerializeElement + private List