Issue #239 Start of remote target capabilities

Former-commit-id: d2d03e2c64 [formerly 30b76609cff9a737b8e4190bbfebb5a37a259fad]
Former-commit-id: 6c411ffb07
This commit is contained in:
Max Schenkelberg 2012-04-03 15:11:20 -05:00
parent ccde60b87e
commit ac1fc79f5b
55 changed files with 5806 additions and 7 deletions

View file

@ -114,4 +114,11 @@
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.viz.remote.graphics"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>

View file

@ -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
*

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.raytheon.uf.viz.remote.graphics</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View file

@ -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

View file

@ -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

View file

@ -0,0 +1,4 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.

View file

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<?eclipse version="3.2"?>
<plugin>
<extension
point="com.raytheon.uf.viz.core.graphicsExtension">
<graphicsExtension
class="com.raytheon.uf.viz.remote.graphics.extensions.DispatchColormappedImageExtension">
</graphicsExtension>
<graphicsExtension
class="com.raytheon.uf.viz.remote.graphics.extensions.DispatchingMapMeshExtension">
</graphicsExtension>
</extension>
</plugin>

View file

@ -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
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 8, 2012 mschenke Initial creation
*
* </pre>
*
* @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;
}
}

View file

@ -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;
}
}

View file

@ -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
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 28, 2012 mschenke Initial creation
*
* </pre>
*
* @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);
}

View file

@ -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
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 8, 2012 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public interface DispatcherFactory {
/**
* Creates a new Dispatcher object for dispatching events
*
* @return
*/
public Dispatcher createNewDispatcher();
}

View file

@ -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
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 5, 2012 mschenke Initial creation
*
* </pre>
*
* @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();
// }
// }
// }
}
}

View file

@ -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
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 28, 2012 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public class DispatchingObject<T> {
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);
}
}

View file

@ -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
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 8, 2012 mschenke Initial creation
*
* </pre>
*
* @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;
}
}

View file

@ -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
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 8, 2012 mschenke Initial creation
*
* </pre>
*
* @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;
}
}

View file

@ -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
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 26, 2012 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
@DynamicSerialize
public class DisposeImageEvent extends AbstractDispatchingObjectEvent {
}

View file

@ -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
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 8, 2012 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
@DynamicSerialize
public class EndFrameEvent extends AbstractRemoteGraphicsEvent {
}

View file

@ -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
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 8, 2012 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public class RemoteGraphicsEventFactory {
public static <T extends AbstractRemoteGraphicsEvent> T createEvent(
Class<? extends T> 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;
}
}

View file

@ -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
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 29, 2012 mschenke Initial creation
*
* </pre>
*
* @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);
}
}
}
}

View file

@ -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
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 26, 2012 mschenke Initial creation
*
* </pre>
*
* @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;
}
}

View file

@ -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
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 9, 2012 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
@DynamicSerialize
@DynamicSerializeTypeAdapter(factory = ColorMapDataEventAdapter.class)
public class ColorMapDataEvent extends AbstractDispatchingObjectEvent {
public static class ColorMapDataEventAdapter implements
ISerializationTypeAdapter<ColorMapDataEvent> {
/*
* (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;
}
}

View file

@ -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
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 8, 2012 mschenke Initial creation
*
* </pre>
*
* @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;
}
}

View file

@ -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
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 8, 2012 mschenke Initial creation
*
* </pre>
*
* @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;
}
}

View file

@ -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
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 26, 2012 mschenke Initial creation
*
* </pre>
*
* @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;
}
}

View file

@ -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
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 26, 2012 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
@DynamicSerialize
public class DisposeMeshEvent extends AbstractDispatchingObjectEvent {
}

View file

@ -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
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 26, 2012 mschenke Initial creation
*
* </pre>
*
* @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;
}
}

View file

@ -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
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 29, 2012 mschenke Initial creation
*
* </pre>
*
* @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;
}
}

View file

@ -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
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 29, 2012 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
@DynamicSerialize
public class RenderOffscreenEvent extends AbstractDispatchingObjectEvent {
}

View file

@ -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
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 29, 2012 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
@DynamicSerialize
public class RenderOnscreenEvent extends AbstractRemoteGraphicsEvent {
}

View file

@ -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
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 8, 2012 mschenke Initial creation
*
* </pre>
*
* @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();
}
}

View file

@ -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
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 8, 2012 mschenke Initial creation
*
* </pre>
*
* @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;
}
}

View file

@ -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
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 26, 2012 mschenke Initial creation
*
* </pre>
*
* @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;
}
}

View file

@ -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
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 27, 2012 mschenke Initial creation
*
* </pre>
*
* @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]);
}
}

View file

@ -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
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 26, 2012 mschenke Initial creation
*
* </pre>
*
* @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;
}
}

View file

@ -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
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 29, 2012 mschenke Initial creation
*
* </pre>
*
* @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;
}
}

View file

@ -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
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 26, 2012 mschenke Initial creation
*
* </pre>
*
* @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<double[][]> coordinates = new LinkedList<double[][]>();
@DynamicSerializeElement
private List<Label> labels = new LinkedList<Label>();
/**
* @return the labels
*/
public List<Label> getLabels() {
return labels;
}
/**
* @param labels
* the labels to set
*/
public void setLabels(List<Label> labels) {
this.labels = labels;
}
/**
* @return the coordinates
*/
public List<double[][]> getCoordinates() {
return coordinates;
}
/**
* @param coordinates
* the coordinates to set
*/
public void setCoordinates(List<double[][]> coordinates) {
this.coordinates = coordinates;
}
public void addLabel(String text, double[] point) {
labels.add(new Label(text, point));
}
public void addCoordinates(double[][] points) {
coordinates.add(points);
}
}

View file

@ -0,0 +1,127 @@
/**
* 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.extensions;
import java.util.ArrayList;
import java.util.List;
import com.raytheon.uf.viz.core.DrawableImage;
import com.raytheon.uf.viz.core.IMesh;
import com.raytheon.uf.viz.core.PixelCoverage;
import com.raytheon.uf.viz.core.drawables.IImage;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension;
import com.raytheon.uf.viz.core.drawables.ext.IImagingExtension;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.remote.graphics.DispatchGraphicsTarget;
import com.raytheon.uf.viz.remote.graphics.events.RemoteGraphicsEventFactory;
import com.raytheon.uf.viz.remote.graphics.events.paint.PaintImageEvent;
import com.raytheon.uf.viz.remote.graphics.events.paint.PaintImagesEvent;
import com.raytheon.uf.viz.remote.graphics.objects.AbstractDispatchingImage;
import com.raytheon.uf.viz.remote.graphics.objects.DispatchingMesh;
/**
* TODO Add Description
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 5, 2012 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public abstract class AbstractDispatchingImageExtension extends
GraphicsExtension<DispatchGraphicsTarget> implements IImagingExtension {
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension#
* getCompatibilityValue(com.raytheon.uf.viz.core.IGraphicsTarget)
*/
@Override
public int getCompatibilityValue(DispatchGraphicsTarget target) {
return Compatibilty.TARGET_COMPATIBLE;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.drawables.ext.IImagingExtension#drawRasters(
* com.raytheon.uf.viz.core.drawables.PaintProperties,
* com.raytheon.uf.viz.core.DrawableImage[])
*/
@Override
public boolean drawRasters(PaintProperties paintProps,
DrawableImage... images) throws VizException {
// All of these images are ready for actual rendering (status == LOADED)
List<DrawableImage> targeted = new ArrayList<DrawableImage>(
images.length);
PaintImageEvent[] imageEvents = new PaintImageEvent[images.length];
for (int i = 0; i < images.length; ++i) {
DrawableImage di = images[i];
AbstractDispatchingImage<?> dispatchingImage = (AbstractDispatchingImage<?>) di
.getImage();
// If image parameters have been modified, update
dispatchingImage.updateState();
IImage targetImage = dispatchingImage.getWrappedObject();
PixelCoverage coverage = di.getCoverage();
PixelCoverage targetCoverage = new PixelCoverage(coverage.getUl(),
coverage.getUr(), coverage.getLr(), coverage.getLl());
PaintImageEvent paintEvent = RemoteGraphicsEventFactory
.createEvent(PaintImageEvent.class, dispatchingImage);
paintEvent.setPixelCoverage(coverage);
IMesh mesh = coverage.getMesh();
IMesh targetMesh = null;
if (mesh != null) {
DispatchingMesh dmesh = (DispatchingMesh) mesh;
targetMesh = dmesh.getWrappedObject();
paintEvent.setMeshId(dmesh.getObjectId());
targetCoverage.setMesh(targetMesh);
}
targeted.add(new DrawableImage(targetImage, targetCoverage, di
.getMode()));
imageEvents[i] = paintEvent;
}
PaintImagesEvent bulkRender = RemoteGraphicsEventFactory.createEvent(
PaintImagesEvent.class, target);
bulkRender.setImageEvents(imageEvents);
target.dispatch(bulkRender);
return target.getWrappedObject().drawRasters(paintProps,
targeted.toArray(new DrawableImage[targeted.size()]));
}
}

View file

@ -0,0 +1,80 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.remote.graphics.extensions;
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback;
import com.raytheon.uf.viz.core.drawables.ColorMapParameters;
import com.raytheon.uf.viz.core.drawables.IColormappedImage;
import com.raytheon.uf.viz.core.drawables.ext.colormap.IColormappedImageExtension;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.remote.graphics.objects.DispatchingColormappedImage;
import com.raytheon.uf.viz.remote.graphics.objects.DispatchingColormappedImage.DispatchingColormappedCallback;
/**
* TODO Add Description
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 28, 2012 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public class DispatchColormappedImageExtension extends
AbstractDispatchingImageExtension implements IColormappedImageExtension {
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.drawables.ext.colormap.IColormappedImageExtension
* #
* initializeRaster(com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback
* , com.raytheon.uf.viz.core.drawables.ColorMapParameters)
*/
@Override
public IColormappedImage initializeRaster(
IColorMapDataRetrievalCallback dataCallback,
ColorMapParameters colorMapParameters) {
IColormappedImageExtension targetExt;
try {
targetExt = target.getWrappedObject().getExtension(
IColormappedImageExtension.class);
} catch (VizException e) {
throw new RuntimeException(
"Could not get IColormappedImageExtension from targetObject",
e);
}
DispatchingColormappedCallback wrapper = new DispatchingColormappedCallback(
dataCallback);
IColormappedImage actualImage = targetExt.initializeRaster(wrapper,
colorMapParameters);
return new DispatchingColormappedImage(actualImage, wrapper,
target.getDispatcher());
}
}

View file

@ -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.extensions;
import com.raytheon.uf.viz.core.drawables.ext.IImagingExtension;
/**
* TODO Add Description
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 5, 2012 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public class DispatchingImagingExtension extends
AbstractDispatchingImageExtension implements IImagingExtension {
}

View file

@ -0,0 +1,106 @@
/**
* 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.extensions;
import org.geotools.coverage.grid.GeneralGridGeometry;
import org.geotools.coverage.grid.GridGeometry2D;
import com.raytheon.uf.viz.core.IMesh;
import com.raytheon.uf.viz.core.drawables.IDescriptor;
import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.map.IMapMeshExtension;
import com.raytheon.uf.viz.remote.graphics.DispatchGraphicsTarget;
import com.raytheon.uf.viz.remote.graphics.events.RemoteGraphicsEventFactory;
import com.raytheon.uf.viz.remote.graphics.events.mesh.CreateMeshEvent;
import com.raytheon.uf.viz.remote.graphics.objects.DispatchingMesh;
/**
* TODO Add Description
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 5, 2012 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public class DispatchingMapMeshExtension extends
GraphicsExtension<DispatchGraphicsTarget> implements IMapMeshExtension {
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.map.IMapMeshExtension#constructMesh(org.geotools
* .coverage.grid.GridGeometry2D,
* com.raytheon.uf.viz.core.drawables.IDescriptor)
*/
@Override
public IMesh constructMesh(GridGeometry2D imageGeometry,
IDescriptor targetDescriptor) throws VizException {
return constructMesh(imageGeometry, targetDescriptor.getGridGeometry());
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.map.IMapMeshExtension#constructMesh(org.geotools
* .coverage.grid.GridGeometry2D,
* org.geotools.coverage.grid.GeneralGridGeometry)
*/
@Override
public IMesh constructMesh(GridGeometry2D imageGeometry,
GeneralGridGeometry targetGeometry) throws VizException {
IMesh targetMesh = target.getExtension(IMapMeshExtension.class)
.constructMesh(imageGeometry, targetGeometry);
DispatchingMesh mesh = new DispatchingMesh(targetMesh,
target.getDispatcher());
// Send mesh creation event
CreateMeshEvent event = RemoteGraphicsEventFactory.createEvent(
CreateMeshEvent.class, mesh);
event.setImageGeometry(imageGeometry);
event.setTargetGeometry(targetGeometry);
target.dispatch(event);
return mesh;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension#
* getCompatibilityValue(com.raytheon.uf.viz.core.IGraphicsTarget)
*/
@Override
public int getCompatibilityValue(DispatchGraphicsTarget target) {
return Compatibilty.TARGET_COMPATIBLE;
}
}

View file

@ -0,0 +1,169 @@
/**
* 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.extensions;
import java.nio.Buffer;
import com.raytheon.uf.viz.core.drawables.ColorMapParameters;
import com.raytheon.uf.viz.core.drawables.IImage;
import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension;
import com.raytheon.uf.viz.core.drawables.ext.IOffscreenRenderingExtension;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.remote.graphics.DispatchGraphicsTarget;
import com.raytheon.uf.viz.remote.graphics.events.RemoteGraphicsEventFactory;
import com.raytheon.uf.viz.remote.graphics.events.colormap.UpdateColorMapParametersEvent;
import com.raytheon.uf.viz.remote.graphics.events.offscreen.CreateOffscreenImageEvent;
import com.raytheon.uf.viz.remote.graphics.events.offscreen.RenderOffscreenEvent;
import com.raytheon.uf.viz.remote.graphics.events.offscreen.RenderOnscreenEvent;
import com.raytheon.uf.viz.remote.graphics.objects.AbstractDispatchingImage;
import com.raytheon.uf.viz.remote.graphics.objects.DispatchingOffscreenImage;
/**
* Offscreen rendering extension that creates remote images for offscreen
* rendering
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 29, 2012 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public class DispatchingOffscreenRenderingExtension extends
GraphicsExtension<DispatchGraphicsTarget> implements
IOffscreenRenderingExtension {
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.ext.IOffscreenRenderingExtension#
* renderOffscreen(com.raytheon.uf.viz.core.drawables.IImage)
*/
@Override
public void renderOffscreen(IImage offscreenImage) throws VizException {
AbstractDispatchingImage<?> image = (AbstractDispatchingImage<?>) offscreenImage;
// Render off screen for target image
target.getWrappedObject()
.getExtension(IOffscreenRenderingExtension.class)
.renderOffscreen(image.getWrappedObject());
// Send event for offscreen rendering
image.dispatch(RemoteGraphicsEventFactory.createEvent(
RenderOffscreenEvent.class, image));
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.ext.IOffscreenRenderingExtension#
* renderOnscreen()
*/
@Override
public void renderOnscreen() throws VizException {
target.getWrappedObject()
.getExtension(IOffscreenRenderingExtension.class)
.renderOnscreen();
// Send event
target.dispatch(RemoteGraphicsEventFactory.createEvent(
RenderOnscreenEvent.class, target));
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.ext.IOffscreenRenderingExtension#
* constructOffscreenImage(int[])
*/
@Override
public IImage constructOffscreenImage(int[] dimensions) throws VizException {
IImage wrapped = target
.getExtension(IOffscreenRenderingExtension.class)
.constructOffscreenImage(dimensions);
return createOffscreenImage(wrapped, null, dimensions, null);
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.ext.IOffscreenRenderingExtension#
* constructOffscreenImage(java.lang.Class, int[])
*/
@Override
public IImage constructOffscreenImage(Class<? extends Buffer> dataType,
int[] dimensions) throws VizException {
return constructOffscreenImage(dataType, dimensions, null);
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.ext.IOffscreenRenderingExtension#
* constructOffscreenImage(java.lang.Class, int[],
* com.raytheon.uf.viz.core.drawables.ColorMapParameters)
*/
@Override
public IImage constructOffscreenImage(Class<? extends Buffer> dataType,
int[] dimensions, ColorMapParameters parameters)
throws VizException {
IImage offscreenImage = target.getWrappedObject()
.getExtension(IOffscreenRenderingExtension.class)
.constructOffscreenImage(dataType, dimensions, parameters);
return createOffscreenImage(offscreenImage, dataType, dimensions,
parameters);
}
private DispatchingOffscreenImage createOffscreenImage(IImage wrapped,
Class<? extends Buffer> dataType, int[] dimensions,
ColorMapParameters parameters) {
DispatchingOffscreenImage wrapper = new DispatchingOffscreenImage(
wrapped, target.getDispatcher(), parameters);
// Send event of offscreen image creation
CreateOffscreenImageEvent event = RemoteGraphicsEventFactory
.createEvent(CreateOffscreenImageEvent.class, wrapper);
event.setDimensions(dimensions);
if (dataType != null) {
event.setBufferType(dataType.getName());
}
if (parameters != null) {
event.setColorMapParamters(UpdateColorMapParametersEvent
.createEvent(wrapper, parameters));
}
wrapper.dispatch(event);
return wrapper;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension#
* getCompatibilityValue(com.raytheon.uf.viz.core.IGraphicsTarget)
*/
@Override
public int getCompatibilityValue(DispatchGraphicsTarget target) {
return Compatibilty.TARGET_COMPATIBLE;
}
}

View file

@ -0,0 +1,100 @@
/**
* 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.objects;
import com.raytheon.uf.common.colormap.IColorMap;
import com.raytheon.uf.viz.core.drawables.ColorMapParameters;
import com.raytheon.uf.viz.core.drawables.IColorMapParametersListener;
import com.raytheon.uf.viz.core.drawables.IImage;
import com.raytheon.uf.viz.core.drawables.ext.IImagingExtension;
import com.raytheon.uf.viz.remote.graphics.Dispatcher;
import com.raytheon.uf.viz.remote.graphics.events.colormap.UpdateColorMapParametersEvent;
/**
* TODO Add Description
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 29, 2012 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public abstract class AbstractDispatchingColormappedImage<T extends IImage>
extends AbstractDispatchingImage<T> implements
IColorMapParametersListener {
private IColorMap colorMap;
/**
* @param targetObject
* @param extensionClass
* @param dispatcher
*/
public AbstractDispatchingColormappedImage(T targetObject,
Class<? extends IImagingExtension> extensionClass,
Dispatcher dispatcher, ColorMapParameters parameters) {
super(targetObject, extensionClass, dispatcher);
if (parameters != null) {
this.colorMap = parameters.getColorMap();
parameters.addListener(this);
}
}
public abstract ColorMapParameters getColorMapParameters();
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.IColorMapParametersListener#
* colorMapChanged()
*/
@Override
public void colorMapChanged() {
ColorMapParameters parameters = getColorMapParameters();
if (parameters != null) {
dispatch(createColorMapParametersUpdateEvent(parameters));
}
}
protected UpdateColorMapParametersEvent createColorMapParametersUpdateEvent(
ColorMapParameters parameters) {
UpdateColorMapParametersEvent event = UpdateColorMapParametersEvent
.createEvent(this, parameters);
if (parameters.getColorMap() == colorMap) {
// Same colormap, discard cm data
event.setRed(null);
event.setBlue(null);
event.setGreen(null);
event.setAlpha(null);
} else {
colorMap = parameters.getColorMap();
}
return event;
}
}

View file

@ -0,0 +1,186 @@
/**
* 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.objects;
import com.raytheon.uf.viz.core.drawables.IImage;
import com.raytheon.uf.viz.core.drawables.ext.IImagingExtension;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.remote.graphics.Dispatcher;
import com.raytheon.uf.viz.remote.graphics.DispatchingObject;
import com.raytheon.uf.viz.remote.graphics.events.DisposeImageEvent;
import com.raytheon.uf.viz.remote.graphics.events.RemoteGraphicsEventFactory;
import com.raytheon.uf.viz.remote.graphics.events.UpdateImageDataEvent;
/**
* Abstract dispatching image object created from graphics image and forwards
* key events to remote clients
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 28, 2012 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public abstract class AbstractDispatchingImage<T extends IImage> extends
DispatchingObject<T> implements IImage {
protected boolean dirty = true;
protected UpdateImageDataEvent imageData;
private Class<? extends IImagingExtension> extensionClass;
/**
* @param targetObject
* @param dispatcher
*/
public AbstractDispatchingImage(T targetObject,
Class<? extends IImagingExtension> extensionClass,
Dispatcher dispatcher) {
super(targetObject, dispatcher);
this.extensionClass = extensionClass;
this.imageData = RemoteGraphicsEventFactory.createEvent(
UpdateImageDataEvent.class, this);
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.IImage#getStatus()
*/
@Override
public Status getStatus() {
return wrappedObject.getStatus();
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.IImage#setInterpolated(boolean)
*/
@Override
public void setInterpolated(boolean isInterpolated) {
if (isInterpolated != imageData.isInterpolated()) {
imageData.setInterpolated(isInterpolated);
wrappedObject.setInterpolated(isInterpolated);
dirty = true;
}
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.IImage#dispose()
*/
@Override
public void dispose() {
wrappedObject.dispose();
// Dispatch the dispose
dispatch(RemoteGraphicsEventFactory.createEvent(
DisposeImageEvent.class, this));
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.IImage#getWidth()
*/
@Override
public int getWidth() {
return wrappedObject.getWidth();
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.IImage#getHeight()
*/
@Override
public int getHeight() {
return wrappedObject.getHeight();
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.IImage#setBrightness(float)
*/
@Override
public void setBrightness(float brightness) {
if (brightness != imageData.getBrightness()) {
imageData.setBrightness(brightness);
wrappedObject.setBrightness(brightness);
dirty = true;
}
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.IImage#setContrast(float)
*/
@Override
public void setContrast(float contrast) {
if (contrast != imageData.getContrast()) {
imageData.setContrast(contrast);
wrappedObject.setContrast(contrast);
dirty = true;
}
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.IImage#stage()
*/
@Override
public void stage() throws VizException {
wrappedObject.stage();
}
/**
* Dispatches event updating image state
*/
public void updateState() {
if (dirty) {
dispatch(imageData);
dirty = false;
}
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.IImage#getExtensionClass()
*/
@Override
public Class<? extends IImagingExtension> getExtensionClass() {
return extensionClass;
}
}

View file

@ -0,0 +1,149 @@
/**
* 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.objects;
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback;
import com.raytheon.uf.viz.core.drawables.ColorMapParameters;
import com.raytheon.uf.viz.core.drawables.IColormappedImage;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.remote.graphics.Dispatcher;
import com.raytheon.uf.viz.remote.graphics.events.RemoteGraphicsEventFactory;
import com.raytheon.uf.viz.remote.graphics.events.colormap.ColorMapDataEvent;
import com.raytheon.uf.viz.remote.graphics.events.colormap.CreateColormappedImageEvent;
import com.raytheon.uf.viz.remote.graphics.extensions.DispatchColormappedImageExtension;
/**
* Dispatching colormapped image object created from graphics image and forwards
* key events to remote clients
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 28, 2012 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public class DispatchingColormappedImage extends
AbstractDispatchingColormappedImage<IColormappedImage> implements
IColormappedImage {
public static class DispatchingColormappedCallback implements
IColorMapDataRetrievalCallback {
private IColorMapDataRetrievalCallback callback;
private DispatchingColormappedImage image;
public DispatchingColormappedCallback(
IColorMapDataRetrievalCallback callback) {
this.callback = callback;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback#
* getColorMapData()
*/
@Override
public ColorMapData getColorMapData() throws VizException {
ColorMapData data = callback.getColorMapData();
ColorMapDataEvent event = RemoteGraphicsEventFactory.createEvent(
ColorMapDataEvent.class, image);
event.setColorMapData(data);
image.dispatch(event);
return data;
}
}
/**
* @param targetObject
* @param dispatcher
*/
public DispatchingColormappedImage(IColormappedImage targetObject,
DispatchingColormappedCallback callback, Dispatcher dispatcher) {
super(targetObject, DispatchColormappedImageExtension.class,
dispatcher, targetObject.getColorMapParameters());
callback.image = this;
ColorMapParameters parameters = targetObject.getColorMapParameters();
// Send creation event
CreateColormappedImageEvent creation = RemoteGraphicsEventFactory
.createEvent(CreateColormappedImageEvent.class, this);
if (parameters != null) {
creation.setColorMapParameters(createColorMapParametersUpdateEvent(parameters));
}
dispatch(creation);
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.drawables.IColormappedImage#getColorMapParameters
* ()
*/
@Override
public ColorMapParameters getColorMapParameters() {
return wrappedObject.getColorMapParameters();
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.drawables.IColormappedImage#setColorMapParameters
* (com.raytheon.uf.viz.core.drawables.ColorMapParameters)
*/
@Override
public void setColorMapParameters(ColorMapParameters params) {
ColorMapParameters parameters = getColorMapParameters();
if (params != parameters) {
if (parameters != null) {
parameters.removeListener(this);
}
wrappedObject.setColorMapParameters(params);
if (params != null) {
params.addListener(this);
dispatch(createColorMapParametersUpdateEvent(params));
}
}
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.IColormappedImage#getValue(int,
* int)
*/
@Override
public double getValue(int x, int y) {
return wrappedObject.getValue(x, y);
}
}

View file

@ -0,0 +1,89 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.remote.graphics.objects;
import java.awt.image.RenderedImage;
import com.raytheon.uf.viz.core.data.IRenderedImageCallback;
import com.raytheon.uf.viz.core.drawables.IImage;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.remote.graphics.Dispatcher;
import com.raytheon.uf.viz.remote.graphics.events.RemoteGraphicsEventFactory;
import com.raytheon.uf.viz.remote.graphics.events.RenderedImageEvent;
import com.raytheon.uf.viz.remote.graphics.extensions.DispatchingImagingExtension;
/**
* Dispatching image object created from existing image and forwards key events
* to remote clients
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 28, 2012 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public class DispatchingImage extends AbstractDispatchingImage<IImage> {
public static class DispatchingRenderedImageCallback implements
IRenderedImageCallback {
private IRenderedImageCallback callback;
private DispatchingImage image;
public DispatchingRenderedImageCallback(IRenderedImageCallback callback) {
this.callback = callback;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.data.IRenderedImageCallback#getImage()
*/
@Override
public RenderedImage getImage() throws VizException {
RenderedImage image = callback.getImage();
RenderedImageEvent event = RemoteGraphicsEventFactory.createEvent(
RenderedImageEvent.class, this.image);
event.setRenderedImage(image);
this.image.dispatch(event);
return image;
}
}
/**
* @param targetObject
* @param dispatcher
*/
public DispatchingImage(IImage targetObject,
DispatchingRenderedImageCallback callback, Dispatcher dispatcher) {
super(targetObject, DispatchingImagingExtension.class, dispatcher);
callback.image = this;
}
}

View file

@ -0,0 +1,104 @@
/**
* 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.objects;
import org.geotools.coverage.grid.GeneralGridGeometry;
import com.raytheon.uf.viz.core.IExtent;
import com.raytheon.uf.viz.core.IMesh;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.remote.graphics.Dispatcher;
import com.raytheon.uf.viz.remote.graphics.DispatchingObject;
import com.raytheon.uf.viz.remote.graphics.events.RemoteGraphicsEventFactory;
import com.raytheon.uf.viz.remote.graphics.events.mesh.DisposeMeshEvent;
import com.raytheon.uf.viz.remote.graphics.events.mesh.ReprojectMeshEvent;
/**
* Dispatching mesh object created from graphics mesh and forwards key events to
* remote clients
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 5, 2012 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public class DispatchingMesh extends DispatchingObject<IMesh> implements IMesh {
/**
* @param targetObject
* @param dispatcher
*/
public DispatchingMesh(IMesh targetObject, Dispatcher dispatcher) {
super(targetObject, dispatcher);
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.IMesh#dispose()
*/
@Override
public void dispose() {
wrappedObject.dispose();
// Send event to dispose mesh
dispatch(RemoteGraphicsEventFactory.createEvent(DisposeMeshEvent.class,
this));
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.IMesh#intersects(com.raytheon.uf.viz.core.IExtent
* )
*/
@Override
public boolean intersects(IExtent extent) {
return wrappedObject.intersects(extent);
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.IMesh#reproject(org.geotools.coverage.grid.
* GeneralGridGeometry)
*/
@Override
public void reproject(GeneralGridGeometry targetGeometry)
throws VizException {
wrappedObject.reproject(targetGeometry);
// Send event for reprojection
ReprojectMeshEvent event = RemoteGraphicsEventFactory.createEvent(
ReprojectMeshEvent.class, this);
event.setTargetGeometry(targetGeometry);
dispatch(event);
}
}

View file

@ -0,0 +1,87 @@
/**
* 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.objects;
import com.raytheon.uf.viz.core.drawables.ColorMapParameters;
import com.raytheon.uf.viz.core.drawables.IImage;
import com.raytheon.uf.viz.remote.graphics.Dispatcher;
import com.raytheon.uf.viz.remote.graphics.extensions.DispatchingImagingExtension;
/**
* TODO Add Description
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 29, 2012 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public class DispatchingOffscreenImage extends
AbstractDispatchingColormappedImage<IImage> {
private ColorMapParameters parameters;
/**
* @param targetObject
* @param extensionClass
* @param dispatcher
*/
public DispatchingOffscreenImage(IImage targetObject,
Dispatcher dispatcher, ColorMapParameters parameters) {
super(targetObject, DispatchingImagingExtension.class, dispatcher,
parameters);
this.parameters = parameters;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.remote.graphics.objects.
* AbstractDispatchingColormappedImage#getColorMapParameters()
*/
@Override
public ColorMapParameters getColorMapParameters() {
return parameters;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.remote.graphics.objects.AbstractDispatchingImage#
* dispose()
*/
@Override
public void dispose() {
super.dispose();
if (parameters != null) {
parameters.removeListener(this);
}
}
}

View file

@ -0,0 +1,241 @@
/**
* 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.objects;
import org.geotools.coverage.grid.GeneralGridGeometry;
import org.geotools.referencing.operation.DefaultMathTransformFactory;
import org.opengis.referencing.operation.MathTransform;
import org.opengis.referencing.operation.TransformException;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.core.drawables.AbstractDescriptor;
import com.raytheon.uf.viz.core.drawables.IWireframeShape;
import com.raytheon.uf.viz.remote.graphics.Activator;
import com.raytheon.uf.viz.remote.graphics.Dispatcher;
import com.raytheon.uf.viz.remote.graphics.DispatchingObject;
import com.raytheon.uf.viz.remote.graphics.events.RemoteGraphicsEventFactory;
import com.raytheon.uf.viz.remote.graphics.events.wireframe.AllocatePointsEvent;
import com.raytheon.uf.viz.remote.graphics.events.wireframe.SimpleWireframeShapeEvent;
import com.raytheon.uf.viz.remote.graphics.events.wireframe.SimpleWireframeShapeEvent.EventAction;
import com.raytheon.uf.viz.remote.graphics.events.wireframe.UpdateWireframeShapeEvent;
import com.raytheon.uf.viz.remote.graphics.events.wireframe.WireframeShapeData;
import com.vividsolutions.jts.geom.Coordinate;
/**
* Dispatching wireframe shape object created from graphics shape and forwards
* key events to remote clients
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 26, 2012 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public class DispatchingWireframeShape extends
DispatchingObject<IWireframeShape> implements IWireframeShape {
private MathTransform worldToTargetGrid;
private WireframeShapeData shapeData;
private boolean dirty = true;
/**
* @param targetObject
* @param dispatcher
*/
public DispatchingWireframeShape(IWireframeShape targetObject,
Dispatcher dispatcher, GeneralGridGeometry targetGeometry) {
super(targetObject, dispatcher);
this.shapeData = new WireframeShapeData();
MathTransform worldToCRS = AbstractDescriptor
.getWorldToCRSTransform(targetGeometry);
if (worldToCRS != null) {
try {
MathTransform crsToGrid = targetGeometry.getGridToCRS()
.inverse();
worldToTargetGrid = new DefaultMathTransformFactory()
.createConcatenatedTransform(worldToCRS, crsToGrid);
} catch (Exception e) {
Activator.statusHandler.handle(Priority.PROBLEM,
"Error getting transform from base crs to target grid",
e);
}
}
}
/**
*
* @see com.raytheon.uf.viz.core.drawables.IShape#compile()
*/
public void compile() {
wrappedObject.compile();
// flush data
updateState();
// Send compile event
sendSimpleEvent(EventAction.COMPILE);
}
/**
*
*/
public void updateState() {
if (dirty) {
if (shapeData != null) {
UpdateWireframeShapeEvent event = RemoteGraphicsEventFactory
.createEvent(UpdateWireframeShapeEvent.class, this);
event.setWireframeData(shapeData);
shapeData = new WireframeShapeData();
dispatch(event);
}
dirty = false;
}
}
private void sendSimpleEvent(EventAction action) {
SimpleWireframeShapeEvent event = RemoteGraphicsEventFactory
.createEvent(SimpleWireframeShapeEvent.class, this);
event.setAction(action);
dispatch(event);
}
/**
* @param latLong
* @see com.raytheon.uf.viz.core.drawables.IWireframeShape#addLineSegment(com.vividsolutions.jts.geom.Coordinate[])
*/
public void addLineSegment(Coordinate[] latLong) {
wrappedObject.addLineSegment(latLong);
double[][] points = new double[latLong.length][];
for (int i = 0; i < latLong.length; ++i) {
if (worldToTargetGrid != null) {
try {
double[] out = new double[2];
worldToTargetGrid.transform(new double[] { latLong[i].x,
latLong[i].y }, 0, out, 0, 1);
points[i] = out;
} catch (TransformException e) {
// Ignore...
}
} else {
points[i] = new double[] { latLong[i].x, latLong[i].y };
}
}
addLineSegment(points);
}
/**
* @return
* @see com.raytheon.uf.viz.core.drawables.IShape#isMutable()
*/
public boolean isMutable() {
return wrappedObject.isMutable();
}
/**
* @param screenCoordinates
* @see com.raytheon.uf.viz.core.drawables.IWireframeShape#addLineSegment(double[][])
*/
public void addLineSegment(double[][] screenCoordinates) {
wrappedObject.addLineSegment(screenCoordinates);
if (shapeData != null) {
shapeData.addCoordinates(screenCoordinates);
dirty = true;
}
}
/**
* @return
* @see com.raytheon.uf.viz.core.drawables.IShape#isDrawable()
*/
public boolean isDrawable() {
return wrappedObject.isDrawable();
}
/**
* @param label
* @param screenCoordinate
* @see com.raytheon.uf.viz.core.drawables.IWireframeShape#addLabel(java.lang.String,
* double[])
*/
public void addLabel(String label, double[] screenCoordinate) {
wrappedObject.addLabel(label, screenCoordinate);
if (shapeData != null) {
shapeData.addLabel(label, screenCoordinate);
dirty = true;
}
}
/**
*
* @see com.raytheon.uf.viz.core.drawables.IShape#dispose()
*/
public void dispose() {
wrappedObject.dispose();
// Send dispose event
sendSimpleEvent(EventAction.DISPOSE);
shapeData = null;
}
/**
*
* @see com.raytheon.uf.viz.core.drawables.IWireframeShape#clearLabels()
*/
public void clearLabels() {
wrappedObject.clearLabels();
// Send clear labels event
sendSimpleEvent(EventAction.CLEAR_LABELS);
if (shapeData != null) {
shapeData.getLabels().clear();
}
}
/**
* @param points
* @see com.raytheon.uf.viz.core.drawables.IWireframeShape#allocate(int)
*/
public void allocate(int points) {
wrappedObject.allocate(points);
// Send allocation event
AllocatePointsEvent event = RemoteGraphicsEventFactory.createEvent(
AllocatePointsEvent.class, this);
event.setNumberOfPoints(points);
dispatch(event);
}
/**
*
* @see com.raytheon.uf.viz.core.drawables.IShape#reset()
*/
public void reset() {
wrappedObject.reset();
// Send reset event
sendSimpleEvent(EventAction.RESET);
shapeData = new WireframeShapeData();
}
}

View file

@ -0,0 +1,353 @@
/**
* 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.objects;
import javax.vecmath.Vector3d;
import org.eclipse.swt.graphics.Rectangle;
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.PixelCoverage;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.geom.Plane;
import com.raytheon.uf.viz.remote.graphics.DispatchGraphicsTarget;
/**
* View that wraps a graphics view. This class exists because we can't pass in a
* DispatchGraphcisTarget to a view expecting a different type. We must pass in
* the dispatching targets wrapped target
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 7, 2012 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public class ViewWrapper implements IView {
private IView delegate;
public ViewWrapper(IView delegate) {
this.delegate = delegate;
}
private IGraphicsTarget getDelegateTarget(IGraphicsTarget target) {
if (target instanceof DispatchGraphicsTarget) {
return ((DispatchGraphicsTarget) target).getWrappedObject();
}
return target;
}
/**
* @param target
* @see com.raytheon.uf.viz.core.IView#setupView(com.raytheon.uf.viz.core.IGraphicsTarget)
*/
public void setupView(IGraphicsTarget target) {
// Any view functions that need a target must take the delegate target.
// We need to figure out a better way to do this so this class is not
// needed
delegate.setupView(getDelegateTarget(target));
}
/**
* @return
* @see com.raytheon.uf.viz.core.IView#getDisplayType()
*/
public String getDisplayType() {
return delegate.getDisplayType();
}
/**
* @return
* @see com.raytheon.uf.viz.core.IView#getZoom()
*/
public double getZoom() {
return delegate.getZoom();
}
/**
* @param dimensions
* @return
* @see com.raytheon.uf.viz.core.IView#recalcZoomLevel(int[])
*/
public double recalcZoomLevel(int[] dimensions) {
return delegate.recalcZoomLevel(dimensions);
}
/**
* @param factor
* @see com.raytheon.uf.viz.core.IView#setElevationExaggeration(double)
*/
public void setElevationExaggeration(double factor) {
delegate.setElevationExaggeration(factor);
}
/**
* @return
* @see com.raytheon.uf.viz.core.IView#getElevationExaggeration()
*/
public double getElevationExaggeration() {
return delegate.getElevationExaggeration();
}
/**
* @param zoomLevel
* @see com.raytheon.uf.viz.core.IView#zoom(double)
*/
public void zoom(double zoomLevel) {
delegate.zoom(zoomLevel);
}
/**
* @param factor
* @param screenX
* @param screenY
* @param target
* @see com.raytheon.uf.viz.core.IView#scaleAndBias(double, double, double,
* com.raytheon.uf.viz.core.IGraphicsTarget)
*/
public void scaleAndBias(double factor, double screenX, double screenY,
IGraphicsTarget target) {
delegate.scaleAndBias(factor, screenX, screenY,
getDelegateTarget(target));
}
/**
* @param pixel
* @return
* @see com.raytheon.uf.viz.core.IView#isVisible(double[])
*/
public boolean isVisible(double[] pixel) {
return delegate.isVisible(pixel);
}
/**
* @param pe
* @return
* @see com.raytheon.uf.viz.core.IView#isVisible(com.raytheon.uf.viz.core.IExtent)
*/
public boolean isVisible(IExtent pe) {
return delegate.isVisible(pe);
}
/**
* @return
* @see com.raytheon.uf.viz.core.IView#getExtent()
*/
public IExtent getExtent() {
return delegate.getExtent();
}
/**
* @param pe
* @see com.raytheon.uf.viz.core.IView#setExtent(com.raytheon.uf.viz.core.IExtent)
*/
public void setExtent(IExtent pe) {
delegate.setExtent(pe);
}
/**
* @param point
* @see com.raytheon.uf.viz.core.IView#setCenter(com.raytheon.uf.viz.core.Vector3d)
*/
public void setCenter(Vector3d point) {
delegate.setCenter(point);
}
/**
* @param screenCoordinate
* @param target
* @return
* @see com.raytheon.uf.viz.core.IView#getDisplayCoords(double[],
* com.raytheon.uf.viz.core.IGraphicsTarget)
*/
public double[] getDisplayCoords(double[] screenCoordinate,
IGraphicsTarget target) {
return delegate.getDisplayCoords(screenCoordinate,
getDelegateTarget(target));
}
/**
* @param lastMouse
* @param currentMouse
* @param shiftType
* @param target
* @return
* @see com.raytheon.uf.viz.core.IView#shiftPOV(double[], double[],
* com.raytheon.uf.viz.core.IView.POVShiftType,
* com.raytheon.uf.viz.core.IGraphicsTarget)
*/
public boolean shiftPOV(double[] lastMouse, double[] currentMouse,
POVShiftType shiftType, IGraphicsTarget target) {
return delegate.shiftPOV(lastMouse, currentMouse, shiftType,
getDelegateTarget(target));
}
/**
* @param delta
* @see com.raytheon.uf.viz.core.IView#setTilt(double)
*/
public void setTilt(double delta) {
delegate.setTilt(delta);
}
/**
* @return
* @see com.raytheon.uf.viz.core.IView#getTilt()
*/
public double getTilt() {
return delegate.getTilt();
}
/**
* @param currentMouse
* @param target
* @return
* @see com.raytheon.uf.viz.core.IView#setFocalPoint(double[],
* com.raytheon.uf.viz.core.IGraphicsTarget)
*/
public boolean setFocalPoint(double[] currentMouse, IGraphicsTarget target) {
return delegate.setFocalPoint(currentMouse, getDelegateTarget(target));
}
/**
* @return
* @see com.raytheon.uf.viz.core.IView#getClippingPlanes()
*/
public Plane[] getClippingPlanes() {
return delegate.getClippingPlanes();
}
/**
* @param point
* @return
* @see com.raytheon.uf.viz.core.IView#getEyeDistance(com.raytheon.uf.viz.core.Vector3d)
*/
public double getEyeDistance(Vector3d point) {
return delegate.getEyeDistance(point);
}
/**
* @return
* @see com.raytheon.uf.viz.core.IView#getEye()
*/
public double[] getEye() {
return delegate.getEye();
}
/**
* @param eye
* @see com.raytheon.uf.viz.core.IView#setEye(double[])
*/
public void setEye(double[] eye) {
delegate.setEye(eye);
}
/**
* @return
* @see com.raytheon.uf.viz.core.IView#getFocalPoint()
*/
public double[] getFocalPoint() {
return delegate.getFocalPoint();
}
/**
* @param pc
* @return
* @see com.raytheon.uf.viz.core.IView#createExtent(com.raytheon.uf.viz.core.PixelCoverage)
*/
public IExtent createExtent(PixelCoverage pc) {
return delegate.createExtent(pc);
}
/**
* @throws VizException
* @see com.raytheon.uf.viz.core.IView#setClippingPlanes()
*/
public void setClippingPlanes() throws VizException {
delegate.setClippingPlanes();
}
/**
* @param startScreen
* @param endScreen
* @param target
* @see com.raytheon.uf.viz.core.IView#shiftExtent(double[], double[],
* com.raytheon.uf.viz.core.IGraphicsTarget)
*/
public void shiftExtent(double[] startScreen, double[] endScreen,
IGraphicsTarget target) {
delegate.shiftExtent(startScreen, endScreen, getDelegateTarget(target));
}
/**
* @param x
* @param y
* @param depth
* @param target
* @return
* @see com.raytheon.uf.viz.core.IView#screenToGrid(double, double, double,
* com.raytheon.uf.viz.core.IGraphicsTarget)
*/
public double[] screenToGrid(double x, double y, double depth,
IGraphicsTarget target) {
return delegate.screenToGrid(x, y, depth, getDelegateTarget(target));
}
/**
* @param grid
* @param target
* @return
* @see com.raytheon.uf.viz.core.IView#gridToScreen(double[],
* com.raytheon.uf.viz.core.IGraphicsTarget)
*/
public double[] gridToScreen(double[] grid, IGraphicsTarget target) {
return delegate.gridToScreen(grid, getDelegateTarget(target));
}
/**
* @param clientArea
* @param dimensions
* @see com.raytheon.uf.viz.core.IView#scaleToClientArea(org.eclipse.swt.graphics.Rectangle,
* int[])
*/
public void scaleToClientArea(Rectangle clientArea, int[] dimensions) {
delegate.scaleToClientArea(clientArea, dimensions);
}
/**
* @return
* @see com.raytheon.uf.viz.core.IView#clone()
*/
public Object clone() {
return new ViewWrapper((IView) delegate.clone());
}
}

View file

@ -1,5 +1,7 @@
package com.raytheon.viz.core.gl.ext;
import java.awt.image.BufferedImage;
import java.awt.image.RenderedImage;
import java.nio.Buffer;
import java.nio.ByteBuffer;
@ -8,6 +10,7 @@ import javax.media.opengl.GL;
import org.eclipse.swt.graphics.Rectangle;
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback;
import com.raytheon.uf.viz.core.data.IRenderedImageCallback;
import com.raytheon.uf.viz.core.drawables.ColorMapParameters;
import com.raytheon.uf.viz.core.drawables.IImage;
import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension;
@ -66,6 +69,24 @@ public class GLOffscreenRenderingExtension extends GraphicsExtension<IGLTarget>
return Compatibilty.TARGET_COMPATIBLE;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.ext.IOffscreenRenderingExtension#
* constructOffscreenImage(int[])
*/
@Override
public IImage constructOffscreenImage(final int[] dimensions)
throws VizException {
return target.initializeRaster(new IRenderedImageCallback() {
@Override
public RenderedImage getImage() throws VizException {
return new BufferedImage(dimensions[0], dimensions[1],
BufferedImage.TYPE_INT_RGB);
}
});
}
/*
* (non-Javadoc)
*

View file

@ -19,7 +19,6 @@
**/
package com.raytheon.viz.satellite.rsc;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -32,10 +31,10 @@ import com.raytheon.uf.common.time.DataTime;
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.prep.IODataPreparer;
import com.raytheon.uf.viz.core.drawables.IImage;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.drawables.ResourcePair;
import com.raytheon.uf.viz.core.drawables.ext.IOffscreenRenderingExtension;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.map.MapDescriptor;
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
@ -214,10 +213,9 @@ public class SatBlendedResource extends
// Construct texture for fbo
imageBounds = new int[] { paintProps.getCanvasBounds().width,
paintProps.getCanvasBounds().height };
offscreenImage = target.initializeRaster(new IODataPreparer(
new BufferedImage(imageBounds[0], imageBounds[1],
BufferedImage.TYPE_INT_RGB), "SatBlendedImage", 0),
null);
offscreenImage = target
.getExtension(IOffscreenRenderingExtension.class)
.constructOffscreenImage(imageBounds);
}
private void disposeImage() {

View file

@ -43,6 +43,7 @@ import java.util.concurrent.ConcurrentHashMap;
import net.sf.cglib.beans.BeanMap;
import org.geotools.coverage.grid.GeneralGridGeometry;
import org.geotools.coverage.grid.GridGeometry2D;
import com.raytheon.uf.common.serialization.BuiltInTypeSupport.CalendarSerializer;
@ -54,6 +55,7 @@ import com.raytheon.uf.common.serialization.adapters.EnumSetAdapter;
import com.raytheon.uf.common.serialization.adapters.FloatBufferAdapter;
import com.raytheon.uf.common.serialization.adapters.GeometryTypeAdapter;
import com.raytheon.uf.common.serialization.adapters.GridGeometry2DAdapter;
import com.raytheon.uf.common.serialization.adapters.GridGeometryAdapter;
import com.raytheon.uf.common.serialization.adapters.JTSEnvelopeAdapter;
import com.raytheon.uf.common.serialization.adapters.PointAdapter;
import com.raytheon.uf.common.serialization.adapters.StackTraceElementAdapter;
@ -150,6 +152,10 @@ public class DynamicSerializationManager {
md.adapterStructName = GridGeometry2D.class.getName();
serializedAttributes.put(GridGeometry2D.class.getName(), md);
md = new SerializationMetadata();
md.serializationFactory = new GridGeometryAdapter();
md.adapterStructName = GeneralGridGeometry.class.getName();
serializedAttributes.put(GeneralGridGeometry.class.getName(), md);
md = new SerializationMetadata();
md.serializationFactory = new EnumSetAdapter();
md.adapterStructName = EnumSet.class.getName();
serializedAttributes.put(EnumSet.class.getName(), md);

View file

@ -26,8 +26,16 @@ import org.geotools.coverage.grid.GeneralGridGeometry;
import org.geotools.coverage.grid.GridEnvelope2D;
import org.geotools.geometry.GeneralEnvelope;
import org.geotools.referencing.CRS;
import org.opengis.coverage.grid.GridEnvelope;
import org.opengis.geometry.Envelope;
import org.opengis.referencing.FactoryException;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
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;
/**
* Marshals GeneralGridGeometry to a class that is easily JAXB'd
*
@ -45,7 +53,8 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
*/
public class GridGeometryAdapter extends
XmlAdapter<GridGeometrySerialized, GeneralGridGeometry> {
XmlAdapter<GridGeometrySerialized, GeneralGridGeometry> implements
ISerializationTypeAdapter<GeneralGridGeometry> {
@Override
public GridGeometrySerialized marshal(GeneralGridGeometry v)
@ -104,4 +113,61 @@ public class GridGeometryAdapter extends
return ggg;
}
/*
* (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,
GeneralGridGeometry object) throws SerializationException {
int numDims = object.getDimension();
GridEnvelope range = object.getGridRange();
Envelope env = object.getEnvelope();
serializer.writeString(object.getCoordinateReferenceSystem().toWKT());
serializer.writeI32(numDims);
for (int i = 0; i < numDims; ++i) {
serializer.writeI32(range.getLow(i));
serializer.writeI32(range.getHigh(i));
serializer.writeDouble(env.getMinimum(i));
serializer.writeDouble(env.getMaximum(i));
}
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.common.serialization.ISerializationTypeAdapter#deserialize
* (com.raytheon.uf.common.serialization.IDeserializationContext)
*/
@Override
public GeneralGridGeometry deserialize(IDeserializationContext deserializer)
throws SerializationException {
try {
CoordinateReferenceSystem crs = CRS.parseWKT(deserializer
.readString());
int numDims = deserializer.readI32();
GeneralEnvelope env = new GeneralEnvelope(crs);
int[] lowRange = new int[numDims];
int[] highRange = new int[numDims];
for (int i = 0; i < numDims; ++i) {
lowRange[i] = deserializer.readI32();
highRange[i] = deserializer.readI32();
env.setRange(i, deserializer.readDouble(),
deserializer.readDouble());
}
return new GeneralGridGeometry(new GeneralGridEnvelope(lowRange,
highRange, false), env);
} catch (FactoryException e) {
throw new SerializationException(
"Error deserializing GeneralGridGeometry, could not read CRS",
e);
}
}
}