14.1.1-12 baseline

Former-commit-id: a3ec45a99f [formerly 371d1ca63c [formerly b24d9c80b0] [formerly a3ec45a99f [formerly 3b3b8ffbdadc65f41b67f2d649ec18e19521c989]]]
Former-commit-id: 371d1ca63c [formerly b24d9c80b0]
Former-commit-id: 371d1ca63c
Former-commit-id: f53eb87892
This commit is contained in:
Steve Harris 2013-12-04 16:47:59 -05:00
parent 40022915dd
commit 55fbdca04f
24 changed files with 293 additions and 194 deletions

View file

@ -24,11 +24,12 @@
#------*-python-*------------------------------------------------------------- #------*-python-*-------------------------------------------------------------
# Config file for the GFE (Graphical Forecast Editor). # Config file for the GFE (Graphical Forecast Editor).
# #
# $Id$ # SOFTWARE HISTORY
#----------------------------------------------------------------------------- #
# Heading # Date Ticket# Engineer Description
#----------------------------------------------------------------------------- # ------------ ---------- ----------- --------------------------
# 11/20/2013 2488 randerso Changed to use DejaVu fonts
GFESUITE_HOME = "/awips2/GFESuite" GFESUITE_HOME = "/awips2/GFESuite"
GFESUITE_PRDDIR = "/tmp/products" GFESUITE_PRDDIR = "/tmp/products"
@ -262,11 +263,11 @@ MapBackgrounds_default = ['States','CWA']
# style is a font style (one of "regular", "bold", "italic", or "bold italic") # style is a font style (one of "regular", "bold", "italic", or "bold italic")
# height is an integer representing the font height. # height is an integer representing the font height.
# Example: Times New Roman-bold-36. # Example: Times New Roman-bold-36.
TextFont0 = "Bitstream Vera Sans Mono-regular-9" TextFont0 = "DejaVu Sans Mono-regular-9"
TextFont1 = "Bitstream Vera Sans Mono-regular-9" TextFont1 = "DejaVu Sans Mono-regular-9"
TextFont2 = "Bitstream Vera Sans Mono-bold-12" TextFont2 = "DejaVu Sans Mono-bold-12"
TextFont3 = "Bitstream Vera Sans Mono-bold-14" TextFont3 = "DejaVu Sans Mono-bold-14"
TextFont4 = "Bitstream Vera Sans Mono-bold-20" TextFont4 = "DejaVu Sans Mono-bold-20"
# The color which will be used as the background for all of the display # The color which will be used as the background for all of the display
# panes. # panes.

View file

@ -25,6 +25,9 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job; import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.swt.widgets.Display;
import com.raytheon.uf.viz.core.VizApp;
/** /**
* Repeats playing the System beep. Same code as * Repeats playing the System beep. Same code as
@ -36,9 +39,9 @@ import org.eclipse.core.runtime.jobs.Job;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Mar 03, 2011 #8059 rferrel Initial creation * Mar 03, 2011 #8059 rferrel Initial creation
* Nov 26, 2013 DR16772 gzhang use Display.beep()
* *
* </pre> * </pre>
*
* @author rferrel * @author rferrel
* @version 1.0 * @version 1.0
*/ */
@ -70,8 +73,8 @@ public class AlarmBeepJob extends Job {
@Override @Override
protected IStatus run(IProgressMonitor monitor) { protected IStatus run(IProgressMonitor monitor) {
IStatus status = Status.OK_STATUS; IStatus status = Status.OK_STATUS;
if (count > 0) { if (count > 0) {
Toolkit.getDefaultToolkit().beep(); VizApp.runAsync(new Runnable(){@Override public void run(){Display.getDefault().beep();}}); // DR 16772 //Toolkit.getDefaultToolkit().beep();
reSchedule(); reSchedule();
count--; count--;
} else { } else {

View file

@ -250,7 +250,8 @@ public abstract class FFMPTable extends Composite {
event.gc.setForeground(lineColor); event.gc.setForeground(lineColor);
event.gc.setLineWidth(1); event.gc.setLineWidth(1);
int currentCol = event.index; int currentCol = event.index;
TableItem ti = (TableItem) event.item;
Rectangle rect = ((TableItem) event.item).getBounds(currentCol); Rectangle rect = ((TableItem) event.item).getBounds(currentCol);
event.gc.drawRectangle(rect.x - 1, rect.y - 1, rect.width, event.gc.drawRectangle(rect.x - 1, rect.y - 1, rect.width,
rect.height); rect.height);
@ -265,6 +266,13 @@ public abstract class FFMPTable extends Composite {
// Draw a top line // Draw a top line
event.gc.drawLine(rect.x, rect.y, rect.x + rect.width, rect.y); event.gc.drawLine(rect.x, rect.y, rect.x + rect.width, rect.y);
// Draw a bottom line if this is the last row of the table
int index = table.indexOf(ti);
if (index == table.getItemCount() - 1) {
event.gc.drawLine(rect.x, rect.y + rect.height - 2, rect.x
+ rect.width, rect.y + rect.height - 2);
}
if ((tableIndex >= 0) && (tableIndex < table.getItemCount())) { if ((tableIndex >= 0) && (tableIndex < table.getItemCount())) {
event.gc.setForeground(parent.getDisplay().getSystemColor( event.gc.setForeground(parent.getDisplay().getSystemColor(
SWT.COLOR_BLUE)); SWT.COLOR_BLUE));

View file

@ -41,6 +41,22 @@ import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Canvas; import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
/**
* Time Duration Scale Composite
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 20, 2013 #2488 randerso Changed to use DejaVu font
*
* </pre>
*
* @author randerso
* @version 1.0
*/
public class TimeDurScaleComp extends Composite { public class TimeDurScaleComp extends Composite {
/** /**
* Parent composite. * Parent composite.
@ -252,13 +268,10 @@ public class TimeDurScaleComp extends Composite {
*/ */
private void init() { private void init() {
// Create the font // Create the font
// canvasFont = new Font(parentComp.getDisplay(), "Courier", 10,
// SWT.NORMAL);
// canvasFont = new Font(parentComp.getDisplay(), "Monospace", 10,
// SWT.NORMAL);
FontData fd = parentComp.getDisplay().getSystemFont().getFontData()[0]; FontData fd = parentComp.getDisplay().getSystemFont().getFontData()[0];
fd.setName("Bitstream Vera Sans Mono"); // TODO not have hard coded font name
fd.setName("DejaVu Sans Mono");
canvasFont = new Font(parentComp.getDisplay(), fd); canvasFont = new Font(parentComp.getDisplay(), fd);
// Create the time bar colors // Create the time bar colors
@ -307,6 +320,7 @@ public class TimeDurScaleComp extends Composite {
this.pack(); this.pack();
this.addDisposeListener(new DisposeListener() { this.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent arg0) { public void widgetDisposed(DisposeEvent arg0) {
greyColor.dispose(); greyColor.dispose();
yellowColor.dispose(); yellowColor.dispose();
@ -328,6 +342,7 @@ public class TimeDurScaleComp extends Composite {
timeSliderCanvas.setLayoutData(new GridData(CANVAS_WIDTH + 10, timeSliderCanvas.setLayoutData(new GridData(CANVAS_WIDTH + 10,
CANVAS_HEIGHT)); CANVAS_HEIGHT));
timeSliderCanvas.addPaintListener(new PaintListener() { timeSliderCanvas.addPaintListener(new PaintListener() {
@Override
public void paintControl(PaintEvent e) { public void paintControl(PaintEvent e) {
drawTimeSliderCanvas(e.gc); drawTimeSliderCanvas(e.gc);
} }

View file

@ -82,8 +82,8 @@ import com.raytheon.uf.viz.monitor.scan.tables.SCANAlarmAlertManager.AlertedAlar
* issue on the images being blank and throwing errors. * issue on the images being blank and throwing errors.
* Also cleaned up some code. * Also cleaned up some code.
* *
* Nov 26, 2013 DR16782 gzhang use Display.beep()
* </pre> * </pre>
*
* @author lvenable * @author lvenable
* @version 1.0 * @version 1.0
*/ */
@ -934,7 +934,7 @@ public abstract class SCANTable extends Composite {
beepTimer.purge(); beepTimer.purge();
} }
if (mgr.isRing()) { if (mgr.isRing()) {
Toolkit.getDefaultToolkit().beep(); Display.getDefault().beep();//Toolkit.getDefaultToolkit().beep();
} else { } else {
beepTimer.cancel(); beepTimer.cancel();
beepTimer.purge(); beepTimer.purge();

View file

@ -270,6 +270,14 @@ public abstract class TableComp extends Composite {
// Draw a top line // Draw a top line
event.gc.drawLine(rect.x, rect.y, rect.x + rect.width, rect.y); event.gc.drawLine(rect.x, rect.y, rect.x + rect.width, rect.y);
// Draw a bottom line if this is the last row of the table
TableItem ti = (TableItem) event.item;
int idx = table.indexOf(ti);
if (idx == table.getItemCount() - 1) {
event.gc.drawLine(rect.x, rect.y + rect.height - 2, rect.x
+ rect.width, rect.y + rect.height - 2);
}
if (tableIndex >= 0) { if (tableIndex >= 0) {
event.gc.setForeground(parent.getDisplay().getSystemColor( event.gc.setForeground(parent.getDisplay().getSystemColor(

View file

@ -37,7 +37,9 @@ import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData; import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.ImageLoader; import org.eclipse.swt.graphics.ImageLoader;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.printing.PrintDialog; import org.eclipse.swt.printing.PrintDialog;
@ -85,6 +87,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* 04OCT2012 1229 rferrel Changes for non-blocking WindRoseConfigDlg. * 04OCT2012 1229 rferrel Changes for non-blocking WindRoseConfigDlg.
* 08OCT2012 1229 rferrel Made non-blocking. * 08OCT2012 1229 rferrel Made non-blocking.
* 10/15/2012 1229 rferrel Changes for non-blocking HelpUsageDlg. * 10/15/2012 1229 rferrel Changes for non-blocking HelpUsageDlg.
* 03Dec2013 16754 zhao Modified printImage()
* *
* </pre> * </pre>
* *
@ -734,20 +737,36 @@ public class WindRosePlotDlg extends CaveSWTDialog {
} }
private void printImage() { private void printImage() {
Image image = windRoseCanvasComp.getWindRoseImage();
ImageData imageData = image.getImageData();
PrintDialog dialog = new PrintDialog(shell, SWT.NULL); PrintDialog dialog = new PrintDialog(shell, SWT.NULL);
PrinterData printerData = dialog.open(); PrinterData printerData = dialog.open();
if (printerData != null) { if (printerData != null) {
// Create the printer object
Printer printer = new Printer(printerData); Printer printer = new Printer(printerData);
Point screenDPI = shell.getDisplay().getDPI();
Point printerDPI = printer.getDPI();
Rectangle bounds = printer.getBounds();
int destX = (screenDPI.x*bounds.width - printerDPI.x*imageData.width)/screenDPI.x/2;
if (destX < 0) {
destX = 0;
}
int destY = (screenDPI.x*bounds.height - printerDPI.x*imageData.height)/screenDPI.x*80/100/2;
if (destY < 0) {
destY = 0;
}
printer.startJob("jj"); printer.startJob("jj");
GC gc = new GC(printer); GC gc = new GC(printer);
Image printerImage = new Image(printer, imageData);
if (printer.startPage()) { if (printer.startPage()) {
windRoseCanvasComp.drawCanvas(gc); gc.drawImage(printerImage, 0, 0, imageData.width, imageData.height, destX, destY,
printerDPI.x*imageData.width/screenDPI.x,
printerDPI.x*imageData.height/screenDPI.x);
printer.endPage(); printer.endPage();
} }
printerImage.dispose();
gc.dispose(); gc.dispose();
printer.endJob(); printer.endJob();
printer.dispose(); printer.dispose();

View file

@ -63,10 +63,11 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Oct 26, 2011 randerso Initial creation * Oct 26, 2011 randerso Initial creation
* Oct 30, 2012 1298 rferrel Code clean for non-blocking dialog. * Oct 30, 2012 1298 rferrel Code clean for non-blocking dialog.
* 02/13/2013 #1597 randerso Made number of concurrent save threads a configurable value. * Feb 13, 2013 1597 randerso Made number of concurrent save threads a configurable value.
* Added logging to support GFE Performance metrics * Added logging to support GFE Performance metrics
* Nov 20, 2013 2488 randerso Changed to use DejaVu font
* *
* </pre> * </pre>
* *
@ -127,7 +128,8 @@ public abstract class AbstractSaveParameterDialog extends CaveJFACEDialog
master.addDisposeListener(this); master.addDisposeListener(this);
FontData fd = master.getDisplay().getSystemFont().getFontData()[0]; FontData fd = master.getDisplay().getSystemFont().getFontData()[0];
fd.setName("Bitstream Vera Sans Mono"); // TODO not have hard coded font name
fd.setName("DejaVu Sans Mono");
font = new Font(master.getDisplay(), fd); font = new Font(master.getDisplay(), fd);
initializeComponents(); initializeComponents();

View file

@ -57,8 +57,9 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Jan 21, 2011 randerso Initial creation * Jan 21, 2011 randerso Initial creation
* Oct 25, 2012 1287 rferrel Code clean up for non-blocking dialog. * Oct 25, 2012 1287 rferrel Code clean up for non-blocking dialog.
* Nov 20, 2013 2488 randerso Changed to use DejaVu font
* *
* </pre> * </pre>
* *
@ -107,7 +108,8 @@ public class WERevertDialog extends CaveJFACEDialog implements DisposeListener {
master.addDisposeListener(this); master.addDisposeListener(this);
FontData fd = master.getDisplay().getSystemFont().getFontData()[0]; FontData fd = master.getDisplay().getSystemFont().getFontData()[0];
fd.setName("Bitstream Vera Sans Mono"); // TODO not have hard coded font name
fd.setName("DejaVu Sans Mono");
font = new Font(master.getDisplay(), fd); font = new Font(master.getDisplay(), fd);
String t; String t;

View file

@ -65,11 +65,12 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.core.RGBColors; import com.raytheon.uf.viz.core.RGBColors;
import com.raytheon.viz.gfe.Activator; import com.raytheon.viz.gfe.Activator;
import com.raytheon.viz.gfe.dialogs.formatterlauncher.ProductEditorComp.PTypeCategory; import com.raytheon.viz.gfe.dialogs.formatterlauncher.ProductEditorComp.PTypeCategory;
import com.raytheon.viz.gfe.rsc.GFEFonts;
import com.raytheon.viz.gfe.textformatter.TextFmtParserUtil; import com.raytheon.viz.gfe.textformatter.TextFmtParserUtil;
/** /**
* Composite containing the product editor. * Composite containing the product editor.
* *
* <pre> * <pre>
* SOFTWARE HISTORY * SOFTWARE HISTORY
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
@ -81,12 +82,12 @@ import com.raytheon.viz.gfe.textformatter.TextFmtParserUtil;
* 03 Dec 2012 15620 ryu Unlock framed cities list for editing. * 03 Dec 2012 15620 ryu Unlock framed cities list for editing.
* 30 APR 2013 16095 ryu Modified updateTextStyle() to not lock edited text. * 30 APR 2013 16095 ryu Modified updateTextStyle() to not lock edited text.
* 04 SEP 2013 16534 ryu Fixed word wrap to not insert duplicate text; refactor. * 04 SEP 2013 16534 ryu Fixed word wrap to not insert duplicate text; refactor.
* *
* </pre> * </pre>
* *
* @author lvenable * @author lvenable
* @version 1.0 * @version 1.0
* *
*/ */
public class StyledTextComp extends Composite { public class StyledTextComp extends Composite {
private static final transient IUFStatusHandler statusHandler = UFStatus private static final transient IUFStatusHandler statusHandler = UFStatus
@ -189,7 +190,7 @@ public class StyledTextComp extends Composite {
/** /**
* Constructor. * Constructor.
* *
* @param parent * @param parent
* Parent composite. * Parent composite.
*/ */
@ -207,10 +208,12 @@ public class StyledTextComp extends Composite {
private void init() { private void init() {
String fontSetting = Activator.getDefault().getPreferenceStore() String fontSetting = Activator.getDefault().getPreferenceStore()
.getString("ProductOutputDialog_font"); .getString("ProductOutputDialog_font");
FontData fontData;
if (fontSetting.isEmpty()) { if (fontSetting.isEmpty()) {
fontSetting = "Bitstream Vera Sans Mono-bold-12"; fontData = GFEFonts.getFontData(2);
} else {
fontData = StringConverter.asFontData(fontSetting);
} }
FontData fontData = StringConverter.asFontData(fontSetting);
textFont = new Font(parent.getDisplay(), fontData); textFont = new Font(parent.getDisplay(), fontData);
createMouseListner(); createMouseListner();
@ -227,6 +230,7 @@ public class StyledTextComp extends Composite {
createTextControl(); createTextControl();
this.addDisposeListener(new DisposeListener() { this.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent arg0) { public void widgetDisposed(DisposeEvent arg0) {
textFont.dispose(); textFont.dispose();
bgColor.dispose(); bgColor.dispose();
@ -307,7 +311,7 @@ public class StyledTextComp extends Composite {
/** /**
* Get the StyledText editor. * Get the StyledText editor.
* *
* @return The StyledText editor. * @return The StyledText editor.
*/ */
public StyledText getTextEditorST() { public StyledText getTextEditorST() {
@ -316,7 +320,7 @@ public class StyledTextComp extends Composite {
/** /**
* Set the product text. * Set the product text.
* *
* @param text * @param text
* The product text. * The product text.
*/ */
@ -398,8 +402,7 @@ public class StyledTextComp extends Composite {
// should be unlocked. Cities list is unlocked for editing // should be unlocked. Cities list is unlocked for editing
// when framing codes are present. // when framing codes are present.
if (newProduct) { if (newProduct) {
if (cityTip != null && if (cityTip != null && cityTip.getText().indexOf("|*") > 0) {
cityTip.getText().indexOf("|*") > 0) {
unlockCitySegs.add(ugc); unlockCitySegs.add(ugc);
} }
} }
@ -411,8 +414,7 @@ public class StyledTextComp extends Composite {
lockLines(productTextArray, startLine, cityStart); lockLines(productTextArray, startLine, cityStart);
lockLines(productTextArray, cityEnd, endLine); lockLines(productTextArray, cityEnd, endLine);
} } else {
else {
lockLines(productTextArray, startLine, endLine); lockLines(productTextArray, startLine, endLine);
} }
} }
@ -484,7 +486,7 @@ public class StyledTextComp extends Composite {
/** /**
* Parse the product text string. * Parse the product text string.
* *
* @param productText * @param productText
*/ */
private void parseProductText(String productText) { private void parseProductText(String productText) {
@ -564,7 +566,7 @@ public class StyledTextComp extends Composite {
replaceText(ff, SPC + newfield); replaceText(ff, SPC + newfield);
} }
} else { } else {
String s = SPC + newfield; String s = SPC + newfield;
if (!ff.getText().equals(s)) { if (!ff.getText().equals(s)) {
replaceText(ff, s); replaceText(ff, s);
} }
@ -670,7 +672,7 @@ public class StyledTextComp extends Composite {
/** /**
* Handle the verify key event. This event fires after a change has been * Handle the verify key event. This event fires after a change has been
* made to the control (after the text has been updated, for example) * made to the control (after the text has been updated, for example)
* *
* @param event * @param event
* Verify event that was fired. * Verify event that was fired.
*/ */
@ -731,8 +733,7 @@ public class StyledTextComp extends Composite {
// .getStyleRangeAtOffset(event.start + event.length + 1); // .getStyleRangeAtOffset(event.start + event.length + 1);
// if it's in a framing code, turn it red // if it's in a framing code, turn it red
if (startRange != null if (startRange != null && endRange != null
&& endRange != null
&& event.start > startRange.start && event.start > startRange.start
&& event.start + event.length < endRange.start && event.start + event.length < endRange.start
&& startRange.similarTo(endRange) && startRange.similarTo(endRange)
@ -763,7 +764,7 @@ public class StyledTextComp extends Composite {
/** /**
* Handle the key event when a key is released. * Handle the key event when a key is released.
* *
* @param ke * @param ke
* Key event. * Key event.
*/ */
@ -785,7 +786,7 @@ public class StyledTextComp extends Composite {
/** /**
* Check if there is selected text and if there is locked text in the * Check if there is selected text and if there is locked text in the
* selected text. * selected text.
* *
* @return True if there is selected text that contains locked text. * @return True if there is selected text that contains locked text.
*/ */
private boolean selectionHasLockedText() { private boolean selectionHasLockedText() {
@ -799,12 +800,12 @@ public class StyledTextComp extends Composite {
/** /**
* Check if there is locked text in the specified range of text. * Check if there is locked text in the specified range of text.
* *
* @param offset * @param offset
* The starting point of the locked text search. * The starting point of the locked text search.
* @param length * @param length
* The length of the search. * The length of the search.
* *
* @return Whether or not there is text in the range that contains locked * @return Whether or not there is text in the range that contains locked
* text. * text.
*/ */
@ -822,7 +823,7 @@ public class StyledTextComp extends Composite {
/** /**
* Select the framing code and the text contained in the framing code. * Select the framing code and the text contained in the framing code.
* *
* @param sr * @param sr
* StyleRange. * StyleRange.
*/ */
@ -834,7 +835,7 @@ public class StyledTextComp extends Composite {
/** /**
* Check if the key being pressed is a "non-edit" key. * Check if the key being pressed is a "non-edit" key.
* *
* @param event * @param event
* Verify event. * Verify event.
* @return True if the key is an arrow or "non-edit" key. * @return True if the key is an arrow or "non-edit" key.
@ -856,6 +857,7 @@ public class StyledTextComp extends Composite {
private void createMouseListner() { private void createMouseListner() {
mouseListener = new Listener() { mouseListener = new Listener() {
@Override
public void handleEvent(Event e) { public void handleEvent(Event e) {
if (e.type == SWT.MouseDown) { if (e.type == SWT.MouseDown) {
handleMouseDown(e); handleMouseDown(e);
@ -868,7 +870,7 @@ public class StyledTextComp extends Composite {
/** /**
* Handle the mouse down event. * Handle the mouse down event.
* *
* @param e * @param e
* Event fired. * Event fired.
*/ */
@ -903,7 +905,7 @@ public class StyledTextComp extends Composite {
/** /**
* Handle the mouse up event * Handle the mouse up event
* *
* @param e * @param e
* Event fired. * Event fired.
*/ */
@ -1010,7 +1012,7 @@ public class StyledTextComp extends Composite {
/** /**
* Checks if the system is editing, e.g. updating the issue time every * Checks if the system is editing, e.g. updating the issue time every
* minute, vs a user typing text in the text area * minute, vs a user typing text in the text area
* *
* @return * @return
*/ */
private boolean isSystemTextChange() { private boolean isSystemTextChange() {
@ -1035,17 +1037,19 @@ public class StyledTextComp extends Composite {
} }
protected boolean isUpperCase(final String word) { protected boolean isUpperCase(final String word) {
for (int index= word.length() - 1; index >= 0; index--) { for (int index = word.length() - 1; index >= 0; index--) {
if (Character.isLowerCase(word.charAt(index))) if (Character.isLowerCase(word.charAt(index))) {
return false; return false;
}
} }
return true; return true;
} }
protected void upper() { protected void upper() {
String text = textEditorST.getText(); String text = textEditorST.getText();
if (isUpperCase(text)) if (isUpperCase(text)) {
return; return;
}
int topIdx = textEditorST.getTopIndex(); int topIdx = textEditorST.getTopIndex();
setProductText(textEditorST.getText().toUpperCase()); setProductText(textEditorST.getText().toUpperCase());
textEditorST.setTopIndex(topIdx); textEditorST.setTopIndex(topIdx);
@ -1161,7 +1165,7 @@ public class StyledTextComp extends Composite {
/** /**
* Getter for the column at which wrap and auto-wrap will wrap the text. * Getter for the column at which wrap and auto-wrap will wrap the text.
* *
* @return the column number * @return the column number
*/ */
public int getWrapColumn() { public int getWrapColumn() {
@ -1170,7 +1174,7 @@ public class StyledTextComp extends Composite {
/** /**
* Getter for the column at which wrap and auto-wrap will wrap the text. * Getter for the column at which wrap and auto-wrap will wrap the text.
* *
* @param wrapColumn * @param wrapColumn
* the column number * the column number
*/ */
@ -1209,7 +1213,7 @@ public class StyledTextComp extends Composite {
/** /**
* Query the prefs for setting. If it does not exist, use colorDft as its * Query the prefs for setting. If it does not exist, use colorDft as its
* value. Create an SWT Color for display from the value and return it. * value. Create an SWT Color for display from the value and return it.
* *
* @param prefs * @param prefs
* A preference store which might have config values. * A preference store which might have config values.
* @param display * @param display
@ -1232,7 +1236,7 @@ public class StyledTextComp extends Composite {
/** /**
* Send a PROBLEM message if color1 is exactly equal to color2. * Send a PROBLEM message if color1 is exactly equal to color2.
* *
* @param color1 * @param color1
* the first color * the first color
* @param color2 * @param color2
@ -1259,7 +1263,7 @@ public class StyledTextComp extends Composite {
* <p> * <p>
* The getter name is different to avoid confusion with the getFgColor() * The getter name is different to avoid confusion with the getFgColor()
* method of Control. * method of Control.
* *
* @return the foreground Color * @return the foreground Color
*/ */
public Color getFgndColor() { public Color getFgndColor() {
@ -1270,7 +1274,7 @@ public class StyledTextComp extends Composite {
* Get the framed text color of the StyledTextComp. This is the actual * Get the framed text color of the StyledTextComp. This is the actual
* color, not a copy. It will be disposed when the StyledTextComp is, and * color, not a copy. It will be disposed when the StyledTextComp is, and
* should not be disposed before then. * should not be disposed before then.
* *
* @return the frameColor * @return the frameColor
*/ */
public Color getFrameColor() { public Color getFrameColor() {
@ -1281,7 +1285,7 @@ public class StyledTextComp extends Composite {
* Get the insert color of the StyledTextComp. This is the actual color, not * Get the insert color of the StyledTextComp. This is the actual color, not
* a copy. It will be disposed when the StyledTextComp is, and should not be * a copy. It will be disposed when the StyledTextComp is, and should not be
* disposed before then. * disposed before then.
* *
* @return the insertColor * @return the insertColor
*/ */
public Color getInsertColor() { public Color getInsertColor() {
@ -1292,7 +1296,7 @@ public class StyledTextComp extends Composite {
* Get the locked text color of the StyledTextComp. This is the actual * Get the locked text color of the StyledTextComp. This is the actual
* color, not a copy. It will be disposed when the StyledTextComp is, and * color, not a copy. It will be disposed when the StyledTextComp is, and
* should not be disposed before then. * should not be disposed before then.
* *
* @return the lockColor * @return the lockColor
*/ */
public Color getLockColor() { public Color getLockColor() {
@ -1302,7 +1306,7 @@ public class StyledTextComp extends Composite {
/** /**
* Word wrap the text in the block around cursorIndex. Adjust the cursor * Word wrap the text in the block around cursorIndex. Adjust the cursor
* position to account for inserted or deleted whitespace. * position to account for inserted or deleted whitespace.
* *
* @param st * @param st
* The StyledText in which word wrap is to be performed * The StyledText in which word wrap is to be performed
* @param cursorIndex * @param cursorIndex
@ -1336,7 +1340,7 @@ public class StyledTextComp extends Composite {
line = st.getLine(searchLine); line = st.getLine(searchLine);
int lineOffset = st.getOffsetAtLine(searchLine); int lineOffset = st.getOffsetAtLine(searchLine);
// if line contains locked text, quit looking. // if line contains locked text, quit looking.
if (rangeHasLockedText(lineOffset, line.length())) { if (rangeHasLockedText(lineOffset, line.length())) {
break; break;
} }
@ -1393,7 +1397,7 @@ public class StyledTextComp extends Composite {
if (endIndex >= st.getCharCount()) { if (endIndex >= st.getCharCount()) {
endIndex = st.getCharCount() - 1; endIndex = st.getCharCount() - 1;
} }
if (endIndex < startIndex) { if (endIndex < startIndex) {
return new int[] { startIndex, endIndex, 0 }; return new int[] { startIndex, endIndex, 0 };
} }

View file

@ -46,6 +46,7 @@ import com.raytheon.viz.gfe.GFEPreference;
* Apr 27, 2011 #9250 bkowal getStyle and getName are now used to * Apr 27, 2011 #9250 bkowal getStyle and getName are now used to
* get the style and name associated with * get the style and name associated with
* a FontData object. * a FontData object.
* Nov 20, 2013 #2488 randerso Changed to use DejaVu fonts
* *
* </pre> * </pre>
* *
@ -57,9 +58,9 @@ public class GFEFonts {
private static final transient IUFStatusHandler statusHandler = UFStatus private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(GFEFonts.class); .getHandler(GFEFonts.class);
private static final String DEFAULT_FONT_NAME = "Bitstream Vera Sans"; private static final String DEFAULT_FONT_NAME = "DejaVu Sans Mono";
private static final int[] DEFAULT_FONT_SIZE = { 8, 10, 12, 14, 20 }; private static final int[] DEFAULT_FONT_SIZE = { 9, 9, 12, 14, 20 };
private static final int DEFAULT_FONT_STYLE = SWT.BOLD; private static final int DEFAULT_FONT_STYLE = SWT.BOLD;

View file

@ -147,4 +147,12 @@
</menu> </menu>
</menuContribution> </menuContribution>
</extension> </extension>
<extension
point="org.eclipse.ui.themes">
<fontDefinition
id="com.raytheon.viz.radar.rsc.graphic.RadarGraphicsPage"
label="Radar Graphics Font"
value="Monospaced-regular-12">
</fontDefinition>
</extension>
</plugin> </plugin>

View file

@ -19,13 +19,12 @@
**/ **/
package com.raytheon.viz.radar.rsc.graphic; package com.raytheon.viz.radar.rsc.graphic;
import java.io.File; import java.awt.image.BufferedImage;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
import java.awt.image.BufferedImage;
import javax.measure.converter.UnitConverter; import javax.measure.converter.UnitConverter;
import javax.measure.unit.NonSI; import javax.measure.unit.NonSI;
@ -42,8 +41,8 @@ import com.raytheon.uf.common.dataplugin.radar.level3.CellTrendDataPacket;
import com.raytheon.uf.common.dataplugin.radar.level3.CellTrendVolumeScanPacket; import com.raytheon.uf.common.dataplugin.radar.level3.CellTrendVolumeScanPacket;
import com.raytheon.uf.common.dataplugin.radar.level3.CorrelatedShearPacket; import com.raytheon.uf.common.dataplugin.radar.level3.CorrelatedShearPacket;
import com.raytheon.uf.common.dataplugin.radar.level3.DMDPacket.DMDAttributeIDs; import com.raytheon.uf.common.dataplugin.radar.level3.DMDPacket.DMDAttributeIDs;
import com.raytheon.uf.common.dataplugin.radar.level3.GFMPacket;
import com.raytheon.uf.common.dataplugin.radar.level3.ETVSPacket; import com.raytheon.uf.common.dataplugin.radar.level3.ETVSPacket;
import com.raytheon.uf.common.dataplugin.radar.level3.GFMPacket;
import com.raytheon.uf.common.dataplugin.radar.level3.HailPositivePacket; import com.raytheon.uf.common.dataplugin.radar.level3.HailPositivePacket;
import com.raytheon.uf.common.dataplugin.radar.level3.HailProbablePacket; import com.raytheon.uf.common.dataplugin.radar.level3.HailProbablePacket;
import com.raytheon.uf.common.dataplugin.radar.level3.HdaHailPacket; import com.raytheon.uf.common.dataplugin.radar.level3.HdaHailPacket;
@ -78,20 +77,19 @@ import com.raytheon.uf.common.dataplugin.radar.level3.generic.GenericDataCompone
import com.raytheon.uf.common.geospatial.ReferencedCoordinate; import com.raytheon.uf.common.geospatial.ReferencedCoordinate;
import com.raytheon.uf.common.geospatial.ReferencedGeometry; import com.raytheon.uf.common.geospatial.ReferencedGeometry;
import com.raytheon.uf.common.geospatial.ReferencedObject.Type; import com.raytheon.uf.common.geospatial.ReferencedObject.Type;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.viz.core.DrawableLine; import com.raytheon.uf.viz.core.DrawableLine;
import com.raytheon.uf.viz.core.DrawableString; 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.VerticalAlignment;
import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle; import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle;
import com.raytheon.uf.viz.core.IGraphicsTarget.VerticalAlignment;
import com.raytheon.uf.viz.core.data.prep.IODataPreparer; import com.raytheon.uf.viz.core.data.prep.IODataPreparer;
import com.raytheon.uf.viz.core.drawables.IDescriptor; import com.raytheon.uf.viz.core.drawables.IDescriptor;
import com.raytheon.uf.viz.core.drawables.IFont; import com.raytheon.uf.viz.core.drawables.IFont;
import com.raytheon.uf.viz.core.drawables.IImage;
import com.raytheon.uf.viz.core.drawables.IRenderable; import com.raytheon.uf.viz.core.drawables.IRenderable;
import com.raytheon.uf.viz.core.drawables.IWireframeShape; import com.raytheon.uf.viz.core.drawables.IWireframeShape;
import com.raytheon.uf.viz.core.drawables.PaintProperties; import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.drawables.ext.ICanvasRenderingExtension; import com.raytheon.uf.viz.core.drawables.ext.ICanvasRenderingExtension;
import com.raytheon.uf.viz.core.drawables.IImage;
import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.viz.core.rsc.jts.JTSCompiler; import com.raytheon.viz.core.rsc.jts.JTSCompiler;
import com.raytheon.viz.pointdata.PointWindDisplay; import com.raytheon.viz.pointdata.PointWindDisplay;
@ -121,6 +119,7 @@ import com.vividsolutions.jts.geom.LineString;
* Jan 8, 2009 chammack Initial creation * Jan 8, 2009 chammack Initial creation
* 03/05/2013 DCS51 zwang Handle GFM product * 03/05/2013 DCS51 zwang Handle GFM product
* 06/24/2013 DR16162 zwang Remove "wind behind" * 06/24/2013 DR16162 zwang Remove "wind behind"
* 11/20/2013 2488 randerso Removed use of VeraMono font file
* *
* </pre> * </pre>
* *
@ -143,7 +142,7 @@ public class RadarGraphicsPage implements IRenderable {
private JTSCompiler compiler; private JTSCompiler compiler;
private IWireframeShape wireframeShape; private IWireframeShape wireframeShape;
private IWireframeShape gfmFcstWireframeShape; private IWireframeShape gfmFcstWireframeShape;
/** Map of ascii strings in local coordinate system */ /** Map of ascii strings in local coordinate system */
@ -190,14 +189,15 @@ public class RadarGraphicsPage implements IRenderable {
private boolean drawBorder = false; private boolean drawBorder = false;
private int recordsPerPage = 5; private int recordsPerPage = 5;
// for GFM product, add gfmFcstWireframeShape // for GFM product, add gfmFcstWireframeShape
public RadarGraphicsPage(IDescriptor descriptor, GeneralGridGeometry gg, public RadarGraphicsPage(IDescriptor descriptor, GeneralGridGeometry gg,
IWireframeShape shape, IWireframeShape gfmShape, IGraphicsTarget target, RGB color) { IWireframeShape shape, IWireframeShape gfmShape,
IGraphicsTarget target, RGB color) {
this(descriptor, gg, shape, target, color); this(descriptor, gg, shape, target, color);
this.gfmFcstWireframeShape = gfmShape; this.gfmFcstWireframeShape = gfmShape;
} }
public RadarGraphicsPage(IDescriptor descriptor, GeneralGridGeometry gg, public RadarGraphicsPage(IDescriptor descriptor, GeneralGridGeometry gg,
IWireframeShape shape, IGraphicsTarget target, RGB color, IWireframeShape shape, IGraphicsTarget target, RGB color,
DmdModifier tableModifier) { DmdModifier tableModifier) {
@ -467,10 +467,10 @@ public class RadarGraphicsPage implements IRenderable {
} }
} }
// GFM // GFM
else if (type == 140) { else if (type == 140) {
List<PlotObject> gfmImages = new ArrayList<PlotObject>(); List<PlotObject> gfmImages = new ArrayList<PlotObject>();
// Handle each Feature in the GFM Packet // Handle each Feature in the GFM Packet
for (GenericDataComponent currComponent : stormData for (GenericDataComponent currComponent : stormData
.getDisplayGenericPointData().get(type).values()) { .getDisplayGenericPointData().get(type).values()) {
// Handle Graphic portion // Handle Graphic portion
@ -892,104 +892,113 @@ public class RadarGraphicsPage implements IRenderable {
// Handle GFM product // Handle GFM product
private List<PlotObject> getGfmImage(GenericDataComponent currPt) private List<PlotObject> getGfmImage(GenericDataComponent currPt)
throws VizException { throws VizException {
List<PlotObject> images = new ArrayList<PlotObject>(); List<PlotObject> images = new ArrayList<PlotObject>();
UnitConverter metersPerSecondToKnots = SI.METERS_PER_SECOND.getConverterTo(NonSI.KNOT); UnitConverter metersPerSecondToKnots = SI.METERS_PER_SECOND
.getConverterTo(NonSI.KNOT);
boolean isFcst = false; boolean isFcst = false;
double x,y; double x, y;
Coordinate pos1, pos2; Coordinate pos1, pos2;
int imgSize = 64; int imgSize = 64;
AreaComponent currFeature = (AreaComponent) currPt; AreaComponent currFeature = (AreaComponent) currPt;
int numPoints = currFeature.getPoints().size(); int numPoints = currFeature.getPoints().size();
int numParam = currFeature.getParameters().size(); int numParam = currFeature.getParameters().size();
String propU, propV, windX, windY; String propU, propV, windX, windY;
double pU = 0.0; double pU = 0.0;
double pV = 0.0; double pV = 0.0;
double wX = 0.0; double wX = 0.0;
double wY = 0.0; double wY = 0.0;
// if the component only has dectect ID and DeltaT // if the component only has dectect ID and DeltaT
if (numParam == 2) { if (numParam == 2) {
isFcst = true; isFcst = true;
} }
// 11 parameters // 11 parameters
else { else {
propU = currFeature.getValue(GFMPacket.GFMAttributeIDs.PROPU.getName()); propU = currFeature.getValue(GFMPacket.GFMAttributeIDs.PROPU
if ((propU != null) && (propU.length() > 0)) { .getName());
pU = metersPerSecondToKnots.convert(new Double(propU)); if ((propU != null) && (propU.length() > 0)) {
} pU = metersPerSecondToKnots.convert(new Double(propU));
propV = currFeature.getValue(GFMPacket.GFMAttributeIDs.PROPV.getName()); }
if ((propV != null) && (propV.length() > 0)) { propV = currFeature.getValue(GFMPacket.GFMAttributeIDs.PROPV
pV = metersPerSecondToKnots.convert(new Double(propV)); .getName());
} if ((propV != null) && (propV.length() > 0)) {
windX = currFeature.getValue(GFMPacket.GFMAttributeIDs.WINDBEHINDX.getName()); pV = metersPerSecondToKnots.convert(new Double(propV));
if ((windX != null) && (windX.length() > 0)) { }
wX = Float.parseFloat(windX); windX = currFeature.getValue(GFMPacket.GFMAttributeIDs.WINDBEHINDX
} .getName());
windY = currFeature.getValue(GFMPacket.GFMAttributeIDs.WINDBEHINDY.getName()); if ((windX != null) && (windX.length() > 0)) {
if ((windY != null) && (windY.length() > 0)) { wX = Float.parseFloat(windX);
wY = Float.parseFloat(windY); }
} windY = currFeature.getValue(GFMPacket.GFMAttributeIDs.WINDBEHINDY
.getName());
// Get the nearest point on the MIGFA front to the wind behind point if ((windY != null) && (windY.length() > 0)) {
// Plot front movement arrow at this point wY = Float.parseFloat(windY);
Coordinate windBehind = new Coordinate(wX, wY); }
Coordinate plotPoint = getPlotPoint(currFeature, windBehind);
wX = plotPoint.x; // Get the nearest point on the MIGFA front to the wind behind point
wY = plotPoint.y; // Plot front movement arrow at this point
Coordinate windBehind = new Coordinate(wX, wY);
// Prop wind arrow Coordinate plotPoint = getPlotPoint(currFeature, windBehind);
PlotObject poWind = new PlotObject(); wX = plotPoint.x;
PointWindDisplay barb = new PointWindDisplay(imgSize * 0.4, 0.5, 2, 0); wY = plotPoint.y;
barb.setImageParameters(imgSize, imgSize, 255, 255, 255, 1);
barb.setColor(this.color); // Prop wind arrow
PlotObject poWind = new PlotObject();
// plot the wind arrow in the same length as 50 kts PointWindDisplay barb = new PointWindDisplay(imgSize * 0.4, 0.5, 2,
double spd = Math.sqrt(pU * pU + pV * pV); 0);
if (spd > 0) { barb.setImageParameters(imgSize, imgSize, 255, 255, 255, 1);
pU *= 50.0 / spd; barb.setColor(this.color);
pV *= 50.0 / spd;
} // plot the wind arrow in the same length as 50 kts
double spd = Math.sqrt(pU * pU + pV * pV);
barb.setWind(pU, pV, false); if (spd > 0) {
BufferedImage imgBuf = barb.getWindImage(false, DisplayType.ARROW, 0.2); pU *= 50.0 / spd;
IImage img = this.target.initializeRaster(new IODataPreparer(imgBuf, UUID.randomUUID().toString(), 0), null); pV *= 50.0 / spd;
poWind.image = img; }
ReferencedCoordinate rc = referencedGfmCoord(wX, wY); barb.setWind(pU, pV, false);
try { BufferedImage imgBuf = barb.getWindImage(false, DisplayType.ARROW,
poWind.coord = rc.asPixel(this.descriptor.getGridGeometry()); 0.2);
poWind.pixelOffset = new int[] { 0, 0 }; IImage img = this.target.initializeRaster(new IODataPreparer(
images.add(poWind); imgBuf, UUID.randomUUID().toString(), 0), null);
} catch (Exception e) { poWind.image = img;
throw new VizException("Unable to transform coordinates", e);
} ReferencedCoordinate rc = referencedGfmCoord(wX, wY);
try {
poWind.coord = rc.asPixel(this.descriptor.getGridGeometry());
poWind.pixelOffset = new int[] { 0, 0 };
images.add(poWind);
} catch (Exception e) {
throw new VizException("Unable to transform coordinates", e);
}
} }
// Draw GFM fronts // Draw GFM fronts
x = currFeature.getPoints().get(0).getCoordinate1(); x = currFeature.getPoints().get(0).getCoordinate1();
y = currFeature.getPoints().get(0).getCoordinate2(); y = currFeature.getPoints().get(0).getCoordinate2();
try { try {
pos1 = referencedGfmCoord(x, y).asLatLon(); pos1 = referencedGfmCoord(x, y).asLatLon();
for (int k = 1; k < numPoints; k++) { for (int k = 1; k < numPoints; k++) {
x = currFeature.getPoints().get(k).getCoordinate1(); x = currFeature.getPoints().get(k).getCoordinate1();
y = currFeature.getPoints().get(k).getCoordinate2(); y = currFeature.getPoints().get(k).getCoordinate2();
//convert xy to latlon // convert xy to latlon
pos2 = referencedGfmCoord(x, y).asLatLon(); pos2 = referencedGfmCoord(x, y).asLatLon();
// Connect the dots // Connect the dots
if (isFcst) { if (isFcst) {
gfmFcstWireframeShape.addLineSegment(new Coordinate[] {pos1, pos2 }); gfmFcstWireframeShape.addLineSegment(new Coordinate[] {
} pos1, pos2 });
else { } else {
wireframeShape.addLineSegment(new Coordinate[] {pos1, pos2 }); wireframeShape
.addLineSegment(new Coordinate[] { pos1, pos2 });
} }
pos1 = pos2; pos1 = pos2;
} }
@ -1000,7 +1009,7 @@ public class RadarGraphicsPage implements IRenderable {
} }
return images; return images;
} }
private PlotObject getImage(HdaHailPoint currPt) throws VizException { private PlotObject getImage(HdaHailPoint currPt) throws VizException {
PlotObject image = null; PlotObject image = null;
@ -1190,9 +1199,7 @@ public class RadarGraphicsPage implements IRenderable {
public void paint(IGraphicsTarget target, PaintProperties paintProps) public void paint(IGraphicsTarget target, PaintProperties paintProps)
throws VizException { throws VizException {
if (font == null) { if (font == null) {
File fontFile = PathManagerFactory.getPathManager().getStaticFile( this.font = target.initializeFont(getClass().getName());
"fonts" + File.separator + "VeraMono.ttf");
this.font = target.initializeFont(fontFile, 12.0f, null);
this.font.setMagnification((float) magnification, false); this.font.setMagnification((float) magnification, false);
this.font.setSmoothing(true); this.font.setSmoothing(true);
} }
@ -1201,9 +1208,9 @@ public class RadarGraphicsPage implements IRenderable {
// GFM forecast positions should be dashed thick lines // GFM forecast positions should be dashed thick lines
if (this.gfmFcstWireframeShape != null) { if (this.gfmFcstWireframeShape != null) {
target.drawWireframeShape(this.wireframeShape, this.color, 3.0f); target.drawWireframeShape(this.wireframeShape, this.color, 3.0f);
target.drawWireframeShape(this.gfmFcstWireframeShape, this.color, 3.0f, LineStyle.DASHED); target.drawWireframeShape(this.gfmFcstWireframeShape, this.color,
} 3.0f, LineStyle.DASHED);
else if (this.wireframeShape != null) { } else if (this.wireframeShape != null) {
target.drawWireframeShape(this.wireframeShape, this.color, 1.0f); target.drawWireframeShape(this.wireframeShape, this.color, 1.0f);
} }
@ -1478,35 +1485,36 @@ public class RadarGraphicsPage implements IRenderable {
this.tableX = this.startTableX; this.tableX = this.startTableX;
this.tableY = this.startTableY; this.tableY = this.startTableY;
} }
/** /**
* Need to convert x/y to lon/lat for GFM product * Need to convert x/y to lon/lat for GFM product
*/ */
public ReferencedCoordinate referencedGfmCoord(double i, double j) { public ReferencedCoordinate referencedGfmCoord(double i, double j) {
return new ReferencedCoordinate(rectifyCoordinate(new Coordinate(i * 4, j * 4)), return new ReferencedCoordinate(rectifyCoordinate(new Coordinate(i * 4,
this.gridGeometry, Type.GRID_CENTER); j * 4)), this.gridGeometry, Type.GRID_CENTER);
} }
/** /**
* Gets the nearest point from GFM front to wind behind point to plot * Gets the nearest point from GFM front to wind behind point to plot front
* front movement arrow * movement arrow
* *
* @param AreaComponent * @param AreaComponent
* @param Coordinate * @param Coordinate
* @return Coordinate * @return Coordinate
* *
*/ */
private Coordinate getPlotPoint(AreaComponent currFeature, Coordinate windBehind) { private Coordinate getPlotPoint(AreaComponent currFeature,
Coordinate windBehind) {
Coordinate point = new Coordinate(); Coordinate point = new Coordinate();
double minDist = Double.MAX_VALUE; double minDist = Double.MAX_VALUE;
int numPoints = currFeature.getPoints().size(); int numPoints = currFeature.getPoints().size();
double x1 = windBehind.x; double x1 = windBehind.x;
double y1 = windBehind.y; double y1 = windBehind.y;
double x2 = 0.0; double x2 = 0.0;
double y2 = 0.0; double y2 = 0.0;
double dist = 0.0; double dist = 0.0;
for (int k = 0; k < numPoints; k++) { for (int k = 0; k < numPoints; k++) {
x2 = currFeature.getPoints().get(k).getCoordinate1(); x2 = currFeature.getPoints().get(k).getCoordinate1();
y2 = currFeature.getPoints().get(k).getCoordinate2(); y2 = currFeature.getPoints().get(k).getCoordinate2();
@ -1517,8 +1525,8 @@ public class RadarGraphicsPage implements IRenderable {
minDist = dist; minDist = dist;
} }
} }
return point; return point;
} }
} }

View file

@ -60,7 +60,8 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* uses the font. * uses the font.
* Feb 03, 2012 14317 mhuang Make alarm display window wider * Feb 03, 2012 14317 mhuang Make alarm display window wider
* Sep 6, 2012 13365 rferrel Accumulate and Display fix. * Sep 6, 2012 13365 rferrel Accumulate and Display fix.
* Sep 25, 2012 1196 lvenable Dialog refactor for AlarmDisplayWindow.Added DO_NOT_BLOCK. * Sep 25, 2012 1196 lvenable Dialog refactor for AlarmDisplayWindow.Added DO_NOT_BLOCK.
* Nov 20, 2013 2488 randerso Changed to use DejaVu font
* *
* </pre> * </pre>
* *
@ -127,7 +128,8 @@ public class AlarmDisplayWindow extends CaveSWTDialog {
shell.setMinimumSize(300, 100); shell.setMinimumSize(300, 100);
FontData fd = shell.getDisplay().getSystemFont().getFontData()[0]; FontData fd = shell.getDisplay().getSystemFont().getFontData()[0];
fd.setName("Bitstream Vera Sans Mono"); // TODO not have hard coded font name
fd.setName("DejaVu Sans Mono");
font = new Font(shell.getDisplay(), fd); font = new Font(shell.getDisplay(), fd);
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true); GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
@ -207,7 +209,7 @@ public class AlarmDisplayWindow extends CaveSWTDialog {
@Override @Override
public void widgetSelected(SelectionEvent event) { public void widgetSelected(SelectionEvent event) {
PrintDisplay.print(text.getText(), PrintDisplay.print(text.getText(),
text.getFont().getFontData()[0], text.getFont().getFontData()[0],
UFStatus.getHandler(AlarmDisplayWindow.class)); UFStatus.getHandler(AlarmDisplayWindow.class));
} }
}); });

View file

@ -19,11 +19,10 @@
**/ **/
package com.raytheon.viz.texteditor.alarmalert.util; package com.raytheon.viz.texteditor.alarmalert.util;
import java.awt.Toolkit;
import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.Status;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.progress.UIJob; import org.eclipse.ui.progress.UIJob;
/** /**
@ -36,6 +35,8 @@ import org.eclipse.ui.progress.UIJob;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Oct 19, 2009 mnash Initial creation * Oct 19, 2009 mnash Initial creation
* Jul 25, 2012 15122 rferrel Add sound repeat interval. * Jul 25, 2012 15122 rferrel Add sound repeat interval.
* Nov 26, 2013 16781 mgamazaychikov Changed AWT Toolkit.getDefaultToolkit().beep to
* SWT Display.beep()
* *
* </pre> * </pre>
* *
@ -78,7 +79,7 @@ public class AlarmBeepJob extends UIJob {
public IStatus runInUIThread(IProgressMonitor monitor) { public IStatus runInUIThread(IProgressMonitor monitor) {
IStatus status = Status.OK_STATUS; IStatus status = Status.OK_STATUS;
if (count < BEEP_COUNT) { if (count < BEEP_COUNT) {
Toolkit.getDefaultToolkit().beep(); Display.getCurrent().beep();
if (!disposed) { if (!disposed) {
this.schedule(BEEP_INTERVAL); this.schedule(BEEP_INTERVAL);
} }

View file

@ -106,7 +106,7 @@ public class DupElimSrv {
newPdos.add(pdo); newPdos.add(pdo);
} else { } else {
// shouldn't be more than 1 // shouldn't be more than 1
PluginDataObject dbPdo = dbPdos.get(1); PluginDataObject dbPdo = dbPdos.get(0);
if ((dbPdo == null) if ((dbPdo == null)
|| !pdo.getDataURI().equals(dbPdo.getDataURI())) { || !pdo.getDataURI().equals(dbPdo.getDataURI())) {
newPdos.add(pdo); newPdos.add(pdo);

View file

@ -14,12 +14,14 @@ namespace VizLauncher.com.raytheon.viz.launcher.process
protected static readonly String LOG_SUFFIX = ".log"; protected static readonly String LOG_SUFFIX = ".log";
protected Process process = null; protected Process process = null;
private StreamWriter logFileWriter; private StreamWriter logFileWriter;
protected VizEnvironment vizEnvironment;
private bool ready = false; private bool ready = false;
private String exceptionText = null; private String exceptionText = null;
public AbstractProcessLauncher(VizEnvironment vizEnvironment) public AbstractProcessLauncher(VizEnvironment vizEnvironment)
{ {
this.vizEnvironment = vizEnvironment;
// Prepare the log file. // Prepare the log file.
if (Directory.Exists(vizEnvironment.getLogDirectory()) == false) if (Directory.Exists(vizEnvironment.getLogDirectory()) == false)
{ {
@ -56,8 +58,10 @@ namespace VizLauncher.com.raytheon.viz.launcher.process
{ {
ProcessStartInfo processStartInfo = ProcessStartInfo processStartInfo =
new ProcessStartInfo(this.constructProcessName(vizEnvironment.getLocation())); new ProcessStartInfo(this.constructProcessName(vizEnvironment.getLocation()));
// include the default system PATH in the application PATH
String systemPath = System.Environment.GetEnvironmentVariable("PATH");
processStartInfo.EnvironmentVariables[EnvironmentProperties.ENVIRONMENT_VARIABLE_PATH] = processStartInfo.EnvironmentVariables[EnvironmentProperties.ENVIRONMENT_VARIABLE_PATH] =
vizEnvironment.getPath(); vizEnvironment.getPath() + this.getApplicationSpecificPath() + systemPath;
processStartInfo.EnvironmentVariables[EnvironmentProperties.ENVIRONMENT_VARIABLE_PYTHON_PATH] = processStartInfo.EnvironmentVariables[EnvironmentProperties.ENVIRONMENT_VARIABLE_PYTHON_PATH] =
vizEnvironment.getPythonPath(); vizEnvironment.getPythonPath();
processStartInfo.UseShellExecute = false; processStartInfo.UseShellExecute = false;
@ -119,6 +123,11 @@ namespace VizLauncher.com.raytheon.viz.launcher.process
return this.exceptionText; return this.exceptionText;
} }
protected virtual String getApplicationSpecificPath()
{
return String.Empty;
}
protected abstract String constructProcessName(String location); protected abstract String constructProcessName(String location);
protected abstract String constructLogName(String logDate); protected abstract String constructLogName(String logDate);

View file

@ -12,14 +12,21 @@ namespace VizLauncher.com.raytheon.viz.launcher.process.impl
{ {
private static readonly String LOG_PREFIX = "cave_"; private static readonly String LOG_PREFIX = "cave_";
private static readonly String COMMAND_LINE_ARGUMENTS = "-component thinclient"; private static readonly String COMMAND_LINE_ARGUMENTS = "-component thinclient";
private static readonly String CAVE_EXECUTABLE = private static readonly String CAVE_DIRECTORY = Path.DirectorySeparatorChar + "CAVE";
Path.DirectorySeparatorChar + "CAVE" + Path.DirectorySeparatorChar + "cave.exe"; private static readonly String CAVE_EXECUTABLE =
CAVE_DIRECTORY + Path.DirectorySeparatorChar + "cave.exe";
public CaveProcessLauncher(VizEnvironment vizEnvironment) public CaveProcessLauncher(VizEnvironment vizEnvironment)
: base(vizEnvironment) : base(vizEnvironment)
{ {
} }
protected override String getApplicationSpecificPath()
{
return Path.PathSeparator + this.vizEnvironment.getLocation() +
CAVE_DIRECTORY + Path.DirectorySeparatorChar + "lib" + Path.PathSeparator;
}
protected override String constructProcessName(String location) protected override String constructProcessName(String location)
{ {
return location + CAVE_EXECUTABLE; return location + CAVE_EXECUTABLE;

View file

@ -29,6 +29,7 @@
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* 11/17/09 3580 brockwoo Initial Creation * 11/17/09 3580 brockwoo Initial Creation
* 11/19/13 2495 bclement changed dim arrays/lists to use npy_intp
* *
* </pre> * </pre>
* *
@ -50,7 +51,7 @@ static int dimensions(PyObject * array) {
if (aDim == 3) { if (aDim == 3) {
returnValue |= 4; // 2d arrays returnValue |= 4; // 2d arrays
} else if (aDim == 2) { } else if (aDim == 2) {
npy_int * aDimList = PyArray_DIMS(array); npy_intp * aDimList = PyArray_DIMS(array);
if (aDimList[0] == 1) { if (aDimList[0] == 1) {
returnValue |= 1; //linear array returnValue |= 1; //linear array
} }
@ -79,9 +80,9 @@ static PyObject * defineNumpySlice(PyObject *self, PyObject* args)
int * param3dDim; int * param3dDim;
int levelCount; int levelCount;
int vnz, pnz, vny , pny , vnx , pnx; int vnz, pnz, vny , pny , vnx , pnx;
int dimSize[2]; npy_intp dimSize[2];
npy_int * vdimList; npy_intp * vdimList;
npy_int * pdimList; npy_intp * pdimList;
if (!PyArg_ParseTuple(args, "OOfi", &vc, &param, &targetLevel, &sense)) { if (!PyArg_ParseTuple(args, "OOfi", &vc, &param, &targetLevel, &sense)) {
return NULL; return NULL;
@ -211,9 +212,9 @@ static PyObject * createNumpySlice(PyObject *self, PyObject* args)
int * vc3dDim ; int * vc3dDim ;
int levelCount; int levelCount;
float * vc2d ; float * vc2d ;
int dimSize[2]; npy_intp dimSize[2];
npy_int * vdimList; npy_intp * vdimList;
npy_int * sdimList; npy_intp * sdimList;
if (!PyArg_ParseTuple(args, "OOOi|i", &vc, &s3d, &targetLevel, &sense, &hyb)) { if (!PyArg_ParseTuple(args, "OOOi|i", &vc, &s3d, &targetLevel, &sense, &hyb)) {
return NULL; return NULL;

View file

@ -9,7 +9,7 @@
Name: awips2-python Name: awips2-python
Summary: AWIPS II Python Distribution Summary: AWIPS II Python Distribution
Version: 2.7.1 Version: 2.7.1
Release: 9.el6 Release: 10.el6
Group: AWIPSII Group: AWIPSII
BuildRoot: %{_build_root} BuildRoot: %{_build_root}
BuildArch: %{_build_arch} BuildArch: %{_build_arch}

View file

@ -400,10 +400,10 @@ if [ "${1}" = "-viz" ]; then
buildRPM "awips2" buildRPM "awips2"
buildRPM "awips2-common-base" buildRPM "awips2-common-base"
#buildRPM "awips2-python-dynamicserialize" #buildRPM "awips2-python-dynamicserialize"
buildRPM "awips2-gfesuite-client" #buildRPM "awips2-gfesuite-client"
buildRPM "awips2-gfesuite-server" #buildRPM "awips2-gfesuite-server"
buildRPM "awips2-python-numpy" #buildRPM "awips2-python-numpy"
#buildRPM "awips2-python" buildRPM "awips2-python"
#buildRPM "awips2-adapt-native" #buildRPM "awips2-adapt-native"
#unpackHttpdPypies #unpackHttpdPypies
#if [ $? -ne 0 ]; then #if [ $? -ne 0 ]; then