Merge "Issue #1803 fix redbook sharing in collaboration" into development

Former-commit-id: 666b271528 [formerly 296b4dee5e8907296c45b8372b5dffe28a2b9f4c]
Former-commit-id: e88519c5e3
This commit is contained in:
Nate Jensen 2014-04-10 13:50:55 -05:00 committed by Gerrit Code Review
commit 74a7189143

View file

@ -94,6 +94,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* Jul 19, 2013 16401 D. Friedman Fix unknown block processing. * Jul 19, 2013 16401 D. Friedman Fix unknown block processing.
* Mar 13, 2014 2907 njensen split edex.redbook plugin into common * Mar 13, 2014 2907 njensen split edex.redbook plugin into common
* and edex redbook plugins * and edex redbook plugins
* Apr 10, 2014 1803 njensen Fix dispose() for collaboration
* *
* </pre> * </pre>
* *
@ -141,7 +142,7 @@ public class RedbookFrame implements IRenderable {
return (this.compiler != null); return (this.compiler != null);
} }
public void deInit() { protected void deInit() {
if (this.wireframeShape != null) { if (this.wireframeShape != null) {
this.wireframeShape.dispose(); this.wireframeShape.dispose();
} }
@ -329,9 +330,9 @@ public class RedbookFrame implements IRenderable {
@Override @Override
public void paint(IGraphicsTarget target, PaintProperties paintProps) public void paint(IGraphicsTarget target, PaintProperties paintProps)
throws VizException { throws VizException {
RGB color = this.redbookResource.getCapability(
target.drawWireframeShape(this.wireframeShape, this.redbookResource ColorableCapability.class).getColor();
.getCapability(ColorableCapability.class).getColor(), target.drawWireframeShape(this.wireframeShape, color,
this.redbookResource.getCapability(OutlineCapability.class) this.redbookResource.getCapability(OutlineCapability.class)
.getOutlineWidth(), .getOutlineWidth(),
this.redbookResource.getCapability(OutlineCapability.class) this.redbookResource.getCapability(OutlineCapability.class)
@ -339,8 +340,9 @@ public class RedbookFrame implements IRenderable {
synchronized (this) { synchronized (this) {
IExtent pe = paintProps.getView().getExtent(); IExtent pe = paintProps.getView().getExtent();
IFont font = this.redbookResource.getRenderingFont(); DrawableString m = new DrawableString("M", color);
Rectangle2D cellSize = target.getStringBounds(font, "M"); m.font = this.redbookResource.getRenderingFont();
Rectangle2D cellSize = target.getStringsBounds(m);
boolean clipped = true; boolean clipped = true;
double xRatio = paintProps.getView().getExtent().getWidth() double xRatio = paintProps.getView().getExtent().getWidth()
/ paintProps.getCanvasBounds().width; / paintProps.getCanvasBounds().width;
@ -556,7 +558,7 @@ public class RedbookFrame implements IRenderable {
: VerticalAlignment.BOTTOM; : VerticalAlignment.BOTTOM;
Rectangle2D bounds = target.getStringsBounds(dstring); Rectangle2D bounds = target.getStringsBounds(dstring);
if (blanked) { if (blanked) {
dstring.textStyle = TextStyle.BLANKED; dstring.addTextStyle(TextStyle.BLANKED);
} }
if (isLegend) { if (isLegend) {
target.getExtension(ICanvasRenderingExtension.class) target.getExtension(ICanvasRenderingExtension.class)
@ -608,9 +610,7 @@ public class RedbookFrame implements IRenderable {
} }
public void dispose() { public void dispose() {
if (this.wireframeShape != null) { deInit();
this.wireframeShape.dispose();
}
} }
public DataTime getDataTime() { public DataTime getDataTime() {