From 4a826332e90987ca586dbfe7cd8b655121b8a0b3 Mon Sep 17 00:00:00 2001 From: Nate Jensen Date: Thu, 10 Apr 2014 10:50:33 -0500 Subject: [PATCH] Issue #1803 fix redbook sharing in collaboration Change-Id: I7e5d887d8dd46fec02966d9ea4723252d7cda31e Former-commit-id: fdf384ea4cedebbf06c5e4861a5a7cdcc72533b4 --- .../viz/redbook/rsc/RedbookFrame.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/cave/com.raytheon.viz.redbook/src/com/raytheon/viz/redbook/rsc/RedbookFrame.java b/cave/com.raytheon.viz.redbook/src/com/raytheon/viz/redbook/rsc/RedbookFrame.java index 59ae6fad98..493b2097c2 100644 --- a/cave/com.raytheon.viz.redbook/src/com/raytheon/viz/redbook/rsc/RedbookFrame.java +++ b/cave/com.raytheon.viz.redbook/src/com/raytheon/viz/redbook/rsc/RedbookFrame.java @@ -94,6 +94,7 @@ import com.vividsolutions.jts.geom.Coordinate; * Jul 19, 2013 16401 D. Friedman Fix unknown block processing. * Mar 13, 2014 2907 njensen split edex.redbook plugin into common * and edex redbook plugins + * Apr 10, 2014 1803 njensen Fix dispose() for collaboration * * * @@ -141,7 +142,7 @@ public class RedbookFrame implements IRenderable { return (this.compiler != null); } - public void deInit() { + protected void deInit() { if (this.wireframeShape != null) { this.wireframeShape.dispose(); } @@ -329,9 +330,9 @@ public class RedbookFrame implements IRenderable { @Override public void paint(IGraphicsTarget target, PaintProperties paintProps) throws VizException { - - target.drawWireframeShape(this.wireframeShape, this.redbookResource - .getCapability(ColorableCapability.class).getColor(), + RGB color = this.redbookResource.getCapability( + ColorableCapability.class).getColor(); + target.drawWireframeShape(this.wireframeShape, color, this.redbookResource.getCapability(OutlineCapability.class) .getOutlineWidth(), this.redbookResource.getCapability(OutlineCapability.class) @@ -339,8 +340,9 @@ public class RedbookFrame implements IRenderable { synchronized (this) { IExtent pe = paintProps.getView().getExtent(); - IFont font = this.redbookResource.getRenderingFont(); - Rectangle2D cellSize = target.getStringBounds(font, "M"); + DrawableString m = new DrawableString("M", color); + m.font = this.redbookResource.getRenderingFont(); + Rectangle2D cellSize = target.getStringsBounds(m); boolean clipped = true; double xRatio = paintProps.getView().getExtent().getWidth() / paintProps.getCanvasBounds().width; @@ -556,7 +558,7 @@ public class RedbookFrame implements IRenderable { : VerticalAlignment.BOTTOM; Rectangle2D bounds = target.getStringsBounds(dstring); if (blanked) { - dstring.textStyle = TextStyle.BLANKED; + dstring.addTextStyle(TextStyle.BLANKED); } if (isLegend) { target.getExtension(ICanvasRenderingExtension.class) @@ -608,9 +610,7 @@ public class RedbookFrame implements IRenderable { } public void dispose() { - if (this.wireframeShape != null) { - this.wireframeShape.dispose(); - } + deInit(); } public DataTime getDataTime() {