diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ConfigData.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ConfigData.java index 5f2f0c8f88..5eadd4af8e 100755 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ConfigData.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ConfigData.java @@ -26,7 +26,7 @@ package com.raytheon.viz.gfe.dialogs.formatterlauncher; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 18 APR 2008 ### lvenable Initial creation + * 18 APR 2008 ### lvenable Initial creation * * * diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/FindReplaceDlg.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/FindReplaceDlg.java index 0824869d72..e76e47ada7 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/FindReplaceDlg.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/FindReplaceDlg.java @@ -548,7 +548,7 @@ public class FindReplaceDlg extends CaveSWTDialog { this.searchOptions.remove(FindReplaceOptions.SEARCH_POS_END); int[] matchRange = findString(searchString); - while (!(matchRange[0] == 0 && matchRange[1] == 0)) { + while (!((matchRange[0] == 0) && (matchRange[1] == 0))) { int newOffset = matchRange[1]; editorST.replaceTextRange(matchRange[0], searchString.length(), @@ -607,7 +607,7 @@ public class FindReplaceDlg extends CaveSWTDialog { int[] replaceMatch = findString(replaceString, selectionToBeReplaced.x); - if (!(replaceMatch[0] == 0 && replaceMatch[1] == 0)) { + if (!((replaceMatch[0] == 0) && (replaceMatch[1] == 0))) { editorComp.reParse(); editorST.setCaretOffset(replaceMatch[1]); } @@ -630,8 +630,9 @@ public class FindReplaceDlg extends CaveSWTDialog { * */ private void handleClickFind(SelectionEvent event) { - if (findTF.getText().equals("")) + if (findTF.getText().equals("")) { return; + } cursorOffset = editorST.getCaretOffset(); @@ -639,8 +640,8 @@ public class FindReplaceDlg extends CaveSWTDialog { // For BACKWARD_SEARCH option: // Need skip the previously found string if (searchOptions.contains(FindReplaceOptions.BACKWARD_SEARCH)) { - if (editorST.getSelectionRange() != null - && editorST.getSelectionRange().y > 0) { + if ((editorST.getSelectionRange() != null) + && (editorST.getSelectionRange().y > 0)) { cursorOffset -= editorST.getSelectionRange().y; if (cursorOffset < 0) { cursorOffset = 0; @@ -671,7 +672,7 @@ public class FindReplaceDlg extends CaveSWTDialog { private boolean findAndSelectString(String searchString) { int[] matchRange = findString(searchString); - if (!(matchRange[0] == 0 && matchRange[1] == 0)) { + if (!((matchRange[0] == 0) && (matchRange[1] == 0))) { editorST.setSelection(matchRange[0], matchRange[1]); editorST.showSelection(); cursorOffset = editorST.getCaretOffset(); @@ -744,8 +745,9 @@ public class FindReplaceDlg extends CaveSWTDialog { // if (searchOptions.contains(FindReplaceOptions.EXACT_MATCH) // && !searchOptions.contains(FindReplaceOptions.REGEX_SEARCH)) // searchRegex = "\\b" + searchRegex + "\\b"; - if (searchOptions.contains(FindReplaceOptions.IGNORE_CASE)) + if (searchOptions.contains(FindReplaceOptions.IGNORE_CASE)) { regexFlags |= Pattern.CASE_INSENSITIVE; + } // Need handle the PatternSyntaxException when user searches meta // character(s) but forgot to toggle on the regex option. @@ -761,8 +763,9 @@ public class FindReplaceDlg extends CaveSWTDialog { match[0] = matcher.start(); match[1] = matcher.end(); if (searchOptions - .contains(FindReplaceOptions.FORWARD_SEARCH)) + .contains(FindReplaceOptions.FORWARD_SEARCH)) { break; + } } } } catch (PatternSyntaxException e) { @@ -829,7 +832,7 @@ public class FindReplaceDlg extends CaveSWTDialog { int searchEndIndex; int[] match = { 0, 0 }; - if (searchString == null || searchString.equals("")) { + if ((searchString == null) || searchString.equals("")) { return match; } diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/IStoreTransmitProduct.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/IStoreTransmitProduct.java index 6cbbff7d37..455662b928 100755 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/IStoreTransmitProduct.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/IStoreTransmitProduct.java @@ -26,7 +26,7 @@ package com.raytheon.viz.gfe.dialogs.formatterlauncher; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 18 APR 2008 ### lvenable Initial creation + * 18 APR 2008 ### lvenable Initial creation * * * diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ITransmissionState.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ITransmissionState.java index e4ab9709de..e53b75d055 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ITransmissionState.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ITransmissionState.java @@ -23,19 +23,18 @@ package com.raytheon.viz.gfe.dialogs.formatterlauncher; * Interface used for sending status of transmitted products. * *
- * + * * SOFTWARE HISTORY - * + * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Feb 22, 2010 #2861 lvenable Initial creation - * + * *- * + * * @author lvenable * @version 1.0 */ -public interface ITransmissionState -{ +public interface ITransmissionState { void setTransmissionState(ConfigData.productStateEnum state); } diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ProductEditorComp.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ProductEditorComp.java index 848d82180b..b770bd2fe3 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ProductEditorComp.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ProductEditorComp.java @@ -125,7 +125,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback; * *
* SOFTWARE HISTORY - * Date Ticket# Engineer Description + * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 18 APR 2008 ### lvenable Initial creation * 19 JAN 2010 4085 ryu Save and load draft @@ -2015,8 +2015,7 @@ public class ProductEditorComp extends Composite implements if (pds != null) { String officeTimeZone = dm.getParmManager() - .compositeGridLocation() - .getTimeZone(); + .compositeGridLocation().getTimeZone(); int numSegments = pds.getSegmentsArray().size(); SimpleDateFormat fmt = new SimpleDateFormat(longLocalFmtStr); fmt.setTimeZone(localTimeZone); @@ -2025,8 +2024,7 @@ public class ProductEditorComp extends Composite implements for (int i = 0; i < numSegments; i++) { textComp.startUpdate(); HashMap* @@ -45,182 +45,181 @@ import com.raytheon.viz.gfe.core.DataManager; * */ public class StoreTransmitCountdownThread extends Thread { - /** - * Parent display. - */ - private Display display; + /** + * Parent display. + */ + private Display display; - /** - * Progress bar to be updated. - */ - private ProgressBar progressBar; + /** + * Progress bar to be updated. + */ + private ProgressBar progressBar; - /** - * Flag indicating if the thread is done running. - */ - private boolean isDone = false; + /** + * Flag indicating if the thread is done running. + */ + private boolean isDone = false; - /** - * Flag indicating if the thread has been canceled. - */ - private boolean isCancelled = false; + /** + * Flag indicating if the thread has been canceled. + */ + private boolean isCancelled = false; - /** - * Count down label. - */ - private Label countdownLbl; + /** + * Count down label. + */ + private Label countdownLbl; - /** - * Count down string. - */ - private String countdownStr; + /** + * Count down string. + */ + private String countdownStr; - /** - * Counter. - */ - private int counter = 5; + /** + * Counter. + */ + private int counter = 5; - /** - * Store/Transmit callback. - */ - private IStoreTransmitProduct storeCB; + /** + * Store/Transmit callback. + */ + private IStoreTransmitProduct storeCB; - /** - * Count down prefix string. - */ - private String countdownPrefix; + /** + * Count down prefix string. + */ + private String countdownPrefix; - /** - * Constructor. - * - * @param display - * Parent display. - * @param progressBar - * Progress bar. - * @param countdownLbl - * Count down label. - * @param countdownStr - * Count down string. - * @param cb - * Callback interface. - * @param isStore - * True to display store, false to display transmit. - */ - public StoreTransmitCountdownThread(Display display, - ProgressBar progressBar, Label countdownLbl, String countdownStr, - IStoreTransmitProduct cb, boolean isStore) { - this.display = display; - this.progressBar = progressBar; - this.countdownLbl = countdownLbl; - this.countdownStr = countdownStr; - this.storeCB = cb; - countdownPrefix = new String(); - CAVEMode opMode = DataManager.getCurrentInstance().getOpMode(); - if (!opMode.equals(CAVEMode.OPERATIONAL)) { - countdownPrefix = "Simulated "; - } - if (isStore == true) { - countdownPrefix += "Store in "; - } else { - countdownPrefix += "Transmit in "; - } - } + /** + * Constructor. + * + * @param display + * Parent display. + * @param progressBar + * Progress bar. + * @param countdownLbl + * Count down label. + * @param countdownStr + * Count down string. + * @param cb + * Callback interface. + * @param isStore + * True to display store, false to display transmit. + */ + public StoreTransmitCountdownThread(Display display, + ProgressBar progressBar, Label countdownLbl, String countdownStr, + IStoreTransmitProduct cb, boolean isStore) { + this.display = display; + this.progressBar = progressBar; + this.countdownLbl = countdownLbl; + this.countdownStr = countdownStr; + this.storeCB = cb; + countdownPrefix = new String(); + CAVEMode opMode = DataManager.getCurrentInstance().getOpMode(); + if (!opMode.equals(CAVEMode.OPERATIONAL)) { + countdownPrefix = "Simulated "; + } + if (isStore == true) { + countdownPrefix += "Store in "; + } else { + countdownPrefix += "Transmit in "; + } + } - /** - * Thread's run method. - */ - @Override - public void run() { - isDone = false; - countdownLabelStart(); + /** + * Thread's run method. + */ + @Override + public void run() { + isDone = false; + countdownLabelStart(); - for (int i = 0; i < 6; i++) { - try { - Thread.sleep(1000); - } catch (InterruptedException e) { - e.printStackTrace(); - } + for (int i = 0; i < 6; i++) { + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } - if (isCancelled == false) { - display.asyncExec(new Runnable() { - public void run() { - if (progressBar.isDisposed()) { - return; - } - // Increment the progress bar - progressBar - .setSelection(progressBar.getSelection() + 1); - countdownLbl.setText(countdownPrefix + counter - + " seconds..."); - --counter; - } - }); - } else { - break; - } - } + if (isCancelled == false) { + display.asyncExec(new Runnable() { + public void run() { + if (progressBar.isDisposed()) { + return; + } + // Increment the progress bar + progressBar.setSelection(progressBar.getSelection() + 1); + countdownLbl.setText(countdownPrefix + counter + + " seconds..."); + --counter; + } + }); + } else { + break; + } + } - if (isCancelled == false) { - countdownLabelFinished(); - } + if (isCancelled == false) { + countdownLabelFinished(); + } - isDone = true; + isDone = true; - storeCB.storeTransmitProduct(); - } + storeCB.storeTransmitProduct(); + } - /** - * Check if the thread is done running. - * - * @return True if the thread is done running, false if it is still running. - */ - public boolean isDone() { - return isDone; - } + /** + * Check if the thread is done running. + * + * @return True if the thread is done running, false if it is still running. + */ + public boolean isDone() { + return isDone; + } - /** - * Cancel the running thread. - */ - public void cancelThread() { - isCancelled = true; - } + /** + * Cancel the running thread. + */ + public void cancelThread() { + isCancelled = true; + } - /** - * Check if the thread has been canceled. - * - * @return True if the thread was canceled, false otherwise. - */ - public boolean threadCancelled() { - return isCancelled; - } + /** + * Check if the thread has been canceled. + * + * @return True if the thread was canceled, false otherwise. + */ + public boolean threadCancelled() { + return isCancelled; + } - /** - * Set the count down label to have a red background and white text while - * the Store/Transmit is in count down mode. - */ - private void countdownLabelStart() { - display.asyncExec(new Runnable() { - public void run() { - countdownLbl.setBackground(display - .getSystemColor(SWT.COLOR_RED)); - countdownLbl.setForeground(display - .getSystemColor(SWT.COLOR_WHITE)); - } - }); - } + /** + * Set the count down label to have a red background and white text while + * the Store/Transmit is in count down mode. + */ + private void countdownLabelStart() { + display.asyncExec(new Runnable() { + public void run() { + countdownLbl.setBackground(display + .getSystemColor(SWT.COLOR_RED)); + countdownLbl.setForeground(display + .getSystemColor(SWT.COLOR_WHITE)); + } + }); + } - /** - * Set the count down label back to its original state. - */ - private void countdownLabelFinished() { - display.asyncExec(new Runnable() { - public void run() { - countdownLbl.setText(countdownStr); - countdownLbl.setBackground(display - .getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); - countdownLbl.setForeground(display - .getSystemColor(SWT.COLOR_BLACK)); - } - }); - } + /** + * Set the count down label back to its original state. + */ + private void countdownLabelFinished() { + display.asyncExec(new Runnable() { + public void run() { + countdownLbl.setText(countdownStr); + countdownLbl.setBackground(display + .getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); + countdownLbl.setForeground(display + .getSystemColor(SWT.COLOR_BLACK)); + } + }); + } } diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/StyledTextComp.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/StyledTextComp.java index b039140294..aae69d92ec 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/StyledTextComp.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/StyledTextComp.java @@ -410,7 +410,8 @@ public class StyledTextComp extends Composite { // should be unlocked. Cities list is unlocked for editing // when framing codes are present. if (newProduct) { - if (cityTip != null && cityTip.getText().indexOf("|*") > 0) { + if ((cityTip != null) + && (cityTip.getText().indexOf("|*") > 0)) { unlockCitySegs.add(ugc); } } @@ -448,7 +449,7 @@ public class StyledTextComp extends Composite { * correct the end value. */ int endLineOffset = 0; - if (endLine == productTextArray.length - 1) { + if (endLine == (productTextArray.length - 1)) { ++endLineOffset; } @@ -568,7 +569,7 @@ public class StyledTextComp extends Composite { TextIndexPoints pit = prodDataStruct.getPIT(); if (ff == null) { - if (pit == null || newfield.length() == 0) { + if ((pit == null) || (newfield.length() == 0)) { return; // No typecode or ci block found } else { ff = new TextIndexPoints(); @@ -587,7 +588,7 @@ public class StyledTextComp extends Composite { public void replaceText(TextIndexPoints tip, String text) { replaceText(tip, text, false); } - + /** * Replacement of the text in the given range with new text. * @@ -608,8 +609,7 @@ public class StyledTextComp extends Composite { // only reparse if we replaced with different length text or forced // else, replace StyleRanges since the operation is safe - if ((tip.getText().length() != text.length()) - || forceReparse) { + if ((tip.getText().length() != text.length()) || forceReparse) { dirty = true; } else { for (StyleRange range : ranges) { @@ -635,7 +635,7 @@ public class StyledTextComp extends Composite { try { startUpdate(); ListsegMap = pds - .getSegmentsArray() - .get(i).getSementMap(); + .getSegmentsArray().get(i).getSementMap(); TextIndexPoints tip = segMap.get("purgeT"); if (tip != null) { @@ -2046,10 +2044,10 @@ public class ProductEditorComp extends Composite implements // vtecs are fixed length and this is variable length, // which ensures we only need to reParse() once per // segment - List zones = decodeUGCs(pds.getSegmentsArray().get(i)); + List zones = decodeUGCs(pds.getSegmentsArray() + .get(i)); List timeZones = dm.getTextProductMgr() - .getTimeZones(zones, - officeTimeZone); + .getTimeZones(zones, officeTimeZone); StringBuilder sb = new StringBuilder(); for (String tz : timeZones) { @@ -2254,18 +2252,18 @@ public class ProductEditorComp extends Composite implements * Save the current text in the product editor to a file. */ private void saveFile() { - + String fname = null; - if ( productDefinition.get("outputFile") != null ) { - fname = getDefString("outputFile"); - if ( fname.equals(EMPTY) ) { + if (productDefinition.get("outputFile") != null) { + fname = getDefString("outputFile"); + if (fname.equals(EMPTY)) { return; } } else { return; } fname = fixfname(fname); - + FileDialog fd = new FileDialog(parent.getShell(), SWT.SAVE); fd.setText("Save As"); String filePath = (new File(fname)).getParentFile().getPath(); diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/SegmentData.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/SegmentData.java index c9098d37b4..00b53cd973 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/SegmentData.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/SegmentData.java @@ -37,7 +37,7 @@ import java.util.HashMap; * */ public class SegmentData { - + /** * Segment map. */ @@ -58,8 +58,11 @@ public class SegmentData { /** * Add entry into the segment map. - * @param key Map key. - * @param tip Text index point data. + * + * @param key + * Map key. + * @param tip + * Text index point data. */ public void addToSegmentMap(String key, TextIndexPoints tip) { segMap.put(key, tip); @@ -67,8 +70,11 @@ public class SegmentData { /** * Add entry into the head info map. - * @param key Map key. - * @param tip Text index point data. + * + * @param key + * Map key. + * @param tip + * Text index point data. */ public void addToHeadInfoMap(String key, TextIndexPoints tip) { headInfoMap.put(key, tip); @@ -76,7 +82,9 @@ public class SegmentData { /** * Get a text index point data from the segment map. - * @param key Map key. + * + * @param key + * Map key. * @return Segment text index point data. */ public TextIndexPoints getSegmentDataIndexPoints(String key) { @@ -85,7 +93,9 @@ public class SegmentData { /** * Get a text index point data from the head info map. - * @param key Map key. + * + * @param key + * Map key. * @return Segment text index point data. */ public TextIndexPoints getHeadInfoDataIndexPoints(String key) { @@ -94,6 +104,7 @@ public class SegmentData { /** * Get the segment map. + * * @return The segment map. */ public HashMap getSementMap() { @@ -102,6 +113,7 @@ public class SegmentData { /** * Get the head info map. + * * @return The head info map. */ public HashMap getHeadInfoMap() { diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/StoreTransmitCountdownThread.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/StoreTransmitCountdownThread.java index 043fea20c7..dcc53eaace 100755 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/StoreTransmitCountdownThread.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/StoreTransmitCountdownThread.java @@ -36,7 +36,7 @@ import com.raytheon.viz.gfe.core.DataManager; * ------------ ---------- ----------- -------------------------- * 18 APR 2008 ### lvenable Initial creation * 20 AUG 2010 4687 cjeanbap "null" showed up in - * countdown message. + * countdown message. * *