Merge "Issue #1638 Made Map scales more generalized for use outside of D2D" into development
Former-commit-id:f8e5534417
[formerly 5ebb2a9670ef28c759b434ed25e68465b5a2d8ac] Former-commit-id:faf937d3b0
This commit is contained in:
commit
7f5b3d6f84
15 changed files with 315 additions and 79 deletions
|
@ -3,4 +3,5 @@ com.raytheon.uf.viz.core.maps.rsc.DbMapResourceData
|
|||
com.raytheon.uf.viz.core.maps.rsc.DbPointMapResourceData
|
||||
com.raytheon.uf.viz.core.maps.MapStylePreferenceStore
|
||||
com.raytheon.uf.viz.core.maps.display.MapRenderableDisplay
|
||||
com.raytheon.uf.viz.core.maps.display.PlainMapRenderableDisplay
|
||||
com.raytheon.uf.viz.core.maps.display.PlainMapRenderableDisplay
|
||||
com.raytheon.uf.viz.core.maps.scales.MapScaleRenderableDisplay
|
|
@ -56,6 +56,10 @@
|
|||
class="com.raytheon.uf.viz.core.maps.actions.LoadMap"
|
||||
commandId="com.raytheon.uf.viz.core.maps.actions.LoadMap">
|
||||
</handler>
|
||||
<handler
|
||||
class="com.raytheon.uf.viz.core.maps.scales.MapScaleHandler"
|
||||
commandId="com.raytheon.viz.ui.setScale">
|
||||
</handler>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.viz.ui.contextualMenu">
|
||||
|
@ -110,4 +114,14 @@
|
|||
value="mapStyles">
|
||||
</path>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.menus">
|
||||
<menuContribution
|
||||
locationURI="menu:com.raytheon.viz.ui.scale">
|
||||
<dynamic
|
||||
class="com.raytheon.uf.viz.core.maps.scales.MapScalePopulator"
|
||||
id="com.raytheon.uf.viz.core.maps.mapScales">
|
||||
</dynamic>
|
||||
</menuContribution>
|
||||
</extension>
|
||||
</plugin>
|
||||
|
|
|
@ -39,6 +39,7 @@ import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay;
|
|||
import com.raytheon.uf.viz.core.drawables.PaintProperties;
|
||||
import com.raytheon.uf.viz.core.drawables.ResourcePair;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.map.IMapDescriptor;
|
||||
import com.raytheon.uf.viz.core.map.MapDescriptor;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractVizResource.ResourceStatus;
|
||||
|
@ -91,7 +92,7 @@ public class MapRenderableDisplay extends AbstractRenderableDisplay implements
|
|||
super();
|
||||
}
|
||||
|
||||
public MapRenderableDisplay(MapDescriptor desc) {
|
||||
public MapRenderableDisplay(IMapDescriptor desc) {
|
||||
this();
|
||||
setDescriptor(desc);
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ import javax.xml.bind.annotation.XmlAccessType;
|
|||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import com.raytheon.uf.viz.core.map.MapDescriptor;
|
||||
import com.raytheon.uf.viz.core.map.IMapDescriptor;
|
||||
import com.raytheon.uf.viz.core.rsc.ResourceList;
|
||||
|
||||
/**
|
||||
|
@ -57,7 +57,7 @@ public class PlainMapRenderableDisplay extends MapRenderableDisplay {
|
|||
/**
|
||||
* @param desc
|
||||
*/
|
||||
public PlainMapRenderableDisplay(MapDescriptor desc) {
|
||||
public PlainMapRenderableDisplay(IMapDescriptor desc) {
|
||||
super(desc);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
**/
|
||||
package com.raytheon.uf.viz.core.maps.scales;
|
||||
|
||||
import com.raytheon.uf.viz.core.maps.scales.MapScales.MapScale;
|
||||
|
||||
/**
|
||||
* Interface for display containing a scale
|
||||
*
|
||||
|
@ -44,4 +46,10 @@ public interface IMapScaleDisplay {
|
|||
*/
|
||||
public String getScaleName();
|
||||
|
||||
/**
|
||||
* Changes the scale of the display
|
||||
*
|
||||
* @param scale
|
||||
*/
|
||||
public void changeScale(MapScale scale);
|
||||
}
|
||||
|
|
|
@ -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.core.maps.scales;
|
||||
|
||||
import org.eclipse.core.commands.AbstractHandler;
|
||||
import org.eclipse.core.commands.ExecutionEvent;
|
||||
import org.eclipse.core.commands.ExecutionException;
|
||||
import org.eclipse.ui.IEditorPart;
|
||||
import org.eclipse.ui.handlers.HandlerUtil;
|
||||
|
||||
import com.raytheon.uf.viz.core.IDisplayPane;
|
||||
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
|
||||
import com.raytheon.uf.viz.core.drawables.IRenderableDisplay;
|
||||
import com.raytheon.uf.viz.core.globals.VizGlobalsManager;
|
||||
import com.raytheon.uf.viz.core.maps.scales.MapScales.MapScale;
|
||||
|
||||
/**
|
||||
* Handler of setScale command that looks for a {@link MapScale} by name of
|
||||
* attribute scale and sets on any {@link IMapScaleDisplay}s on the current
|
||||
* editor
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 22, 2013 mschenke Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mschenke
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class MapScaleHandler extends AbstractHandler {
|
||||
|
||||
public static final String SET_SCALE_COMMAND_ID = "com.raytheon.viz.ui.setScale";
|
||||
|
||||
public static final String SCALE_NAME_ID = "scale";
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.
|
||||
* ExecutionEvent)
|
||||
*/
|
||||
@Override
|
||||
public Object execute(ExecutionEvent event) throws ExecutionException {
|
||||
MapScale scale = MapScales.getInstance().getScaleByName(
|
||||
event.getParameter(SCALE_NAME_ID));
|
||||
if (scale != null) {
|
||||
IEditorPart part = HandlerUtil.getActiveEditor(event);
|
||||
if (part instanceof IDisplayPaneContainer) {
|
||||
IDisplayPaneContainer container = (IDisplayPaneContainer) part;
|
||||
for (IDisplayPane pane : container.getDisplayPanes()) {
|
||||
IRenderableDisplay display = pane.getRenderableDisplay();
|
||||
if (display instanceof IMapScaleDisplay) {
|
||||
((IMapScaleDisplay) display).changeScale(scale);
|
||||
}
|
||||
}
|
||||
container.refresh();
|
||||
VizGlobalsManager.getInstance(
|
||||
HandlerUtil.getActiveWorkbenchWindow(event)).updateUI(
|
||||
container);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -63,20 +63,19 @@ public class MapScalePopulator extends CompoundContributionItem {
|
|||
protected IContributionItem[] getContributionItems() {
|
||||
MenuManager menuMgr = new MenuManager("Scales", "mapControls");
|
||||
IDisplayPaneContainer cont = EditorUtil.getActiveVizContainer();
|
||||
// Load scales if we have d2d map renderable display on editor or, there
|
||||
// is no editor opened in the d2d perspective
|
||||
if ((cont != null && (cont.getActiveDisplayPane()
|
||||
.getRenderableDisplay() instanceof IMapScaleDisplay))
|
||||
|| EditorUtil.getActiveEditor() == null) {
|
||||
for (MapScale scale : MapScales.getInstance().getScales()) {
|
||||
Map<String, String> parms = new HashMap<String, String>();
|
||||
parms.put("scale", scale.getDisplayName());
|
||||
parms.put(MapScaleHandler.SCALE_NAME_ID, scale.getDisplayName());
|
||||
CommandContributionItem item = new CommandContributionItem(
|
||||
new CommandContributionItemParameter(
|
||||
PlatformUI.getWorkbench(), null,
|
||||
"com.raytheon.viz.ui.setScale", parms, null,
|
||||
null, null, scale.getDisplayName(), null, null,
|
||||
CommandContributionItem.STYLE_PUSH, null, true));
|
||||
MapScaleHandler.SET_SCALE_COMMAND_ID, parms,
|
||||
null, null, null, scale.getDisplayName(), null,
|
||||
null, CommandContributionItem.STYLE_PUSH, null,
|
||||
true));
|
||||
menuMgr.add(item);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,144 @@
|
|||
/**
|
||||
* 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.core.maps.scales;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.viz.core.VizConstants;
|
||||
import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.globals.VizGlobalsManager;
|
||||
import com.raytheon.uf.viz.core.map.IMapDescriptor;
|
||||
import com.raytheon.uf.viz.core.maps.display.PlainMapRenderableDisplay;
|
||||
import com.raytheon.uf.viz.core.maps.scales.MapScales.MapScale;
|
||||
import com.raytheon.uf.viz.core.procedures.Bundle;
|
||||
import com.raytheon.viz.ui.actions.LoadSerializedXml;
|
||||
|
||||
/**
|
||||
* MapRenderableDisplay associated with a {@link MapScale}
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 22, 2013 mschenke Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mschenke
|
||||
* @version 1.0
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@XmlRootElement
|
||||
public class MapScaleRenderableDisplay extends PlainMapRenderableDisplay
|
||||
implements IMapScaleDisplay {
|
||||
|
||||
@XmlAttribute
|
||||
protected String scale = (String) VizGlobalsManager.getCurrentInstance()
|
||||
.getPropery(VizConstants.SCALE_ID);
|
||||
|
||||
public MapScaleRenderableDisplay() {
|
||||
super();
|
||||
}
|
||||
|
||||
public MapScaleRenderableDisplay(IMapDescriptor desc) {
|
||||
super(desc);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.uf.viz.core.maps.scales.IMapScaleDisplay#getScaleName()
|
||||
*/
|
||||
@Override
|
||||
public String getScaleName() {
|
||||
return scale;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.core.maps.scales.IMapScaleDisplay#changeScale(com
|
||||
* .raytheon.uf.viz.core.maps.scales.MapScales.MapScale)
|
||||
*/
|
||||
@Override
|
||||
public void changeScale(MapScale scale) {
|
||||
MapScale currentScale = MapScales.getInstance().getScaleByName(
|
||||
getScaleName());
|
||||
Bundle bundle = (Bundle) LoadSerializedXml.deserialize(currentScale
|
||||
.getFile());
|
||||
for (AbstractRenderableDisplay display : bundle.getDisplays()) {
|
||||
descriptor.getResourceList().removeAll(
|
||||
display.getDescriptor().getResourceList());
|
||||
}
|
||||
loadScale(scale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
MapScale scale = MapScales.getInstance().getScaleByName(getScaleName());
|
||||
if (scale == null) {
|
||||
scale = MapScales.getInstance().getScaleByName(
|
||||
(String) VizGlobalsManager.getCurrentInstance().getPropery(
|
||||
VizConstants.SCALE_ID));
|
||||
}
|
||||
if (scale != null) {
|
||||
descriptor.getResourceList().clear();
|
||||
loadScale(scale);
|
||||
}
|
||||
}
|
||||
|
||||
protected void loadScale(MapScale scale) {
|
||||
Bundle bundle = (Bundle) LoadSerializedXml.deserialize(scale.getFile());
|
||||
for (AbstractRenderableDisplay ard : bundle.getDisplays()) {
|
||||
try {
|
||||
descriptor.setGridGeometry(ard.getDescriptor()
|
||||
.getGridGeometry());
|
||||
descriptor.getResourceList().addAll(
|
||||
ard.getDescriptor().getResourceList());
|
||||
ard.getDescriptor().getResourceList().clear();
|
||||
break;
|
||||
} catch (VizException e) {
|
||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
|
||||
e);
|
||||
}
|
||||
}
|
||||
descriptor.getResourceList().instantiateResources(descriptor, true);
|
||||
this.scale = scale.getDisplayName();
|
||||
scaleToClientArea(getBounds());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getGlobalsMap() {
|
||||
Map<String, Object> globals = super.getGlobalsMap();
|
||||
globals.put(VizConstants.SCALE_ID, getScaleName());
|
||||
return globals;
|
||||
}
|
||||
|
||||
}
|
|
@ -74,7 +74,7 @@ import com.raytheon.uf.viz.core.rsc.ResourceList.RemoveListener;
|
|||
*/
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public abstract class AbstractRenderableDisplay implements IRenderableDisplay {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
protected static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(AbstractRenderableDisplay.class);
|
||||
|
||||
private static RGB BACKGROUND_COLOR = null;
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
**/
|
||||
package com.raytheon.uf.viz.d2d.core.map;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -32,7 +31,6 @@ import javax.xml.bind.annotation.XmlRootElement;
|
|||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||
import com.raytheon.uf.viz.core.VizConstants;
|
||||
import com.raytheon.uf.viz.core.drawables.AbstractDescriptor;
|
||||
import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay;
|
||||
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
||||
import com.raytheon.uf.viz.core.drawables.PaintProperties;
|
||||
import com.raytheon.uf.viz.core.drawables.ResourcePair;
|
||||
|
@ -40,10 +38,7 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
|||
import com.raytheon.uf.viz.core.globals.VizGlobalsManager;
|
||||
import com.raytheon.uf.viz.core.map.IMapDescriptor;
|
||||
import com.raytheon.uf.viz.core.map.MapDescriptor;
|
||||
import com.raytheon.uf.viz.core.maps.display.MapRenderableDisplay;
|
||||
import com.raytheon.uf.viz.core.maps.scales.IMapScaleDisplay;
|
||||
import com.raytheon.uf.viz.core.maps.scales.MapScales;
|
||||
import com.raytheon.uf.viz.core.procedures.Bundle;
|
||||
import com.raytheon.uf.viz.core.maps.scales.MapScaleRenderableDisplay;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
||||
import com.raytheon.uf.viz.core.rsc.IResourceGroup;
|
||||
import com.raytheon.uf.viz.core.rsc.RenderingOrderFactory.ResourceOrder;
|
||||
|
@ -56,7 +51,6 @@ import com.raytheon.uf.viz.d2d.core.ID2DRenderableDisplay;
|
|||
import com.raytheon.uf.viz.d2d.core.sampling.CloudHeightResourceData;
|
||||
import com.raytheon.uf.viz.d2d.core.time.D2DTimeMatcher;
|
||||
import com.raytheon.viz.core.imagery.ImageCombiner;
|
||||
import com.raytheon.viz.ui.actions.LoadSerializedXml;
|
||||
|
||||
/**
|
||||
* Implementation of a D2D-specific map renderable display
|
||||
|
@ -68,6 +62,7 @@ import com.raytheon.viz.ui.actions.LoadSerializedXml;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 9, 2009 njensen Initial creation
|
||||
* Mar 21, 2013 1638 mschenke Made map scales not tied to d2d
|
||||
* Mar 22, 2013 1638 mschenke Moved map scale code to MapScaleRenderableDisplay
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -76,8 +71,8 @@ import com.raytheon.viz.ui.actions.LoadSerializedXml;
|
|||
*/
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@XmlRootElement
|
||||
public class D2DMapRenderableDisplay extends MapRenderableDisplay implements
|
||||
ID2DRenderableDisplay, IMapScaleDisplay {
|
||||
public class D2DMapRenderableDisplay extends MapScaleRenderableDisplay
|
||||
implements ID2DRenderableDisplay {
|
||||
|
||||
private static final CloudHeightResourceData cloudHeightData = new CloudHeightResourceData();
|
||||
|
||||
|
@ -92,11 +87,6 @@ public class D2DMapRenderableDisplay extends MapRenderableDisplay implements
|
|||
protected double density = ((Double) VizGlobalsManager.getCurrentInstance()
|
||||
.getPropery(VizConstants.DENSITY_ID)).doubleValue();
|
||||
|
||||
/** The current display scale */
|
||||
@XmlAttribute
|
||||
protected String scale = (String) VizGlobalsManager.getCurrentInstance()
|
||||
.getPropery(VizConstants.SCALE_ID);
|
||||
|
||||
protected DataScaleListener scaleListener = null;
|
||||
|
||||
protected ImageCombiner combinerListener = null;
|
||||
|
@ -264,28 +254,11 @@ public class D2DMapRenderableDisplay extends MapRenderableDisplay implements
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
descriptor.getResourceList().clear();
|
||||
File scaleFile = MapScales.getInstance().getScaleByName(getScale())
|
||||
.getFile();
|
||||
Bundle bundle = (Bundle) LoadSerializedXml.deserialize(scaleFile);
|
||||
for (AbstractRenderableDisplay ard : bundle.getDisplays()) {
|
||||
descriptor.getResourceList().addAll(
|
||||
ard.getDescriptor().getResourceList());
|
||||
ard.getDescriptor().getResourceList().clear();
|
||||
break;
|
||||
}
|
||||
descriptor.getResourceList().instantiateResources(descriptor, true);
|
||||
scaleToClientArea(getBounds());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getGlobalsMap() {
|
||||
Map<String, Object> globals = super.getGlobalsMap();
|
||||
globals.put(VizConstants.FRAMES_ID, new Integer(getDescriptor()
|
||||
.getNumberOfFrames()));
|
||||
globals.put(VizConstants.SCALE_ID, scale);
|
||||
globals.put(VizConstants.DENSITY_ID, new Double(density));
|
||||
globals.put(VizConstants.MAGNIFICATION_ID, new Double(magnification));
|
||||
globals.put(VizConstants.LOADMODE_ID, ((D2DTimeMatcher) getDescriptor()
|
||||
|
@ -358,14 +331,4 @@ public class D2DMapRenderableDisplay extends MapRenderableDisplay implements
|
|||
return combinerListener;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.uf.viz.core.maps.scales.IMapScaleDisplay#getScaleName()
|
||||
*/
|
||||
@Override
|
||||
public String getScaleName() {
|
||||
return getScale();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1375,13 +1375,6 @@
|
|||
id="com.raytheon.uf.viz.d2d.ui.densityPopulator">
|
||||
</dynamic>
|
||||
</menuContribution>
|
||||
<menuContribution
|
||||
locationURI="menu:com.raytheon.viz.ui.scale">
|
||||
<dynamic
|
||||
class="com.raytheon.uf.viz.core.maps.scales.MapScalePopulator"
|
||||
id="com.raytheon.uf.viz.d2d.ui.mapScales">
|
||||
</dynamic>
|
||||
</menuContribution>
|
||||
</extension>
|
||||
|
||||
|
||||
|
@ -1398,13 +1391,14 @@
|
|||
class="com.raytheon.uf.viz.d2d.ui.map.actions.ClearAction"
|
||||
commandId="com.raytheon.viz.ui.clear">
|
||||
</handler>
|
||||
<handler
|
||||
class="com.raytheon.uf.viz.d2d.ui.map.actions.ScaleButtonHandler"
|
||||
commandId="com.raytheon.viz.ui.scalebutton">
|
||||
</handler>
|
||||
<handler
|
||||
class="com.raytheon.uf.viz.d2d.ui.map.actions.ScaleHandler"
|
||||
commandId="com.raytheon.viz.ui.setScale">
|
||||
<activeWhen>
|
||||
<reference
|
||||
definitionId="com.raytheon.uf.viz.d2d.ui.inD2DActionSet">
|
||||
</reference>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
<handler
|
||||
class="com.raytheon.uf.viz.d2d.ui.actions.TimeOptionsAction"
|
||||
|
|
|
@ -216,7 +216,8 @@
|
|||
</command>
|
||||
<command
|
||||
id="com.raytheon.viz.ui.scalebutton"
|
||||
name="Update Scale Button">
|
||||
name="Update Scale Button"
|
||||
defaultHandler="com.raytheon.viz.ui.actions.ScaleButtonHandler">
|
||||
</command>
|
||||
<command
|
||||
id="com.raytheon.viz.ui.setScale"
|
||||
|
|
|
@ -36,8 +36,9 @@ import com.raytheon.viz.ui.editor.IMultiPaneEditor;
|
|||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 8, 2013 mschenke Initial creation
|
||||
* Jan 8, 2013 mschenke Initial creation
|
||||
* Feb 25, 2013 1640 bsteffen Dispose old display in BundleLoader
|
||||
* Mar 22, 2013 1638 mschenke Made not throw errors when no time matcher
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -164,13 +165,17 @@ public class BundleLoader extends Job {
|
|||
if (i == 0) {
|
||||
IRenderableDisplay loadFrom = items[i].loadFrom;
|
||||
IDisplayPane loadTo = items[i].loadTo;
|
||||
AbstractTimeMatcher srcTimeMatcher = loadFrom
|
||||
|
||||
AbstractTimeMatcher destTimeMatcher = loadTo
|
||||
.getDescriptor().getTimeMatcher();
|
||||
if (srcTimeMatcher != null) {
|
||||
loadTo.getDescriptor().getTimeMatcher()
|
||||
.copyFrom(srcTimeMatcher);
|
||||
if (destTimeMatcher != null) {
|
||||
AbstractTimeMatcher srcTimeMatcher = loadFrom
|
||||
.getDescriptor().getTimeMatcher();
|
||||
if (srcTimeMatcher != null) {
|
||||
destTimeMatcher.copyFrom(srcTimeMatcher);
|
||||
}
|
||||
destTimeMatcher.resetMultiload();
|
||||
}
|
||||
loadTo.getDescriptor().getTimeMatcher().resetMultiload();
|
||||
t.run();
|
||||
} else {
|
||||
t.start();
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package com.raytheon.uf.viz.d2d.ui.map.actions;
|
||||
package com.raytheon.viz.ui.actions;
|
||||
|
||||
import org.eclipse.ui.IWorkbenchWindow;
|
||||
import org.eclipse.ui.commands.IElementUpdater;
|
||||
|
@ -28,7 +28,6 @@ import org.eclipse.ui.menus.UIElement;
|
|||
|
||||
import com.raytheon.uf.viz.core.VizConstants;
|
||||
import com.raytheon.uf.viz.core.globals.IGlobalChangedListener;
|
||||
import com.raytheon.viz.ui.actions.AbstractGlobalsButtonHandler;
|
||||
|
||||
/**
|
||||
* Updates the scale
|
|
@ -20,10 +20,11 @@
|
|||
package com.raytheon.uf.common.serialization;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.StringReader;
|
||||
import java.io.StringWriter;
|
||||
import java.util.ArrayList;
|
||||
|
@ -255,28 +256,45 @@ public class JAXBManager {
|
|||
*/
|
||||
public void jaxbMarshalToXmlFile(Object obj, String filePath)
|
||||
throws SerializationException {
|
||||
FileWriter writer = null;
|
||||
try {
|
||||
jaxbMarshalToStream(obj, new FileOutputStream(new File(filePath)));
|
||||
} catch (SerializationException e) {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
throw new SerializationException(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of a class to an XML representation and write XML to
|
||||
* output stream. Uses JAXB.
|
||||
*
|
||||
* @param obj
|
||||
* @param out
|
||||
* @throws SerializationException
|
||||
*/
|
||||
public void jaxbMarshalToStream(Object obj, OutputStream out)
|
||||
throws SerializationException {
|
||||
Marshaller msh = null;
|
||||
try {
|
||||
msh = getMarshaller();
|
||||
msh.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, new Boolean(true));
|
||||
writer = new FileWriter(new File(filePath));
|
||||
msh.marshal(obj, writer);
|
||||
msh.marshal(obj, out);
|
||||
} catch (Exception e) {
|
||||
throw new SerializationException(e);
|
||||
} finally {
|
||||
if (msh != null && marshallers.size() < QUEUE_SIZE) {
|
||||
marshallers.add(msh);
|
||||
}
|
||||
if (writer != null) {
|
||||
if (out != null) {
|
||||
try {
|
||||
writer.close();
|
||||
out.close();
|
||||
} catch (IOException e) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue