diff --git a/cave/com.raytheon.uf.viz.core.maps/src/com/raytheon/uf/viz/core/maps/display/MapRenderableDisplay.java b/cave/com.raytheon.uf.viz.core.maps/src/com/raytheon/uf/viz/core/maps/display/MapRenderableDisplay.java index b6d7cec7f3..0b1250ef3c 100644 --- a/cave/com.raytheon.uf.viz.core.maps/src/com/raytheon/uf/viz/core/maps/display/MapRenderableDisplay.java +++ b/cave/com.raytheon.uf.viz.core.maps/src/com/raytheon/uf/viz/core/maps/display/MapRenderableDisplay.java @@ -66,6 +66,9 @@ import com.raytheon.uf.viz.core.rsc.sampling.SamplingResource; * Jul 20, 2010 6187 bkowal The alpha level will always be reset for every * resource when the paint method is called now. * 06/24/2013 2140 randerso Changed to use standardized paint error handling + * Mar 3, 2014 2804 mschenke Setup display to clip before each resource is + * to ensure resources do not affect each other + * * * * @@ -145,7 +148,6 @@ public class MapRenderableDisplay extends AbstractRenderableDisplay implements this.mapCenter = descriptor.pixelToWorld(paintProps.getView() .getExtent().getCenter()); - target.setupClippingPlane(getMapExtent()); paintProps.setClippingPane(getMapExtent()); int displayWidth = (int) (((MapDescriptor) descriptor).getMapWidth() * zoomLevel); @@ -173,6 +175,7 @@ public class MapRenderableDisplay extends AbstractRenderableDisplay implements } paintProps = calcPaintDataTime(paintProps, rsc); + target.setupClippingPlane(paintProps.getClippingPane()); paintResource(pair, target, paintProps); } } diff --git a/cave/com.raytheon.uf.viz.core.rsc/src/com/raytheon/uf/viz/core/rsc/sampling/SamplingResource.java b/cave/com.raytheon.uf.viz.core.rsc/src/com/raytheon/uf/viz/core/rsc/sampling/SamplingResource.java index c95df387f9..b49e2c65ba 100644 --- a/cave/com.raytheon.uf.viz.core.rsc/src/com/raytheon/uf/viz/core/rsc/sampling/SamplingResource.java +++ b/cave/com.raytheon.uf.viz.core.rsc/src/com/raytheon/uf/viz/core/rsc/sampling/SamplingResource.java @@ -66,6 +66,7 @@ import com.vividsolutions.jts.geom.Coordinate; * ------------ ---------- ----------- -------------------------- * Dec 22, 2010 mschenke Initial creation * Jan 31, 2012 14306 kshresth Cursor readout as you sample the dispays + * Mar 3, 2014 2804 mschenke Set back up clipping pane * * * @@ -352,6 +353,8 @@ public class SamplingResource extends + e.getLocalizedMessage(), e); } errorInHovering = true; + } finally { + target.setupClippingPlane(paintProps.getClippingPane()); } } diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/rsc/AbstractResourceData.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/rsc/AbstractResourceData.java index d5da59f4ea..e84f3fe9da 100644 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/rsc/AbstractResourceData.java +++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/rsc/AbstractResourceData.java @@ -29,6 +29,7 @@ import javax.xml.bind.annotation.XmlElement; import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.viz.core.drawables.IDescriptor; import com.raytheon.uf.viz.core.exception.VizException; +import com.raytheon.uf.viz.core.rsc.IResourceDataChanged.ChangeType; /** * A base implementation of resource data and metadata. This class is used by @@ -112,7 +113,10 @@ public abstract class AbstractResourceData { * * This class is typically implemented and provides any transformations * necessary to go between the raw data form and the input of the renderable - * AbstractVizResource. + * AbstractVizResource. Default calls + * {@link #fireChangeListeners(com.raytheon.uf.viz.core.rsc.IResourceDataChanged.ChangeType, Object)} + * with {@link ChangeType#DATA_UPDATE} and the updateData with no + * transformations * * * @param updateData diff --git a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPResource.java b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPResource.java index 1cbafcf0bf..c190363ee3 100644 --- a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPResource.java +++ b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPResource.java @@ -174,6 +174,7 @@ import com.vividsolutions.jts.geom.Point; * Jul 17, 2013 2197 njensen Improved speed of getName() * Oct 18, 2013 DR 16151 gzhang Used getAverageValue() for QPF Graph. * Feb 19, 2014 2819 randerso Removed unnecessary .clone() call + * Mar 3, 2014 2804 mschenke Set back up clipping pane * * * @@ -1211,198 +1212,208 @@ public class FFMPResource extends } aTarget.clearClippingPlane(); + try { - paintTime = paintProps.getDataTime(); - paintProps.setAlpha(getCapability(ImagingCapability.class).getAlpha()); + paintTime = paintProps.getDataTime(); + paintProps.setAlpha(getCapability(ImagingCapability.class) + .getAlpha()); - FFMPDrawable drawable = null; + FFMPDrawable drawable = null; - if (paintTime != null) { - if (!drawables.containsKey(paintTime)) { + if (paintTime != null) { + if (!drawables.containsKey(paintTime)) { - drawable = new FFMPDrawable(getDomains()); - drawables.put(paintTime, drawable); - } else { - // we found it! - drawable = drawables.get(paintTime); - // System.out.println("Found the drawable"); + drawable = new FFMPDrawable(getDomains()); + drawables.put(paintTime, drawable); + } else { + // we found it! + drawable = drawables.get(paintTime); + // System.out.println("Found the drawable"); - if (!paintTime.equals(drawable.getTime())) { - drawable.setDirty(true); - } - - // auto refresh state - if (isQuery) { - drawable.setDirty(true); - } - } - - if (getResourceData().tableLoad - && !paintTime.getRefTime().equals(getMostRecentTime())) { - setMostRecentTime(paintTime.getRefTime()); - setTableTime(); - // if (isLinkToFrame && loader != null && loader.loadType != - // LOADER_TYPE.GENERAL) { - if (isLinkToFrame) { - updateDialog(); - } - } - } else { - getResourceData().getMonitor().forceKillFFMPSplash(); - } - - if ((drawable != null) && drawable.isDirty()) { - // only need to do the query if extent changed, pfafs may be - // fine - if (!isFirst || (queryJob.getState() == Job.NONE)) { - queryJob.request(aTarget, drawable, paintTime); - } - } - - if ((drawable != null) && isFfmpDataToggle()) { - IColormapShadedShapeExtension ext = aTarget - .getExtension(IColormapShadedShapeExtension.class); - ImagingCapability imageCap = getCapability(ImagingCapability.class); - float brightness = imageCap.getBrightness(); - float alpha = imageCap.getAlpha(); - for (DomainXML domain : getDomains()) { - String cwa = domain.getCwa(); - IColormapShadedShape shape = shadedShapes.getDrawableShape(cwa, - drawable.getShadedHuc()); - Map colorMap = drawable.getColorMap(cwa); - if ((shape != null) && (colorMap != null)) { - ext.drawColormapShadedShape(shape, colorMap, alpha, - brightness); - } - } - } - - boolean isAllHuc = getHuc().equals(FFMPRecord.ALL); - if (getResourceData().tableLoad) { - - int mapWidth = getDescriptor().getMapWidth() / 1000; - double zoom = getDescriptor().getRenderableDisplay().getZoom(); - - // determine whether or not to draw the small guys - if ((mapWidth * zoom) > 250.0) { - if (isSmallBasins) { - isSmallBasins = false; - refresh(); - } - - } else if ((mapWidth * zoom) < 250.0) { - if (!isSmallBasins) { - isSmallBasins = true; - if (smallBasinOverlayShape == null) { + if (!paintTime.equals(drawable.getTime())) { drawable.setDirty(true); - } else { + } + + // auto refresh state + if (isQuery) { + drawable.setDirty(true); + } + } + + if (getResourceData().tableLoad + && !paintTime.getRefTime().equals(getMostRecentTime())) { + setMostRecentTime(paintTime.getRefTime()); + setTableTime(); + // if (isLinkToFrame && loader != null && loader.loadType != + // LOADER_TYPE.GENERAL) { + if (isLinkToFrame) { + updateDialog(); + } + } + } else { + getResourceData().getMonitor().forceKillFFMPSplash(); + } + + if ((drawable != null) && drawable.isDirty()) { + // only need to do the query if extent changed, pfafs may be + // fine + if (!isFirst || (queryJob.getState() == Job.NONE)) { + queryJob.request(aTarget, drawable, paintTime); + } + } + + if ((drawable != null) && isFfmpDataToggle()) { + IColormapShadedShapeExtension ext = aTarget + .getExtension(IColormapShadedShapeExtension.class); + ImagingCapability imageCap = getCapability(ImagingCapability.class); + float brightness = imageCap.getBrightness(); + float alpha = imageCap.getAlpha(); + for (DomainXML domain : getDomains()) { + String cwa = domain.getCwa(); + IColormapShadedShape shape = shadedShapes.getDrawableShape( + cwa, drawable.getShadedHuc()); + Map colorMap = drawable.getColorMap(cwa); + if ((shape != null) && (colorMap != null)) { + ext.drawColormapShadedShape(shape, colorMap, alpha, + brightness); + } + } + } + + boolean isAllHuc = getHuc().equals(FFMPRecord.ALL); + if (getResourceData().tableLoad) { + + int mapWidth = getDescriptor().getMapWidth() / 1000; + double zoom = getDescriptor().getRenderableDisplay().getZoom(); + + // determine whether or not to draw the small guys + if ((mapWidth * zoom) > 250.0) { + if (isSmallBasins) { + isSmallBasins = false; refresh(); } - } - } - if (isSmallBasins && this.isBasinToggle()) { - OutlineCapability lineCap = getCapability(OutlineCapability.class); - if ((smallBasinOverlayShape != null) - && smallBasinOverlayShape.isDrawable()) { - - if (basinBoundaryColor == null) { - basinBoundaryColor = getCapability( - ColorableCapability.class).getColor(); - } - - aTarget.drawWireframeShape(smallBasinOverlayShape, - basinBoundaryColor, lineCap.getOutlineWidth(), - lineCap.getLineStyle()); - } else if ((smallBasinOverlayShape == null) - && lineCap.isOutlineOn()) { - issueRefresh(); - } - } - - // the product string - if (isFfmpDataToggle() && (fieldDescString != null)) { - paintProductString(aTarget, paintProps); - } - } - // re-centered ? - if (centeredAggregationKey != null) { - vgbDrawables.clear(); - // create pixelCoverages for the VGB's - if (isAllHuc) { - for (DomainXML domain : getDomains()) { - for (Long pfaf : monitor.getTemplates(getSiteKey()) - .getMap(getSiteKey(), domain.getCwa(), getHuc()) - .keySet()) { - List fvgmdList = monitor - .getTemplates(getSiteKey()) - .getVirtualGageBasinMetaData(getSiteKey(), - domain.getCwa(), pfaf); - if (fvgmdList != null) { - for (FFMPVirtualGageBasinMetaData fvgmd : fvgmdList) { - vgbDrawables.put( - fvgmd.getLid(), - getPixelCoverage(fvgmd.getCoordinate(), - paintProps)); - } + } else if ((mapWidth * zoom) < 250.0) { + if (!isSmallBasins) { + isSmallBasins = true; + if (smallBasinOverlayShape == null) { + drawable.setDirty(true); + } else { + refresh(); } } } - } else { - if (lowestCenter == FFMPRecord.ZOOM.AGGREGATE) { - for (Long pfaf : monitor.getTemplates(getSiteKey()) - .getAllAggregatePfafs(centeredAggregationKey, - getHuc())) { - List fvgmdList = monitor + + if (isSmallBasins && this.isBasinToggle()) { + OutlineCapability lineCap = getCapability(OutlineCapability.class); + if ((smallBasinOverlayShape != null) + && smallBasinOverlayShape.isDrawable()) { + + if (basinBoundaryColor == null) { + basinBoundaryColor = getCapability( + ColorableCapability.class).getColor(); + } + + aTarget.drawWireframeShape(smallBasinOverlayShape, + basinBoundaryColor, lineCap.getOutlineWidth(), + lineCap.getLineStyle()); + } else if ((smallBasinOverlayShape == null) + && lineCap.isOutlineOn()) { + issueRefresh(); + } + } + + // the product string + if (isFfmpDataToggle() && (fieldDescString != null)) { + paintProductString(aTarget, paintProps); + } + } + // re-centered ? + if (centeredAggregationKey != null) { + vgbDrawables.clear(); + // create pixelCoverages for the VGB's + if (isAllHuc) { + for (DomainXML domain : getDomains()) { + for (Long pfaf : monitor .getTemplates(getSiteKey()) - .getVirtualGageBasinMetaData(getSiteKey(), - null, pfaf); - if (fvgmdList != null) { - for (FFMPVirtualGageBasinMetaData fvgmd : fvgmdList) { - vgbDrawables.put( - fvgmd.getLid(), - getPixelCoverage(fvgmd.getCoordinate(), - paintProps)); + .getMap(getSiteKey(), domain.getCwa(), getHuc()) + .keySet()) { + List fvgmdList = monitor + .getTemplates(getSiteKey()) + .getVirtualGageBasinMetaData(getSiteKey(), + domain.getCwa(), pfaf); + if (fvgmdList != null) { + for (FFMPVirtualGageBasinMetaData fvgmd : fvgmdList) { + vgbDrawables.put( + fvgmd.getLid(), + getPixelCoverage( + fvgmd.getCoordinate(), + paintProps)); + } } } } } else { - for (DomainXML domain : getDomains()) { - for (Entry entry : monitor - .getTemplates(getSiteKey()) - .getVirtualGageBasins(getSiteKey(), - domain.getCwa()).entrySet()) { - if (entry.getValue() != null) { - vgbDrawables.put( - entry.getKey(), - getPixelCoverage(entry.getValue() - .getCoordinate(), paintProps)); + if (lowestCenter == FFMPRecord.ZOOM.AGGREGATE) { + for (Long pfaf : monitor.getTemplates(getSiteKey()) + .getAllAggregatePfafs(centeredAggregationKey, + getHuc())) { + List fvgmdList = monitor + .getTemplates(getSiteKey()) + .getVirtualGageBasinMetaData(getSiteKey(), + null, pfaf); + if (fvgmdList != null) { + for (FFMPVirtualGageBasinMetaData fvgmd : fvgmdList) { + vgbDrawables.put( + fvgmd.getLid(), + getPixelCoverage( + fvgmd.getCoordinate(), + paintProps)); + } + } + } + } else { + for (DomainXML domain : getDomains()) { + for (Entry entry : monitor + .getTemplates(getSiteKey()) + .getVirtualGageBasins(getSiteKey(), + domain.getCwa()).entrySet()) { + if (entry.getValue() != null) { + vgbDrawables.put( + entry.getKey(), + getPixelCoverage(entry.getValue() + .getCoordinate(), + paintProps)); + } } } } } + + paintCenter(aTarget, paintProps); + paintVGBs(aTarget, paintProps); } - paintCenter(aTarget, paintProps); - paintVGBs(aTarget, paintProps); - } + // draw or clear the colorMap + if (!isFfmpDataToggle()) { // clear if ffmpDataToggle is false + getCapability(ColorMapCapability.class).setColorMapParameters( + null); + } else if (getColorUtil().getColorMapParameters() != null) { + // restore if null + getCapability(ColorMapCapability.class).setColorMapParameters( + getColorUtil().getColorMapParameters()); + } - // draw or clear the colorMap - if (!isFfmpDataToggle()) { // clear if ffmpDataToggle is false - getCapability(ColorMapCapability.class).setColorMapParameters(null); - } else if (getColorUtil().getColorMapParameters() != null) { - // restore if null - getCapability(ColorMapCapability.class).setColorMapParameters( - getColorUtil().getColorMapParameters()); - } + // draw stream trace? + if (isShowStream() && isStreamFollow()) { + paintUpAndDownStream(aTarget, paintProps); + } - // draw stream trace? - if (isShowStream() && isStreamFollow()) { - paintUpAndDownStream(aTarget, paintProps); + // always reset + isQuery = false; + } finally { + aTarget.setupClippingPlane(paintProps.getClippingPane()); } - - // always reset - isQuery = false; } /** diff --git a/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/resource/ScanResource.java b/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/resource/ScanResource.java index e0ba40b028..0cc16d4de6 100644 --- a/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/resource/ScanResource.java +++ b/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/resource/ScanResource.java @@ -84,7 +84,7 @@ import com.vividsolutions.jts.geom.Coordinate; * D2DTimeMatcher. * Apr 02, 2013 1731 mpduff Fix problem with DMD updates. * Apr 22, 2013 1926 njensen Faster rendering - * + * Mar 3, 2014 2804 mschenke Set back up clipping pane * * * @author dhladky @@ -246,7 +246,6 @@ public class ScanResource extends PaintProperties paintProps) throws VizException { getScan().setFrames(paintProps.getFramesInfo().getFrameCount()); - target.setupClippingPlane(paintProps.getClippingPane()); this.paintTime = paintProps.getDataTime(); if (paintTime != null) { @@ -393,6 +392,7 @@ public class ScanResource extends } else if (getTable().equals(ScanTables.DMD)) { paintElevationAngle(target, paintProps); } + target.setupClippingPlane(paintProps.getClippingPane()); } } diff --git a/cave/com.raytheon.uf.viz.vil/src/com/raytheon/uf/viz/vil/VILResource.java b/cave/com.raytheon.uf.viz.vil/src/com/raytheon/uf/viz/vil/VILResource.java index 08d7c2a822..def308d310 100644 --- a/cave/com.raytheon.uf.viz.vil/src/com/raytheon/uf/viz/vil/VILResource.java +++ b/cave/com.raytheon.uf.viz.vil/src/com/raytheon/uf/viz/vil/VILResource.java @@ -39,9 +39,9 @@ import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.style.ParamLevelMatchCriteria; +import com.raytheon.uf.common.style.StyleException; import com.raytheon.uf.common.style.StyleManager; import com.raytheon.uf.common.style.StyleRule; -import com.raytheon.uf.common.style.StyleException; import com.raytheon.uf.common.style.image.ImagePreferences; import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.viz.core.IGraphicsTarget; @@ -68,8 +68,8 @@ import com.vividsolutions.jts.geom.Coordinate; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 11Nov2009 2037 dhladky Initial Creation. - * + * 11Nov2009 2037 dhladky Initial Creation. + * Mar 3, 2014 2804 mschenke Set back up clipping pane * * * @author dhladky @@ -196,76 +196,81 @@ public class VILResource extends PaintProperties paintProps) throws VizException { target.clearClippingPlane(); - this.displayedDataTime = paintProps.getDataTime(); + try { + this.displayedDataTime = paintProps.getDataTime(); - if (this.font == null) { - this.font = target.initializeFont("Dialog", 11, null); - } - - // Pull the record out - this.record = resourceData.dataObjectMap.get(this.displayedDataTime); - - if (record == null) { - // Don't have data for this frame - return; - } - - GriddedImageDisplay2 gridDisplay = null; - - if (record.getDataArray() == null) { - record = resourceData.populateRecord(record); - } - - gridDisplay = griddedDisplayMap.get(displayedDataTime); - if (gridDisplay == null) { - gridDisplay = new GriddedImageDisplay2(FloatBuffer.wrap(record - .getDataArray()), record.getGridGeometry(), this); - this.previousDataTime = displayedDataTime; - griddedDisplayMap.put(displayedDataTime, gridDisplay); - } - - if (record.getDataArray() == null) { - // this should never happen, but just to be sure - System.err.println("record.getDataArray() returned null"); - return; - } - - ColorMapParameters colorMapParameters = getCapability( - ColorMapCapability.class).getColorMapParameters(); - - if (record != null && init) { - // Get default colormap - StyleRule sr; - try { - sr = StyleManager.getInstance().getStyleRule( - StyleManager.StyleType.IMAGERY, getMatchCriteria()); - } catch (StyleException e) { - throw new VizException(e.getLocalizedMessage(), e); + if (this.font == null) { + this.font = target.initializeFont("Dialog", 11, null); } - this.colormapfile = ((ImagePreferences) sr.getPreferences()) - .getDefaultColormap(); - IColorMap cxml = ColorMapLoader.loadColorMap(colormapfile); - ColorMap colorMap = new ColorMap(colormapfile, (ColorMap) cxml); - colorMapParameters.setColorMap(colorMap); + // Pull the record out + this.record = resourceData.dataObjectMap + .get(this.displayedDataTime); - colorMapParameters.setDataMapping(((ImagePreferences) sr - .getPreferences()).getDataMapping()); + if (record == null) { + // Don't have data for this frame + return; + } - vilmax = colorMapParameters - .getDataMapping() - .getEntries() - .get(colorMapParameters.getDataMapping().getEntries() - .size() - 1).getDisplayValue().floatValue(); - vilmin = colorMapParameters.getDataMapping().getEntries().get(0) - .getDisplayValue().floatValue(); - colorMapParameters.setColorMapMax(vilmax); - colorMapParameters.setColorMapMin(vilmin); + GriddedImageDisplay2 gridDisplay = null; - init = false; + if (record.getDataArray() == null) { + record = resourceData.populateRecord(record); + } + + gridDisplay = griddedDisplayMap.get(displayedDataTime); + if (gridDisplay == null) { + gridDisplay = new GriddedImageDisplay2(FloatBuffer.wrap(record + .getDataArray()), record.getGridGeometry(), this); + this.previousDataTime = displayedDataTime; + griddedDisplayMap.put(displayedDataTime, gridDisplay); + } + + if (record.getDataArray() == null) { + // this should never happen, but just to be sure + System.err.println("record.getDataArray() returned null"); + return; + } + + ColorMapParameters colorMapParameters = getCapability( + ColorMapCapability.class).getColorMapParameters(); + + if (record != null && init) { + // Get default colormap + StyleRule sr; + try { + sr = StyleManager.getInstance().getStyleRule( + StyleManager.StyleType.IMAGERY, getMatchCriteria()); + } catch (StyleException e) { + throw new VizException(e.getLocalizedMessage(), e); + } + this.colormapfile = ((ImagePreferences) sr.getPreferences()) + .getDefaultColormap(); + + IColorMap cxml = ColorMapLoader.loadColorMap(colormapfile); + ColorMap colorMap = new ColorMap(colormapfile, (ColorMap) cxml); + colorMapParameters.setColorMap(colorMap); + + colorMapParameters.setDataMapping(((ImagePreferences) sr + .getPreferences()).getDataMapping()); + + vilmax = colorMapParameters + .getDataMapping() + .getEntries() + .get(colorMapParameters.getDataMapping().getEntries() + .size() - 1).getDisplayValue().floatValue(); + vilmin = colorMapParameters.getDataMapping().getEntries() + .get(0).getDisplayValue().floatValue(); + colorMapParameters.setColorMapMax(vilmax); + colorMapParameters.setColorMapMin(vilmin); + + init = false; + } + + gridDisplay.paint(target, paintProps); + } finally { + target.setupClippingPlane(paintProps.getClippingPane()); } - - gridDisplay.paint(target, paintProps); } /* diff --git a/cave/com.raytheon.viz.awipstools/src/com/raytheon/viz/awipstools/ui/layer/ShearLayer.java b/cave/com.raytheon.viz.awipstools/src/com/raytheon/viz/awipstools/ui/layer/ShearLayer.java index 309292646a..f213bafad8 100644 --- a/cave/com.raytheon.viz.awipstools/src/com/raytheon/viz/awipstools/ui/layer/ShearLayer.java +++ b/cave/com.raytheon.viz.awipstools/src/com/raytheon/viz/awipstools/ui/layer/ShearLayer.java @@ -72,6 +72,7 @@ import com.vividsolutions.jts.geom.LineString; * Aug 29, 2013 2281 bsteffen Fix click distance calculations. * Sep 03, 2013 2310 bsteffen Move MouseHandler from ShearAction to * ShearLayer. + * Mar 3, 2014 2804 mschenke Set back up clipping pane * * * @@ -167,7 +168,11 @@ public class ShearLayer extends drawLineString(target, ls, color, IGraphicsTarget.LineStyle.SOLID); String label = drawLabeling(target, ls, color, paintProps); target.clearClippingPlane(); - drawUpperLeftCornerLabel(target, paintProps, label); + try { + drawUpperLeftCornerLabel(target, paintProps, label); + } finally { + target.setupClippingPlane(paintProps.getClippingPane()); + } } public void drawLines(Coordinate[] coors) { @@ -227,7 +232,7 @@ public class ShearLayer extends return coorOnCircle; } - + protected void drawBaselineLabel(IGraphicsTarget target, Coordinate latLong, String label) throws VizException { @@ -244,7 +249,7 @@ public class ShearLayer extends ds.horizontalAlignment = HorizontalAlignment.LEFT; // set the magnification ds.magnification = this.getCapability(MagnificationCapability.class) - .getMagnification().floatValue(); + .getMagnification().floatValue(); target.drawStrings(ds); } @@ -309,8 +314,7 @@ public class ShearLayer extends * y location in screen pixels * @return T Coordinate of the endpoint, null if not found. */ - public Coordinate isInsideEndpoint(int x, - int y) { + public Coordinate isInsideEndpoint(int x, int y) { IDisplayPaneContainer container = getResourceContainer(); if (container == null) { return null; @@ -378,7 +382,7 @@ public class ShearLayer extends ds.horizontalAlignment = HorizontalAlignment.LEFT; // set the magnification ds.magnification = this.getCapability(MagnificationCapability.class) - .getMagnification().floatValue(); + .getMagnification().floatValue(); target.drawStrings(ds); } @@ -425,9 +429,10 @@ public class ShearLayer extends String separatorSymbol; public VelocityRange(Map map) { - if (map != null && map.containsKey("Mnemonic") - && (map.containsKey(BASE_VELOCITY_VALUE_KEY) || - map.containsKey(VALUE_KEY))) { + if (map != null + && map.containsKey("Mnemonic") + && (map.containsKey(BASE_VELOCITY_VALUE_KEY) || map + .containsKey(VALUE_KEY))) { String mnemonic = map.get("Mnemonic").toString(); if (mnemonic.equalsIgnoreCase("V") diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/GLTarget.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/GLTarget.java index 017c4a18a0..c081c4a5c8 100644 --- a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/GLTarget.java +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/GLTarget.java @@ -130,6 +130,7 @@ import com.sun.opengl.util.j2d.TextRenderer; * May 28, 2013 1638 mschenke Made sure {@link TextStyle#BLANKED} text is drawing correct size * box around text * Nov 4, 2013 2492 mschenke Switched colormap drawing to use 1D texture object for alpha mask + * Mar 3, 2014 2804 mschenke Added clipping pane field to only setup if changed * * * @@ -250,6 +251,8 @@ public class GLTarget extends AbstractGraphicsTarget implements IGLTarget { protected Rectangle monitorBounds; + protected IExtent clippingPane; + /** * Construct a GL target using a canvas (inherited from IGraphicsTarget) * @@ -406,6 +409,7 @@ public class GLTarget extends AbstractGraphicsTarget implements IGLTarget { gl.glDisable(GL.GL_CLIP_PLANE1); gl.glDisable(GL.GL_CLIP_PLANE2); gl.glDisable(GL.GL_CLIP_PLANE3); + this.clippingPane = null; } /* @@ -1394,9 +1398,19 @@ public class GLTarget extends AbstractGraphicsTarget implements IGLTarget { */ @Override public void setupClippingPlane(IExtent extent) { - if (extent == null) { + if (this.clippingPane == extent + || (this.clippingPane != null && extent != null && this.clippingPane + .equals(extent))) { + // Clipping pane already set to this return; } + this.clippingPane = extent; + if (clippingPane == null) { + clearClippingPlane(); + return; + } + // Clone to preserve clipping pane extent + this.clippingPane = clippingPane.clone(); gl.glMatrixMode(GL.GL_MODELVIEW); gl.glPushMatrix(); diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/rsc/colorbar/GFEColorbarResource.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/rsc/colorbar/GFEColorbarResource.java index 9c47ca94f8..59e1199b39 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/rsc/colorbar/GFEColorbarResource.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/rsc/colorbar/GFEColorbarResource.java @@ -35,8 +35,6 @@ import com.raytheon.uf.common.dataplugin.gfe.reference.ReferenceData; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; -import com.raytheon.uf.viz.core.AbstractGraphicsFactoryAdapter; -import com.raytheon.uf.viz.core.GraphicsFactory; import com.raytheon.uf.viz.core.IDisplayPane; import com.raytheon.uf.viz.core.IDisplayPaneContainer; import com.raytheon.uf.viz.core.IExtent; @@ -103,6 +101,7 @@ import com.raytheon.viz.ui.input.InputAdapter; * 01/23/2013 #1524 randerso Fix error when clicking on discrete color bar when * no grid exists * 08/27/2013 #2287 randerso Fixed fitToDataColorTable for Single Grids + * Mar 3, 2014 #2804 mschenke Set back up clipping pane * * * @@ -241,8 +240,6 @@ public class GFEColorbarResource extends protected static RGB seColorBarBgWxPickupColor = new RGB(255, 0, 255); - AbstractGraphicsFactoryAdapter graphicsAdapter = null; - protected Set fittedParms; static { @@ -430,12 +427,7 @@ public class GFEColorbarResource extends colorbarDisplay.paint(target, paintProps); } - if (graphicsAdapter == null) { - graphicsAdapter = GraphicsFactory.getGraphicsAdapter(); - } - - target.setupClippingPlane(graphicsAdapter.constructExtent(descriptor - .getGridGeometry().getGridRange())); + target.setupClippingPlane(paintProps.getClippingPane()); // this.lastIndex = curIndex; diff --git a/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/colorbar/HydroColorBarResource.java b/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/colorbar/HydroColorBarResource.java index fd9b6c7594..23908a7e18 100644 --- a/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/colorbar/HydroColorBarResource.java +++ b/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/colorbar/HydroColorBarResource.java @@ -61,10 +61,11 @@ import com.raytheon.viz.ui.cmenu.IContextMenuContributor; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Feb 20, 2009 mpduff Initial creation + * Feb 20, 2009 mpduff Initial creation * Feb 14, 2013 1616 bsteffen Add option for interpolation of colormap * parameters, disable colormap interpolation * by default. + * Mar 3, 2014 2804 mschenke Set back up clipping pane * * * @@ -156,11 +157,15 @@ public class HydroColorBarResource extends target.clearClippingPlane(); - double yMax = screenExtent.getMaxY(); + try { + double yMax = screenExtent.getMaxY(); - /* Draw the color bar */ - yMax = drawColorBar(target, screenExtent.getMinX(), - screenExtent.getMaxX(), yMax); + /* Draw the color bar */ + yMax = drawColorBar(target, screenExtent.getMinX(), + screenExtent.getMaxX(), yMax); + } finally { + target.setupClippingPlane(paintProps.getClippingPane()); + } } /** diff --git a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/rsc/PointFreezePlotResource.java b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/rsc/PointFreezePlotResource.java index 87cba6cd3c..e21240c433 100644 --- a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/rsc/PointFreezePlotResource.java +++ b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/rsc/PointFreezePlotResource.java @@ -86,6 +86,7 @@ import com.vividsolutions.jts.index.strtree.STRtree; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Jul 8, 2009 2589 snaples Initial creation + * Mar 3, 2014 2804 mschenke Set back up clipping pane * * * @@ -528,6 +529,7 @@ public class PointFreezePlotResource extends } target.clearClippingPlane(); drawQCLegend(); + target.setupClippingPlane(paintProps.getClippingPane()); } } diff --git a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/rsc/PointPrecipPlotResource.java b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/rsc/PointPrecipPlotResource.java index f64769e1a3..a2e36f0cf8 100644 --- a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/rsc/PointPrecipPlotResource.java +++ b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/rsc/PointPrecipPlotResource.java @@ -88,6 +88,7 @@ import com.vividsolutions.jts.index.strtree.STRtree; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Nov 24, 2008 1748 snaples Initial creation + * Mar 3, 2014 2804 mschenke Set back up clipping pane * * * @@ -761,6 +762,7 @@ public class PointPrecipPlotResource extends } target.clearClippingPlane(); drawQCLegend(); + target.setupClippingPlane(paintProps.getClippingPane()); } } diff --git a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/rsc/PointTempPlotResource.java b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/rsc/PointTempPlotResource.java index a2dc970fea..d7a5d1cc8e 100644 --- a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/rsc/PointTempPlotResource.java +++ b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/rsc/PointTempPlotResource.java @@ -87,6 +87,7 @@ import com.vividsolutions.jts.index.strtree.STRtree; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Jun 24, 2009 2524 snaples Initial creation + * Mar 3, 2014 2804 mschenke Set back up clipping pane * * * @@ -602,6 +603,7 @@ public class PointTempPlotResource extends } target.clearClippingPlane(); drawQCLegend(); + target.setupClippingPlane(paintProps.getClippingPane()); } } diff --git a/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/rsc/graphic/RadarGraphicsResource.java b/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/rsc/graphic/RadarGraphicsResource.java index a8dc49589b..94da618396 100644 --- a/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/rsc/graphic/RadarGraphicsResource.java +++ b/cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/rsc/graphic/RadarGraphicsResource.java @@ -43,11 +43,11 @@ import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability; import com.raytheon.uf.viz.core.rsc.capabilities.IMiddleClickCapableResource; import com.raytheon.uf.viz.core.rsc.capabilities.MagnificationCapability; import com.raytheon.viz.radar.IRadarConfigListener; +import com.raytheon.viz.radar.VizRadarRecord; import com.raytheon.viz.radar.interrogators.IRadarInterrogator; import com.raytheon.viz.radar.rsc.AbstractRadarResource; import com.raytheon.viz.radar.rsc.RadarResourceData; import com.raytheon.viz.radar.ui.RadarDisplayManager; -import com.raytheon.viz.radar.VizRadarRecord; import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.Envelope; @@ -62,7 +62,8 @@ import com.vividsolutions.jts.geom.Envelope; * May 13, 2010 mnash Initial creation * Jul 20, 2010 #6187 bkowal The cache will be cleared out every time * a refresh is required. - * 03/05/2013 DCS51 zwang Handle GFM product + * 03/05/2013 DCS51 zwang Handle GFM product + * Mar 3, 2014 2804 mschenke Set back up clipping pane * * * @@ -164,14 +165,14 @@ public class RadarGraphicsResource extends AbstractRadarResource @Override public String[] getUpperText(DataTime time) { - VizRadarRecord record = getRadarRecord(time); - - // Use upper text to display gfmCount for GFM (140) - if (record != null && record.getProductCode() == 140) { - return super.getUpperText(time); - } - - // Upper text would interfere with the table + VizRadarRecord record = getRadarRecord(time); + + // Use upper text to display gfmCount for GFM (140) + if (record != null && record.getProductCode() == 140) { + return super.getUpperText(time); + } + + // Upper text would interfere with the table return null; } @@ -223,48 +224,53 @@ public class RadarGraphicsResource extends AbstractRadarResource // DMD specify if (radarRecord.getProductCode() == 149) { target.clearClippingPlane(); - int xPos = 95; - int yPos = 10; - xPos = paintProps.getCanvasBounds().x - + paintProps.getCanvasBounds().width - xPos; + try { + int xPos = 95; + int yPos = 10; + xPos = paintProps.getCanvasBounds().x + + paintProps.getCanvasBounds().width - xPos; - // Get the Lat/Lon of the screen Extent - Envelope screenLatLon = descriptor.pixelToWorld(paintProps - .getView().getExtent()); + // Get the Lat/Lon of the screen Extent + Envelope screenLatLon = descriptor.pixelToWorld(paintProps + .getView().getExtent()); - int offScreenCount = 0; - int filteredCount = 0; - Coordinate currFeature; - for (RadarDataKey currPt : radarRecord.getSymbologyData().keySet()) { - currFeature = new Coordinate(currPt.getLon(), currPt.getLat()); + int offScreenCount = 0; + int filteredCount = 0; + Coordinate currFeature; + for (RadarDataKey currPt : radarRecord.getSymbologyData() + .keySet()) { + currFeature = new Coordinate(currPt.getLon(), + currPt.getLat()); - if (!screenLatLon.contains(currFeature)) { - // Count how many are not on the screen - offScreenCount++; - } else if (!radarRecord.getSymbologyData().get(currPt) - .isVisible()) { - // Count how many are not visible, that would be on the - // screen - filteredCount++; + if (!screenLatLon.contains(currFeature)) { + // Count how many are not on the screen + offScreenCount++; + } else if (!radarRecord.getSymbologyData().get(currPt) + .isVisible()) { + // Count how many are not visible, that would be on the + // screen + filteredCount++; + } } + + DrawableString offscreen = new DrawableString(offScreenCount + + " FEATURES OFF SCREEN", this.getCapability( + ColorableCapability.class).getColor()); + offscreen.setCoordinates(xPos, yPos); + offscreen.horizontalAlignment = HorizontalAlignment.CENTER; + offscreen.verticallAlignment = VerticalAlignment.MIDDLE; + + DrawableString notShown = new DrawableString(filteredCount + + " FEATURES NOT SHOWN", this.getCapability( + ColorableCapability.class).getColor()); + notShown.setCoordinates(xPos, yPos + 20); + notShown.horizontalAlignment = HorizontalAlignment.CENTER; + notShown.verticallAlignment = VerticalAlignment.MIDDLE; + target.getExtension(ICanvasRenderingExtension.class) + .drawStrings(paintProps, offscreen, notShown); + } finally { + target.setupClippingPlane(paintProps.getClippingPane()); } - - DrawableString offscreen = new DrawableString(offScreenCount - + " FEATURES OFF SCREEN", this.getCapability( - ColorableCapability.class).getColor()); - offscreen.setCoordinates(xPos, yPos); - offscreen.horizontalAlignment = HorizontalAlignment.CENTER; - offscreen.verticallAlignment = VerticalAlignment.MIDDLE; - - DrawableString notShown = new DrawableString(filteredCount - + " FEATURES NOT SHOWN", this.getCapability( - ColorableCapability.class).getColor()); - notShown.setCoordinates(xPos, yPos + 20); - notShown.horizontalAlignment = HorizontalAlignment.CENTER; - notShown.verticallAlignment = VerticalAlignment.MIDDLE; - target.getExtension(ICanvasRenderingExtension.class).drawStrings( - paintProps, offscreen, notShown); - } }