Omaha #3523 Replace Raytheon usage of IGraphicsTarget.TextStyle.NORMAL and directly assigning the text style

Change-Id: Idcc31d11251df8de949bd1bd9bf8c402a5d47f4f

Former-commit-id: e409b578fcb15caadf28da57d2cb1860e1ea246c
This commit is contained in:
Mark Peters 2014-08-14 15:27:55 -05:00
parent 1ad6977b87
commit 308ada356b
18 changed files with 98 additions and 92 deletions

View file

@ -24,6 +24,7 @@ import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.graphics.RGB;
@ -72,6 +73,8 @@ import com.vividsolutions.jts.geom.Polygon;
* Jun 10, 2011 9744 cjeanbap Added Magnification, Outline, and * Jun 10, 2011 9744 cjeanbap Added Magnification, Outline, and
* Density capability. * Density capability.
* Jun 13, 2011 9758 cjeanbap Set colorString of AdvisoryResourceData. * Jun 13, 2011 9758 cjeanbap Set colorString of AdvisoryResourceData.
* Aug 14, 2014 3523 mapeters Updated deprecated {@link DrawableString#textStyle}
* assignments.
* </pre> * </pre>
* *
* @author bsteffen * @author bsteffen
@ -256,7 +259,7 @@ public class AdvisoryResource extends
record.getLabel(), color); record.getLabel(), color);
dStrings.font = font; dStrings.font = font;
dStrings.setCoordinates(pixelLoc[0], pixelLoc[1]); dStrings.setCoordinates(pixelLoc[0], pixelLoc[1]);
dStrings.textStyle = TextStyle.DROP_SHADOW; dStrings.addTextStyle(TextStyle.DROP_SHADOW);
dStrings.horizontalAlignment = HorizontalAlignment.LEFT; dStrings.horizontalAlignment = HorizontalAlignment.LEFT;
dStrings.verticallAlignment = VerticalAlignment.TOP; dStrings.verticallAlignment = VerticalAlignment.TOP;
target.drawStrings(dStrings); target.drawStrings(dStrings);
@ -270,6 +273,7 @@ public class AdvisoryResource extends
dashedShape.clearLabels(); dashedShape.clearLabels();
dottedShape.clearLabels(); dottedShape.clearLabels();
List<DrawableString> strings = new ArrayList<DrawableString>();
for (AdvisoryRecord record : records.get(curDataTime)) { for (AdvisoryRecord record : records.get(curDataTime)) {
if (record.getType() == AdvisoryResourceType.AREA) { if (record.getType() == AdvisoryResourceType.AREA) {
font.setMagnification(magnification); font.setMagnification(magnification);
@ -282,10 +286,10 @@ public class AdvisoryResource extends
DrawableString dStrings = new DrawableString(labels, colors); DrawableString dStrings = new DrawableString(labels, colors);
dStrings.font = font; dStrings.font = font;
dStrings.setCoordinates(pixelLoc[0], pixelLoc[1]); dStrings.setCoordinates(pixelLoc[0], pixelLoc[1]);
dStrings.textStyle = TextStyle.DROP_SHADOW; dStrings.addTextStyle(TextStyle.DROP_SHADOW);
dStrings.horizontalAlignment = HorizontalAlignment.CENTER; dStrings.horizontalAlignment = HorizontalAlignment.CENTER;
dStrings.verticallAlignment = VerticalAlignment.MIDDLE; dStrings.verticallAlignment = VerticalAlignment.MIDDLE;
target.drawStrings(dStrings); strings.add(dStrings);
} else if (record.getType() == AdvisoryResourceType.TEXT) { } else if (record.getType() == AdvisoryResourceType.TEXT) {
double[] pixelLoc = descriptor.worldToPixel(new double[] { double[] pixelLoc = descriptor.worldToPixel(new double[] {
record.getLabelLoc().x, record.getLabelLoc().y }); record.getLabelLoc().x, record.getLabelLoc().y });
@ -295,13 +299,13 @@ public class AdvisoryResource extends
record.getLabel(), color); record.getLabel(), color);
dStrings.font = font; dStrings.font = font;
dStrings.setCoordinates(pixelLoc[0], pixelLoc[1]); dStrings.setCoordinates(pixelLoc[0], pixelLoc[1]);
dStrings.textStyle = TextStyle.DROP_SHADOW; dStrings.addTextStyle(TextStyle.DROP_SHADOW);
dStrings.horizontalAlignment = HorizontalAlignment.LEFT; dStrings.horizontalAlignment = HorizontalAlignment.LEFT;
dStrings.verticallAlignment = VerticalAlignment.TOP; dStrings.verticallAlignment = VerticalAlignment.TOP;
target.drawStrings(dStrings); strings.add(dStrings);
} }
} }
target.drawStrings(strings);
} }
// LineStyle lineStyle = resourceData.getDataAdapter().getLineStyle(); // LineStyle lineStyle = resourceData.getDataAdapter().getLineStyle();
// float lineWidth = resourceData.getDataAdapter().getLineWidth(); // float lineWidth = resourceData.getDataAdapter().getLineWidth();
@ -365,7 +369,7 @@ public class AdvisoryResource extends
nonStandardInspectStrings, colors); nonStandardInspectStrings, colors);
dStrings.font = null; dStrings.font = null;
dStrings.setCoordinates(xLoc, yLoc); dStrings.setCoordinates(xLoc, yLoc);
dStrings.textStyle = TextStyle.BLANKED; dStrings.addTextStyle(TextStyle.BLANKED);
dStrings.horizontalAlignment = HorizontalAlignment.LEFT; dStrings.horizontalAlignment = HorizontalAlignment.LEFT;
dStrings.verticallAlignment = VerticalAlignment.TOP; dStrings.verticallAlignment = VerticalAlignment.TOP;
target.drawStrings(dStrings); target.drawStrings(dStrings);

View file

@ -62,6 +62,8 @@ import com.raytheon.uf.viz.core.rsc.capabilities.ImagingCapability;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Apr 5, 2010 mschenke Initial creation * Apr 5, 2010 mschenke Initial creation
* Aug 14, 2014 3523 mapeters Updated deprecated {@link DrawableString#textStyle}
* assignments.
* *
* </pre> * </pre>
* *
@ -503,7 +505,7 @@ public class D2DColorBarResource extends
drawable.setCoordinates(xPos, yPos, zPos); drawable.setCoordinates(xPos, yPos, zPos);
drawable.horizontalAlignment = IGraphicsTarget.HorizontalAlignment.CENTER; drawable.horizontalAlignment = IGraphicsTarget.HorizontalAlignment.CENTER;
drawable.verticallAlignment = IGraphicsTarget.VerticalAlignment.MIDDLE; drawable.verticallAlignment = IGraphicsTarget.VerticalAlignment.MIDDLE;
drawable.textStyle = TextStyle.BLANKED; drawable.addTextStyle(TextStyle.BLANKED);
drawable.basics.alpha = paintProps.getAlpha(); drawable.basics.alpha = paintProps.getAlpha();
Rectangle2D rect = target.getStringsBounds(drawable); Rectangle2D rect = target.getStringsBounds(drawable);

View file

@ -122,6 +122,8 @@ import com.vividsolutions.jts.geom.Point;
* Mar 25, 2014 #2664 randerso Added support for non-WGS84 shape files * Mar 25, 2014 #2664 randerso Added support for non-WGS84 shape files
* Apr 14, 2014 #2664 randerso Fix NullPointerException when no .prj file present * Apr 14, 2014 #2664 randerso Fix NullPointerException when no .prj file present
* Apr 21, 2014 #2998 randerso Stored types of attributes to be used in the AttributeViewer * Apr 21, 2014 #2998 randerso Stored types of attributes to be used in the AttributeViewer
* Aug 14, 2014 #3523 mapeters Updated deprecated {@link DrawableString#textStyle}
* assignments.
* *
* </pre> * </pre>
* *
@ -964,8 +966,8 @@ public class DataStoreResource extends
DrawableString ds = new DrawableString("Drag to select", new RGB(0, DrawableString ds = new DrawableString("Drag to select", new RGB(0,
0, 0)); 0, 0));
ds.setCoordinates(dragPromptCoord.x, dragPromptCoord.y); ds.setCoordinates(dragPromptCoord.x, dragPromptCoord.y);
ds.textStyle = TextStyle.BOXED; ds.addTextStyle(TextStyle.BLANKED);
ds.boxColor = new RGB(255, 255, 255); ds.addTextStyle(TextStyle.BOXED, new RGB(255, 255, 255));
ds.horizontalAlignment = HorizontalAlignment.LEFT; ds.horizontalAlignment = HorizontalAlignment.LEFT;
ds.verticallAlignment = VerticalAlignment.BOTTOM; ds.verticallAlignment = VerticalAlignment.BOTTOM;
aTarget.drawStrings(ds); aTarget.drawStrings(ds);

View file

@ -194,6 +194,8 @@ import com.vividsolutions.jts.geom.Point;
* May 19, 2014 DR 16096 gzhang Make getBasin() protected for FFMPDataGenerator. * May 19, 2014 DR 16096 gzhang Make getBasin() protected for FFMPDataGenerator.
* 06/24/2016 mnash Make FFMPResource implement Interrogatable * 06/24/2016 mnash Make FFMPResource implement Interrogatable
* Aug 13, 2014 3492 mapeters Updated deprecated createWireframeShape() calls. * Aug 13, 2014 3492 mapeters Updated deprecated createWireframeShape() calls.
* Aug 14, 2014 3523 mapeters Updated deprecated {@link DrawableString#textStyle}
* assignments.
* </pre> * </pre>
* *
* @author dhladky * @author dhladky
@ -1232,7 +1234,7 @@ public class FFMPResource extends
basinLocatorString.font = xfont; basinLocatorString.font = xfont;
basinLocatorString.horizontalAlignment = HorizontalAlignment.CENTER; basinLocatorString.horizontalAlignment = HorizontalAlignment.CENTER;
basinLocatorString.verticallAlignment = VerticalAlignment.MIDDLE; basinLocatorString.verticallAlignment = VerticalAlignment.MIDDLE;
basinLocatorString.textStyle = TextStyle.BLANKED; basinLocatorString.addTextStyle(TextStyle.BLANKED);
} }
}); });

View file

@ -68,6 +68,8 @@ import com.vividsolutions.jts.geom.Point;
* Jul 22, 2014 3422 mapeters Updated deprecated drawArc() call. * Jul 22, 2014 3422 mapeters Updated deprecated drawArc() call.
* Jul 23, 2014 3429 mapeters Updated deprecated drawLine() call. * Jul 23, 2014 3429 mapeters Updated deprecated drawLine() call.
* Jul 29, 2014 3465 mapeters Updated deprecated drawString() calls. * Jul 29, 2014 3465 mapeters Updated deprecated drawString() calls.
* Aug 14, 2014 3523 mapeters Updated deprecated {@link DrawableString#textStyle}
* assignments.
* </pre> * </pre>
* *
* @author dhladky * @author dhladky
@ -436,7 +438,7 @@ public class ScanDrawer {
ds.horizontalAlignment = HorizontalAlignment.RIGHT; ds.horizontalAlignment = HorizontalAlignment.RIGHT;
ds.verticallAlignment = VerticalAlignment.BOTTOM; ds.verticallAlignment = VerticalAlignment.BOTTOM;
ds.font = font; ds.font = font;
ds.textStyle = TextStyle.DROP_SHADOW; ds.addTextStyle(TextStyle.DROP_SHADOW);
if (km < 50) { if (km < 50) {
ds.setCoordinates(center[0] - 1, center[1] - 1); ds.setCoordinates(center[0] - 1, center[1] - 1);

View file

@ -86,6 +86,8 @@ import com.vividsolutions.jts.geom.Coordinate;
* Apr 22, 2013 1926 njensen Faster rendering * Apr 22, 2013 1926 njensen Faster rendering
* Mar 3, 2014 2804 mschenke Set back up clipping pane * Mar 3, 2014 2804 mschenke Set back up clipping pane
* May 09, 2014 3145 mpduff Dispose the ScanDrawer font * May 09, 2014 3145 mpduff Dispose the ScanDrawer font
* Aug 14, 2014 3523 mapeters Updated deprecated {@link DrawableString#textStyle}
* assignments.
* </pre> * </pre>
* *
* @author dhladky * @author dhladky
@ -415,54 +417,42 @@ public class ScanResource extends
float mag = getCapability(MagnificationCapability.class) float mag = getCapability(MagnificationCapability.class)
.getMagnification().floatValue(); .getMagnification().floatValue();
DrawableString string = new DrawableString( DrawableString[] strings = new DrawableString[4];
strings[0] = new DrawableString(
getScanDrawer().sdc.getAttrName(), getCapability( getScanDrawer().sdc.getAttrName(), getCapability(
ColorableCapability.class).getColor()); ColorableCapability.class).getColor());
string.basics.x = pixel[0]; strings[0].basics.x = pixel[0];
string.basics.y = pixel[1]; strings[0].basics.y = pixel[1];
string.font = getScanDrawer().font;
string.textStyle = TextStyle.BLANKED;
string.horizontalAlignment = HorizontalAlignment.LEFT;
string.verticallAlignment = VerticalAlignment.MIDDLE;
target.drawStrings(string);
double[] pixel1 = paintProps.getView().getDisplayCoords( double[] pixel1 = paintProps.getView().getDisplayCoords(
new double[] { titleOffset * 2 * mag, titleOffset }, target); new double[] { titleOffset * 2 * mag, titleOffset }, target);
string = new DrawableString(String.valueOf(getScanDrawer().sdc strings[1] = new DrawableString(String.valueOf(getScanDrawer().sdc
.getUpperVal()), ScanDrawer.red); .getUpperVal()), ScanDrawer.red);
string.basics.x = pixel1[0]; strings[1].basics.x = pixel1[0];
string.basics.y = pixel1[1]; strings[1].basics.y = pixel1[1];
string.font = getScanDrawer().font;
string.textStyle = TextStyle.BLANKED;
string.horizontalAlignment = HorizontalAlignment.LEFT;
string.verticallAlignment = VerticalAlignment.MIDDLE;
target.drawStrings(string);
double[] pixel2 = paintProps.getView().getDisplayCoords( double[] pixel2 = paintProps.getView().getDisplayCoords(
new double[] { titleOffset * 3 * mag, titleOffset }, target); new double[] { titleOffset * 3 * mag, titleOffset }, target);
string = new DrawableString(String.valueOf(getScanDrawer().sdc strings[2] = new DrawableString(String.valueOf(getScanDrawer().sdc
.getMidVal()), ScanDrawer.yellow); .getMidVal()), ScanDrawer.yellow);
string.basics.x = pixel2[0]; strings[2].basics.x = pixel2[0];
string.basics.y = pixel2[1]; strings[2].basics.y = pixel2[1];
string.font = getScanDrawer().font;
string.textStyle = TextStyle.BLANKED;
string.horizontalAlignment = HorizontalAlignment.LEFT;
string.verticallAlignment = VerticalAlignment.MIDDLE;
target.drawStrings(string);
double[] pixel3 = paintProps.getView().getDisplayCoords( double[] pixel3 = paintProps.getView().getDisplayCoords(
new double[] { titleOffset * 4 * mag, titleOffset }, target); new double[] { titleOffset * 4 * mag, titleOffset }, target);
string = new DrawableString(String.valueOf(getScanDrawer().sdc strings[3] = new DrawableString(String.valueOf(getScanDrawer().sdc
.getLowerVal()), ScanDrawer.white); .getLowerVal()), ScanDrawer.white);
string.basics.x = pixel3[0]; strings[3].basics.x = pixel3[0];
string.basics.y = pixel3[1]; strings[3].basics.y = pixel3[1];
string.font = getScanDrawer().font;
string.textStyle = TextStyle.BLANKED;
string.horizontalAlignment = HorizontalAlignment.LEFT;
string.verticallAlignment = VerticalAlignment.MIDDLE;
target.drawStrings(string);
for (DrawableString string : strings) {
string.font = getScanDrawer().font;
string.addTextStyle(TextStyle.BLANKED);
string.horizontalAlignment = HorizontalAlignment.LEFT;
string.verticallAlignment = VerticalAlignment.MIDDLE;
}
target.drawStrings(strings);
} }
private void paintElevationAngle(IGraphicsTarget target, private void paintElevationAngle(IGraphicsTarget target,
@ -485,7 +475,7 @@ public class ScanResource extends
string.font = getScanDrawer().font; string.font = getScanDrawer().font;
string.horizontalAlignment = HorizontalAlignment.LEFT; string.horizontalAlignment = HorizontalAlignment.LEFT;
string.verticallAlignment = VerticalAlignment.MIDDLE; string.verticallAlignment = VerticalAlignment.MIDDLE;
string.textStyle = TextStyle.BLANKED; string.addTextStyle(TextStyle.BLANKED);
string.basics.x = pixel[0]; string.basics.x = pixel[0];
string.basics.y = pixel[1]; string.basics.y = pixel[1];
target.drawStrings(string); target.drawStrings(string);

View file

@ -80,6 +80,8 @@ import com.vividsolutions.jts.geom.Coordinate;
* display to match AWIPS I. * display to match AWIPS I.
* 08/13/2012 1046 jkorman Changed to load colorMap file. * 08/13/2012 1046 jkorman Changed to load colorMap file.
* 07/25/2014 3429 mapeters Updated deprecated drawLine() calls. * 07/25/2014 3429 mapeters Updated deprecated drawLine() calls.
* 08/14/2014 3523 mapeters Updated deprecated {@link DrawableString#textStyle}
* assignments.
* </pre> * </pre>
* *
* @author dhladky * @author dhladky
@ -474,7 +476,7 @@ public class ProfilerResource extends
parameters[i] = new DrawableString("", parameters[i] = new DrawableString("",
ProfilerUtils.GRAPH_COLOR); ProfilerUtils.GRAPH_COLOR);
parameters[i].textStyle = TextStyle.BLANKED; parameters[i].addTextStyle(TextStyle.BLANKED);
parameters[i].font = font; parameters[i].font = font;
parameters[i].horizontalAlignment = IGraphicsTarget.HorizontalAlignment.CENTER; parameters[i].horizontalAlignment = IGraphicsTarget.HorizontalAlignment.CENTER;
parameters[i].verticallAlignment = verticalAlignment; parameters[i].verticallAlignment = verticalAlignment;
@ -523,7 +525,7 @@ public class ProfilerResource extends
ArrayList<DrawableString> parameters = new ArrayList<DrawableString>(); ArrayList<DrawableString> parameters = new ArrayList<DrawableString>();
DrawableString string1 = new DrawableString("18km", DrawableString string1 = new DrawableString("18km",
ProfilerUtils.GRAPH_COLOR); ProfilerUtils.GRAPH_COLOR);
string1.textStyle = TextStyle.BLANKED; string1.addTextStyle(TextStyle.BLANKED);
string1.font = font; string1.font = font;
string1.horizontalAlignment = IGraphicsTarget.HorizontalAlignment.RIGHT; string1.horizontalAlignment = IGraphicsTarget.HorizontalAlignment.RIGHT;
string1.verticallAlignment = IGraphicsTarget.VerticalAlignment.MIDDLE; string1.verticallAlignment = IGraphicsTarget.VerticalAlignment.MIDDLE;
@ -565,7 +567,7 @@ public class ProfilerResource extends
DrawableString string = new DrawableString( DrawableString string = new DrawableString(
ProfilerUtils.decimalFormat.format(new Double(i)) + " km", ProfilerUtils.decimalFormat.format(new Double(i)) + " km",
ProfilerUtils.GRAPH_COLOR); ProfilerUtils.GRAPH_COLOR);
string.textStyle = TextStyle.BLANKED; string.addTextStyle(TextStyle.BLANKED);
string.font = font; string.font = font;
string.verticallAlignment = IGraphicsTarget.VerticalAlignment.MIDDLE; string.verticallAlignment = IGraphicsTarget.VerticalAlignment.MIDDLE;
string.basics.y = calcY(i * 1000); string.basics.y = calcY(i * 1000);
@ -623,7 +625,7 @@ public class ProfilerResource extends
ProfilerUtils.decimalFormat.format(new Double( ProfilerUtils.decimalFormat.format(new Double(
ProfilerUtils.PRESSURES[i])) + " mb", ProfilerUtils.PRESSURES[i])) + " mb",
ProfilerUtils.GRAPH_COLOR); ProfilerUtils.GRAPH_COLOR);
string.textStyle = TextStyle.BLANKED; string.addTextStyle(TextStyle.BLANKED);
string.font = font; string.font = font;
string.verticallAlignment = IGraphicsTarget.VerticalAlignment.MIDDLE; string.verticallAlignment = IGraphicsTarget.VerticalAlignment.MIDDLE;
string.basics.y = calcY(height); string.basics.y = calcY(height);

View file

@ -39,7 +39,6 @@ import com.raytheon.uf.viz.core.DrawableString;
import com.raytheon.uf.viz.core.IDisplayPaneContainer; import com.raytheon.uf.viz.core.IDisplayPaneContainer;
import com.raytheon.uf.viz.core.IGraphicsTarget; import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment; import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment;
import com.raytheon.uf.viz.core.IGraphicsTarget.TextStyle;
import com.raytheon.uf.viz.core.drawables.IFont; import com.raytheon.uf.viz.core.drawables.IFont;
import com.raytheon.uf.viz.core.drawables.IFont.Style; import com.raytheon.uf.viz.core.drawables.IFont.Style;
import com.raytheon.uf.viz.core.drawables.PaintProperties; import com.raytheon.uf.viz.core.drawables.PaintProperties;
@ -74,6 +73,8 @@ import com.vividsolutions.jts.geom.Coordinate;
* 23Jul2014 3429 mapeters Updated deprecated drawLine() calls. * 23Jul2014 3429 mapeters Updated deprecated drawLine() calls.
* 28Jul2014 3430 mapeters Updated move function to prevent errors when * 28Jul2014 3430 mapeters Updated move function to prevent errors when
* MB3 clicking off the map in editable mode. * MB3 clicking off the map in editable mode.
* 14Aug2014 3523 mapeters Updated deprecated {@link DrawableString#textStyle}
* assignments.
* </pre> * </pre>
* *
* @author ebabin * @author ebabin
@ -179,7 +180,6 @@ public class HomeToolLayer extends AbstractMovableToolLayer<Coordinate>
dString.basics.x = labelLoc[0]; dString.basics.x = labelLoc[0];
dString.basics.y = labelLoc[1]; dString.basics.y = labelLoc[1];
dString.basics.z = 0.0; dString.basics.z = 0.0;
dString.textStyle = TextStyle.NORMAL;
dString.horizontalAlignment = HorizontalAlignment.LEFT; dString.horizontalAlignment = HorizontalAlignment.LEFT;
dString.font = labelFont; dString.font = labelFont;
target.drawStrings(dString); target.drawStrings(dString);

View file

@ -78,6 +78,8 @@ import com.vividsolutions.jts.geom.LineString;
* to prevent errors when MB3 clicking off * to prevent errors when MB3 clicking off
* the map or MB1 dragging off the map with * the map or MB1 dragging off the map with
* tool in editable mode. * tool in editable mode.
* Aug 14, 2014 3523 mapeters Updated deprecated {@link DrawableString#textStyle}
* assignments.
* *
* </pre> * </pre>
* *
@ -250,7 +252,6 @@ public class ShearLayer extends
ds.basics.x = c2[0]; ds.basics.x = c2[0];
ds.basics.y = c2[1]; ds.basics.y = c2[1];
ds.font = null; ds.font = null;
ds.textStyle = IGraphicsTarget.TextStyle.NORMAL;
ds.horizontalAlignment = HorizontalAlignment.LEFT; ds.horizontalAlignment = HorizontalAlignment.LEFT;
// set the magnification // set the magnification
ds.magnification = this.getCapability(MagnificationCapability.class) ds.magnification = this.getCapability(MagnificationCapability.class)
@ -383,7 +384,6 @@ public class ShearLayer extends
ds.basics.x = x1; ds.basics.x = x1;
ds.basics.y = y1; ds.basics.y = y1;
ds.font = null; ds.font = null;
ds.textStyle = IGraphicsTarget.TextStyle.NORMAL;
ds.horizontalAlignment = HorizontalAlignment.LEFT; ds.horizontalAlignment = HorizontalAlignment.LEFT;
// set the magnification // set the magnification
ds.magnification = this.getCapability(MagnificationCapability.class) ds.magnification = this.getCapability(MagnificationCapability.class)

View file

@ -100,6 +100,8 @@ import com.vividsolutions.jts.geom.GeometryFactory;
* for the text to the left of the point. * for the text to the left of the point.
* 15Mar2013 15693 mgamazaychikov Added magnification capability. * 15Mar2013 15693 mgamazaychikov Added magnification capability.
* Apr 12 2013 DR 16032 D. Friedman Make it work in multiple panes. * Apr 12 2013 DR 16032 D. Friedman Make it work in multiple panes.
* Aug 14 2014 3523 mapeters Updated deprecated {@link DrawableString#textStyle}
* assignments.
* </pre> * </pre>
* *
* @author mschenke * @author mschenke
@ -402,7 +404,6 @@ public class TimeOfArrivalLayer extends AbstractStormTrackResource {
DrawableString ds = new DrawableString(leadState.text, color); DrawableString ds = new DrawableString(leadState.text, color);
ds.basics.x = labelLoc[0]; ds.basics.x = labelLoc[0];
ds.basics.y = labelLoc[1]; ds.basics.y = labelLoc[1];
ds.textStyle = IGraphicsTarget.TextStyle.NORMAL;
ds.horizontalAlignment = alignment; ds.horizontalAlignment = alignment;
ds.font = null; ds.font = null;
ds.magnification = getCapability(MagnificationCapability.class) ds.magnification = getCapability(MagnificationCapability.class)

View file

@ -73,6 +73,8 @@ import com.vividsolutions.jts.geom.Coordinate;
* 11/05/2012 #14566 jzeng Paint the sample points with the order of grids * 11/05/2012 #14566 jzeng Paint the sample points with the order of grids
* in calcGridLabels () * in calcGridLabels ()
* 07/24/2014 #3429 mapeters Updated deprecated drawLine() calls. * 07/24/2014 #3429 mapeters Updated deprecated drawLine() calls.
* 08/14/2014 #3523 mapeters Updated deprecated {@link DrawableString#textStyle}
* assignments.
* </pre> * </pre>
* *
* @author chammack * @author chammack
@ -235,13 +237,13 @@ public class SamplePainter {
labels.toArray(new String[labels.size()]), labels.toArray(new String[labels.size()]),
colors.toArray(new RGB[colors.size()])); colors.toArray(new RGB[colors.size()]));
ds.font = font; ds.font = font;
ds.textStyle = (this.showShadows ? TextStyle.DROP_SHADOW if (this.showShadows) {
: TextStyle.NORMAL); ds.addTextStyle(TextStyle.DROP_SHADOW, this.shadowColor);
}
ds.horizontalAlignment = HorizontalAlignment.CENTER; ds.horizontalAlignment = HorizontalAlignment.CENTER;
ds.verticallAlignment = VerticalAlignment.BOTTOM; ds.verticallAlignment = VerticalAlignment.BOTTOM;
ds.basics.x = screenloc[0] + this.xOffset * ratio; ds.basics.x = screenloc[0] + this.xOffset * ratio;
ds.basics.y = screenloc[1] + (this.yOffset + OFFSET) * ratio; ds.basics.y = screenloc[1] + (this.yOffset + OFFSET) * ratio;
ds.shadowColor = this.shadowColor;
target.drawStrings(ds); target.drawStrings(ds);
} catch (VizException e) { } catch (VizException e) {

View file

@ -61,6 +61,8 @@ import com.raytheon.viz.gfe.rsc.GFEResource;
* by default. * by default.
* 02/11/2014 #2788 randerso Fixed infinite loop in computeIntervalAndPrecision * 02/11/2014 #2788 randerso Fixed infinite loop in computeIntervalAndPrecision
* when pmax < pmin * when pmax < pmin
* 08/14/2014 #3523 mapeters Updated deprecated {@link DrawableString#textStyle}
* assignments.
* *
* </pre> * </pre>
* *
@ -169,7 +171,6 @@ public class ContinuousColorbar implements IColorBarDisplay {
DrawableString dstring = new DrawableString("", seColorBarTextColor); DrawableString dstring = new DrawableString("", seColorBarTextColor);
dstring.font = colorbarResource.getColorbarScaleFont(); dstring.font = colorbarResource.getColorbarScaleFont();
dstring.textStyle = TextStyle.NORMAL;
dstring.horizontalAlignment = HorizontalAlignment.CENTER; dstring.horizontalAlignment = HorizontalAlignment.CENTER;
dstring.verticallAlignment = VerticalAlignment.MIDDLE; dstring.verticallAlignment = VerticalAlignment.MIDDLE;
@ -186,8 +187,6 @@ public class ContinuousColorbar implements IColorBarDisplay {
int precision = (int) val[1]; int precision = (int) val[1];
// float labelLength = val[2] / (float) ratio; // float labelLength = val[2] / (float) ratio;
dstring.font = colorbarResource.getColorbarScaleFont();
dstring.textStyle = TextStyle.NORMAL;
for (int i = 0; (minParm + (i * interval)) <= maxParm; i++) { for (int i = 0; (minParm + (i * interval)) <= maxParm; i++) {
// check to see whether this colorTable item needs to be // check to see whether this colorTable item needs to be
// rendered // rendered
@ -257,11 +256,8 @@ public class ContinuousColorbar implements IColorBarDisplay {
} else { } else {
dstring.setText(s, seColorBarFgPickupColor); dstring.setText(s, seColorBarFgPickupColor);
} }
dstring.textStyle = TextStyle.DROP_SHADOW; dstring.addTextStyle(TextStyle.DROP_SHADOW,
dstring.shadowColor = seColorBarBgPickupColor; seColorBarBgPickupColor);
if (dstring.shadowColor == null) {
dstring.shadowColor = new RGB(0, 0, 0);
}
double halfWidth = (target.getStringsBounds(dstring).getWidth() * ratio) / 2; double halfWidth = (target.getStringsBounds(dstring).getWidth() * ratio) / 2;

View file

@ -99,6 +99,8 @@ import com.vividsolutions.jts.geom.Coordinate;
* Feb 12, 2013 15719 jdynina Fixed out of bounds error in calcGridColorTable * Feb 12, 2013 15719 jdynina Fixed out of bounds error in calcGridColorTable
* Oct 31, 2013 #2508 randerso Change to use DiscreteGridSlice.getKeys() * Oct 31, 2013 #2508 randerso Change to use DiscreteGridSlice.getKeys()
* Jul 23, 2014 #3429 mapeters Updated deprecated drawLine() calls * Jul 23, 2014 #3429 mapeters Updated deprecated drawLine() calls
* Aug 14, 2014 #3523 mapeters Updated deprecated {@link DrawableString#textStyle}
* assignments.
* *
* </pre> * </pre>
* *
@ -511,27 +513,20 @@ public class DiscreteColorbar implements IColorBarDisplay,
} }
dstring.setCoordinates(pickupLabelDrawPoint / xScaleFactor, center); dstring.setCoordinates(pickupLabelDrawPoint / xScaleFactor, center);
dstring.textStyle = TextStyle.BOXED;
dstring.horizontalAlignment = pickupValueAlignment; dstring.horizontalAlignment = pickupValueAlignment;
dstring.verticallAlignment = VerticalAlignment.MIDDLE; dstring.verticallAlignment = VerticalAlignment.MIDDLE;
dstring.addTextStyle(TextStyle.BLANKED);
// draw once for the box dstring.addTextStyle(TextStyle.BOXED);
target.drawStrings(dstring); dstring.addTextStyle(TextStyle.DROP_SHADOW,
// and again for shadowed text in the box seColorBarBgWxPickupColor);
dstring.shadowColor = seColorBarBgWxPickupColor;
dstring.textStyle = TextStyle.DROP_SHADOW;
target.drawStrings(dstring); target.drawStrings(dstring);
} else { } else {
pickupLabelMinX = Double.NEGATIVE_INFINITY; pickupLabelMinX = Double.NEGATIVE_INFINITY;
pickupLabelMaxX = Double.NEGATIVE_INFINITY; pickupLabelMaxX = Double.NEGATIVE_INFINITY;
} }
DrawableString dstring = new DrawableString("", seColorBarTextColor);
dstring.textStyle = TextStyle.NORMAL;
dstring.horizontalAlignment = HorizontalAlignment.CENTER;
dstring.verticallAlignment = VerticalAlignment.MIDDLE;
DrawableLine[] lines = new DrawableLine[colorTable.size()]; DrawableLine[] lines = new DrawableLine[colorTable.size()];
List<DrawableString> strings = new ArrayList<DrawableString>();
i = 0; i = 0;
for (ColorEntry colorEntry : colorTable) { for (ColorEntry colorEntry : colorTable) {
double ikeywidth = i * keywidth; double ikeywidth = i * keywidth;
@ -553,15 +548,19 @@ public class DiscreteColorbar implements IColorBarDisplay,
target, colorbarResource.getColorbarWxLabelFont(), target, colorbarResource.getColorbarWxLabelFont(),
keyName, (int) Math.floor(keywidth * xScaleFactor), keyName, (int) Math.floor(keywidth * xScaleFactor),
true); true);
dstring.setText(truncatedLabel, seColorBarTextColor); DrawableString dstring = new DrawableString(truncatedLabel,
seColorBarTextColor);
dstring.setCoordinates(labelLoc, center); dstring.setCoordinates(labelLoc, center);
dstring.font = colorbarResource.getColorbarWxLabelFont(); dstring.font = colorbarResource.getColorbarWxLabelFont();
target.drawStrings(dstring); dstring.horizontalAlignment = HorizontalAlignment.CENTER;
dstring.verticallAlignment = VerticalAlignment.MIDDLE;
strings.add(dstring);
} }
} }
i++; i++;
} }
target.drawLine(lines); target.drawLine(lines);
target.drawStrings(strings);
} }
/** /**

View file

@ -97,6 +97,8 @@ import com.vividsolutions.jts.io.WKBReader;
* wldougher Initial creation * wldougher Initial creation
* Jul 11, 2011 9928 rferrel moveGroup now takes list of groups. * Jul 11, 2011 9928 rferrel moveGroup now takes list of groups.
* Jun 24, 2013 2134 randerso Fixed NullPointerException in fitToCWA. * Jun 24, 2013 2134 randerso Fixed NullPointerException in fitToCWA.
* Aug 14, 2014 3523 mapeters Updated deprecated {@link DrawableString#textStyle}
* assignments.
* *
* </pre> * </pre>
* *
@ -2044,10 +2046,9 @@ public class ZoneDbResource extends
if (tables.contains(data.tableName)) { if (tables.contains(data.tableName)) {
refCoordList = labelMap.get(data.zone); refCoordList = labelMap.get(data.zone);
if (refCoordList != null) { if (refCoordList != null) {
paintLabelSet(" " + data.zone, labelFont, paintLabelSet(" " + data.zone, labelFont, null, color,
IGraphicsTarget.TextStyle.NORMAL, color, horiz, horiz, vert, refCoordList, mapGeometry, ""
vert, refCoordList, mapGeometry, "" + data.zone, + data.zone, alreadyDrawn);
alreadyDrawn);
} }
} }
} }
@ -2135,7 +2136,7 @@ public class ZoneDbResource extends
Coordinate coord; Coordinate coord;
DrawableString ds = new DrawableString("", color); DrawableString ds = new DrawableString("", color);
ds.font = font; ds.font = font;
ds.textStyle = TextStyle.DROP_SHADOW; ds.addTextStyle(TextStyle.DROP_SHADOW);
ds.horizontalAlignment = horiz; ds.horizontalAlignment = horiz;
ds.verticallAlignment = vert; ds.verticallAlignment = vert;
refcLoop: for (ReferencedCoordinate refCoord : refCoordList) { refcLoop: for (ReferencedCoordinate refCoord : refCoordList) {

View file

@ -105,6 +105,8 @@ import com.vividsolutions.jts.io.WKBReader;
* Jan 07, 2014 #2662 randerso Fixed limitZones (subDomainUGCs) support * Jan 07, 2014 #2662 randerso Fixed limitZones (subDomainUGCs) support
* Feb 18, 2014 #2819 randerso Removed unnecessary clones of geometries * Feb 18, 2014 #2819 randerso Removed unnecessary clones of geometries
* Aug 13, 2014 #3492 mapeters Updated deprecated createWireframeShape() calls. * Aug 13, 2014 #3492 mapeters Updated deprecated createWireframeShape() calls.
* Aug 14, 2014 #3523 mapeters Updated deprecated {@link DrawableString#textStyle}
* assignments.
* *
* </pre> * </pre>
* *
@ -824,8 +826,7 @@ public class ZoneSelectorResource extends DbMapResource {
ds.font = font; ds.font = font;
ds.horizontalAlignment = HorizontalAlignment.CENTER; ds.horizontalAlignment = HorizontalAlignment.CENTER;
ds.verticallAlignment = VerticalAlignment.MIDDLE; ds.verticallAlignment = VerticalAlignment.MIDDLE;
ds.textStyle = TextStyle.DROP_SHADOW; ds.addTextStyle(TextStyle.DROP_SHADOW);
ds.shadowColor = RGBColors.getRGBColor("black");
strings.add(ds); strings.add(ds);
alreadyDrawn.add(new LabelTuple(x, y, group, zone)); alreadyDrawn.add(new LabelTuple(x, y, group, zone));

View file

@ -55,6 +55,8 @@ import com.raytheon.viz.radar.rsc.mosaic.RadarMosaicResource;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Jul 29, 2010 mschenke Initial creation * Jul 29, 2010 mschenke Initial creation
* Aug 14, 2014 3523 mapeters Updated deprecated {@link DrawableString#textStyle}
* assignments.
* *
* </pre> * </pre>
* *
@ -244,7 +246,7 @@ public class RadarTextResource extends
DrawableString dString = new DrawableString(pair.text, colors); DrawableString dString = new DrawableString(pair.text, colors);
dString.font = textFont; dString.font = textFont;
dString.setCoordinates(xOffset, yOffset, 0); dString.setCoordinates(xOffset, yOffset, 0);
dString.textStyle = TextStyle.BLANKED; dString.addTextStyle(TextStyle.BLANKED);
dString.horizontalAlignment = hAlign; dString.horizontalAlignment = hAlign;
dString.verticallAlignment = VerticalAlignment.TOP; dString.verticallAlignment = VerticalAlignment.TOP;
dString.basics.alpha = pair.alpha; dString.basics.alpha = pair.alpha;

View file

@ -55,7 +55,6 @@ import com.raytheon.uf.viz.core.IExtent;
import com.raytheon.uf.viz.core.IGraphicsTarget; import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment; import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment;
import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle; import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle;
import com.raytheon.uf.viz.core.IGraphicsTarget.TextStyle;
import com.raytheon.uf.viz.core.IGraphicsTarget.VerticalAlignment; import com.raytheon.uf.viz.core.IGraphicsTarget.VerticalAlignment;
import com.raytheon.uf.viz.core.drawables.IFont; import com.raytheon.uf.viz.core.drawables.IFont;
import com.raytheon.uf.viz.core.drawables.IWireframeShape; import com.raytheon.uf.viz.core.drawables.IWireframeShape;
@ -83,6 +82,8 @@ import com.vividsolutions.jts.geom.Coordinate;
* Jul 13, 2103 2223 njensen Overrode remove() to fix memory leak * Jul 13, 2103 2223 njensen Overrode remove() to fix memory leak
* Jul 28, 2013 2227 mnash Fixing the projection issues, moving things * Jul 28, 2013 2227 mnash Fixing the projection issues, moving things
* around for better logical separation * around for better logical separation
* Aug 14, 2014 3523 mapeters Updated deprecated {@link DrawableString#textStyle}
* assignments.
* </pre> * </pre>
* *
* @author mnash * @author mnash
@ -220,7 +221,6 @@ public class RadarMLResource extends RadarGraphicsResource {
info.verticallAlignment = VerticalAlignment.TOP; info.verticallAlignment = VerticalAlignment.TOP;
info.setCoordinates(extent.getMinX() + X_OFFSET * ratio, info.setCoordinates(extent.getMinX() + X_OFFSET * ratio,
extent.getMinY() + Y_OFFSET * ratio); extent.getMinY() + Y_OFFSET * ratio);
info.textStyle = TextStyle.NORMAL;
target.drawStrings(info); target.drawStrings(info);
target.setupClippingPlane(extent); target.setupClippingPlane(extent);
} }

View file

@ -14,7 +14,6 @@ import java.util.concurrent.ConcurrentHashMap;
import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.graphics.RGB;
import org.opengis.referencing.crs.CoordinateReferenceSystem; import org.opengis.referencing.crs.CoordinateReferenceSystem;
import com.raytheon.uf.common.inventory.exception.DataCubeException;
import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord; import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord;
import com.raytheon.uf.common.dataplugin.warning.EmergencyType; import com.raytheon.uf.common.dataplugin.warning.EmergencyType;
@ -23,6 +22,7 @@ import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint; import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType; import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
import com.raytheon.uf.common.geospatial.ReferencedCoordinate; import com.raytheon.uf.common.geospatial.ReferencedCoordinate;
import com.raytheon.uf.common.inventory.exception.DataCubeException;
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.time.DataTime; import com.raytheon.uf.common.time.DataTime;
@ -33,7 +33,6 @@ import com.raytheon.uf.viz.core.DrawableString;
import com.raytheon.uf.viz.core.IGraphicsTarget; import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment; import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment;
import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle; import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle;
import com.raytheon.uf.viz.core.IGraphicsTarget.TextStyle;
import com.raytheon.uf.viz.core.IGraphicsTarget.VerticalAlignment; import com.raytheon.uf.viz.core.IGraphicsTarget.VerticalAlignment;
import com.raytheon.uf.viz.core.VizApp; import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.uf.viz.core.drawables.IDescriptor.FramesInfo; import com.raytheon.uf.viz.core.drawables.IDescriptor.FramesInfo;
@ -86,6 +85,8 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory;
* Nov 11, 2013 2439 rferrel Changes to prevent getting future warning when in DRT mode. * Nov 11, 2013 2439 rferrel Changes to prevent getting future warning when in DRT mode.
* Dec 3, 2013 2576 jsanchez Increased the font size of EMER. * Dec 3, 2013 2576 jsanchez Increased the font size of EMER.
* Mar 10, 2014 2832 njensen Moved duplicated subclass's disposeInternal() logic here * Mar 10, 2014 2832 njensen Moved duplicated subclass's disposeInternal() logic here
* Aug 14, 2014 3523 mapeters Updated deprecated {@link DrawableString#textStyle}
* assignments.
* *
* </pre> * </pre>
* *
@ -425,7 +426,6 @@ public abstract class AbstractWWAResource extends
textToPrintReversed, color); textToPrintReversed, color);
params.font = warningsFont; params.font = warningsFont;
params.setCoordinates(d[0], d[1]); params.setCoordinates(d[0], d[1]);
params.textStyle = TextStyle.NORMAL;
params.horizontalAlignment = HorizontalAlignment.RIGHT; params.horizontalAlignment = HorizontalAlignment.RIGHT;
params.verticallAlignment = VerticalAlignment.BOTTOM; params.verticallAlignment = VerticalAlignment.BOTTOM;
params.magnification = getCapability( params.magnification = getCapability(