Merge branch 'development' of ssh://lightning.omaha.us.ray.com:29418/AWIPS2_baseline into development
Former-commit-id:27fa10e133
[formerlye3927a11c7
] [formerly27fa10e133
[formerlye3927a11c7
] [formerlye530637aa3
[formerly 43d4642bc39a053d40fce9b6aff1d11f3d313dd7]]] Former-commit-id:e530637aa3
Former-commit-id:118113bd60
[formerly1687889756
] Former-commit-id:03ebee99f8
This commit is contained in:
commit
f6ec677a1b
4 changed files with 84 additions and 48 deletions
|
@ -27,11 +27,15 @@ import java.util.Map;
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
|
||||||
|
import org.eclipse.ui.IEditorPart;
|
||||||
|
import org.eclipse.ui.IWorkbenchWindow;
|
||||||
|
|
||||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
|
import com.raytheon.uf.viz.core.DescriptorMap;
|
||||||
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
|
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
|
||||||
import com.raytheon.uf.viz.core.catalog.CatalogQuery;
|
import com.raytheon.uf.viz.core.catalog.CatalogQuery;
|
||||||
import com.raytheon.uf.viz.core.catalog.DbQuery;
|
import com.raytheon.uf.viz.core.catalog.DbQuery;
|
||||||
|
@ -39,6 +43,7 @@ import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay;
|
||||||
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
||||||
import com.raytheon.uf.viz.core.drawables.ResourcePair;
|
import com.raytheon.uf.viz.core.drawables.ResourcePair;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
|
import com.raytheon.uf.viz.core.map.MapDescriptor;
|
||||||
import com.raytheon.uf.viz.core.procedures.Bundle;
|
import com.raytheon.uf.viz.core.procedures.Bundle;
|
||||||
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
|
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
|
||||||
import com.raytheon.uf.viz.core.rsc.ResourceProperties;
|
import com.raytheon.uf.viz.core.rsc.ResourceProperties;
|
||||||
|
@ -46,7 +51,10 @@ import com.raytheon.uf.viz.core.rsc.ResourceType;
|
||||||
import com.raytheon.uf.viz.productbrowser.ProductBrowserPreference.PreferenceType;
|
import com.raytheon.uf.viz.productbrowser.ProductBrowserPreference.PreferenceType;
|
||||||
import com.raytheon.viz.ui.EditorUtil;
|
import com.raytheon.viz.ui.EditorUtil;
|
||||||
import com.raytheon.viz.ui.MenuLoader;
|
import com.raytheon.viz.ui.MenuLoader;
|
||||||
|
import com.raytheon.viz.ui.VizWorkbenchManager;
|
||||||
import com.raytheon.viz.ui.editor.AbstractEditor;
|
import com.raytheon.viz.ui.editor.AbstractEditor;
|
||||||
|
import com.raytheon.viz.ui.perspectives.AbstractVizPerspectiveManager;
|
||||||
|
import com.raytheon.viz.ui.perspectives.VizPerspectiveListener;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Product browser abstract requestable implementation
|
* Product browser abstract requestable implementation
|
||||||
|
@ -134,11 +142,11 @@ public abstract class AbstractRequestableProductBrowserDataDefinition<T extends
|
||||||
|
|
||||||
String[] temp = queryData(param, queryList);
|
String[] temp = queryData(param, queryList);
|
||||||
if (temp != null) {
|
if (temp != null) {
|
||||||
if ((Boolean) getPreference(FORMAT_DATA).getValue()) {
|
if ((Boolean) getPreference(FORMAT_DATA).getValue()) {
|
||||||
parameters = formatData(param, temp);
|
parameters = formatData(param, temp);
|
||||||
} else {
|
} else {
|
||||||
parameters = super.formatData(param, temp);
|
parameters = super.formatData(param, temp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parameters != null) {
|
if (parameters != null) {
|
||||||
|
@ -194,7 +202,10 @@ public abstract class AbstractRequestableProductBrowserDataDefinition<T extends
|
||||||
IDescriptor currDesc = null;
|
IDescriptor currDesc = null;
|
||||||
// retrieves the correct editor
|
// retrieves the correct editor
|
||||||
getEditor();
|
getEditor();
|
||||||
IDisplayPaneContainer container = EditorUtil.getActiveVizContainer();
|
IDisplayPaneContainer container = getEditor();
|
||||||
|
if (container == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
AbstractRenderableDisplay display = (AbstractRenderableDisplay) container
|
AbstractRenderableDisplay display = (AbstractRenderableDisplay) container
|
||||||
.getActiveDisplayPane().getRenderableDisplay();
|
.getActiveDisplayPane().getRenderableDisplay();
|
||||||
display = (AbstractRenderableDisplay) display.createNewDisplay();
|
display = (AbstractRenderableDisplay) display.createNewDisplay();
|
||||||
|
@ -265,8 +276,39 @@ public abstract class AbstractRequestableProductBrowserDataDefinition<T extends
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getEditor() {
|
protected IDisplayPaneContainer getEditor() {
|
||||||
// do nothing, if user wants a certain editor then overwrite this method
|
String id = DescriptorMap.getEditorId(getDescriptorClass().getName());
|
||||||
|
IEditorPart editorPart = EditorUtil.getActiveEditor();
|
||||||
|
if (editorPart != null && id.equals(editorPart.getEditorSite().getId())) {
|
||||||
|
return (AbstractEditor) editorPart;
|
||||||
|
}
|
||||||
|
editorPart = EditorUtil.findEditor(id);
|
||||||
|
if (editorPart != null) {
|
||||||
|
return (AbstractEditor) editorPart;
|
||||||
|
}
|
||||||
|
return openNewEditor(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected IDisplayPaneContainer openNewEditor(String editorId) {
|
||||||
|
IWorkbenchWindow window = VizWorkbenchManager.getInstance()
|
||||||
|
.getCurrentWindow();
|
||||||
|
AbstractVizPerspectiveManager mgr = VizPerspectiveListener.getInstance(
|
||||||
|
window).getActivePerspectiveManager();
|
||||||
|
if (mgr != null) {
|
||||||
|
AbstractEditor editor = mgr.openNewEditor();
|
||||||
|
if (editor == null) {
|
||||||
|
return null;
|
||||||
|
} else if (editorId.equals(editor.getEditorSite().getId())) {
|
||||||
|
return editor;
|
||||||
|
} else {
|
||||||
|
window.getActivePage().closeEditor(editor, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Class<? extends IDescriptor> getDescriptorClass() {
|
||||||
|
return MapDescriptor.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -27,15 +27,13 @@ import java.util.Collections;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.eclipse.ui.PartInitException;
|
|
||||||
import org.eclipse.ui.PlatformUI;
|
|
||||||
|
|
||||||
import com.raytheon.uf.common.dataplugin.radar.util.RadarInfoDict;
|
import com.raytheon.uf.common.dataplugin.radar.util.RadarInfoDict;
|
||||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.viz.core.DescriptorMap;
|
||||||
import com.raytheon.uf.viz.core.drawables.IRenderableDisplay;
|
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
|
||||||
|
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
||||||
import com.raytheon.uf.viz.core.rsc.DisplayType;
|
import com.raytheon.uf.viz.core.rsc.DisplayType;
|
||||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||||
import com.raytheon.uf.viz.core.rsc.ResourceType;
|
import com.raytheon.uf.viz.core.rsc.ResourceType;
|
||||||
|
@ -44,9 +42,11 @@ import com.raytheon.uf.viz.productbrowser.AbstractRequestableProductBrowserDataD
|
||||||
import com.raytheon.uf.viz.productbrowser.ProductBrowserLabel;
|
import com.raytheon.uf.viz.productbrowser.ProductBrowserLabel;
|
||||||
import com.raytheon.uf.viz.productbrowser.ProductBrowserPreference;
|
import com.raytheon.uf.viz.productbrowser.ProductBrowserPreference;
|
||||||
import com.raytheon.viz.radar.rsc.RadarResourceData;
|
import com.raytheon.viz.radar.rsc.RadarResourceData;
|
||||||
|
import com.raytheon.viz.radar.ui.xy.RadarGraphDescriptor;
|
||||||
import com.raytheon.viz.radar.ui.xy.RadarGraphDisplay;
|
import com.raytheon.viz.radar.ui.xy.RadarGraphDisplay;
|
||||||
|
import com.raytheon.viz.radar.ui.xy.RadarXYDescriptor;
|
||||||
import com.raytheon.viz.radar.ui.xy.RadarXYDisplay;
|
import com.raytheon.viz.radar.ui.xy.RadarXYDisplay;
|
||||||
import com.raytheon.viz.ui.editor.EditorInput;
|
import com.raytheon.viz.ui.UiUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Product browser implementation for radar
|
* Product browser implementation for radar
|
||||||
|
@ -174,40 +174,30 @@ public class RadarProductBrowserDataDefinition extends
|
||||||
return new RadarResourceData();
|
return new RadarResourceData();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* com.raytheon.uf.viz.productbrowser.AbstractProductBrowserDataDefinition
|
|
||||||
* #getEditor()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void getEditor() {
|
protected IDisplayPaneContainer openNewEditor(String editorId) {
|
||||||
|
if (editorId.equals(DescriptorMap.getEditorId(RadarXYDescriptor.class
|
||||||
|
.getName()))) {
|
||||||
|
return UiUtil.createEditor(editorId, new RadarXYDisplay());
|
||||||
|
} else if (editorId.equals(DescriptorMap
|
||||||
|
.getEditorId(RadarGraphDescriptor.class.getName()))) {
|
||||||
|
return UiUtil.createEditor(editorId, new RadarGraphDisplay());
|
||||||
|
} else {
|
||||||
|
return super.openNewEditor(editorId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<? extends IDescriptor> getDescriptorClass() {
|
||||||
int prodCode = Integer.parseInt((resourceData).getMetadataMap()
|
int prodCode = Integer.parseInt((resourceData).getMetadataMap()
|
||||||
.get("productCode").getConstraintValue());
|
.get("productCode").getConstraintValue());
|
||||||
String format = infoDict.getInfo(prodCode).getFormat();
|
String format = infoDict.getInfo(prodCode).getFormat();
|
||||||
if ("XY".equals(format)) {
|
if ("XY".equals(format)) {
|
||||||
String editor = "com.raytheon.viz.radar.ui.xy.RadarXYEditor";
|
return RadarXYDescriptor.class;
|
||||||
EditorInput cont = new EditorInput(
|
|
||||||
(IRenderableDisplay) new RadarXYDisplay());
|
|
||||||
try {
|
|
||||||
PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
|
||||||
.getActivePage().openEditor(cont, editor, true);
|
|
||||||
} catch (PartInitException e) {
|
|
||||||
statusHandler.handle(Priority.PROBLEM,
|
|
||||||
"Unable to open editor : " + editor, e);
|
|
||||||
}
|
|
||||||
} else if ("Graph".equals(format)) {
|
} else if ("Graph".equals(format)) {
|
||||||
String editor = "com.raytheon.viz.radar.ui.xy.RadarGraphEditor";
|
return RadarGraphDescriptor.class;
|
||||||
EditorInput cont = new EditorInput(
|
} else {
|
||||||
(IRenderableDisplay) new RadarGraphDisplay());
|
return super.getDescriptorClass();
|
||||||
try {
|
|
||||||
PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
|
||||||
.getActivePage().openEditor(cont, editor, true);
|
|
||||||
} catch (PartInitException e) {
|
|
||||||
statusHandler.handle(Priority.PROBLEM,
|
|
||||||
"Unable to open editor : " + editor, e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -102,9 +102,11 @@ public class RadarGraphDisplay extends AbstractNonMapDisplay {
|
||||||
GraphProperties graphProps) throws VizException {
|
GraphProperties graphProps) throws VizException {
|
||||||
// Plot the resource data on the graph
|
// Plot the resource data on the graph
|
||||||
for (ResourcePair rp : getDescriptor().getResourceList()) {
|
for (ResourcePair rp : getDescriptor().getResourceList()) {
|
||||||
graphProps = (GraphProperties) calcPaintDataTime(graphProps,
|
if (rp.getResource() != null) {
|
||||||
rp.getResource());
|
graphProps = (GraphProperties) calcPaintDataTime(graphProps,
|
||||||
rp.getResource().paint(target, graphProps);
|
rp.getResource());
|
||||||
|
rp.getResource().paint(target, graphProps);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -80,9 +80,11 @@ public class RadarXYDisplay extends AbstractNonMapDisplay {
|
||||||
|
|
||||||
// Plot the resource data on the graph
|
// Plot the resource data on the graph
|
||||||
for (ResourcePair rp : getDescriptor().getResourceList()) {
|
for (ResourcePair rp : getDescriptor().getResourceList()) {
|
||||||
graphProps = (GraphProperties) calcPaintDataTime(graphProps,
|
if (rp.getResource() != null) {
|
||||||
rp.getResource());
|
graphProps = (GraphProperties) calcPaintDataTime(graphProps,
|
||||||
rp.getResource().paint(target, graphProps);
|
rp.getResource());
|
||||||
|
rp.getResource().paint(target, graphProps);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue