VLab Issue #4003 - Mostly PGEN bug fixes
minor updates to nsharp, lat/lon overlay, ntrans, and plotdata resource Change-Id: I2a1718ed7674edb786bceec13bcb20c29cc5d616 Former-commit-id: 8bdc663629050457b23d06c19bd7a925597c1288
This commit is contained in:
parent
f87cc6e7fb
commit
57393984d3
37 changed files with 7515 additions and 6910 deletions
|
@ -47,7 +47,7 @@ import java.util.Set;
|
||||||
* 17-May-2011 M. Li Created a parseCINT to simplify CINT parsing.
|
* 17-May-2011 M. Li Created a parseCINT to simplify CINT parsing.
|
||||||
* 07-Apr-2014 TTR-938 D.Sushon Added check for null string to constructor, fixing NullPointerException
|
* 07-Apr-2014 TTR-938 D.Sushon Added check for null string to constructor, fixing NullPointerException
|
||||||
* thrown when attempting to initialize with null String.
|
* thrown when attempting to initialize with null String.
|
||||||
*
|
* 09-Sep-2014 TTR-852 A.Yuk remove restriction of contour lines =50 and make it unlimited contour lines.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -397,11 +397,12 @@ public class CINT {
|
||||||
interval = (cmax - cmin) / 10.0;
|
interval = (cmax - cmin) / 10.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only allow less than 50 contour levels
|
// Only allow less than 50 contour levels :
|
||||||
if ((cmax - cmin) / interval > 50)
|
// comment out contour restriction. : IT WAs BAD Code to generate decimal point on contour labels.
|
||||||
|
/* if ((cmax - cmin) / interval > 50) {
|
||||||
interval = (cmax - cmin) / 50;
|
interval = (cmax - cmin) / 50;
|
||||||
|
interval =(double) (int) ((cmax - cmin)/50) ; }
|
||||||
// System.out.println(" cmax=="+cmax);
|
*/
|
||||||
contourInfo = new CINT(interval.toString() + "/"
|
contourInfo = new CINT(interval.toString() + "/"
|
||||||
+ cmin.toString() + "/" + cmax.toString());
|
+ cmin.toString() + "/" + cmax.toString());
|
||||||
cvalues = contourInfo
|
cvalues = contourInfo
|
||||||
|
@ -409,6 +410,29 @@ public class CINT {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/********************************
|
||||||
|
int csize=cvalues.size();
|
||||||
|
System.out.println(" .................");
|
||||||
|
System.out.println(" .................");
|
||||||
|
System.out.println(" Contour level range is from "+cvalues.get(0)+" to "+cvalues.get(csize-1)+".");
|
||||||
|
System.out.println(" Contour interval "+interval+".");
|
||||||
|
System.out.println(" .................");
|
||||||
|
System.out.println(" .................");
|
||||||
|
// * capped contour lines to 50
|
||||||
|
if (csize > 50) {
|
||||||
|
System.out.println(" !!! Pay attention to CONTOUR INTERVAL.");
|
||||||
|
System.out.println(" Contour lines from "+cvalues.get(0)+" to "+cvalues.get(csize-1)+" are eliminated due to maximum contour allowance." );
|
||||||
|
while (cvalues.size()>50){cvalues.remove(50);}
|
||||||
|
System.out.println(" !!! Contours are being plotted to the first 50th lines.");
|
||||||
|
System.out.println(" Range of contour lines drawn is from "+cvalues.get(0)+" to "+cvalues.get(49)+".");
|
||||||
|
System.out.println(" !!! Contour lines are capped due to allowance of maximum contour lines of 50. ");
|
||||||
|
}
|
||||||
|
System.out.println(" Contour level = "+cvalues.toString()+".");
|
||||||
|
***************************/
|
||||||
|
while (cvalues.size()>50){cvalues.remove(50);}
|
||||||
|
int csize=cvalues.size();
|
||||||
|
System.out.println(" Contour lines("+csize+ ") from "+cvalues.get(0)+" to "+cvalues.get(csize-1));
|
||||||
|
|
||||||
return cvalues;
|
return cvalues;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -652,3 +676,4 @@ public class CINT {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1940,9 +1940,10 @@ public class NsharpResourceHandler {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!fromArchive) {
|
if (!fromArchive) {
|
||||||
// start FixMark:nearByStnCompSnd d2dlite
|
// For those sounding report with forecast time, e.g. model/pfc sounding
|
||||||
if (!(sndType.contentEquals("NCUAIR") || sndType
|
if (timeLine.contains("V")) { //fix D2D loading issue. 10/8/2014
|
||||||
.contentEquals("BUFRUA"))) {
|
// if (!(sndType.contentEquals("NCUAIR") || sndType
|
||||||
|
// .contentEquals("BUFRUA"))) {
|
||||||
// Chin's NOTE:
|
// Chin's NOTE:
|
||||||
// Can Not use reference time directly from the stnInfo,
|
// Can Not use reference time directly from the stnInfo,
|
||||||
// Timestamp refTime = stnInfo.getReftime()
|
// Timestamp refTime = stnInfo.getReftime()
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* 01/08/2014 Chin Chen Only initializing inventory when in NCP
|
* 01/08/2014 Chin Chen Only initializing inventory when in NCP
|
||||||
* 01/13/2014 Chin Chen TTR829- when interpolation, edit graph is allowed
|
* 01/13/2014 Chin Chen TTR829- when interpolation, edit graph is allowed
|
||||||
* 01/22/2014 Chin Chen DR17003 issue: NSHARP sounding display throws errors when swapping into main pane when show text is turned on.
|
* 01/22/2014 Chin Chen DR17003 issue: NSHARP sounding display throws errors when swapping into main pane when show text is turned on.
|
||||||
*
|
* 10/20/2014 Chin Chen DR16864, D2D does not use unload button. Check to make sure not D2D instance before access unload button.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author Chin Chen
|
* @author Chin Chen
|
||||||
|
@ -150,7 +150,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
||||||
|
|
||||||
private boolean spcGpCreated = false;
|
private boolean spcGpCreated = false;
|
||||||
|
|
||||||
private boolean awcGpCreated = false;
|
private boolean imD2d = false; // fixMark:NcInventory
|
||||||
|
|
||||||
public static NsharpPaletteWindow getInstance() {
|
public static NsharpPaletteWindow getInstance() {
|
||||||
if (VizPerspectiveListener.getCurrentPerspectiveManager() != null) {
|
if (VizPerspectiveListener.getCurrentPerspectiveManager() != null) {
|
||||||
|
@ -220,6 +220,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
||||||
interpBtn.setEnabled(false);
|
interpBtn.setEnabled(false);
|
||||||
graphModeBtnIcing.setEnabled(false);
|
graphModeBtnIcing.setEnabled(false);
|
||||||
graphModeBtnTurb.setEnabled(false);
|
graphModeBtnTurb.setEnabled(false);
|
||||||
|
if (!imD2d)
|
||||||
unloadBtn.setEnabled(false); // FixMark:nearByStnCompSnd
|
unloadBtn.setEnabled(false); // FixMark:nearByStnCompSnd
|
||||||
} else if (compareStnIsOn) {
|
} else if (compareStnIsOn) {
|
||||||
compareStnBtn.setText(COMP_STN_ON);
|
compareStnBtn.setText(COMP_STN_ON);
|
||||||
|
@ -231,6 +232,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
||||||
interpBtn.setEnabled(false);
|
interpBtn.setEnabled(false);
|
||||||
graphModeBtnIcing.setEnabled(false);
|
graphModeBtnIcing.setEnabled(false);
|
||||||
graphModeBtnTurb.setEnabled(false);
|
graphModeBtnTurb.setEnabled(false);
|
||||||
|
if (!imD2d)
|
||||||
unloadBtn.setEnabled(false); // FixMark:nearByStnCompSnd
|
unloadBtn.setEnabled(false); // FixMark:nearByStnCompSnd
|
||||||
} else if (compareSndIsOn) {
|
} else if (compareSndIsOn) {
|
||||||
compareSndBtn.setText(COMP_SND_ON);
|
compareSndBtn.setText(COMP_SND_ON);
|
||||||
|
@ -242,6 +244,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
||||||
interpBtn.setEnabled(false);
|
interpBtn.setEnabled(false);
|
||||||
graphModeBtnIcing.setEnabled(false);
|
graphModeBtnIcing.setEnabled(false);
|
||||||
graphModeBtnTurb.setEnabled(false);
|
graphModeBtnTurb.setEnabled(false);
|
||||||
|
if (!imD2d)
|
||||||
unloadBtn.setEnabled(false); // FixMark:nearByStnCompSnd
|
unloadBtn.setEnabled(false); // FixMark:nearByStnCompSnd
|
||||||
} else if (compareTmIsOn) {
|
} else if (compareTmIsOn) {
|
||||||
compareTmBtn.setText(COMP_TM_ON);
|
compareTmBtn.setText(COMP_TM_ON);
|
||||||
|
@ -253,6 +256,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
||||||
interpBtn.setEnabled(false);
|
interpBtn.setEnabled(false);
|
||||||
graphModeBtnIcing.setEnabled(false);
|
graphModeBtnIcing.setEnabled(false);
|
||||||
graphModeBtnTurb.setEnabled(false);
|
graphModeBtnTurb.setEnabled(false);
|
||||||
|
if (!imD2d)
|
||||||
unloadBtn.setEnabled(false); // FixMark:nearByStnCompSnd
|
unloadBtn.setEnabled(false); // FixMark:nearByStnCompSnd
|
||||||
} else if (editGraphOn) {
|
} else if (editGraphOn) {
|
||||||
graphEditBtn.setText(EDIT_GRAPH_ON);
|
graphEditBtn.setText(EDIT_GRAPH_ON);
|
||||||
|
@ -264,6 +268,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
||||||
interpBtn.setEnabled(false);
|
interpBtn.setEnabled(false);
|
||||||
graphModeBtnIcing.setEnabled(false);
|
graphModeBtnIcing.setEnabled(false);
|
||||||
graphModeBtnTurb.setEnabled(false);
|
graphModeBtnTurb.setEnabled(false);
|
||||||
|
if (!imD2d)
|
||||||
unloadBtn.setEnabled(false); // FixMark:nearByStnCompSnd
|
unloadBtn.setEnabled(false); // FixMark:nearByStnCompSnd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -377,7 +382,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
||||||
public NsharpPaletteWindow() {
|
public NsharpPaletteWindow() {
|
||||||
super();
|
super();
|
||||||
instance = this;
|
instance = this;
|
||||||
boolean imD2d = false; // fixMark:NcInventory
|
//boolean imD2d = false; // fixMark:NcInventory
|
||||||
if (VizPerspectiveListener.getCurrentPerspectiveManager() != null) {
|
if (VizPerspectiveListener.getCurrentPerspectiveManager() != null) {
|
||||||
if (VizPerspectiveListener.getCurrentPerspectiveManager()
|
if (VizPerspectiveListener.getCurrentPerspectiveManager()
|
||||||
.getPerspectiveId().equals(D2D5Pane.ID_PERSPECTIVE)) {
|
.getPerspectiveId().equals(D2D5Pane.ID_PERSPECTIVE)) {
|
||||||
|
@ -945,6 +950,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
||||||
graphModeBtnIcing.setEnabled(false);
|
graphModeBtnIcing.setEnabled(false);
|
||||||
interpBtn.setEnabled(false);
|
interpBtn.setEnabled(false);
|
||||||
cfgBtn.setEnabled(false);
|
cfgBtn.setEnabled(false);
|
||||||
|
if (!imD2d)
|
||||||
unloadBtn.setEnabled(false);// FixMark:nearByStnCompSnd
|
unloadBtn.setEnabled(false);// FixMark:nearByStnCompSnd
|
||||||
} else {
|
} else {
|
||||||
overlayIsOn = false;
|
overlayIsOn = false;
|
||||||
|
@ -958,6 +964,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
||||||
graphModeBtnIcing.setEnabled(true);
|
graphModeBtnIcing.setEnabled(true);
|
||||||
interpBtn.setEnabled(true);
|
interpBtn.setEnabled(true);
|
||||||
cfgBtn.setEnabled(true);
|
cfgBtn.setEnabled(true);
|
||||||
|
if (!imD2d)
|
||||||
unloadBtn.setEnabled(true);// FixMark:nearByStnCompSnd
|
unloadBtn.setEnabled(true);// FixMark:nearByStnCompSnd
|
||||||
}
|
}
|
||||||
NsharpResourceHandler rsc = getRscHandler();
|
NsharpResourceHandler rsc = getRscHandler();
|
||||||
|
@ -1001,6 +1008,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
||||||
graphModeBtnIcing.setEnabled(false);
|
graphModeBtnIcing.setEnabled(false);
|
||||||
interpBtn.setEnabled(false);
|
interpBtn.setEnabled(false);
|
||||||
cfgBtn.setEnabled(false);
|
cfgBtn.setEnabled(false);
|
||||||
|
if (!imD2d)
|
||||||
unloadBtn.setEnabled(false);// FixMark:nearByStnCompSnd
|
unloadBtn.setEnabled(false);// FixMark:nearByStnCompSnd
|
||||||
} else {
|
} else {
|
||||||
compareStnIsOn = false;
|
compareStnIsOn = false;
|
||||||
|
@ -1014,6 +1022,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
||||||
graphModeBtnIcing.setEnabled(true);
|
graphModeBtnIcing.setEnabled(true);
|
||||||
interpBtn.setEnabled(true);
|
interpBtn.setEnabled(true);
|
||||||
cfgBtn.setEnabled(true);
|
cfgBtn.setEnabled(true);
|
||||||
|
if (!imD2d)
|
||||||
unloadBtn.setEnabled(true);// FixMark:nearByStnCompSnd
|
unloadBtn.setEnabled(true);// FixMark:nearByStnCompSnd
|
||||||
}
|
}
|
||||||
NsharpResourceHandler rsc = getRscHandler();
|
NsharpResourceHandler rsc = getRscHandler();
|
||||||
|
@ -1059,6 +1068,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
||||||
graphModeBtnIcing.setEnabled(false);
|
graphModeBtnIcing.setEnabled(false);
|
||||||
interpBtn.setEnabled(false);
|
interpBtn.setEnabled(false);
|
||||||
cfgBtn.setEnabled(false);
|
cfgBtn.setEnabled(false);
|
||||||
|
if (!imD2d)
|
||||||
unloadBtn.setEnabled(false);// FixMark:nearByStnCompSnd
|
unloadBtn.setEnabled(false);// FixMark:nearByStnCompSnd
|
||||||
} else {
|
} else {
|
||||||
compareTmIsOn = false;
|
compareTmIsOn = false;
|
||||||
|
@ -1072,6 +1082,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
||||||
graphModeBtnIcing.setEnabled(true);
|
graphModeBtnIcing.setEnabled(true);
|
||||||
interpBtn.setEnabled(true);
|
interpBtn.setEnabled(true);
|
||||||
cfgBtn.setEnabled(true);
|
cfgBtn.setEnabled(true);
|
||||||
|
if (!imD2d)
|
||||||
unloadBtn.setEnabled(true);// FixMark:nearByStnCompSnd
|
unloadBtn.setEnabled(true);// FixMark:nearByStnCompSnd
|
||||||
}
|
}
|
||||||
NsharpResourceHandler rsc = getRscHandler();
|
NsharpResourceHandler rsc = getRscHandler();
|
||||||
|
@ -1115,6 +1126,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
||||||
graphModeBtnIcing.setEnabled(false);
|
graphModeBtnIcing.setEnabled(false);
|
||||||
interpBtn.setEnabled(false);
|
interpBtn.setEnabled(false);
|
||||||
cfgBtn.setEnabled(false);
|
cfgBtn.setEnabled(false);
|
||||||
|
if (!imD2d)
|
||||||
unloadBtn.setEnabled(false);// FixMark:nearByStnCompSnd
|
unloadBtn.setEnabled(false);// FixMark:nearByStnCompSnd
|
||||||
} else {
|
} else {
|
||||||
compareSndIsOn = false;
|
compareSndIsOn = false;
|
||||||
|
@ -1128,6 +1140,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
||||||
graphModeBtnIcing.setEnabled(true);
|
graphModeBtnIcing.setEnabled(true);
|
||||||
interpBtn.setEnabled(true);
|
interpBtn.setEnabled(true);
|
||||||
cfgBtn.setEnabled(true);
|
cfgBtn.setEnabled(true);
|
||||||
|
if (!imD2d)
|
||||||
unloadBtn.setEnabled(true);// FixMark:nearByStnCompSnd
|
unloadBtn.setEnabled(true);// FixMark:nearByStnCompSnd
|
||||||
}
|
}
|
||||||
NsharpResourceHandler rsc = getRscHandler();
|
NsharpResourceHandler rsc = getRscHandler();
|
||||||
|
@ -1187,6 +1200,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
||||||
compareSndBtn.setEnabled(true);
|
compareSndBtn.setEnabled(true);
|
||||||
compareStnBtn.setEnabled(true);
|
compareStnBtn.setEnabled(true);
|
||||||
overlayBtn.setEnabled(true);
|
overlayBtn.setEnabled(true);
|
||||||
|
if (!imD2d)
|
||||||
unloadBtn.setEnabled(true);// FixMark:nearByStnCompSnd
|
unloadBtn.setEnabled(true);// FixMark:nearByStnCompSnd
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -1200,6 +1214,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
||||||
compareSndBtn.setEnabled(false);
|
compareSndBtn.setEnabled(false);
|
||||||
compareStnBtn.setEnabled(false);
|
compareStnBtn.setEnabled(false);
|
||||||
overlayBtn.setEnabled(false);
|
overlayBtn.setEnabled(false);
|
||||||
|
if (!imD2d)
|
||||||
unloadBtn.setEnabled(false);// FixMark:nearByStnCompSnd
|
unloadBtn.setEnabled(false);// FixMark:nearByStnCompSnd
|
||||||
}
|
}
|
||||||
NsharpResourceHandler rsc = getRscHandler();
|
NsharpResourceHandler rsc = getRscHandler();
|
||||||
|
|
|
@ -840,7 +840,7 @@
|
||||||
<Color red="255" green="255" blue="0" alpha="255"/>
|
<Color red="255" green="255" blue="0" alpha="255"/>
|
||||||
<Point Lat="39.35390746604257" Lon="-73.2133975036754"/>
|
<Point Lat="39.35390746604257" Lon="-73.2133975036754"/>
|
||||||
</Vector>
|
</Vector>
|
||||||
<Track skipFactorTextString="0" setTimeButtonSelected="true" pgenType="STORM_TRACK" pgenCategory="Track" lineWidth="1.0" intervalTimeTextString="01:00" intervalComboSelectedIndex="2" initialMarker="FILLED_DIAMOND" initialLinePattern="LINE_SOLID" fontStyleComboSelectedIndex="2" fontSizeComboSelectedIndex="2" fontSize="14.0" fontNameComboSelectedIndex="0" fontName="Courier" extrapMarker="FILLED_TRIANGLE" extrapLinePattern="LINE_SOLID" extraPointTimeDisplayOptionName="SKIP_FACTOR">
|
<Track skipFactorTextString="0" setTimeButtonSelected="true" pgenType="STORM_TRACK" pgenCategory="Track" lineWidth="1.0" intervalTimeTextString="00:30" intervalComboSelectedIndex="2" initialMarker="FILLED_DIAMOND" initialLinePattern="LINE_SOLID" fontStyleComboSelectedIndex="1" fontStyle="BOLD" fontSizeComboSelectedIndex="2" fontSize="14.0" fontNameComboSelectedIndex="0" fontName="Courier" extrapMarker="FILLED_TRIANGLE" extrapLinePattern="LINE_SOLID" extraPointTimeDisplayOptionName="SKIP_FACTOR">
|
||||||
<initialColor>
|
<initialColor>
|
||||||
<Color red="255" green="0" blue="0" alpha="255"/>
|
<Color red="255" green="0" blue="0" alpha="255"/>
|
||||||
</initialColor>
|
</initialColor>
|
||||||
|
|
|
@ -803,7 +803,7 @@
|
||||||
<Color red="255" green="255" blue="0" alpha="255"/>
|
<Color red="255" green="255" blue="0" alpha="255"/>
|
||||||
<Point Lat="39.35390746604257" Lon="-73.2133975036754"/>
|
<Point Lat="39.35390746604257" Lon="-73.2133975036754"/>
|
||||||
</Vector>
|
</Vector>
|
||||||
<Track skipFactorTextString="0" setTimeButtonSelected="true" pgenType="STORM_TRACK" pgenCategory="Track" lineWidth="1.0" intervalTimeTextString="01:00" intervalComboSelectedIndex="2" initialMarker="FILLED_DIAMOND" initialLinePattern="LINE_SOLID" fontStyleComboSelectedIndex="2" fontSizeComboSelectedIndex="2" fontSize="14.0" fontNameComboSelectedIndex="0" fontName="Courier" extrapMarker="FILLED_TRIANGLE" extrapLinePattern="LINE_SOLID" extraPointTimeDisplayOptionName="SKIP_FACTOR">
|
<Track skipFactorTextString="0" setTimeButtonSelected="true" pgenType="STORM_TRACK" pgenCategory="Track" lineWidth="1.0" intervalTimeTextString="00:30" intervalComboSelectedIndex="2" initialMarker="FILLED_DIAMOND" initialLinePattern="LINE_SOLID" fontStyleComboSelectedIndex="1" fontStyle="BOLD" fontSizeComboSelectedIndex="2" fontSize="14.0" fontNameComboSelectedIndex="0" fontName="Courier" extrapMarker="FILLED_TRIANGLE" extrapLinePattern="LINE_SOLID" extraPointTimeDisplayOptionName="SKIP_FACTOR">
|
||||||
<initialColor>
|
<initialColor>
|
||||||
<Color red="255" green="0" blue="0" alpha="255"/>
|
<Color red="255" green="0" blue="0" alpha="255"/>
|
||||||
</initialColor>
|
</initialColor>
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
E. Safford/SAIC 06/07 rm "...UPDT TO CANCEL..."
|
E. Safford/SAIC 06/07 rm "...UPDT TO CANCEL..."
|
||||||
B. Yin/SAIC 02/08 add tag number after cancellation
|
B. Yin/SAIC 02/08 add tag number after cancellation
|
||||||
B. Yin 12/11 added new line for 'New' or 'Cor'
|
B. Yin 12/11 added new line for 'New' or 'Cor'
|
||||||
|
J. Wu 09/14 added new line for 'CAN'
|
||||||
-->
|
-->
|
||||||
<xsl:template name="GetAttentionLine">
|
<xsl:template name="GetAttentionLine">
|
||||||
<xsl:param name="status"></xsl:param>
|
<xsl:param name="status"></xsl:param>
|
||||||
|
@ -30,9 +31,11 @@
|
||||||
|
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="contains( $airmet_outlook, 'AIRMET')">
|
<xsl:when test="contains( $airmet_outlook, 'AIRMET')">
|
||||||
|
<xsl:value-of select="$newline"/>
|
||||||
<xsl:text>CANCEL AIRMET. CONDS HV ENDED.</xsl:text>
|
<xsl:text>CANCEL AIRMET. CONDS HV ENDED.</xsl:text>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
|
<xsl:value-of select="$newline"/>
|
||||||
<xsl:text>CANCEL OUTLOOK.</xsl:text>
|
<xsl:text>CANCEL OUTLOOK.</xsl:text>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
|
|
|
@ -20,6 +20,9 @@
|
||||||
B. Yin/SAIC 08/06 distinguish smear and outlook
|
B. Yin/SAIC 08/06 distinguish smear and outlook
|
||||||
B. Yin/Chugach 12/11 changed 'Status' to 'issueType'
|
B. Yin/Chugach 12/11 changed 'Status' to 'issueType'
|
||||||
changed for-each condition for smears
|
changed for-each condition for smears
|
||||||
|
J. Wu/SGT 10/14 TTR 714 - go through all smears (airmets & outlooks) in
|
||||||
|
one loop since the input XML format is different from
|
||||||
|
those in NMAP2
|
||||||
|
|
||||||
-->
|
-->
|
||||||
<xsl:template name="GetStatus">
|
<xsl:template name="GetStatus">
|
||||||
|
@ -27,8 +30,9 @@
|
||||||
<xsl:param name="haz2">NO HAZARD2</xsl:param>
|
<xsl:param name="haz2">NO HAZARD2</xsl:param>
|
||||||
<xsl:param name="haz3">NO HAZARD3</xsl:param>
|
<xsl:param name="haz3">NO HAZARD3</xsl:param>
|
||||||
|
|
||||||
<xsl:for-each select="//Gfa[(@hazard = $haz1 or @hazard = $haz2 or @hazard = $haz3) and contains(@fcstHr,'-') and @isOutlook='false']">
|
<!-- <xsl:for-each select="//Gfa[(@hazard = $haz1 or @hazard = $haz2 or @hazard = $haz3) and contains(@fcstHr,'-') and @isOutlook='false']">
|
||||||
|
-->
|
||||||
|
<xsl:for-each select="//Gfa[(@hazard = $haz1 or @hazard = $haz2 or @hazard = $haz3) and contains(@fcstHr,'-') ]">
|
||||||
<xsl:if test="contains( @hazard, $haz1 ) or contains( @hazard, $haz2 ) or contains( @hazard, $haz3 )">
|
<xsl:if test="contains( @hazard, $haz1 ) or contains( @hazard, $haz2 ) or contains( @hazard, $haz3 )">
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="@issueType = 'CAN'">
|
<xsl:when test="@issueType = 'CAN'">
|
||||||
|
@ -47,6 +51,7 @@
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
|
|
||||||
|
<!--
|
||||||
<xsl:for-each select="//outlook">
|
<xsl:for-each select="//outlook">
|
||||||
<xsl:if test="contains( hazard, $haz1 ) or contains( hazard, $haz2 ) or contains( hazard, $haz3 )">
|
<xsl:if test="contains( hazard, $haz1 ) or contains( hazard, $haz2 ) or contains( hazard, $haz3 )">
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
|
@ -65,7 +70,7 @@
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
|
-->
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|
|
@ -141,15 +141,14 @@
|
||||||
</xsl:element>
|
</xsl:element>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
|
|
||||||
<xsl:if test="contains( @issueType, 'CAN' ) or not(string-length($freqSevStatement) > 1)">
|
<!-- <xsl:if test="contains( @issueType, 'CAN' ) or not(string-length($freqSevStatement) > 1)">
|
||||||
<xsl:value-of select="$newline"/>
|
<xsl:value-of select="$newline"/>
|
||||||
<!-- <xsl:if test="string-length($airTag) > 1">
|
<xsl:if test="string-length($airTag) > 1">
|
||||||
<xsl:element name="line">
|
<xsl:element name="line">
|
||||||
<xsl:value-of select="$newline"/><xsl:value-of select="normalize-space($airTag)"/>.</xsl:element>
|
<xsl:value-of select="$newline"/><xsl:value-of select="normalize-space($airTag)"/>.</xsl:element>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
-->
|
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
|
-->
|
||||||
<!-- Add the attention line(s) -->
|
<!-- Add the attention line(s) -->
|
||||||
<xsl:call-template name="GetAttentionLine">
|
<xsl:call-template name="GetAttentionLine">
|
||||||
<xsl:with-param name="status"><xsl:value-of select="@issueType"/></xsl:with-param>
|
<xsl:with-param name="status"><xsl:value-of select="@issueType"/></xsl:with-param>
|
||||||
|
|
|
@ -78,6 +78,7 @@ public abstract class AttrDlg extends Dialog implements IAttribute {
|
||||||
public static int ctrlBtnHeight = 28;
|
public static int ctrlBtnHeight = 28;
|
||||||
|
|
||||||
// public static int ctrlBtnWidth = 90;
|
// public static int ctrlBtnWidth = 90;
|
||||||
|
|
||||||
// public static int ctrlBtnHeight = 30;
|
// public static int ctrlBtnHeight = 30;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -128,11 +129,24 @@ public abstract class AttrDlg extends Dialog implements IAttribute {
|
||||||
this.getButton(IDialogConstants.CANCEL_ID).setEnabled(false);
|
this.getButton(IDialogConstants.CANCEL_ID).setEnabled(false);
|
||||||
this.getButton(IDialogConstants.OK_ID).setEnabled(false);
|
this.getButton(IDialogConstants.OK_ID).setEnabled(false);
|
||||||
|
|
||||||
this.getButton(IDialogConstants.CANCEL_ID).setLayoutData(
|
setDefaultControlButtonSize();
|
||||||
new GridData(ctrlBtnWidth, ctrlBtnHeight));
|
}
|
||||||
this.getButton(IDialogConstants.OK_ID).setLayoutData(
|
|
||||||
new GridData(ctrlBtnWidth, ctrlBtnHeight));
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set default size for control buttons.
|
||||||
|
*/
|
||||||
|
public void setDefaultControlButtonSize() {
|
||||||
|
setButtonSize(ctrlBtnWidth, ctrlBtnHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set size for control buttons.
|
||||||
|
*/
|
||||||
|
public void setButtonSize(int width, int height) {
|
||||||
|
this.getButton(IDialogConstants.CANCEL_ID).setLayoutData(
|
||||||
|
new GridData(width, height));
|
||||||
|
this.getButton(IDialogConstants.OK_ID).setLayoutData(
|
||||||
|
new GridData(width, height));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -3169,6 +3169,10 @@ public class ContoursAttrDlg extends AttrDlg implements IContours,
|
||||||
|
|
||||||
private PgenContoursTool tool = null;
|
private PgenContoursTool tool = null;
|
||||||
|
|
||||||
|
private Contours prevCont = null;
|
||||||
|
|
||||||
|
private Contours nowCont = null;
|
||||||
|
|
||||||
private ContourMinmaxAttrDlg(Shell parShell) throws VizException {
|
private ContourMinmaxAttrDlg(Shell parShell) throws VizException {
|
||||||
|
|
||||||
super(parShell);
|
super(parShell);
|
||||||
|
@ -3238,11 +3242,54 @@ public class ContoursAttrDlg extends AttrDlg implements IContours,
|
||||||
if (apt instanceof PgenContoursTool) {
|
if (apt instanceof PgenContoursTool) {
|
||||||
tool = (PgenContoursTool) apt;
|
tool = (PgenContoursTool) apt;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tool != null) {
|
if (tool != null) {
|
||||||
tool.resetUndoRedoCount();
|
tool.resetUndoRedoCount();
|
||||||
PgenSession.getInstance().getCommandManager()
|
PgenSession.getInstance().getCommandManager()
|
||||||
.addStackListener(tool);
|
.addStackListener(tool);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set the lat/lon from the current symbol.
|
||||||
|
DrawableElement de = drawingLayer.getSelectedDE();
|
||||||
|
if (de != null && de.getParent() instanceof ContourMinmax
|
||||||
|
&& de instanceof Symbol) {
|
||||||
|
super.setLatitude(((Symbol) de).getLocation().y);
|
||||||
|
super.setLongitude(((Symbol) de).getLocation().x);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Reset the listenser.
|
||||||
|
*/
|
||||||
|
for (Listener ls : undoBtn.getListeners(SWT.MouseDown)) {
|
||||||
|
undoBtn.removeListener(SWT.MouseDown, ls);
|
||||||
|
}
|
||||||
|
|
||||||
|
undoBtn.addListener(SWT.MouseDown, new Listener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleEvent(Event event) {
|
||||||
|
|
||||||
|
if (undoBtn.getText().equalsIgnoreCase(UNDO_SYMBOL)) {
|
||||||
|
undoBtn.setText(REDO_SYMBOL);
|
||||||
|
drawingLayer.getCommandMgr().undo();
|
||||||
|
|
||||||
|
} else if (undoBtn.getText().equalsIgnoreCase(REDO_SYMBOL)) {
|
||||||
|
undoBtn.setText(UNDO_SYMBOL);
|
||||||
|
drawingLayer.getCommandMgr().redo();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Reset the currentContours for the ContoursAttrDlg.
|
||||||
|
*/
|
||||||
|
currentContours = prevCont;
|
||||||
|
prevCont = nowCont;
|
||||||
|
nowCont = currentContours;
|
||||||
|
|
||||||
|
mapEditor.refresh();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -3252,6 +3299,10 @@ public class ContoursAttrDlg extends AttrDlg implements IContours,
|
||||||
PgenSession.getInstance().getCommandManager()
|
PgenSession.getInstance().getCommandManager()
|
||||||
.removeStackListener(tool);
|
.removeStackListener(tool);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
prevCont = null;
|
||||||
|
nowCont = null;
|
||||||
|
|
||||||
return super.close();
|
return super.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3262,15 +3313,34 @@ public class ContoursAttrDlg extends AttrDlg implements IContours,
|
||||||
protected void placeSymbol() {
|
protected void placeSymbol() {
|
||||||
|
|
||||||
if (tool != null) {
|
if (tool != null) {
|
||||||
|
if (tool.getMouseHandler() instanceof PgenContoursHandler) {
|
||||||
|
/*
|
||||||
|
* Keep a copy of currentConoturs for "Undo". It chnages
|
||||||
|
* after call the "tool".
|
||||||
|
*/
|
||||||
|
prevCont = currentContours;
|
||||||
((PgenContoursHandler) tool.getMouseHandler())
|
((PgenContoursHandler) tool.getMouseHandler())
|
||||||
.drawContourMinmax(new Coordinate(Double
|
.drawContourMinmax(new Coordinate(Double
|
||||||
.parseDouble(longitudeText.getText()), Double
|
.parseDouble(longitudeText.getText()),
|
||||||
.parseDouble(latitudeText.getText())));
|
Double.parseDouble(latitudeText.getText())));
|
||||||
placeBtn.setEnabled(false);
|
placeBtn.setEnabled(false);
|
||||||
|
nowCont = currentContours; // Keep a copy for "Redo"
|
||||||
undoBtn.setEnabled(true);
|
undoBtn.setEnabled(true);
|
||||||
undoBtn.setText("Undo Symbol");
|
undoBtn.setText("Undo Symbol");
|
||||||
|
|
||||||
|
} else if (tool.getMouseHandler() instanceof PgenSelectHandler) {
|
||||||
|
minmaxTemplate = (gov.noaa.nws.ncep.ui.pgen.elements.Symbol) new DrawableElementFactory()
|
||||||
|
.create(DrawableType.SYMBOL, (IAttribute) this,
|
||||||
|
"Symbol", getActiveSymbolObjType(),
|
||||||
|
(Coordinate) null, null);
|
||||||
|
contoursAttrSettings.put(getActiveSymbolObjType(),
|
||||||
|
minmaxTemplate);
|
||||||
|
|
||||||
|
updateMinmaxAttributes();
|
||||||
|
|
||||||
|
placeBtn.setEnabled(false);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3330,7 +3400,34 @@ public class ContoursAttrDlg extends AttrDlg implements IContours,
|
||||||
|
|
||||||
if (newEl != null && oldAdc.equals(de.getParent())) {
|
if (newEl != null && oldAdc.equals(de.getParent())) {
|
||||||
newEl.setParent(newAdc);
|
newEl.setParent(newAdc);
|
||||||
|
|
||||||
if (newEl instanceof Symbol) {
|
if (newEl instanceof Symbol) {
|
||||||
|
|
||||||
|
if (minmaxAttrDlg != null
|
||||||
|
&& minmaxAttrDlg.getShell() != null) {
|
||||||
|
if (minmaxAttrDlg.latitudeText.isEnabled()
|
||||||
|
&& minmaxAttrDlg.longitudeText
|
||||||
|
.isEnabled()) {
|
||||||
|
ArrayList<Coordinate> loc = new ArrayList<Coordinate>();
|
||||||
|
double lat = ((Symbol) newEl).getLocation().y;
|
||||||
|
double lon = ((Symbol) newEl).getLocation().x;
|
||||||
|
try {
|
||||||
|
lon = Double
|
||||||
|
.valueOf(minmaxAttrDlg.longitudeText
|
||||||
|
.getText());
|
||||||
|
lat = Double
|
||||||
|
.valueOf(minmaxAttrDlg.latitudeText
|
||||||
|
.getText());
|
||||||
|
} catch (Exception e) {
|
||||||
|
lon = ((Symbol) newEl).getLocation().x;
|
||||||
|
lat = ((Symbol) newEl).getLocation().y;
|
||||||
|
}
|
||||||
|
|
||||||
|
loc.add(new Coordinate(lon, lat));
|
||||||
|
newEl.setPoints(loc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
((DECollection) newAdc)
|
((DECollection) newAdc)
|
||||||
.replace(((ContourMinmax) newAdc)
|
.replace(((ContourMinmax) newAdc)
|
||||||
.getSymbol(), newEl);
|
.getSymbol(), newEl);
|
||||||
|
@ -3338,6 +3435,8 @@ public class ContoursAttrDlg extends AttrDlg implements IContours,
|
||||||
|
|
||||||
((ContourMinmax) newAdc).getSymbol().update(
|
((ContourMinmax) newAdc).getSymbol().update(
|
||||||
minmaxTemplate);
|
minmaxTemplate);
|
||||||
|
|
||||||
|
((ContourMinmax) newAdc).getLabel().setAuto(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3926,4 +4025,15 @@ public class ContoursAttrDlg extends AttrDlg implements IContours,
|
||||||
return typeChanged;
|
return typeChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update lat/lon and Undo button on SymbolAttrDlg.
|
||||||
|
*/
|
||||||
|
public void updateSymbolAttrOnGUI(Coordinate loc) {
|
||||||
|
if (minmaxAttrDlg != null && minmaxAttrDlg.getShell() != null) {
|
||||||
|
minmaxAttrDlg.setLatitude(loc.y);
|
||||||
|
minmaxAttrDlg.setLongitude(loc.x);
|
||||||
|
minmaxAttrDlg.enableUndoBtn(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -68,9 +68,6 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
*/
|
*/
|
||||||
public class GfaFormatAttrDlg extends AttrDlg {
|
public class GfaFormatAttrDlg extends AttrDlg {
|
||||||
|
|
||||||
// private final static Logger logger =
|
|
||||||
// Logger.getLogger(GfaFormatAttrDlg.class);
|
|
||||||
|
|
||||||
private static final String ZULU = "ZULU";
|
private static final String ZULU = "ZULU";
|
||||||
|
|
||||||
private static final String TANGO = "TANGO";
|
private static final String TANGO = "TANGO";
|
||||||
|
@ -151,7 +148,6 @@ public class GfaFormatAttrDlg extends AttrDlg {
|
||||||
instance = new GfaFormatAttrDlg(parShell);
|
instance = new GfaFormatAttrDlg(parShell);
|
||||||
|
|
||||||
} catch (VizException e) {
|
} catch (VizException e) {
|
||||||
// logger.error(e);
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -309,9 +305,11 @@ public class GfaFormatAttrDlg extends AttrDlg {
|
||||||
super.createButtonsForButtonBar(parent);
|
super.createButtonsForButtonBar(parent);
|
||||||
this.getButton(OK_ID).setText(SAVE_LABEL);
|
this.getButton(OK_ID).setText(SAVE_LABEL);
|
||||||
this.getButton(CANCEL_ID).setText(CANCEL_LABEL);
|
this.getButton(CANCEL_ID).setText(CANCEL_LABEL);
|
||||||
|
}
|
||||||
|
|
||||||
// createButton(parent, OK_ID, SAVE_LABEL, true);
|
@Override
|
||||||
// createButton(parent, CANCEL_ID, CANCEL_LABEL, false);
|
public void setDefaultControlButtonSize() {
|
||||||
|
setButtonSize(ctrlBtnWidth + 50, ctrlBtnHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -8,39 +8,39 @@
|
||||||
|
|
||||||
package gov.noaa.nws.ncep.ui.pgen.attrdialog;
|
package gov.noaa.nws.ncep.ui.pgen.attrdialog;
|
||||||
|
|
||||||
|
import gov.noaa.nws.ncep.ui.pgen.display.FillPatternList.FillPattern;
|
||||||
|
import gov.noaa.nws.ncep.ui.pgen.display.IAttribute;
|
||||||
|
import gov.noaa.nws.ncep.ui.pgen.display.IText.FontStyle;
|
||||||
|
import gov.noaa.nws.ncep.ui.pgen.display.ITrack;
|
||||||
|
import gov.noaa.nws.ncep.ui.pgen.display.TrackPoint;
|
||||||
|
import gov.noaa.nws.ncep.ui.pgen.elements.AbstractDrawableComponent;
|
||||||
|
import gov.noaa.nws.ncep.ui.pgen.elements.Track;
|
||||||
|
import gov.noaa.nws.ncep.viz.common.ui.color.ColorButtonSelector;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.awt.Color;
|
|
||||||
|
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.widgets.Combo;
|
|
||||||
import org.eclipse.swt.widgets.Shell;
|
|
||||||
import org.eclipse.swt.widgets.Composite;
|
|
||||||
import org.eclipse.swt.widgets.Control;
|
|
||||||
import org.eclipse.swt.layout.GridData;
|
|
||||||
import org.eclipse.swt.layout.GridLayout;
|
|
||||||
import org.eclipse.swt.widgets.Label;
|
|
||||||
import org.eclipse.swt.events.ModifyEvent;
|
import org.eclipse.swt.events.ModifyEvent;
|
||||||
import org.eclipse.swt.events.ModifyListener;
|
import org.eclipse.swt.events.ModifyListener;
|
||||||
import org.eclipse.swt.events.SelectionAdapter;
|
import org.eclipse.swt.events.SelectionAdapter;
|
||||||
import org.eclipse.swt.events.SelectionEvent;
|
import org.eclipse.swt.events.SelectionEvent;
|
||||||
import org.eclipse.swt.graphics.RGB;
|
import org.eclipse.swt.graphics.RGB;
|
||||||
|
import org.eclipse.swt.layout.GridData;
|
||||||
|
import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.Button;
|
import org.eclipse.swt.widgets.Button;
|
||||||
|
import org.eclipse.swt.widgets.Combo;
|
||||||
|
import org.eclipse.swt.widgets.Composite;
|
||||||
|
import org.eclipse.swt.widgets.Control;
|
||||||
import org.eclipse.swt.widgets.Group;
|
import org.eclipse.swt.widgets.Group;
|
||||||
|
import org.eclipse.swt.widgets.Label;
|
||||||
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.swt.widgets.Text;
|
import org.eclipse.swt.widgets.Text;
|
||||||
|
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
import com.vividsolutions.jts.geom.Coordinate;
|
import com.vividsolutions.jts.geom.Coordinate;
|
||||||
|
|
||||||
import gov.noaa.nws.ncep.ui.pgen.display.ITrack;
|
|
||||||
import gov.noaa.nws.ncep.ui.pgen.display.IText.FontStyle;
|
|
||||||
import gov.noaa.nws.ncep.ui.pgen.display.TrackPoint;
|
|
||||||
import gov.noaa.nws.ncep.ui.pgen.display.FillPatternList.FillPattern;
|
|
||||||
import gov.noaa.nws.ncep.ui.pgen.elements.AbstractDrawableComponent;
|
|
||||||
import gov.noaa.nws.ncep.ui.pgen.display.IAttribute;
|
|
||||||
import gov.noaa.nws.ncep.ui.pgen.elements.Track;
|
|
||||||
import gov.noaa.nws.ncep.viz.common.ui.color.ColorButtonSelector;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Singleton attribute dialog for Track.
|
* Singleton attribute dialog for Track.
|
||||||
*
|
*
|
||||||
|
@ -61,6 +61,7 @@ import gov.noaa.nws.ncep.viz.common.ui.color.ColorButtonSelector;
|
||||||
* Added isNewTrack flag to make the FirstTime(/SecondTime) current time when create a Track
|
* Added isNewTrack flag to make the FirstTime(/SecondTime) current time when create a Track
|
||||||
* 03/13 #928 B. Yin Added a separator above the button bar.
|
* 03/13 #928 B. Yin Added a separator above the button bar.
|
||||||
* 08/13 #1020 B. Yin Fixed the 'Other' interval problem.
|
* 08/13 #1020 B. Yin Fixed the 'Other' interval problem.
|
||||||
|
* 09/14 TTR750 J. Wu Use fontStyle for track labels.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author M. Gao
|
* @author M. Gao
|
||||||
|
@ -68,42 +69,56 @@ import gov.noaa.nws.ncep.viz.common.ui.color.ColorButtonSelector;
|
||||||
|
|
||||||
public class TrackAttrDlg extends AttrDlg implements ITrack {
|
public class TrackAttrDlg extends AttrDlg implements ITrack {
|
||||||
|
|
||||||
// private final static org.apache.log4j.Logger log =
|
public static enum FontSizeName {
|
||||||
// org.apache.log4j.Logger.getLogger(TrackAttrDlg.class);
|
TINY, SMALL, MEDIUM, LARGE, HUGE, GIANT
|
||||||
|
};
|
||||||
|
|
||||||
public static enum FontSizeName { TINY, SMALL, MEDIUM, LARGE, HUGE, GIANT };
|
|
||||||
public static int[] FontSizeValue = { 10, 12, 14, 18, 24, 34 };
|
public static int[] FontSizeValue = { 10, 12, 14, 18, 24, 34 };
|
||||||
//public static String[] FontName = new String[]{ "Courier", "Helvetica", "Times" };
|
|
||||||
public static String[] FontName = new String[]{ "Courier", "Nimbus Sans L", "Liberation Serif" };
|
|
||||||
|
|
||||||
public static String[] BoxName = new String[]{ "Normal", "Boxed", "Blanked", "Outline" };
|
public static String[] FontName = new String[] { "Courier",
|
||||||
|
"Nimbus Sans L", "Liberation Serif" };
|
||||||
|
|
||||||
|
public static String[] BoxName = new String[] { "Normal", "Boxed",
|
||||||
|
"Blanked", "Outline" };
|
||||||
|
|
||||||
private final int DEFAULT_NUMBER_OF_TIMES = 5;
|
private final int DEFAULT_NUMBER_OF_TIMES = 5;
|
||||||
|
|
||||||
private final int DEFAULT_HOUR_SHIFT_FOR_FIRST_TIME = 4;
|
private final int DEFAULT_HOUR_SHIFT_FOR_FIRST_TIME = 4;
|
||||||
|
|
||||||
private final int DEFAULT_HOUR_SHIFT_BEYOND_FIRST_TIME = 1;
|
private final int DEFAULT_HOUR_SHIFT_BEYOND_FIRST_TIME = 1;
|
||||||
|
|
||||||
private static String[] IntervalTimeValues = {"00:15", "00:30", "01:00", "02:00", "06:00",
|
private static String[] IntervalTimeValues = { "00:15", "00:30", "01:00",
|
||||||
"12:00", "Other"};
|
"02:00", "06:00", "12:00", "Other" };
|
||||||
|
|
||||||
private String previousIntervalTimeValue = "";
|
private String previousIntervalTimeValue = "";
|
||||||
|
|
||||||
private static String[] UnitValues = { "kts", "kph", "mph" };
|
private static String[] UnitValues = { "kts", "kph", "mph" };
|
||||||
|
|
||||||
private static String[] RoundTo = { " ", "5", "10" };
|
private static String[] RoundTo = { " ", "5", "10" };
|
||||||
|
|
||||||
private static String[] RoundDirTo = { " ", "1", "5" };
|
private static String[] RoundDirTo = { " ", "1", "5" };
|
||||||
|
|
||||||
private Text firstTimeText;
|
private Text firstTimeText;
|
||||||
|
|
||||||
private Text secondTimeText;
|
private Text secondTimeText;
|
||||||
|
|
||||||
private boolean setTimeButtonSelected;
|
private boolean setTimeButtonSelected;
|
||||||
|
|
||||||
private Button frameTimeButton;
|
private Button frameTimeButton;
|
||||||
|
|
||||||
private Button setTimeButton;
|
private Button setTimeButton;
|
||||||
|
|
||||||
private Text numberOfTimesText;
|
private Text numberOfTimesText;
|
||||||
|
|
||||||
private Text intervalText;
|
private Text intervalText;
|
||||||
|
|
||||||
private Text skipFactorText;
|
private Text skipFactorText;
|
||||||
|
|
||||||
private ExtraPointTimeDisplayOption extraPointTimeDisplayOption;
|
private ExtraPointTimeDisplayOption extraPointTimeDisplayOption;
|
||||||
|
|
||||||
// private Composite top = null;
|
// private Composite top = null;
|
||||||
private ColorButtonSelector initialCS;
|
private ColorButtonSelector initialCS;
|
||||||
|
|
||||||
private ColorButtonSelector extrapCS;
|
private ColorButtonSelector extrapCS;
|
||||||
|
|
||||||
private Text text = null;
|
private Text text = null;
|
||||||
|
@ -111,27 +126,43 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
private Combo intervalCombo;
|
private Combo intervalCombo;
|
||||||
|
|
||||||
private Combo unitCombo;
|
private Combo unitCombo;
|
||||||
|
|
||||||
private int unitComboSelectedIndex;
|
private int unitComboSelectedIndex;
|
||||||
|
|
||||||
private Button roundButton;
|
private Button roundButton;
|
||||||
|
|
||||||
private Combo roundCombo;
|
private Combo roundCombo;
|
||||||
|
|
||||||
private int roundComboSelectedIndex;
|
private int roundComboSelectedIndex;
|
||||||
|
|
||||||
private Button roundDirButton;
|
private Button roundDirButton;
|
||||||
|
|
||||||
private Combo roundDirCombo;
|
private Combo roundDirCombo;
|
||||||
|
|
||||||
private int roundDirComboSelectedIndex;
|
private int roundDirComboSelectedIndex;
|
||||||
|
|
||||||
private Combo fontSizeCombo;
|
private Combo fontSizeCombo;
|
||||||
|
|
||||||
private int fontSizeComboSelectedIndex;
|
private int fontSizeComboSelectedIndex;
|
||||||
|
|
||||||
private Combo fontNameCombo;
|
private Combo fontNameCombo;
|
||||||
|
|
||||||
private int fontNameComboSelectedIndex;
|
private int fontNameComboSelectedIndex;
|
||||||
|
|
||||||
private Combo fontStyleCombo;
|
private Combo fontStyleCombo;
|
||||||
|
|
||||||
private int fontStyleComboSelectedIndex;
|
private int fontStyleComboSelectedIndex;
|
||||||
|
|
||||||
private Button skipFactorButton;
|
private Button skipFactorButton;
|
||||||
|
|
||||||
private Button showFirstLastButton;
|
private Button showFirstLastButton;
|
||||||
|
|
||||||
private Button onHourButton;
|
private Button onHourButton;
|
||||||
|
|
||||||
private Button onHalfHourButton;
|
private Button onHalfHourButton;
|
||||||
|
|
||||||
private Calendar firstTimeCalendar;
|
private Calendar firstTimeCalendar;
|
||||||
|
|
||||||
private Calendar secondTimeCalendar;
|
private Calendar secondTimeCalendar;
|
||||||
|
|
||||||
private int numberOfTimes = DEFAULT_NUMBER_OF_TIMES; // set the default to 5
|
private int numberOfTimes = DEFAULT_NUMBER_OF_TIMES; // set the default to 5
|
||||||
|
@ -144,6 +175,7 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Private constructor
|
* Private constructor
|
||||||
|
*
|
||||||
* @param parShell
|
* @param parShell
|
||||||
* @throws VizException
|
* @throws VizException
|
||||||
*/
|
*/
|
||||||
|
@ -152,8 +184,8 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a track attribute dialog if the dialog does not exist
|
* Creates a track attribute dialog if the dialog does not exist and returns
|
||||||
* and returns the instance. If the dialog exists, return the instance.
|
* the instance. If the dialog exists, return the instance.
|
||||||
*
|
*
|
||||||
* @param parShell
|
* @param parShell
|
||||||
* @return
|
* @return
|
||||||
|
@ -176,7 +208,8 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
|
|
||||||
// get the list of selected tracks
|
// get the list of selected tracks
|
||||||
if (drawingLayer != null) {
|
if (drawingLayer != null) {
|
||||||
adcList = (ArrayList<AbstractDrawableComponent>) drawingLayer.getAllSelected();
|
adcList = (ArrayList<AbstractDrawableComponent>) drawingLayer
|
||||||
|
.getAllSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (adcList != null && !adcList.isEmpty()) {
|
if (adcList != null && !adcList.isEmpty()) {
|
||||||
|
@ -195,8 +228,10 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
/*
|
/*
|
||||||
* populate the TrackExtrapPointInofDlg object
|
* populate the TrackExtrapPointInofDlg object
|
||||||
*/
|
*/
|
||||||
populateTrackExtrapPointInfoDlgWithNewTrackData(getTrackExtrapPointInfoDlg(), newEl,
|
populateTrackExtrapPointInfoDlgWithNewTrackData(
|
||||||
unitComboSelectedIndex, roundComboSelectedIndex, roundDirComboSelectedIndex);
|
getTrackExtrapPointInfoDlg(), newEl,
|
||||||
|
unitComboSelectedIndex, roundComboSelectedIndex,
|
||||||
|
roundDirComboSelectedIndex);
|
||||||
|
|
||||||
newList.add(newEl);
|
newList.add(newEl);
|
||||||
|
|
||||||
|
@ -207,7 +242,8 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
AttrSettings.getInstance().setSettings(newEl);
|
AttrSettings.getInstance().setSettings(newEl);
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<AbstractDrawableComponent> oldList = new ArrayList<AbstractDrawableComponent>(adcList);
|
ArrayList<AbstractDrawableComponent> oldList = new ArrayList<AbstractDrawableComponent>(
|
||||||
|
adcList);
|
||||||
drawingLayer.replaceElements(oldList, newList);
|
drawingLayer.replaceElements(oldList, newList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,11 +309,16 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
String[] firstSecondTimeValueArray = getFirstSecondTimeInitialTimeValueForSetTimeButton();
|
String[] firstSecondTimeValueArray = getFirstSecondTimeInitialTimeValueForSetTimeButton();
|
||||||
getFirstTimeText().setText(firstSecondTimeValueArray[0]);
|
getFirstTimeText().setText(firstSecondTimeValueArray[0]);
|
||||||
getSecondTimeText().setText(firstSecondTimeValueArray[1]);
|
getSecondTimeText().setText(firstSecondTimeValueArray[1]);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
|
|
||||||
getFirstTimeText().setText(getFirstOrSecondTimeStringValue(track.getFirstTimeCalendar(), true, track.getInitialPoints()));
|
getFirstTimeText().setText(
|
||||||
getSecondTimeText().setText(getFirstOrSecondTimeStringValue(track.getSecondTimeCalendar(), false, track.getInitialPoints()));
|
getFirstOrSecondTimeStringValue(
|
||||||
|
track.getFirstTimeCalendar(), true,
|
||||||
|
track.getInitialPoints()));
|
||||||
|
getSecondTimeText().setText(
|
||||||
|
getFirstOrSecondTimeStringValue(
|
||||||
|
track.getSecondTimeCalendar(), false,
|
||||||
|
track.getInitialPoints()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// isNewTrack = false;
|
// isNewTrack = false;
|
||||||
|
@ -285,33 +326,30 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
* 3. restore Number of times value
|
* 3. restore Number of times value
|
||||||
*/
|
*/
|
||||||
if (track.getExtrapPoints() != null)
|
if (track.getExtrapPoints() != null)
|
||||||
numberOfTimesText.setText(String.valueOf(track.getExtrapPoints().length));
|
numberOfTimesText
|
||||||
|
.setText(String.valueOf(track.getExtrapPoints().length));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 4. restore interval time settings
|
* 4. restore interval time settings
|
||||||
*/
|
*/
|
||||||
// intervalCombo.select(track.getIntervalComboSelectedIndex());
|
|
||||||
// int intervalComboItemCount = intervalCombo.getItemCount();
|
|
||||||
// if ( (intervalComboItemCount - 1) == track.getIntervalComboSelectedIndex() )
|
|
||||||
// intervalText.setText(track.getIntervalTimeString());
|
|
||||||
|
|
||||||
setIntervalTimeString(track.getIntervalTimeString());
|
setIntervalTimeString(track.getIntervalTimeString());
|
||||||
|
|
||||||
// restoreIntervalTimeSettingByTrack(this, track);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 5. restore initial and extrap colors
|
* 5. restore initial and extrap colors
|
||||||
*/
|
*/
|
||||||
java.awt.Color initColor = track.getInitialColor();
|
java.awt.Color initColor = track.getInitialColor();
|
||||||
initialCS.setColorValue(new RGB(initColor.getRed(), initColor.getGreen(), initColor.getBlue()));
|
initialCS.setColorValue(new RGB(initColor.getRed(), initColor
|
||||||
|
.getGreen(), initColor.getBlue()));
|
||||||
java.awt.Color extrapColor = track.getExtrapColor();
|
java.awt.Color extrapColor = track.getExtrapColor();
|
||||||
extrapCS.setColorValue(new RGB(extrapColor.getRed(), extrapColor.getGreen(), extrapColor.getBlue()));
|
extrapCS.setColorValue(new RGB(extrapColor.getRed(), extrapColor
|
||||||
|
.getGreen(), extrapColor.getBlue()));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 6. restore label option settings
|
* 6. restore label option settings
|
||||||
*/
|
*/
|
||||||
setExtraPointTimeDisplayOption(track.getExtraPointTimeDisplayOption());
|
setExtraPointTimeDisplayOption(track.getExtraPointTimeDisplayOption());
|
||||||
makeTimeDisplayOptionSelected(track.getExtraPointTimeDisplayOption(), track.getSkipFactorTextString());
|
makeTimeDisplayOptionSelected(track.getExtraPointTimeDisplayOption(),
|
||||||
|
track.getSkipFactorTextString());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 7. restore Font, Size, Style combo values
|
* 7. restore Font, Size, Style combo values
|
||||||
|
@ -341,36 +379,27 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
roundDirButton.setSelection(false);
|
roundDirButton.setSelection(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void populateTrackExtrapPointInfoDlgWithNewTrackData(TrackExtrapPointInfoDlg trackExtrapPointInfoDlgObject,
|
private void populateTrackExtrapPointInfoDlgWithNewTrackData(
|
||||||
Track newTrackObject, int unitComboSelectedIndex, int roundComboSelectedIndex, int roundDirComboSelectedIndex) {
|
TrackExtrapPointInfoDlg trackExtrapPointInfoDlgObject,
|
||||||
|
Track newTrackObject, int unitComboSelectedIndex,
|
||||||
|
int roundComboSelectedIndex, int roundDirComboSelectedIndex) {
|
||||||
if (trackExtrapPointInfoDlgObject != null && newTrackObject != null) {
|
if (trackExtrapPointInfoDlgObject != null && newTrackObject != null) {
|
||||||
trackExtrapPointInfoDlgObject.close();
|
trackExtrapPointInfoDlgObject.close();
|
||||||
|
|
||||||
trackExtrapPointInfoDlgObject.setBlockOnOpen(false);
|
trackExtrapPointInfoDlgObject.setBlockOnOpen(false);
|
||||||
trackExtrapPointInfoDlgObject.open();
|
trackExtrapPointInfoDlgObject.open();
|
||||||
|
|
||||||
trackExtrapPointInfoDlgObject.setTrack(newTrackObject, unitComboSelectedIndex, roundComboSelectedIndex, roundDirComboSelectedIndex);
|
trackExtrapPointInfoDlgObject.setTrack(newTrackObject,
|
||||||
|
unitComboSelectedIndex, roundComboSelectedIndex,
|
||||||
|
roundDirComboSelectedIndex);
|
||||||
|
|
||||||
trackExtrapPointInfoDlgObject.setBlockOnOpen(true);
|
trackExtrapPointInfoDlgObject.setBlockOnOpen(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// private void restoreIntervalTimeSettingByTrack(TrackAttrDlg targetTrackAttrDlg, Track track) {
|
private void makeTimeDisplayOptionSelected(
|
||||||
// if(targetTrackAttrDlg == null || track == null)
|
ExtraPointTimeDisplayOption extraPointTimeDisplayOption,
|
||||||
// return;
|
String skipFactorTextString) {
|
||||||
//
|
|
||||||
// targetTrackAttrDlg.getIntervalCombo().select(track.getIntervalComboSelectedIndex());
|
|
||||||
// int intervalComboItemCount = targetTrackAttrDlg.getIntervalCombo().getItemCount();
|
|
||||||
// if((intervalComboItemCount - 1) == track.getIntervalComboSelectedIndex()) {
|
|
||||||
// if(track.getIntervalTimeString() != null)
|
|
||||||
// targetTrackAttrDlg.getIntervalText().setText(track.getIntervalTimeString());
|
|
||||||
// } else {
|
|
||||||
//// targetTrackAttrDlg.getIntervalText().setText(targetTrackAttrDlg.getIntervalCombo().getText());
|
|
||||||
// track.setIntervalTimeString(targetTrackAttrDlg.getIntervalCombo().getText());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
private void makeTimeDisplayOptionSelected(ExtraPointTimeDisplayOption extraPointTimeDisplayOption, String skipFactorTextString) {
|
|
||||||
getSkipFactorButton().setSelection(false);
|
getSkipFactorButton().setSelection(false);
|
||||||
skipFactorText.setText("");
|
skipFactorText.setText("");
|
||||||
if (extraPointTimeDisplayOption == ITrack.ExtraPointTimeDisplayOption.ON_HALF_HOUR)
|
if (extraPointTimeDisplayOption == ITrack.ExtraPointTimeDisplayOption.ON_HALF_HOUR)
|
||||||
|
@ -387,6 +416,7 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates buttons, menus, and other controls in the dialog area
|
* Creates buttons, menus, and other controls in the dialog area
|
||||||
|
*
|
||||||
* @param listener
|
* @param listener
|
||||||
*/
|
*/
|
||||||
private void initializeComponents(Composite topComposite) {
|
private void initializeComponents(Composite topComposite) {
|
||||||
|
@ -398,7 +428,6 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
GridLayout childGridLayout = new GridLayout(2, false);
|
GridLayout childGridLayout = new GridLayout(2, false);
|
||||||
|
|
||||||
this.getShell().setText("Track Attributes");
|
this.getShell().setText("Track Attributes");
|
||||||
// log.info("===now it is inside initializeComponents(...)");
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draw Frame/Set time buttons
|
* Draw Frame/Set time buttons
|
||||||
|
@ -407,14 +436,10 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
timeRadioButtonGroup.setLayout(childGridLayout);
|
timeRadioButtonGroup.setLayout(childGridLayout);
|
||||||
|
|
||||||
frameTimeButton = new Button(timeRadioButtonGroup, SWT.RADIO);
|
frameTimeButton = new Button(timeRadioButtonGroup, SWT.RADIO);
|
||||||
// Button frameTimeButton = new Button(topComposite, SWT.RADIO);
|
|
||||||
frameTimeButton.setText("Frame time");
|
frameTimeButton.setText("Frame time");
|
||||||
|
|
||||||
// Button setTimeButton = new Button(topComposite, SWT.RADIO);
|
|
||||||
setTimeButton = new Button(timeRadioButtonGroup, SWT.RADIO);
|
setTimeButton = new Button(timeRadioButtonGroup, SWT.RADIO);
|
||||||
setTimeButton.setText("Set Time");
|
setTimeButton.setText("Set Time");
|
||||||
// setTimeButton.setSelection(true);
|
|
||||||
// timeRadioButtonGroup.h
|
|
||||||
Label emptyLabel = new Label(topComposite, SWT.LEFT);
|
Label emptyLabel = new Label(topComposite, SWT.LEFT);
|
||||||
emptyLabel.setText(" ");
|
emptyLabel.setText(" ");
|
||||||
|
|
||||||
|
@ -429,36 +454,38 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
public void modifyText(ModifyEvent e) {
|
public void modifyText(ModifyEvent e) {
|
||||||
Text txt = (Text) e.widget;
|
Text txt = (Text) e.widget;
|
||||||
Calendar cal = gempakTM2Calendar(txt.getText());
|
Calendar cal = gempakTM2Calendar(txt.getText());
|
||||||
if ( cal != null ) firstTimeCalendar = cal;
|
if (cal != null)
|
||||||
|
firstTimeCalendar = cal;
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
setSecondTimeText(createTextfieldWithLabel(topComposite,
|
||||||
setSecondTimeText(createTextfieldWithLabel(topComposite, "Second time:",
|
"Second time:", SWT.SINGLE | SWT.BORDER, textWidth, textHeight,
|
||||||
SWT.SINGLE | SWT.BORDER, textWidth, textHeight, true));
|
true));
|
||||||
getSecondTimeText().setText(firstSecondTimeValueArray[1]);
|
getSecondTimeText().setText(firstSecondTimeValueArray[1]);
|
||||||
|
|
||||||
getSecondTimeText().addModifyListener(new ModifyListener() {
|
getSecondTimeText().addModifyListener(new ModifyListener() {
|
||||||
public void modifyText(ModifyEvent e) {
|
public void modifyText(ModifyEvent e) {
|
||||||
Text txt = (Text) e.widget;
|
Text txt = (Text) e.widget;
|
||||||
Calendar cal = gempakTM2Calendar(txt.getText());
|
Calendar cal = gempakTM2Calendar(txt.getText());
|
||||||
if ( cal != null ) secondTimeCalendar = cal;
|
if (cal != null)
|
||||||
|
secondTimeCalendar = cal;
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
setTimeButton.setSelection(true);
|
setTimeButton.setSelection(true);
|
||||||
setSetTimeButtonSelected(true);
|
setSetTimeButtonSelected(true);
|
||||||
frameAndSetTimeButtonSelectionListenerAction(frameTimeButton, getFirstTimeText(),
|
frameAndSetTimeButtonSelectionListenerAction(frameTimeButton,
|
||||||
getSecondTimeText());
|
getFirstTimeText(), getSecondTimeText());
|
||||||
frameAndSetTimeButtonSelectionListenerAction(setTimeButton, getFirstTimeText(),
|
frameAndSetTimeButtonSelectionListenerAction(setTimeButton,
|
||||||
getSecondTimeText());
|
getFirstTimeText(), getSecondTimeText());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Played with NMAP2, it seems directly change first/second time texts do not have any
|
* Played with NMAP2, it seems directly change first/second time texts
|
||||||
* impact on the first/second starting points. Thus, now set both text fields are not
|
* do not have any impact on the first/second starting points. Thus, now
|
||||||
* editable
|
* set both text fields are not editable
|
||||||
*/
|
*/
|
||||||
getFirstTimeText().setEditable(true);
|
getFirstTimeText().setEditable(true);
|
||||||
getSecondTimeText().setEditable(true);
|
getSecondTimeText().setEditable(true);
|
||||||
|
@ -466,17 +493,18 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
/*
|
/*
|
||||||
* Draw Number of times text row
|
* Draw Number of times text row
|
||||||
*/
|
*/
|
||||||
setNumberOfTimesText(createTextfieldWithLabel(topComposite, "Number of times:",
|
setNumberOfTimesText(createTextfieldWithLabel(topComposite,
|
||||||
SWT.SINGLE | SWT.BORDER, textWidth/3, textHeight, true));
|
"Number of times:", SWT.SINGLE | SWT.BORDER, textWidth / 3,
|
||||||
|
textHeight, true));
|
||||||
numberOfTimesText.setText(String.valueOf(numberOfTimes));
|
numberOfTimesText.setText(String.valueOf(numberOfTimes));
|
||||||
numberOfTimesText.addModifyListener(new ModifyListener() {
|
numberOfTimesText.addModifyListener(new ModifyListener() {
|
||||||
public void modifyText(ModifyEvent e) {
|
public void modifyText(ModifyEvent e) {
|
||||||
try {
|
try {
|
||||||
numberOfTimes = Integer.parseInt(numberOfTimesText.getText());
|
numberOfTimes = Integer.parseInt(numberOfTimesText
|
||||||
|
.getText());
|
||||||
} catch (NumberFormatException nfe) {
|
} catch (NumberFormatException nfe) {
|
||||||
numberOfTimes = DEFAULT_NUMBER_OF_TIMES; //use the default value
|
numberOfTimes = DEFAULT_NUMBER_OF_TIMES; // use the default
|
||||||
// log.error("The text value of number of times is invalid, input text="
|
// value
|
||||||
// +getNumberOfTimesText().getText());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -490,7 +518,8 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
Group intervalRowGroup = new Group(topComposite, SWT.NONE);
|
Group intervalRowGroup = new Group(topComposite, SWT.NONE);
|
||||||
intervalRowGroup.setLayout(childGridLayout);
|
intervalRowGroup.setLayout(childGridLayout);
|
||||||
|
|
||||||
intervalCombo = new Combo(intervalRowGroup, SWT.DROP_DOWN | SWT.READ_ONLY);
|
intervalCombo = new Combo(intervalRowGroup, SWT.DROP_DOWN
|
||||||
|
| SWT.READ_ONLY);
|
||||||
for (String currentString : IntervalTimeValues) {
|
for (String currentString : IntervalTimeValues) {
|
||||||
intervalCombo.add(currentString);
|
intervalCombo.add(currentString);
|
||||||
}
|
}
|
||||||
|
@ -506,7 +535,6 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
intervalText.setEditable(false);
|
intervalText.setEditable(false);
|
||||||
intervalText.setText("");
|
intervalText.setText("");
|
||||||
setPreviousIntervalTimeValue(intervalCombo.getText());
|
setPreviousIntervalTimeValue(intervalCombo.getText());
|
||||||
// setIntervalTimeString(intervalCombo.getText());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -542,7 +570,8 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
unitCombo.add(unit);
|
unitCombo.add(unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
unitCombo.select(0); // default to the 1st item of the list. the value is Courier
|
unitCombo.select(0); // default to the 1st item of the list. the value
|
||||||
|
// is Courier
|
||||||
setUnitComboSelectedIndex(0);
|
setUnitComboSelectedIndex(0);
|
||||||
unitCombo.addSelectionListener(new SelectionAdapter() {
|
unitCombo.addSelectionListener(new SelectionAdapter() {
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
|
@ -602,7 +631,8 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
roundDirCombo.addSelectionListener(new SelectionAdapter() {
|
roundDirCombo.addSelectionListener(new SelectionAdapter() {
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
if (roundDirButton.getSelection())
|
if (roundDirButton.getSelection())
|
||||||
setRoundDirComboSelectedIndex(roundDirCombo.getSelectionIndex());
|
setRoundDirComboSelectedIndex(roundDirCombo
|
||||||
|
.getSelectionIndex());
|
||||||
else
|
else
|
||||||
setRoundDirComboSelectedIndex(-1);
|
setRoundDirComboSelectedIndex(-1);
|
||||||
}
|
}
|
||||||
|
@ -613,6 +643,7 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
*/
|
*/
|
||||||
Label optionLabel = new Label(topComposite, SWT.LEFT);
|
Label optionLabel = new Label(topComposite, SWT.LEFT);
|
||||||
optionLabel.setText("Label Options:");
|
optionLabel.setText("Label Options:");
|
||||||
|
|
||||||
// make the label to fill the two columns
|
// make the label to fill the two columns
|
||||||
GridData gridData = new GridData();
|
GridData gridData = new GridData();
|
||||||
gridData.horizontalSpan = 2;
|
gridData.horizontalSpan = 2;
|
||||||
|
@ -629,20 +660,21 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
skipFactorText.setLayoutData(new GridData(textWidth / 4, textHeight));
|
skipFactorText.setLayoutData(new GridData(textWidth / 4, textHeight));
|
||||||
|
|
||||||
skipFactorText.setText("0");
|
skipFactorText.setText("0");
|
||||||
labelOptionButtonSelectionListenerAction(skipFactorButton, skipFactorText, true,
|
labelOptionButtonSelectionListenerAction(skipFactorButton,
|
||||||
skipFactorButtonText, 0);
|
skipFactorText, true, skipFactorButtonText, 0);
|
||||||
|
|
||||||
showFirstLastButton = createButton(topComposite, "Show first&&last", true, 2);
|
showFirstLastButton = createButton(topComposite, "Show first&&last",
|
||||||
labelOptionButtonSelectionListenerAction(showFirstLastButton, skipFactorText, false,
|
true, 2);
|
||||||
skipFactorButtonText, 0);
|
labelOptionButtonSelectionListenerAction(showFirstLastButton,
|
||||||
|
skipFactorText, false, skipFactorButtonText, 0);
|
||||||
|
|
||||||
onHourButton = createButton(topComposite, "On hour", true, 2);
|
onHourButton = createButton(topComposite, "On hour", true, 2);
|
||||||
labelOptionButtonSelectionListenerAction(onHourButton, skipFactorText, false,
|
labelOptionButtonSelectionListenerAction(onHourButton, skipFactorText,
|
||||||
skipFactorButtonText, 0);
|
false, skipFactorButtonText, 0);
|
||||||
|
|
||||||
onHalfHourButton = createButton(topComposite, "On half-hour", true, 2);
|
onHalfHourButton = createButton(topComposite, "On half-hour", true, 2);
|
||||||
labelOptionButtonSelectionListenerAction(onHalfHourButton, skipFactorText, false,
|
labelOptionButtonSelectionListenerAction(onHalfHourButton,
|
||||||
skipFactorButtonText, 0);
|
skipFactorText, false, skipFactorButtonText, 0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize the extra point display option as SKIP_FACTOR
|
* Initialize the extra point display option as SKIP_FACTOR
|
||||||
|
@ -658,7 +690,8 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
for (String fontName : FontName) {
|
for (String fontName : FontName) {
|
||||||
fontNameCombo.add(fontName);
|
fontNameCombo.add(fontName);
|
||||||
}
|
}
|
||||||
fontNameCombo.select(0); // default to the 1st item of the list. the value is Courier
|
fontNameCombo.select(0); // default to the 1st item of the list. the
|
||||||
|
// value is Courier
|
||||||
setFontNameComboSelectedIndex(0);
|
setFontNameComboSelectedIndex(0);
|
||||||
fontNameCombo.addSelectionListener(new SelectionAdapter() {
|
fontNameCombo.addSelectionListener(new SelectionAdapter() {
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
|
@ -672,7 +705,8 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
for (FontSizeName fontSizeName : FontSizeName.values()) {
|
for (FontSizeName fontSizeName : FontSizeName.values()) {
|
||||||
fontSizeCombo.add(fontSizeName.name());
|
fontSizeCombo.add(fontSizeName.name());
|
||||||
}
|
}
|
||||||
fontSizeCombo.select(2); // default to the 3rd item of the list. The value is Medium
|
fontSizeCombo.select(2); // default to the 3rd item of the list. The
|
||||||
|
// value is Medium
|
||||||
setFontSizeComboSelectedIndex(2);
|
setFontSizeComboSelectedIndex(2);
|
||||||
fontSizeCombo.addSelectionListener(new SelectionAdapter() {
|
fontSizeCombo.addSelectionListener(new SelectionAdapter() {
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
|
@ -686,11 +720,13 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
for (FontStyle fontStyle : FontStyle.values()) {
|
for (FontStyle fontStyle : FontStyle.values()) {
|
||||||
fontStyleCombo.add(fontStyle.name());
|
fontStyleCombo.add(fontStyle.name());
|
||||||
}
|
}
|
||||||
fontStyleCombo.select(2); // default to the 3rd item of the list. The value is Bold
|
fontStyleCombo.select(2); // default to the 3rd item of the list. The
|
||||||
|
// value is Bold
|
||||||
setFontStyleComboSelectedIndex(2);
|
setFontStyleComboSelectedIndex(2);
|
||||||
fontStyleCombo.addSelectionListener(new SelectionAdapter() {
|
fontStyleCombo.addSelectionListener(new SelectionAdapter() {
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
setFontStyleComboSelectedIndex(fontStyleCombo.getSelectionIndex());
|
setFontStyleComboSelectedIndex(fontStyleCombo
|
||||||
|
.getSelectionIndex());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -698,8 +734,9 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void frameAndSetTimeButtonSelectionListenerAction(final Button button,
|
private void frameAndSetTimeButtonSelectionListenerAction(
|
||||||
final Text firstTimeText, final Text secondTimeText) {
|
final Button button, final Text firstTimeText,
|
||||||
|
final Text secondTimeText) {
|
||||||
button.addSelectionListener(new SelectionAdapter() {
|
button.addSelectionListener(new SelectionAdapter() {
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
String[] firstAndSecondTimeValueArray = null;
|
String[] firstAndSecondTimeValueArray = null;
|
||||||
|
@ -732,46 +769,11 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
setSecondTimeCalendar(calendar);
|
setSecondTimeCalendar(calendar);
|
||||||
timeValueResult[1] = getDateTimeStringValue(calendar);
|
timeValueResult[1] = getDateTimeStringValue(calendar);
|
||||||
|
|
||||||
// Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
|
|
||||||
// //calendar.add(Calendar.HOUR_OF_DAY, DEFAULT_HOUR_SHIFT_FOR_FIRST_TIME);
|
|
||||||
// setFirstTimeCalendar(calendar);
|
|
||||||
// timeValueResult[0] = getDateTimeStringValue(calendar);
|
|
||||||
//
|
|
||||||
// String intervalStr = getPreviousIntervalTimeValue(); //intervalTimeValue;
|
|
||||||
// System.out.println("intervalStr "+intervalStr);
|
|
||||||
//
|
|
||||||
// if (intervalStr == null || intervalStr.equalsIgnoreCase(""))
|
|
||||||
// intervalStr = "1:00";
|
|
||||||
// String[] intervalString = intervalStr.split(":");
|
|
||||||
//
|
|
||||||
// int day = 0;
|
|
||||||
// int hr = 0;
|
|
||||||
// int min = 0;
|
|
||||||
// if (intervalString.length == 1){
|
|
||||||
// try {
|
|
||||||
// hr = Integer.parseInt(intervalString[0]);
|
|
||||||
// }
|
|
||||||
// catch (NumberFormatException e) {
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// else if (intervalString.length == 2){
|
|
||||||
// try {
|
|
||||||
// hr = Integer.parseInt(intervalString[0]);
|
|
||||||
// min = Integer.parseInt(intervalString[1]);
|
|
||||||
// }
|
|
||||||
// catch (NumberFormatException e) {
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// calendar.add(Calendar.HOUR_OF_DAY, hr);
|
|
||||||
// calendar.add(Calendar.MINUTE, min);
|
|
||||||
// setSecondTimeCalendar(calendar);
|
|
||||||
// timeValueResult[1] = getDateTimeStringValue(calendar);
|
|
||||||
|
|
||||||
return timeValueResult;
|
return timeValueResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getFirstOrSecondTimeStringValue(Calendar timeCalendar, boolean isFirstTimeCalendar, TrackPoint[] initTrackPoints) {
|
private String getFirstOrSecondTimeStringValue(Calendar timeCalendar,
|
||||||
|
boolean isFirstTimeCalendar, TrackPoint[] initTrackPoints) {
|
||||||
String timeStringValue = "";
|
String timeStringValue = "";
|
||||||
if (timeCalendar != null) {
|
if (timeCalendar != null) {
|
||||||
timeStringValue = getDateTimeStringValue(timeCalendar);
|
timeStringValue = getDateTimeStringValue(timeCalendar);
|
||||||
|
@ -780,23 +782,25 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
int trackPointArrayIndex = initTrackPoints.length - 1;
|
int trackPointArrayIndex = initTrackPoints.length - 1;
|
||||||
if (isFirstTimeCalendar)
|
if (isFirstTimeCalendar)
|
||||||
trackPointArrayIndex--;
|
trackPointArrayIndex--;
|
||||||
timeStringValue = getInitialPointsTimeStringValue(initTrackPoints, trackPointArrayIndex);
|
timeStringValue = getInitialPointsTimeStringValue(
|
||||||
|
initTrackPoints, trackPointArrayIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return timeStringValue;
|
return timeStringValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getInitialPointsTimeStringValue(TrackPoint[] trackPointArray, int pointArrayIndex) {
|
private String getInitialPointsTimeStringValue(
|
||||||
|
TrackPoint[] trackPointArray, int pointArrayIndex) {
|
||||||
String timeStringValue = "";
|
String timeStringValue = "";
|
||||||
if (pointArrayIndex < trackPointArray.length) {
|
if (pointArrayIndex < trackPointArray.length) {
|
||||||
TrackPoint targetTrackPoint = trackPointArray[pointArrayIndex];
|
TrackPoint targetTrackPoint = trackPointArray[pointArrayIndex];
|
||||||
if (targetTrackPoint != null && targetTrackPoint.getTime() != null)
|
if (targetTrackPoint != null && targetTrackPoint.getTime() != null)
|
||||||
timeStringValue = getDateTimeStringValue(targetTrackPoint.getTime());
|
timeStringValue = getDateTimeStringValue(targetTrackPoint
|
||||||
|
.getTime());
|
||||||
}
|
}
|
||||||
return timeStringValue;
|
return timeStringValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private String getDateTimeStringValue(Calendar calendar) {
|
private String getDateTimeStringValue(Calendar calendar) {
|
||||||
StringBuilder stringBuilder = new StringBuilder(11);
|
StringBuilder stringBuilder = new StringBuilder(11);
|
||||||
int year = calendar.get(Calendar.YEAR);
|
int year = calendar.get(Calendar.YEAR);
|
||||||
|
@ -824,24 +828,9 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
return stringBuilder.toString();
|
return stringBuilder.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
// private Calendar getCalendarByParsingString(String dateString, String dateFormatPattern) {
|
|
||||||
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat(dateFormatPattern); //a pattern is something like "yyMMdd/HHmm"
|
|
||||||
// Calendar cal = null;
|
|
||||||
// if(dateString == null)
|
|
||||||
// return cal;
|
|
||||||
// try {
|
|
||||||
// Date date = simpleDateFormat.parse(dateString);
|
|
||||||
// cal = Calendar.getInstance();
|
|
||||||
// cal.setTime(date);
|
|
||||||
// } catch(ParseException pe) {
|
|
||||||
// log.error("The input of dateString is invalid, parse fails, dateString="+dateString);
|
|
||||||
// }
|
|
||||||
// return cal;
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* a helper method to create an editable text with a text label
|
* a helper method to create an editable text with a text label
|
||||||
|
*
|
||||||
* @parentComposite, a parent Composite the text and label are built on
|
* @parentComposite, a parent Composite the text and label are built on
|
||||||
* @textLabel, the value of the labe ltext
|
* @textLabel, the value of the labe ltext
|
||||||
* @textStyle, text style value
|
* @textStyle, text style value
|
||||||
|
@ -850,8 +839,9 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
* @isEditable, a boolean to indicate if the text is editable
|
* @isEditable, a boolean to indicate if the text is editable
|
||||||
* @return Text
|
* @return Text
|
||||||
*/
|
*/
|
||||||
private Text createTextfieldWithLabel(Composite parentComposite, String textLabel,
|
private Text createTextfieldWithLabel(Composite parentComposite,
|
||||||
int textStyle, int textWidth, int textHeight, boolean isEditable) {
|
String textLabel, int textStyle, int textWidth, int textHeight,
|
||||||
|
boolean isEditable) {
|
||||||
Label firstTimeLabel = new Label(parentComposite, SWT.NONE);
|
Label firstTimeLabel = new Label(parentComposite, SWT.NONE);
|
||||||
firstTimeLabel.setText(textLabel);
|
firstTimeLabel.setText(textLabel);
|
||||||
|
|
||||||
|
@ -863,6 +853,7 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* a helper method to create a button
|
* a helper method to create a button
|
||||||
|
*
|
||||||
* @parentComposite, a parent Composite the button is built on
|
* @parentComposite, a parent Composite the button is built on
|
||||||
* @buttonText, text value associated with the button
|
* @buttonText, text value associated with the button
|
||||||
* @isHorizontalSpan, a boolean to indicate if the button should do a span
|
* @isHorizontalSpan, a boolean to indicate if the button should do a span
|
||||||
|
@ -895,15 +886,15 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
else
|
else
|
||||||
targetText.setText("");
|
targetText.setText("");
|
||||||
String buttonTextString = button.getText();
|
String buttonTextString = button.getText();
|
||||||
ExtraPointTimeDisplayOption extraPointTimeDisplayOption =
|
ExtraPointTimeDisplayOption extraPointTimeDisplayOption = decideExtraPointTimeDisplayOptionByButtonText(buttonTextString);
|
||||||
decideExtraPointTimeDisplayOptionByButtonText(buttonTextString);
|
|
||||||
setExtraPointTimeDisplayOption(extraPointTimeDisplayOption);
|
setExtraPointTimeDisplayOption(extraPointTimeDisplayOption);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// "Skip factor" "Show first&&last" "On hour" "On half-hour"
|
// "Skip factor" "Show first&&last" "On hour" "On half-hour"
|
||||||
private ExtraPointTimeDisplayOption decideExtraPointTimeDisplayOptionByButtonText(String buttonTextString) {
|
private ExtraPointTimeDisplayOption decideExtraPointTimeDisplayOptionByButtonText(
|
||||||
// ITrack.ExtraPointTimeDisplayOption[] testOptions = ITrack.ExtraPointTimeDisplayOption.values();
|
String buttonTextString) {
|
||||||
|
|
||||||
if (buttonTextString.equalsIgnoreCase("Show first&&last"))
|
if (buttonTextString.equalsIgnoreCase("Show first&&last"))
|
||||||
return ITrack.ExtraPointTimeDisplayOption.SHOW_FIRST_LAST;
|
return ITrack.ExtraPointTimeDisplayOption.SHOW_FIRST_LAST;
|
||||||
|
@ -942,7 +933,8 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
/**
|
/**
|
||||||
* Return font style from the style combo
|
* Return font style from the style combo
|
||||||
*/
|
*/
|
||||||
public FontStyle getStyle(){
|
@Override
|
||||||
|
public FontStyle getFontStyle() {
|
||||||
return FontStyle.values()[fontStyleCombo.getSelectionIndex()];
|
return FontStyle.values()[fontStyleCombo.getSelectionIndex()];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -978,7 +970,7 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
/**
|
/**
|
||||||
* set font style
|
* set font style
|
||||||
*/
|
*/
|
||||||
public void setStyle( FontStyle style ){
|
public void setFontStyle(FontStyle style) {
|
||||||
for (FontStyle fs : FontStyle.values()) {
|
for (FontStyle fs : FontStyle.values()) {
|
||||||
if (fs == style) {
|
if (fs == style) {
|
||||||
fontStyleCombo.setText(fs.name());
|
fontStyleCombo.setText(fs.name());
|
||||||
|
@ -1040,7 +1032,6 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
return fontStyleCombo;
|
return fontStyleCombo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public int getFontSizeComboSelectedIndex() {
|
public int getFontSizeComboSelectedIndex() {
|
||||||
return fontSizeComboSelectedIndex;
|
return fontSizeComboSelectedIndex;
|
||||||
}
|
}
|
||||||
|
@ -1101,7 +1092,6 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
this.roundDirComboSelectedIndex = roundDirComboSelectedIndex;
|
this.roundDirComboSelectedIndex = roundDirComboSelectedIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean isSetTimeButtonSelected() {
|
public boolean isSetTimeButtonSelected() {
|
||||||
return setTimeButtonSelected;
|
return setTimeButtonSelected;
|
||||||
}
|
}
|
||||||
|
@ -1109,6 +1099,7 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
public void setSetTimeButtonSelected(boolean setTimeButtonSelected) {
|
public void setSetTimeButtonSelected(boolean setTimeButtonSelected) {
|
||||||
this.setTimeButtonSelected = setTimeButtonSelected;
|
this.setTimeButtonSelected = setTimeButtonSelected;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Button getFrameTimeButton() {
|
public Button getFrameTimeButton() {
|
||||||
return frameTimeButton;
|
return frameTimeButton;
|
||||||
}
|
}
|
||||||
|
@ -1125,12 +1116,12 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
this.setTimeButton = setTimeButton;
|
this.setTimeButton = setTimeButton;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public ExtraPointTimeDisplayOption getExtraPointTimeDisplayOption() {
|
public ExtraPointTimeDisplayOption getExtraPointTimeDisplayOption() {
|
||||||
return extraPointTimeDisplayOption;
|
return extraPointTimeDisplayOption;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setExtraPointTimeDisplayOption(ExtraPointTimeDisplayOption extraPointTimeDisplayOption) {
|
public void setExtraPointTimeDisplayOption(
|
||||||
|
ExtraPointTimeDisplayOption extraPointTimeDisplayOption) {
|
||||||
this.extraPointTimeDisplayOption = extraPointTimeDisplayOption;
|
this.extraPointTimeDisplayOption = extraPointTimeDisplayOption;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1162,8 +1153,7 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
try {
|
try {
|
||||||
ret = Integer.parseInt(numberOfTimesText.getText());
|
ret = Integer.parseInt(numberOfTimesText.getText());
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch ( Exception e ){
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1189,8 +1179,7 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
public String getIntervalTimeString() {
|
public String getIntervalTimeString() {
|
||||||
if (intervalCombo.getSelectionIndex() == intervalCombo.getItemCount() - 1) {
|
if (intervalCombo.getSelectionIndex() == intervalCombo.getItemCount() - 1) {
|
||||||
return intervalText.getText();
|
return intervalText.getText();
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
return intervalCombo.getText();
|
return intervalCombo.getText();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1212,8 +1201,10 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
Calendar cal = Calendar.getInstance();
|
Calendar cal = Calendar.getInstance();
|
||||||
cal.set(Calendar.YEAR, firstTimeCalendar.get(Calendar.YEAR));
|
cal.set(Calendar.YEAR, firstTimeCalendar.get(Calendar.YEAR));
|
||||||
cal.set(Calendar.MONTH, firstTimeCalendar.get(Calendar.MONTH));
|
cal.set(Calendar.MONTH, firstTimeCalendar.get(Calendar.MONTH));
|
||||||
cal.set(Calendar.DAY_OF_MONTH, firstTimeCalendar.get(Calendar.DAY_OF_MONTH));
|
cal.set(Calendar.DAY_OF_MONTH,
|
||||||
cal.set(Calendar.HOUR_OF_DAY, firstTimeCalendar.get(Calendar.HOUR_OF_DAY));
|
firstTimeCalendar.get(Calendar.DAY_OF_MONTH));
|
||||||
|
cal.set(Calendar.HOUR_OF_DAY,
|
||||||
|
firstTimeCalendar.get(Calendar.HOUR_OF_DAY));
|
||||||
cal.set(Calendar.MINUTE, firstTimeCalendar.get(Calendar.MINUTE));
|
cal.set(Calendar.MINUTE, firstTimeCalendar.get(Calendar.MINUTE));
|
||||||
this.firstTimeCalendar = cal;
|
this.firstTimeCalendar = cal;
|
||||||
}
|
}
|
||||||
|
@ -1226,8 +1217,10 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
Calendar cal = Calendar.getInstance();
|
Calendar cal = Calendar.getInstance();
|
||||||
cal.set(Calendar.YEAR, secondTimeCalendar.get(Calendar.YEAR));
|
cal.set(Calendar.YEAR, secondTimeCalendar.get(Calendar.YEAR));
|
||||||
cal.set(Calendar.MONTH, secondTimeCalendar.get(Calendar.MONTH));
|
cal.set(Calendar.MONTH, secondTimeCalendar.get(Calendar.MONTH));
|
||||||
cal.set(Calendar.DAY_OF_MONTH, secondTimeCalendar.get(Calendar.DAY_OF_MONTH));
|
cal.set(Calendar.DAY_OF_MONTH,
|
||||||
cal.set(Calendar.HOUR_OF_DAY, secondTimeCalendar.get(Calendar.HOUR_OF_DAY));
|
secondTimeCalendar.get(Calendar.DAY_OF_MONTH));
|
||||||
|
cal.set(Calendar.HOUR_OF_DAY,
|
||||||
|
secondTimeCalendar.get(Calendar.HOUR_OF_DAY));
|
||||||
cal.set(Calendar.MINUTE, secondTimeCalendar.get(Calendar.MINUTE));
|
cal.set(Calendar.MINUTE, secondTimeCalendar.get(Calendar.MINUTE));
|
||||||
this.secondTimeCalendar = cal;
|
this.secondTimeCalendar = cal;
|
||||||
}
|
}
|
||||||
|
@ -1283,10 +1276,10 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The following methods are used in DrawableElementFactory class to set up all
|
* The following methods are used in DrawableElementFactory class to set up
|
||||||
* necessary attributes for drawing a line. Since Track element dialogue GUI does
|
* all necessary attributes for drawing a line. Since Track element dialogue
|
||||||
* not supply all of those attributes needed by a line. The methods below provide
|
* GUI does not supply all of those attributes needed by a line. The methods
|
||||||
* some default values for the attributes
|
* below provide some default values for the attributes
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* Update the attributes
|
* Update the attributes
|
||||||
|
@ -1325,12 +1318,6 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public FontStyle getFontStyle() {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean[] getExtraPointTimeTextDisplayIndicator() {
|
public boolean[] getExtraPointTimeTextDisplayIndicator() {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
@ -1349,10 +1336,11 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a String in gempak time format to a calendar.
|
* Convert a String in gempak time format to a calendar.
|
||||||
* @param gempakTm - String in GEMPAK time format
|
*
|
||||||
|
* @param gempakTm
|
||||||
|
* - String in GEMPAK time format
|
||||||
* @return - Calendar
|
* @return - Calendar
|
||||||
*/
|
*/
|
||||||
private Calendar gempakTM2Calendar(String gempakTm) {
|
private Calendar gempakTM2Calendar(String gempakTm) {
|
||||||
|
@ -1369,8 +1357,7 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||||
cal.set(Calendar.DAY_OF_MONTH, day);
|
cal.set(Calendar.DAY_OF_MONTH, day);
|
||||||
cal.set(Calendar.HOUR_OF_DAY, hour);
|
cal.set(Calendar.HOUR_OF_DAY, hour);
|
||||||
cal.set(Calendar.MINUTE, min);
|
cal.set(Calendar.MINUTE, min);
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e){
|
|
||||||
cal = null;
|
cal = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,9 +69,27 @@ public class DefaultElementContainer extends AbstractElementContainer {
|
||||||
public void draw(IGraphicsTarget target, PaintProperties paintProps,
|
public void draw(IGraphicsTarget target, PaintProperties paintProps,
|
||||||
DisplayProperties dprops, boolean needsCreate) {
|
DisplayProperties dprops, boolean needsCreate) {
|
||||||
|
|
||||||
if ((displayEls == null) || paintProps.isZooming())
|
/*
|
||||||
|
* For ghost drawing - "needsCreate && dprops == null" - It is always on
|
||||||
|
* the active layer so DiaplayProperties' "filled" should be true while
|
||||||
|
* "monoColor" should be false (using the element's color).
|
||||||
|
*/
|
||||||
|
if (needsCreate && dprops == null) {
|
||||||
|
dprops = new DisplayProperties(false, null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// For normal drawing........
|
||||||
|
if ((displayEls == null) || paintProps.isZooming()) {
|
||||||
needsCreate = true;
|
needsCreate = true;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* TTR971 - needs to set display properties, otherwise the layer
|
||||||
|
* color may not take effect (e.g., after switching projection)
|
||||||
|
*/
|
||||||
|
def.setLayerDisplayAttr(dprops.getLayerMonoColor(),
|
||||||
|
dprops.getLayerColor(), dprops.getLayerFilled());
|
||||||
|
}
|
||||||
|
|
||||||
if (paintProps.getZoomLevel() != zoomLevel) {
|
if (paintProps.getZoomLevel() != zoomLevel) {
|
||||||
needsCreate = true;
|
needsCreate = true;
|
||||||
zoomLevel = paintProps.getZoomLevel();
|
zoomLevel = paintProps.getZoomLevel();
|
||||||
|
@ -102,5 +120,4 @@ public class DefaultElementContainer extends AbstractElementContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,6 +143,9 @@ import com.vividsolutions.jts.operation.distance.DistanceOp;
|
||||||
* 05/14 TTR 995 J. Wu Make contour label auto-placement an option.
|
* 05/14 TTR 995 J. Wu Make contour label auto-placement an option.
|
||||||
* 07/14 ? B. Yin Added support for dashed-line circle for TCM 12 feet sea.
|
* 07/14 ? B. Yin Added support for dashed-line circle for TCM 12 feet sea.
|
||||||
* 08/14 ? B. Yin Fixed world wrap for TCM track and zero circle issues.
|
* 08/14 ? B. Yin Fixed world wrap for TCM track and zero circle issues.
|
||||||
|
* 08/14 TTR972 J. Wu Draw filled object as filled only if either its layer's "filled" flag
|
||||||
|
* "true" or they are on the active layer, .
|
||||||
|
* 09/14 TTR750 J. Wu Draw track label with specified font styles.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author sgilbert
|
* @author sgilbert
|
||||||
|
@ -524,6 +527,7 @@ public class DisplayElementFactory {
|
||||||
if (isFilled) {
|
if (isFilled) {
|
||||||
list.add(createFill(pts));
|
list.add(createFill(pts));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Compile each IWireframeShape, create its LineDisplayElement, and add
|
* Compile each IWireframeShape, create its LineDisplayElement, and add
|
||||||
* to IDisplayable return list
|
* to IDisplayable return list
|
||||||
|
@ -1814,7 +1818,8 @@ public class DisplayElementFactory {
|
||||||
double major = Math.sqrt((diff[0] * diff[0]) + (diff[1] * diff[1]));
|
double major = Math.sqrt((diff[0] * diff[0]) + (diff[1] * diff[1]));
|
||||||
double minor = major * arc.getAxisRatio();
|
double minor = major * arc.getAxisRatio();
|
||||||
|
|
||||||
if (major / this.screenToExtent < 0.000001) { // ignore circles with major = 0
|
if (major / this.screenToExtent < 0.000001) { // ignore circles with
|
||||||
|
// major = 0
|
||||||
return slist;
|
return slist;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2035,8 +2040,9 @@ public class DisplayElementFactory {
|
||||||
Text txt = new Text(null, track.getFontName(),
|
Text txt = new Text(null, track.getFontName(),
|
||||||
track.getFontSize(), TextJustification.LEFT_JUSTIFY,
|
track.getFontSize(), TextJustification.LEFT_JUSTIFY,
|
||||||
pt.getLocation(), 0.0, TextRotation.SCREEN_RELATIVE,
|
pt.getLocation(), 0.0, TextRotation.SCREEN_RELATIVE,
|
||||||
new String[] { dtime }, FontStyle.BOLD, iniDspClr, 0,
|
new String[] { dtime }, track.getFontStyle(),
|
||||||
3, false, DisplayType.NORMAL, "Text", "General Text");
|
iniDspClr, 0, 3, false, DisplayType.NORMAL, "Text",
|
||||||
|
"General Text");
|
||||||
temps = createDisplayElements((IText) txt, paintProps);
|
temps = createDisplayElements((IText) txt, paintProps);
|
||||||
slist.addAll(temps);
|
slist.addAll(temps);
|
||||||
}
|
}
|
||||||
|
@ -2093,8 +2099,9 @@ public class DisplayElementFactory {
|
||||||
Text txt = new Text(null, track.getFontName(),
|
Text txt = new Text(null, track.getFontName(),
|
||||||
track.getFontSize(), TextJustification.LEFT_JUSTIFY,
|
track.getFontSize(), TextJustification.LEFT_JUSTIFY,
|
||||||
pt.getLocation(), 0.0, TextRotation.SCREEN_RELATIVE,
|
pt.getLocation(), 0.0, TextRotation.SCREEN_RELATIVE,
|
||||||
new String[] { dtime }, FontStyle.BOLD, expDspClr, 0,
|
new String[] { dtime }, track.getFontStyle(),
|
||||||
3, false, DisplayType.NORMAL, "Text", "General Text");
|
expDspClr, 0, 3, false, DisplayType.NORMAL, "Text",
|
||||||
|
"General Text");
|
||||||
temps = createDisplayElements((IText) txt, paintProps);
|
temps = createDisplayElements((IText) txt, paintProps);
|
||||||
slist.addAll(temps);
|
slist.addAll(temps);
|
||||||
}
|
}
|
||||||
|
@ -4814,10 +4821,22 @@ public class DisplayElementFactory {
|
||||||
*/
|
*/
|
||||||
private boolean getDisplayFillMode(Boolean filled) {
|
private boolean getDisplayFillMode(Boolean filled) {
|
||||||
|
|
||||||
if (layerFilled) {
|
/*
|
||||||
return layerFilled;
|
* if (layerFilled) { return layerFilled; } else { return filled; }
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* TTR 972 - to match NMAP2 behavior, non-filled elements will always be
|
||||||
|
* drawn as non-filled. Filled objects should be drawn as filled only
|
||||||
|
* when the "filled" flag for its layer is set to "true" or they are on
|
||||||
|
* the active layer, so it is necessary to set the "layerFilled" flag to
|
||||||
|
* true before generating displayables for such objects (see
|
||||||
|
* PgenResource.drawFilledElement()).
|
||||||
|
*/
|
||||||
|
if (filled && layerFilled) {
|
||||||
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return filled;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,14 @@
|
||||||
*/
|
*/
|
||||||
package gov.noaa.nws.ncep.ui.pgen.display;
|
package gov.noaa.nws.ncep.ui.pgen.display;
|
||||||
|
|
||||||
|
import gov.noaa.nws.ncep.ui.pgen.display.IText.FontStyle;
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
|
||||||
import gov.noaa.nws.ncep.ui.pgen.display.IText.FontStyle;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface used to get specific attributes of a PGEN Storm track object.
|
* Interface used to get specific attributes of a PGEN Storm track object.
|
||||||
|
*
|
||||||
* @author sgilbert
|
* @author sgilbert
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -22,15 +23,9 @@ public interface ITrack extends ILine{
|
||||||
/**
|
/**
|
||||||
* this enum stores the time display options for extra points
|
* this enum stores the time display options for extra points
|
||||||
*/
|
*/
|
||||||
public static enum ExtraPointTimeDisplayOption { SKIP_FACTOR, SHOW_FIRST_LAST, ON_ONE_HOUR, ON_HALF_HOUR };
|
public static enum ExtraPointTimeDisplayOption {
|
||||||
|
SKIP_FACTOR, SHOW_FIRST_LAST, ON_ONE_HOUR, ON_HALF_HOUR
|
||||||
// /**
|
};
|
||||||
// * Defines available font styles
|
|
||||||
// * @return font style
|
|
||||||
// */
|
|
||||||
// public static enum FontStyle {
|
|
||||||
// REGULAR, BOLD, ITALIC, BOLD_ITALIC
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a font style for text of track points
|
* Gets a font style for text of track points
|
||||||
|
@ -38,7 +33,8 @@ public interface ITrack extends ILine{
|
||||||
public FontStyle getFontStyle();
|
public FontStyle getFontStyle();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fets a boolean array that indicates if a time text of a extra point should be skipped
|
* Fets a boolean array that indicates if a time text of a extra point
|
||||||
|
* should be skipped
|
||||||
*/
|
*/
|
||||||
public boolean[] getExtraPointTimeTextDisplayIndicator();
|
public boolean[] getExtraPointTimeTextDisplayIndicator();
|
||||||
|
|
||||||
|
@ -49,76 +45,96 @@ public interface ITrack extends ILine{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets color to plot the initial storm points
|
* Gets color to plot the initial storm points
|
||||||
|
*
|
||||||
* @return color
|
* @return color
|
||||||
*/
|
*/
|
||||||
public Color getInitialColor();
|
public Color getInitialColor();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the line pattern used to display the initial storm points
|
* Gets the line pattern used to display the initial storm points
|
||||||
|
*
|
||||||
* @return line pattern
|
* @return line pattern
|
||||||
*/
|
*/
|
||||||
public String getInitialLinePattern();
|
public String getInitialLinePattern();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the marker used to display the initial storm points
|
* Gets the marker used to display the initial storm points
|
||||||
|
*
|
||||||
* @return marker type
|
* @return marker type
|
||||||
*/
|
*/
|
||||||
public String getInitialMarker();
|
public String getInitialMarker();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the initial storm points and associated date/times
|
* Gets the initial storm points and associated date/times
|
||||||
|
*
|
||||||
* @return track points
|
* @return track points
|
||||||
*/
|
*/
|
||||||
public TrackPoint[] getInitialPoints();
|
public TrackPoint[] getInitialPoints();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets color to plot the extrapolated storm points
|
* Gets color to plot the extrapolated storm points
|
||||||
|
*
|
||||||
* @return color
|
* @return color
|
||||||
*/
|
*/
|
||||||
public Color getExtrapColor();
|
public Color getExtrapColor();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the line pattern used to display the extrapolated storm points
|
* Gets the line pattern used to display the extrapolated storm points
|
||||||
|
*
|
||||||
* @return line pattern
|
* @return line pattern
|
||||||
*/
|
*/
|
||||||
public String getExtrapLinePattern();
|
public String getExtrapLinePattern();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the marker used to display the extrapolated storm points
|
* Gets the marker used to display the extrapolated storm points
|
||||||
|
*
|
||||||
* @return marker type
|
* @return marker type
|
||||||
*/
|
*/
|
||||||
public String getExtrapMarker();
|
public String getExtrapMarker();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the extrapolated storm points and associated date/times
|
* Gets the extrapolated storm points and associated date/times
|
||||||
|
*
|
||||||
* @return track points
|
* @return track points
|
||||||
*/
|
*/
|
||||||
public TrackPoint[] getExtrapPoints();
|
public TrackPoint[] getExtrapPoints();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the font used to display the location times
|
* Gets the font used to display the location times
|
||||||
|
*
|
||||||
* @return font name
|
* @return font name
|
||||||
*/
|
*/
|
||||||
public String getFontName();
|
public String getFontName();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the size of the font
|
* Gets the size of the font
|
||||||
|
*
|
||||||
* @return font size
|
* @return font size
|
||||||
*/
|
*/
|
||||||
public float getFontSize();
|
public float getFontSize();
|
||||||
|
|
||||||
public Calendar getFirstTimeCalendar();
|
public Calendar getFirstTimeCalendar();
|
||||||
|
|
||||||
public Calendar getSecondTimeCalendar();
|
public Calendar getSecondTimeCalendar();
|
||||||
|
|
||||||
public boolean isSetTimeButtonSelected();
|
public boolean isSetTimeButtonSelected();
|
||||||
|
|
||||||
public int getExtraDrawingPointNumber();
|
public int getExtraDrawingPointNumber();
|
||||||
public FontStyle getStyle();
|
|
||||||
public String getSkipFactorText();
|
public String getSkipFactorText();
|
||||||
|
|
||||||
public int getFontNameComboSelectedIndex();
|
public int getFontNameComboSelectedIndex();
|
||||||
|
|
||||||
public int getFontSizeComboSelectedIndex();
|
public int getFontSizeComboSelectedIndex();
|
||||||
|
|
||||||
public int getFontStyleComboSelectedIndex();
|
public int getFontStyleComboSelectedIndex();
|
||||||
|
|
||||||
public int getUnitComboSelectedIndex();
|
public int getUnitComboSelectedIndex();
|
||||||
|
|
||||||
public int getRoundComboSelectedIndex();
|
public int getRoundComboSelectedIndex();
|
||||||
|
|
||||||
public int getRoundDirComboSelectedIndex();
|
public int getRoundDirComboSelectedIndex();
|
||||||
|
|
||||||
public String getIntervalTimeString();
|
public String getIntervalTimeString();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,8 +15,10 @@ import com.raytheon.uf.viz.core.map.IMapDescriptor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An Element Container that can be used for most Symbol/Marker Elements.
|
* An Element Container that can be used for most Symbol/Marker Elements.
|
||||||
* Recreation of the IDisplayable objects is only done if the layer DisplayProperties change.
|
* Recreation of the IDisplayable objects is only done if the layer
|
||||||
* The raster images do not need to be recreated when panning or zooming.
|
* DisplayProperties change. The raster images do not need to be recreated when
|
||||||
|
* panning or zooming.
|
||||||
|
*
|
||||||
* @author sgilbert
|
* @author sgilbert
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -36,9 +38,13 @@ public class RasterElementContainer extends AbstractElementContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Draws to the given graphics target. Recreates the IDisplayable objects
|
* Draws to the given graphics target. Recreates the IDisplayable objects if
|
||||||
* if the Layer properties change.
|
* the Layer properties change.
|
||||||
* @see gov.noaa.nws.ncep.ui.pgen.display.AbstractTBNL#draw(com.raytheon.uf.viz.core.IGraphicsTarget, com.raytheon.uf.viz.core.drawables.PaintProperties)
|
*
|
||||||
|
* @see
|
||||||
|
* gov.noaa.nws.ncep.ui.pgen.display.AbstractTBNL#draw(com.raytheon.uf.viz
|
||||||
|
* .core.IGraphicsTarget,
|
||||||
|
* com.raytheon.uf.viz.core.drawables.PaintProperties)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void draw(IGraphicsTarget target, PaintProperties paintProps,
|
public void draw(IGraphicsTarget target, PaintProperties paintProps,
|
||||||
|
@ -47,22 +53,38 @@ public class RasterElementContainer extends AbstractElementContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Draws to the given graphics target. Recreates the IDisplayable objects
|
* Draws to the given graphics target. Recreates the IDisplayable objects if
|
||||||
* if the Layer properties change.
|
* the Layer properties change.
|
||||||
* @see gov.noaa.nws.ncep.ui.pgen.display.AbstractTBNL#draw(com.raytheon.uf.viz.core.IGraphicsTarget, com.raytheon.uf.viz.core.drawables.PaintProperties, boolean)
|
*
|
||||||
|
* @see
|
||||||
|
* gov.noaa.nws.ncep.ui.pgen.display.AbstractTBNL#draw(com.raytheon.uf.viz
|
||||||
|
* .core.IGraphicsTarget,
|
||||||
|
* com.raytheon.uf.viz.core.drawables.PaintProperties, boolean)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void draw(IGraphicsTarget target, PaintProperties paintProps,
|
public void draw(IGraphicsTarget target, PaintProperties paintProps,
|
||||||
DisplayProperties dprops, boolean needsCreate) {
|
DisplayProperties dprops, boolean needsCreate) {
|
||||||
|
|
||||||
if ( displayEls == null ) needsCreate = true;
|
if (displayEls == null) {
|
||||||
|
needsCreate = true;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* TTR971 - needs to set display properties, otherwise the layer
|
||||||
|
* color may not take effect (e.g., after switching projection)
|
||||||
|
*/
|
||||||
|
def.setLayerDisplayAttr(dprops.getLayerMonoColor(),
|
||||||
|
dprops.getLayerColor(), dprops.getLayerFilled());
|
||||||
|
}
|
||||||
|
|
||||||
if ((dprops != null) && !dprops.equals(saveProps)) {
|
if ((dprops != null) && !dprops.equals(saveProps)) {
|
||||||
def.setLayerDisplayAttr(dprops.getLayerMonoColor(), dprops.getLayerColor(), dprops.getLayerFilled());
|
def.setLayerDisplayAttr(dprops.getLayerMonoColor(),
|
||||||
|
dprops.getLayerColor(), dprops.getLayerFilled());
|
||||||
needsCreate = true;
|
needsCreate = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( needsCreate ) createDisplayables(paintProps);
|
if (needsCreate)
|
||||||
|
createDisplayables(paintProps);
|
||||||
|
|
||||||
saveProps = dprops;
|
saveProps = dprops;
|
||||||
|
|
||||||
for (IDisplayable each : displayEls) {
|
for (IDisplayable each : displayEls) {
|
||||||
|
|
|
@ -154,6 +154,14 @@ public class TextDisplayElement implements IDisplayable {
|
||||||
target.drawShadedRect(box, bg, 1.0, null);
|
target.drawShadedRect(box, bg, 1.0, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* TTR 741 (10/2014) - Note, for single-line text, we could match it
|
||||||
|
* to Raytheon's text style. For multi-line text, we cannot match it
|
||||||
|
* to Raytheon's since it may add box, overline, underline to each
|
||||||
|
* line of text, not one single box, overline, or underline - so we
|
||||||
|
* may need to develop a new drawing method or ask Raytheon to
|
||||||
|
* provide support in GlTarget.
|
||||||
|
*/
|
||||||
switch (displayType) {
|
switch (displayType) {
|
||||||
|
|
||||||
case NORMAL:
|
case NORMAL:
|
||||||
|
@ -161,19 +169,40 @@ public class TextDisplayElement implements IDisplayable {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BOX:
|
case BOX:
|
||||||
|
// dstring.textStyle = TextStyle.BOXED;
|
||||||
|
if (dstring.getText().length > 1) {
|
||||||
|
target.drawRect(box, dstring.getColors()[0], 1.0f, 1.0);
|
||||||
|
} else {
|
||||||
dstring.textStyle = TextStyle.BOXED;
|
dstring.textStyle = TextStyle.BOXED;
|
||||||
|
}
|
||||||
// target.drawRect(box, dstring.getColors()[0], 1.0f, 1.0);
|
// target.drawRect(box, dstring.getColors()[0], 1.0f, 1.0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OVERLINE:
|
case OVERLINE:
|
||||||
|
// dstring.textStyle = TextStyle.OVERLINE;
|
||||||
|
if (dstring.getText().length > 1) {
|
||||||
|
target.drawLine(box.getMinX(), box.getMinY(), 0.0,
|
||||||
|
box.getMaxX(), box.getMinY(), 0.0,
|
||||||
|
dstring.getColors()[0], 1.0f);
|
||||||
|
} else {
|
||||||
|
|
||||||
dstring.textStyle = TextStyle.OVERLINE;
|
dstring.textStyle = TextStyle.OVERLINE;
|
||||||
|
}
|
||||||
// target.drawLine(box.getMinX(), box.getMinY(), 0.0,
|
// target.drawLine(box.getMinX(), box.getMinY(), 0.0,
|
||||||
// box.getMaxX(), box.getMinY(), 0.0,
|
// box.getMaxX(), box.getMinY(), 0.0,
|
||||||
// dstring.getColors()[0], 1.0f);
|
// dstring.getColors()[0], 1.0f);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UNDERLINE:
|
case UNDERLINE:
|
||||||
|
// dstring.textStyle = TextStyle.UNDERLINE;
|
||||||
|
if (dstring.getText().length > 1) {
|
||||||
|
target.drawLine(box.getMinX(), box.getMaxY(), 0.0,
|
||||||
|
box.getMaxX(), box.getMaxY(), 0.0,
|
||||||
|
dstring.getColors()[0], 1.0f);
|
||||||
|
|
||||||
|
} else {
|
||||||
dstring.textStyle = TextStyle.UNDERLINE;
|
dstring.textStyle = TextStyle.UNDERLINE;
|
||||||
|
}
|
||||||
// target.drawLine(box.getMinX(), box.getMaxY(), 0.0,
|
// target.drawLine(box.getMinX(), box.getMaxY(), 0.0,
|
||||||
// box.getMaxX(), box.getMaxY(), 0.0,
|
// box.getMaxX(), box.getMaxY(), 0.0,
|
||||||
// dstring.getColors()[0], 1.0f);
|
// dstring.getColors()[0], 1.0f);
|
||||||
|
|
|
@ -46,17 +46,16 @@ import com.vividsolutions.jts.geom.Coordinate;
|
||||||
*/
|
*/
|
||||||
@ElementOperations({ Operation.COPY_MOVE, Operation.EXTRAPOLATE })
|
@ElementOperations({ Operation.COPY_MOVE, Operation.EXTRAPOLATE })
|
||||||
public class Track extends Line implements ITrack {
|
public class Track extends Line implements ITrack {
|
||||||
//public class Track extends MultiPointElement implements ITrack {
|
|
||||||
|
|
||||||
// private final static org.apache.log4j.Logger log =
|
|
||||||
// org.apache.log4j.Logger.getLogger(Track.class);
|
|
||||||
|
|
||||||
|
|
||||||
private final static float DEFAULT_FONT_SIZE = 14.0f;
|
private final static float DEFAULT_FONT_SIZE = 14.0f;
|
||||||
|
|
||||||
private final static float DEFAULT_LINE_WIDTH = 0.1f;
|
private final static float DEFAULT_LINE_WIDTH = 0.1f;
|
||||||
|
|
||||||
private final static int DEFAULT_EXTRA_POINT_NUMBER = 5;
|
private final static int DEFAULT_EXTRA_POINT_NUMBER = 5;
|
||||||
|
|
||||||
// private final static int DEFAULT_INTERVAL_HOUR = 1;
|
// private final static int DEFAULT_INTERVAL_HOUR = 1;
|
||||||
private final static String INTERVAL_TIME_FORMAT_PATTERN = "HH:mm";
|
private final static String INTERVAL_TIME_FORMAT_PATTERN = "HH:mm";
|
||||||
|
|
||||||
public void setExtrapMarker(String extrapMarker) {
|
public void setExtrapMarker(String extrapMarker) {
|
||||||
this.extrapMarker = extrapMarker;
|
this.extrapMarker = extrapMarker;
|
||||||
}
|
}
|
||||||
|
@ -66,74 +65,105 @@ public class Track extends Line implements ITrack {
|
||||||
}
|
}
|
||||||
|
|
||||||
private final static String INITIAL_MARKER = "FILLED_DIAMOND";
|
private final static String INITIAL_MARKER = "FILLED_DIAMOND";
|
||||||
|
|
||||||
private final static String EXTRAP_MARKER = "FILLED_TRIANGLE";
|
private final static String EXTRAP_MARKER = "FILLED_TRIANGLE";
|
||||||
|
|
||||||
private final static String INITIAL_LINE_PATTERN = "LINE_SOLID";
|
private final static String INITIAL_LINE_PATTERN = "LINE_SOLID";
|
||||||
|
|
||||||
private final static String EXTRAP_LINE_PATTERN = "LINE_SOLID";
|
private final static String EXTRAP_LINE_PATTERN = "LINE_SOLID";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This value of DEFAULT_LINE_PATTERN is a temporary solution
|
* This value of DEFAULT_LINE_PATTERN is a temporary solution Eventually a
|
||||||
* Eventually a decision needs to be done for what a value
|
* decision needs to be done for what a value should be used
|
||||||
* should be used
|
|
||||||
*/
|
*/
|
||||||
public final static String TRACK_PGEN_CATEGORY = "Track";
|
public final static String TRACK_PGEN_CATEGORY = "Track";
|
||||||
|
|
||||||
public final static String TRACK_INFO_DLG_CATEGORY_NAME = "TRACK_EXTRA_POINTS_INFO";
|
public final static String TRACK_INFO_DLG_CATEGORY_NAME = "TRACK_EXTRA_POINTS_INFO";
|
||||||
|
|
||||||
public final static String TRACK_PGEN_TYPE = "STORM_TRACK";
|
public final static String TRACK_PGEN_TYPE = "STORM_TRACK";
|
||||||
|
|
||||||
private Color initialColor;
|
private Color initialColor;
|
||||||
|
|
||||||
private Color extrapColor;
|
private Color extrapColor;
|
||||||
|
|
||||||
private String initialMarker;
|
private String initialMarker;
|
||||||
|
|
||||||
private String initialLinePattern;
|
private String initialLinePattern;
|
||||||
|
|
||||||
private String extrapMarker;
|
private String extrapMarker;
|
||||||
|
|
||||||
private String extrapLinePattern;
|
private String extrapLinePattern;
|
||||||
|
|
||||||
private TrackPoint[] initTrackPoints;
|
private TrackPoint[] initTrackPoints;
|
||||||
|
|
||||||
private TrackPoint[] extrapPoints;
|
private TrackPoint[] extrapPoints;
|
||||||
|
|
||||||
private String fontName;
|
private String fontName;
|
||||||
|
|
||||||
private float fontSize;
|
private float fontSize;
|
||||||
|
|
||||||
private FontStyle fontStyle;
|
private FontStyle fontStyle;
|
||||||
|
|
||||||
private float lineWidth;
|
private float lineWidth;
|
||||||
|
|
||||||
private int extraDrawingPointNumber;
|
private int extraDrawingPointNumber;
|
||||||
|
|
||||||
private boolean setTimeButtonSelected;
|
private boolean setTimeButtonSelected;
|
||||||
|
|
||||||
private Calendar firstTimeCalendar;
|
private Calendar firstTimeCalendar;
|
||||||
|
|
||||||
private Calendar secondTimeCalendar;
|
private Calendar secondTimeCalendar;
|
||||||
|
|
||||||
private String intervalTimeString;
|
private String intervalTimeString;
|
||||||
|
|
||||||
private int intervalComboSelectedIndex;
|
private int intervalComboSelectedIndex;
|
||||||
|
|
||||||
private int fontSizeComboSelectedIndex;
|
private int fontSizeComboSelectedIndex;
|
||||||
|
|
||||||
private int fontNameComboSelectedIndex;
|
private int fontNameComboSelectedIndex;
|
||||||
|
|
||||||
private int fontStyleComboSelectedIndex;
|
private int fontStyleComboSelectedIndex;
|
||||||
|
|
||||||
private int elapsedHourForExtraPoint;
|
private int elapsedHourForExtraPoint;
|
||||||
|
|
||||||
private int elapsedMinuteForExtraPoint;
|
private int elapsedMinuteForExtraPoint;
|
||||||
|
|
||||||
private ExtraPointTimeDisplayOption extraPointTimeDisplayOption;
|
private ExtraPointTimeDisplayOption extraPointTimeDisplayOption;
|
||||||
|
|
||||||
private String skipFactorTextString;
|
private String skipFactorTextString;
|
||||||
|
|
||||||
private boolean[] extraPointTimeTextDisplayIndicator;
|
private boolean[] extraPointTimeTextDisplayIndicator;
|
||||||
|
|
||||||
// direction, speed and unit are not saved to a file
|
// direction, speed and unit are not saved to a file
|
||||||
private double directionForExtraPoints;
|
private double directionForExtraPoints;
|
||||||
|
|
||||||
private boolean roundDirBtnSelected;
|
private boolean roundDirBtnSelected;
|
||||||
|
|
||||||
private int roundDirComboSelectedIndex;
|
private int roundDirComboSelectedIndex;
|
||||||
|
|
||||||
private double speed; // speed in meter/millisecond
|
private double speed; // speed in meter/millisecond
|
||||||
|
|
||||||
private double speedInKnotOverHour;
|
private double speedInKnotOverHour;
|
||||||
|
|
||||||
private double speedInKilometerOverHour;
|
private double speedInKilometerOverHour;
|
||||||
|
|
||||||
private double speedInMileOverHour;
|
private double speedInMileOverHour;
|
||||||
|
|
||||||
private boolean roundBtnSelected;
|
private boolean roundBtnSelected;
|
||||||
|
|
||||||
private int unitComboSelectedIndex;
|
private int unitComboSelectedIndex;
|
||||||
|
|
||||||
private int roundComboSelectedIndex;
|
private int roundComboSelectedIndex;
|
||||||
|
|
||||||
public Track() {}
|
public Track() {
|
||||||
|
}
|
||||||
|
|
||||||
public Track(ArrayList<Coordinate> _locations, Calendar _firstTimeCalendar,
|
public Track(ArrayList<Coordinate> _locations, Calendar _firstTimeCalendar,
|
||||||
Calendar _secondTimeCalendar) {
|
Calendar _secondTimeCalendar) {
|
||||||
initializeInitTrackPoints(_locations,
|
initializeInitTrackPoints(_locations, _firstTimeCalendar,
|
||||||
_firstTimeCalendar, _secondTimeCalendar);
|
_secondTimeCalendar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void initializeInitTrackPoints(ArrayList<Coordinate> locations,
|
public void initializeInitTrackPoints(ArrayList<Coordinate> locations,
|
||||||
Calendar firstTimeCalendar, Calendar secondTimeCalendar) {
|
Calendar firstTimeCalendar, Calendar secondTimeCalendar) {
|
||||||
initializeInitTrackPoints(locations);
|
initializeInitTrackPoints(locations);
|
||||||
|
@ -141,49 +171,61 @@ public class Track extends Line implements ITrack {
|
||||||
initializeInitSecondTimeCalendar(secondTimeCalendar);
|
initializeInitSecondTimeCalendar(secondTimeCalendar);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initializeTrackByTrackAttrDlgAndLocationList(ITrack trackAttrDlgObject, ArrayList<Coordinate> locations) {
|
public void initializeTrackByTrackAttrDlgAndLocationList(
|
||||||
|
ITrack trackAttrDlgObject, ArrayList<Coordinate> locations) {
|
||||||
initializeInitTrackPoints(locations);
|
initializeInitTrackPoints(locations);
|
||||||
initializeInitFirstTimeCalendar(trackAttrDlgObject.getFirstTimeCalendar());
|
initializeInitFirstTimeCalendar(trackAttrDlgObject
|
||||||
initializeInitSecondTimeCalendar(trackAttrDlgObject.getSecondTimeCalendar());
|
.getFirstTimeCalendar());
|
||||||
|
initializeInitSecondTimeCalendar(trackAttrDlgObject
|
||||||
|
.getSecondTimeCalendar());
|
||||||
|
|
||||||
this.setInitialMarker("");
|
this.setInitialMarker("");
|
||||||
this.setSetTimeButtonSelected(trackAttrDlgObject.isSetTimeButtonSelected());
|
this.setSetTimeButtonSelected(trackAttrDlgObject
|
||||||
this.setExtraDrawingPointNumber(trackAttrDlgObject.getExtraDrawingPointNumber());
|
.isSetTimeButtonSelected());
|
||||||
|
this.setExtraDrawingPointNumber(trackAttrDlgObject
|
||||||
|
.getExtraDrawingPointNumber());
|
||||||
|
|
||||||
this.setIntervalTimeString(getIntervalTimeTextStringValue(trackAttrDlgObject));
|
this.setIntervalTimeString(getIntervalTimeTextStringValue(trackAttrDlgObject));
|
||||||
|
|
||||||
this.setFontName(trackAttrDlgObject.getFontName());
|
this.setFontName(trackAttrDlgObject.getFontName());
|
||||||
this.setFontStyle(trackAttrDlgObject.getStyle());
|
this.setFontStyle(trackAttrDlgObject.getFontStyle());
|
||||||
this.setFontSize(trackAttrDlgObject.getFontSize());
|
this.setFontSize(trackAttrDlgObject.getFontSize());
|
||||||
this.setInitialColor(trackAttrDlgObject.getInitialColor());
|
this.setInitialColor(trackAttrDlgObject.getInitialColor());
|
||||||
this.setExtrapColor(trackAttrDlgObject.getExtrapColor());
|
this.setExtrapColor(trackAttrDlgObject.getExtrapColor());
|
||||||
this.setExtraPointTimeDisplayOption(trackAttrDlgObject.getExtraPointTimeDisplayOption());
|
this.setExtraPointTimeDisplayOption(trackAttrDlgObject
|
||||||
|
.getExtraPointTimeDisplayOption());
|
||||||
this.setSkipFactorTextString(trackAttrDlgObject.getSkipFactorText());
|
this.setSkipFactorTextString(trackAttrDlgObject.getSkipFactorText());
|
||||||
this.setFontNameComboSelectedIndex(trackAttrDlgObject.getFontNameComboSelectedIndex());
|
this.setFontNameComboSelectedIndex(trackAttrDlgObject
|
||||||
this.setFontSizeComboSelectedIndex(trackAttrDlgObject.getFontSizeComboSelectedIndex());
|
.getFontNameComboSelectedIndex());
|
||||||
this.setFontStyleComboSelectedIndex(trackAttrDlgObject.getFontStyleComboSelectedIndex());
|
this.setFontSizeComboSelectedIndex(trackAttrDlgObject
|
||||||
this.setUnitComboSelectedIndex(trackAttrDlgObject.getUnitComboSelectedIndex());
|
.getFontSizeComboSelectedIndex());
|
||||||
this.setRoundComboSelectedIndex(trackAttrDlgObject.getRoundComboSelectedIndex());
|
this.setFontStyleComboSelectedIndex(trackAttrDlgObject
|
||||||
|
.getFontStyleComboSelectedIndex());
|
||||||
|
this.setUnitComboSelectedIndex(trackAttrDlgObject
|
||||||
|
.getUnitComboSelectedIndex());
|
||||||
|
this.setRoundComboSelectedIndex(trackAttrDlgObject
|
||||||
|
.getRoundComboSelectedIndex());
|
||||||
if (trackAttrDlgObject.getRoundComboSelectedIndex() > 0)
|
if (trackAttrDlgObject.getRoundComboSelectedIndex() > 0)
|
||||||
this.setRoundBtnSelected(true);
|
this.setRoundBtnSelected(true);
|
||||||
else
|
else
|
||||||
this.setRoundBtnSelected(false);
|
this.setRoundBtnSelected(false);
|
||||||
|
|
||||||
this.setRoundDirComboSelectedIndex(trackAttrDlgObject.getRoundDirComboSelectedIndex());
|
this.setRoundDirComboSelectedIndex(trackAttrDlgObject
|
||||||
|
.getRoundDirComboSelectedIndex());
|
||||||
if (trackAttrDlgObject.getRoundDirComboSelectedIndex() > 0)
|
if (trackAttrDlgObject.getRoundDirComboSelectedIndex() > 0)
|
||||||
this.setRoundDirBtnSelected(true);
|
this.setRoundDirBtnSelected(true);
|
||||||
else
|
else
|
||||||
this.setRoundDirBtnSelected(false);
|
this.setRoundDirBtnSelected(false);
|
||||||
|
|
||||||
//This method can be called only after all of the above settings are completed!
|
// This method can be called only after all of the above settings are
|
||||||
|
// completed!
|
||||||
this.calculateExtrapTrackPoints();
|
this.calculateExtrapTrackPoints();
|
||||||
/**
|
/**
|
||||||
* For now, the type is the name of a LinePattern defined in
|
* For now, the type is the name of a LinePattern defined in
|
||||||
* "gov.noaa.nws.ncep.ui.pgen.display.LinePatternList"
|
* "gov.noaa.nws.ncep.ui.pgen.display.LinePatternList" However, there is
|
||||||
* However, there is no type has been decided for Track element
|
* no type has been decided for Track element yet. Thus, it is now hard
|
||||||
* yet. Thus, it is now hard coded.
|
* coded.
|
||||||
*/
|
*/
|
||||||
// this.setType("Solid Lines");
|
|
||||||
this.setPgenCategory(Track.TRACK_PGEN_CATEGORY);
|
this.setPgenCategory(Track.TRACK_PGEN_CATEGORY);
|
||||||
this.setPgenType(Track.TRACK_PGEN_TYPE);
|
this.setPgenType(Track.TRACK_PGEN_TYPE);
|
||||||
}
|
}
|
||||||
|
@ -191,7 +233,7 @@ public class Track extends Line implements ITrack {
|
||||||
public void initializeInitTrackPoints(ArrayList<Coordinate> locations) {
|
public void initializeInitTrackPoints(ArrayList<Coordinate> locations) {
|
||||||
TrackPoint[] initTrackPointArray = new TrackPoint[locations.size()];
|
TrackPoint[] initTrackPointArray = new TrackPoint[locations.size()];
|
||||||
int arrayIndex = 0;
|
int arrayIndex = 0;
|
||||||
// log.info("inside Track.initializeInitTrackPoints, points Number="+locations.size());
|
|
||||||
for (Coordinate currentCoordinate : locations) {
|
for (Coordinate currentCoordinate : locations) {
|
||||||
TrackPoint eachTrackPoint = new TrackPoint(currentCoordinate, null);
|
TrackPoint eachTrackPoint = new TrackPoint(currentCoordinate, null);
|
||||||
initTrackPointArray[arrayIndex++] = eachTrackPoint;
|
initTrackPointArray[arrayIndex++] = eachTrackPoint;
|
||||||
|
@ -204,7 +246,8 @@ public class Track extends Line implements ITrack {
|
||||||
if (getInitTrackPoints() != null) {
|
if (getInitTrackPoints() != null) {
|
||||||
int initTrackPointLength = getInitTrackPoints().length;
|
int initTrackPointLength = getInitTrackPoints().length;
|
||||||
if (initTrackPointLength >= 2) {
|
if (initTrackPointLength >= 2) {
|
||||||
getInitTrackPoints()[initTrackPointLength - 2].setTime(firstCalendar);
|
getInitTrackPoints()[initTrackPointLength - 2]
|
||||||
|
.setTime(firstCalendar);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -214,38 +257,43 @@ public class Track extends Line implements ITrack {
|
||||||
if (getInitTrackPoints() != null) {
|
if (getInitTrackPoints() != null) {
|
||||||
int initTrackPointLength = getInitTrackPoints().length;
|
int initTrackPointLength = getInitTrackPoints().length;
|
||||||
if (initTrackPointLength >= 2) {
|
if (initTrackPointLength >= 2) {
|
||||||
getInitTrackPoints()[initTrackPointLength - 1].setTime(secondCalendar);
|
getInitTrackPoints()[initTrackPointLength - 1]
|
||||||
|
.setTime(secondCalendar);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void calculateExtrapTrackPoints() {
|
public void calculateExtrapTrackPoints() {
|
||||||
extrapPoints = calculateExtrapTrackPoints(getInitialPoints(), getFirstTimeCalendar(),
|
extrapPoints = calculateExtrapTrackPoints(getInitialPoints(),
|
||||||
getSecondTimeCalendar(), getExtraDrawingPointNumber(),
|
getFirstTimeCalendar(), getSecondTimeCalendar(),
|
||||||
getElapsedHourForExtraPoint(), getElapsedMinuteForExtraPoint(),
|
getExtraDrawingPointNumber(), getElapsedHourForExtraPoint(),
|
||||||
|
getElapsedMinuteForExtraPoint(),
|
||||||
getExtraPointTimeDisplayOption(), getSkipFactorTextString());
|
getExtraPointTimeDisplayOption(), getSkipFactorTextString());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* it is important to override the variable "ArrayList<Coordinate> linePoints" with
|
* it is important to override the variable
|
||||||
* initTrackPoints and extrapPoints arrays
|
* "ArrayList<Coordinate> linePoints" with initTrackPoints and
|
||||||
|
* extrapPoints arrays
|
||||||
*/
|
*/
|
||||||
setLinePointsValue(getInitialPoints(), getExtrapPoints());
|
setLinePointsValue(getInitialPoints(), getExtrapPoints());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* a linePattern needs to be set for PgenSelectingTool to pick up
|
* a linePattern needs to be set for PgenSelectingTool to pick up the
|
||||||
* the correct dialogue window to popup
|
* correct dialogue window to popup
|
||||||
*/
|
*/
|
||||||
setPgenCategory(Track.TRACK_PGEN_CATEGORY);
|
setPgenCategory(Track.TRACK_PGEN_CATEGORY);
|
||||||
setPgenType(Track.TRACK_PGEN_TYPE);
|
setPgenType(Track.TRACK_PGEN_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLinePointsValue(TrackPoint[] initTrackPoints, TrackPoint[] extrapPoints) {
|
public void setLinePointsValue(TrackPoint[] initTrackPoints,
|
||||||
|
TrackPoint[] extrapPoints) {
|
||||||
int listSize = 1;
|
int listSize = 1;
|
||||||
if (initTrackPoints != null)
|
if (initTrackPoints != null)
|
||||||
listSize += initTrackPoints.length;
|
listSize += initTrackPoints.length;
|
||||||
if (extrapPoints != null)
|
if (extrapPoints != null)
|
||||||
listSize += extrapPoints.length;
|
listSize += extrapPoints.length;
|
||||||
ArrayList<Coordinate> coordinatePointList = new ArrayList<Coordinate>(listSize);
|
ArrayList<Coordinate> coordinatePointList = new ArrayList<Coordinate>(
|
||||||
|
listSize);
|
||||||
addArrayToArrayList(coordinatePointList, initTrackPoints);
|
addArrayToArrayList(coordinatePointList, initTrackPoints);
|
||||||
addArrayToArrayList(coordinatePointList, extrapPoints);
|
addArrayToArrayList(coordinatePointList, extrapPoints);
|
||||||
|
|
||||||
|
@ -264,40 +312,29 @@ public class Track extends Line implements ITrack {
|
||||||
public Track copy() {
|
public Track copy() {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* create a new Track object and initially set its attributes to this one's
|
* create a new Track object and initially set its attributes to this
|
||||||
|
* one's
|
||||||
*/
|
*/
|
||||||
Track newTrack = new Track();
|
Track newTrack = new Track();
|
||||||
Calendar newFirstTimeCalendar = Calendar.getInstance();
|
Calendar newFirstTimeCalendar = Calendar.getInstance();
|
||||||
newFirstTimeCalendar.setTimeInMillis(getFirstTimeCalendar().getTimeInMillis());
|
newFirstTimeCalendar.setTimeInMillis(getFirstTimeCalendar()
|
||||||
|
.getTimeInMillis());
|
||||||
newTrack.setFirstTimeCalendar(newFirstTimeCalendar);
|
newTrack.setFirstTimeCalendar(newFirstTimeCalendar);
|
||||||
// newTrack.setFirstTimeCalendar(getFirstTimeCalendar());
|
|
||||||
|
|
||||||
Calendar newSecondTimeCalendar = Calendar.getInstance();
|
Calendar newSecondTimeCalendar = Calendar.getInstance();
|
||||||
newSecondTimeCalendar.setTimeInMillis(getSecondTimeCalendar().getTimeInMillis());
|
newSecondTimeCalendar.setTimeInMillis(getSecondTimeCalendar()
|
||||||
|
.getTimeInMillis());
|
||||||
newTrack.setSecondTimeCalendar(newSecondTimeCalendar);
|
newTrack.setSecondTimeCalendar(newSecondTimeCalendar);
|
||||||
// newTrack.setSecondTimeCalendar(getSecondTimeCalendar());
|
|
||||||
|
|
||||||
TrackPoint[] newInitTrackPoints = new TrackPoint[getInitTrackPoints().length];
|
TrackPoint[] newInitTrackPoints = new TrackPoint[getInitTrackPoints().length];
|
||||||
// log.info("######, before enter the loop for TrackPoint.clone, newInitTrackPoints.length="+newInitTrackPoints.length);
|
|
||||||
for(int i=0; i<newInitTrackPoints.length; i++) {
|
|
||||||
// log.info("######, inside enter the loop for TrackPoint.clone, index of the TrackPoint.clone="+i);
|
|
||||||
// if(getInitTrackPoints()[i].getLocation() == null)
|
|
||||||
// log.info("#####, getInitTrackPoints()["+i+"].getLocation() is NULL");
|
|
||||||
// else
|
|
||||||
// log.info("#####, getInitTrackPoints()["+i+"].getLocation() is NOTNOTNOT NULL");
|
|
||||||
|
|
||||||
newInitTrackPoints[i] = TrackPoint.clone(getInitTrackPoints()[i].getLocation(), getInitTrackPoints()[i].getTime());
|
for (int i = 0; i < newInitTrackPoints.length; i++) {
|
||||||
|
|
||||||
|
newInitTrackPoints[i] = TrackPoint.clone(
|
||||||
|
getInitTrackPoints()[i].getLocation(),
|
||||||
|
getInitTrackPoints()[i].getTime());
|
||||||
}
|
}
|
||||||
newTrack.setInitTrackPoints(newInitTrackPoints);
|
newTrack.setInitTrackPoints(newInitTrackPoints);
|
||||||
// newTrack.setInitTrackPoints(getInitTrackPoints());
|
|
||||||
|
|
||||||
// not sure if extrap points shoud be simply copied over or calculated by initial points
|
|
||||||
// TrackPoint[] newExtrapTrackPoints = new TrackPoint[getExtrapPoints().length];
|
|
||||||
// for(int i=0; i<newExtrapTrackPoints.length; i++) {
|
|
||||||
// if(getExtrapPoints()[i].getLocation() == null || getExtrapPoints()[i].getTime() == null)
|
|
||||||
// throw new PGenRuntimeException("Method: Track.copy(), both location and time can not be NULL for any of extrap points");
|
|
||||||
// newExtrapTrackPoints[i] = TrackPoint.clone(getExtrapPoints()[i].getLocation(), getExtrapPoints()[i].getTime());
|
|
||||||
// }
|
|
||||||
|
|
||||||
newTrack.setFontStyle(getFontStyle());
|
newTrack.setFontStyle(getFontStyle());
|
||||||
newTrack.setFontSize(getFontSize());
|
newTrack.setFontSize(getFontSize());
|
||||||
|
@ -309,31 +346,31 @@ public class Track extends Line implements ITrack {
|
||||||
newExtraPointTimeTextDisplayIndicator[i] = getExtraPointTimeTextDisplayIndicator()[i];
|
newExtraPointTimeTextDisplayIndicator[i] = getExtraPointTimeTextDisplayIndicator()[i];
|
||||||
}
|
}
|
||||||
newTrack.setExtraPointTimeTextDisplayIndicator(newExtraPointTimeTextDisplayIndicator);
|
newTrack.setExtraPointTimeTextDisplayIndicator(newExtraPointTimeTextDisplayIndicator);
|
||||||
// newTrack.setExtraPointTimeTextDisplayIndicator(getExtraPointTimeTextDisplayIndicator());
|
|
||||||
|
|
||||||
newTrack.setSkipFactorTextString(new String(getSkipFactorTextString()));
|
newTrack.setSkipFactorTextString(new String(getSkipFactorTextString()));
|
||||||
newTrack.setInitialColor(new Color(getInitialColor().getRed(), getInitialColor().getGreen(),
|
newTrack.setInitialColor(new Color(getInitialColor().getRed(),
|
||||||
getInitialColor().getBlue()));
|
getInitialColor().getGreen(), getInitialColor().getBlue()));
|
||||||
newTrack.setExtrapColor(new Color(getExtrapColor().getRed(), getExtrapColor().getGreen(),
|
newTrack.setExtrapColor(new Color(getExtrapColor().getRed(),
|
||||||
getExtrapColor().getBlue()));
|
getExtrapColor().getGreen(), getExtrapColor().getBlue()));
|
||||||
|
|
||||||
newTrack.setIntervalTimeString(new String(getIntervalTimeString()));
|
newTrack.setIntervalTimeString(new String(getIntervalTimeString()));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Under some scenarios, e.g. marshall/unmarshall procees, the ExtraDrawingPointNumber
|
* Under some scenarios, e.g. marshall/unmarshall procees, the
|
||||||
* is not serialized. Thus, first try to use the length of ExtrapPoints array
|
* ExtraDrawingPointNumber is not serialized. Thus, first try to use the
|
||||||
|
* length of ExtrapPoints array
|
||||||
*/
|
*/
|
||||||
if (getExtrapPoints() != null)
|
if (getExtrapPoints() != null)
|
||||||
newTrack.setExtraDrawingPointNumber(getExtrapPoints().length);
|
newTrack.setExtraDrawingPointNumber(getExtrapPoints().length);
|
||||||
else
|
else
|
||||||
newTrack.setExtraDrawingPointNumber(getExtraDrawingPointNumber());
|
newTrack.setExtraDrawingPointNumber(getExtraDrawingPointNumber());
|
||||||
// newTrack.setExtraDrawingPointNumberText(getExtraDrawingPointNumberText());
|
|
||||||
newTrack.setExtrapLinePattern(new String(getExtrapLinePattern()));
|
newTrack.setExtrapLinePattern(new String(getExtrapLinePattern()));
|
||||||
newTrack.setExtrapMarker(new String(getExtrapMarker()));
|
newTrack.setExtrapMarker(new String(getExtrapMarker()));
|
||||||
// log.info("#######, inside track.copy(), getInitialLinePattern()="+getInitialLinePattern());
|
|
||||||
newTrack.setInitialLinePattern(new String(getInitialLinePattern()));
|
newTrack.setInitialLinePattern(new String(getInitialLinePattern()));
|
||||||
newTrack.setInitialMarker(new String(getInitialMarker()));
|
newTrack.setInitialMarker(new String(getInitialMarker()));
|
||||||
// newTrack.setType("Solid Lines");
|
|
||||||
if (getPgenCategory() != null)
|
if (getPgenCategory() != null)
|
||||||
newTrack.setPgenCategory(new String(getPgenCategory()));
|
newTrack.setPgenCategory(new String(getPgenCategory()));
|
||||||
if (getPgenType() != null)
|
if (getPgenType() != null)
|
||||||
|
@ -342,31 +379,32 @@ public class Track extends Line implements ITrack {
|
||||||
newTrack.calculateExtrapTrackPoints();
|
newTrack.calculateExtrapTrackPoints();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Now copy some important attributes that make a Line or multi-points element can be displayed
|
* Now copy some important attributes that make a Line or multi-points
|
||||||
|
* element can be displayed
|
||||||
*/
|
*/
|
||||||
newTrack.setClosed(isClosedLine());
|
newTrack.setClosed(isClosedLine());
|
||||||
newTrack.setFilled(isFilled());
|
newTrack.setFilled(isFilled());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* colors value in Track will only be used in dragging initial points. Thus,
|
* colors value in Track will only be used in dragging initial points.
|
||||||
* here the color of the initial points is used
|
* Thus, here the color of the initial points is used
|
||||||
*/
|
*/
|
||||||
Color[] initColors = new Color[1];
|
Color[] initColors = new Color[1];
|
||||||
initColors[0] = getInitialColor();
|
initColors[0] = getInitialColor();
|
||||||
newTrack.setColors(initColors);
|
newTrack.setColors(initColors);
|
||||||
newTrack.setLineWidth(getLineWidth());
|
newTrack.setLineWidth(getLineWidth());
|
||||||
newTrack.setSizeScale(getSizeScale());
|
newTrack.setSizeScale(getSizeScale());
|
||||||
// newTrack.setSmoothFactor(getSmoothFactor());
|
|
||||||
newTrack.setSmoothFactor(2);
|
newTrack.setSmoothFactor(2);
|
||||||
newTrack.setFillPattern(getFillPattern());
|
newTrack.setFillPattern(getFillPattern());
|
||||||
|
|
||||||
newTrack.setParent(this.getParent());
|
newTrack.setParent(this.getParent());
|
||||||
|
|
||||||
// log.info("@@@###$$$%%%!!!, the last line of track.copy()");
|
|
||||||
return newTrack;
|
return newTrack;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void update(ITrack trackAttrDlg) {
|
public void update(ITrack trackAttrDlg) {
|
||||||
// log.info("############, track.update(...) is executed!!!!");
|
|
||||||
initializeInitFirstTimeCalendar(trackAttrDlg.getFirstTimeCalendar());
|
initializeInitFirstTimeCalendar(trackAttrDlg.getFirstTimeCalendar());
|
||||||
initializeInitSecondTimeCalendar(trackAttrDlg.getSecondTimeCalendar());
|
initializeInitSecondTimeCalendar(trackAttrDlg.getSecondTimeCalendar());
|
||||||
|
|
||||||
|
@ -375,15 +413,19 @@ public class Track extends Line implements ITrack {
|
||||||
setExtraDrawingPointNumber(trackAttrDlg.getExtraDrawingPointNumber());
|
setExtraDrawingPointNumber(trackAttrDlg.getExtraDrawingPointNumber());
|
||||||
setIntervalTimeString(trackAttrDlg.getIntervalTimeString());
|
setIntervalTimeString(trackAttrDlg.getIntervalTimeString());
|
||||||
setFontName(trackAttrDlg.getFontName());
|
setFontName(trackAttrDlg.getFontName());
|
||||||
setFontStyle(trackAttrDlg.getStyle());
|
setFontStyle(trackAttrDlg.getFontStyle());
|
||||||
setFontSize(trackAttrDlg.getFontSize());
|
setFontSize(trackAttrDlg.getFontSize());
|
||||||
setInitialColor(trackAttrDlg.getInitialColor());
|
setInitialColor(trackAttrDlg.getInitialColor());
|
||||||
setExtrapColor(trackAttrDlg.getExtrapColor());
|
setExtrapColor(trackAttrDlg.getExtrapColor());
|
||||||
setExtraPointTimeDisplayOption(trackAttrDlg.getExtraPointTimeDisplayOption());
|
setExtraPointTimeDisplayOption(trackAttrDlg
|
||||||
|
.getExtraPointTimeDisplayOption());
|
||||||
setSkipFactorTextString(trackAttrDlg.getSkipFactorText());
|
setSkipFactorTextString(trackAttrDlg.getSkipFactorText());
|
||||||
setFontNameComboSelectedIndex(trackAttrDlg.getFontNameComboSelectedIndex());
|
setFontNameComboSelectedIndex(trackAttrDlg
|
||||||
setFontSizeComboSelectedIndex(trackAttrDlg.getFontSizeComboSelectedIndex());
|
.getFontNameComboSelectedIndex());
|
||||||
setFontStyleComboSelectedIndex(trackAttrDlg.getFontStyleComboSelectedIndex());
|
setFontSizeComboSelectedIndex(trackAttrDlg
|
||||||
|
.getFontSizeComboSelectedIndex());
|
||||||
|
setFontStyleComboSelectedIndex(trackAttrDlg
|
||||||
|
.getFontStyleComboSelectedIndex());
|
||||||
setUnitComboSelectedIndex(trackAttrDlg.getUnitComboSelectedIndex());
|
setUnitComboSelectedIndex(trackAttrDlg.getUnitComboSelectedIndex());
|
||||||
setRoundComboSelectedIndex(trackAttrDlg.getRoundComboSelectedIndex());
|
setRoundComboSelectedIndex(trackAttrDlg.getRoundComboSelectedIndex());
|
||||||
if (trackAttrDlg.getRoundComboSelectedIndex() > 0)
|
if (trackAttrDlg.getRoundComboSelectedIndex() > 0)
|
||||||
|
@ -391,21 +433,23 @@ public class Track extends Line implements ITrack {
|
||||||
else
|
else
|
||||||
this.setRoundBtnSelected(false);
|
this.setRoundBtnSelected(false);
|
||||||
|
|
||||||
setRoundDirComboSelectedIndex(trackAttrDlg.getRoundDirComboSelectedIndex());
|
setRoundDirComboSelectedIndex(trackAttrDlg
|
||||||
|
.getRoundDirComboSelectedIndex());
|
||||||
if (trackAttrDlg.getRoundDirComboSelectedIndex() > 0)
|
if (trackAttrDlg.getRoundDirComboSelectedIndex() > 0)
|
||||||
this.setRoundDirBtnSelected(true);
|
this.setRoundDirBtnSelected(true);
|
||||||
else
|
else
|
||||||
this.setRoundDirBtnSelected(false);
|
this.setRoundDirBtnSelected(false);
|
||||||
|
|
||||||
//This method can be called only after all of the above settings are completed!
|
// This method can be called only after all of the above settings are
|
||||||
|
// completed!
|
||||||
calculateExtrapTrackPoints();
|
calculateExtrapTrackPoints();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For now, the type is the name of a LinePattern defined in
|
* For now, the type is the name of a LinePattern defined in
|
||||||
* "gov.noaa.nws.ncep.ui.pgen.display.LinePatternList"
|
* "gov.noaa.nws.ncep.ui.pgen.display.LinePatternList" However, there is
|
||||||
* However, there is no type has been decided for Track element
|
* no type has been decided for Track element yet. Thus, it is now hard
|
||||||
* yet. Thus, it is now hard coded.
|
* coded.
|
||||||
*/
|
*/
|
||||||
// setType("Solid Lines");
|
|
||||||
setPgenType(Track.TRACK_PGEN_TYPE);
|
setPgenType(Track.TRACK_PGEN_TYPE);
|
||||||
setPgenCategory(Track.TRACK_PGEN_CATEGORY);
|
setPgenCategory(Track.TRACK_PGEN_CATEGORY);
|
||||||
}
|
}
|
||||||
|
@ -433,20 +477,18 @@ public class Track extends Line implements ITrack {
|
||||||
modifiedTrackPoint.setLocation(point);
|
modifiedTrackPoint.setLocation(point);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// linePoints.add(index, point);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removePoint(int index) {
|
public void removePoint(int index) {
|
||||||
ArrayList<Coordinate> allLinePoints = getPoints();
|
ArrayList<Coordinate> allLinePoints = getPoints();
|
||||||
if (allLinePoints == null)
|
if (allLinePoints == null)
|
||||||
return;
|
return;
|
||||||
// if(allLinePoints.size() > index && getInitialPoints().length > index) {
|
|
||||||
if (allLinePoints.size() > index) {
|
if (allLinePoints.size() > index) {
|
||||||
allLinePoints.remove(index);
|
allLinePoints.remove(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
// linePoints.remove( index );
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPoints(ArrayList<Coordinate> pts) {
|
public void setPoints(ArrayList<Coordinate> pts) {
|
||||||
|
@ -456,6 +498,7 @@ public class Track extends Line implements ITrack {
|
||||||
* call MultiPointElement.setPoint(...)
|
* call MultiPointElement.setPoint(...)
|
||||||
*/
|
*/
|
||||||
super.setPoints(pts);
|
super.setPoints(pts);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Now initialize initPoint and ExtrapPoint arrays
|
* Now initialize initPoint and ExtrapPoint arrays
|
||||||
*/
|
*/
|
||||||
|
@ -476,15 +519,11 @@ public class Track extends Line implements ITrack {
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int extrapTrackPointSize = 0;
|
int extrapTrackPointSize = 0;
|
||||||
if (getExtrapPoints() != null)
|
if (getExtrapPoints() != null)
|
||||||
extrapTrackPointSize = getExtrapPoints().length;
|
extrapTrackPointSize = getExtrapPoints().length;
|
||||||
int extrapIndex = 0;
|
int extrapIndex = 0;
|
||||||
while(extrapIndex < extrapTrackPointSize &&
|
while (extrapIndex < extrapTrackPointSize && index < allPointsSize) {
|
||||||
index < allPointsSize) {
|
|
||||||
TrackPoint currentTrackPoint = getExtrapPoints()[extrapIndex];
|
TrackPoint currentTrackPoint = getExtrapPoints()[extrapIndex];
|
||||||
if (currentTrackPoint != null)
|
if (currentTrackPoint != null)
|
||||||
currentTrackPoint.setLocation(pts.get(index));
|
currentTrackPoint.setLocation(pts.get(index));
|
||||||
|
@ -492,9 +531,6 @@ public class Track extends Line implements ITrack {
|
||||||
extrapIndex++;
|
extrapIndex++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// this.linePoints = pts;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -505,7 +541,8 @@ public class Track extends Line implements ITrack {
|
||||||
return trackAttrDlg.getIntervalTimeString();
|
return trackAttrDlg.getIntervalTimeString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addArrayToArrayList(ArrayList<Coordinate> coordinatePointList, TrackPoint[] trackPoints) {
|
private void addArrayToArrayList(ArrayList<Coordinate> coordinatePointList,
|
||||||
|
TrackPoint[] trackPoints) {
|
||||||
if (trackPoints == null)
|
if (trackPoints == null)
|
||||||
return;
|
return;
|
||||||
for (TrackPoint trackPoint : trackPoints) {
|
for (TrackPoint trackPoint : trackPoints) {
|
||||||
|
@ -515,8 +552,7 @@ public class Track extends Line implements ITrack {
|
||||||
|
|
||||||
private TrackPoint[] calculateExtrapTrackPoints(TrackPoint[] initialPoints,
|
private TrackPoint[] calculateExtrapTrackPoints(TrackPoint[] initialPoints,
|
||||||
Calendar initPointBeforeLastInitPointTimeCal,
|
Calendar initPointBeforeLastInitPointTimeCal,
|
||||||
Calendar lastInitPointTimeCal,
|
Calendar lastInitPointTimeCal, int extraDrawingPointNumber,
|
||||||
int extraDrawingPointNumber,
|
|
||||||
int elapsedHourForExtraPointValue,
|
int elapsedHourForExtraPointValue,
|
||||||
int elapsedMinuteForExtraPointValue,
|
int elapsedMinuteForExtraPointValue,
|
||||||
ExtraPointTimeDisplayOption extraPointTimeDisplayOption,
|
ExtraPointTimeDisplayOption extraPointTimeDisplayOption,
|
||||||
|
@ -527,14 +563,15 @@ public class Track extends Line implements ITrack {
|
||||||
}
|
}
|
||||||
|
|
||||||
int arrayLength = initialPoints.length;
|
int arrayLength = initialPoints.length;
|
||||||
Coordinate initPointBeforeLastInitPointCoordinate = initialPoints[arrayLength - 2].getLocation();
|
Coordinate initPointBeforeLastInitPointCoordinate = initialPoints[arrayLength - 2]
|
||||||
Coordinate lastInitPointCoordinate = initialPoints[arrayLength - 1].getLocation();
|
.getLocation();
|
||||||
if(!isCoordinateValid(initPointBeforeLastInitPointCoordinate) ||
|
Coordinate lastInitPointCoordinate = initialPoints[arrayLength - 1]
|
||||||
!isCoordinateValid(lastInitPointCoordinate) ||
|
.getLocation();
|
||||||
initPointBeforeLastInitPointTimeCal == null ||
|
if (!isCoordinateValid(initPointBeforeLastInitPointCoordinate)
|
||||||
lastInitPointTimeCal == null) {
|
|| !isCoordinateValid(lastInitPointCoordinate)
|
||||||
// log.error("Method: calculateExtrapTrackPoints, find 4 possible invalid input: startPointCoordinate or "+
|
|| initPointBeforeLastInitPointTimeCal == null
|
||||||
// "destPointCoordinate is invalid. firstTimeCal or secondTimeCal is null");
|
|| lastInitPointTimeCal == null) {
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -547,19 +584,20 @@ public class Track extends Line implements ITrack {
|
||||||
setDirectionForExtraPoints(direction);
|
setDirectionForExtraPoints(direction);
|
||||||
|
|
||||||
double distanceInMeter = gc.getOrthodromicDistance();
|
double distanceInMeter = gc.getOrthodromicDistance();
|
||||||
long timeDifference = getTimeDifferenceInMillisecond(initPointBeforeLastInitPointTimeCal,
|
long timeDifference = getTimeDifferenceInMillisecond(
|
||||||
lastInitPointTimeCal);
|
initPointBeforeLastInitPointTimeCal, lastInitPointTimeCal);
|
||||||
double speed = distanceInMeter / (double) timeDifference;
|
double speed = distanceInMeter / (double) timeDifference;
|
||||||
setSpeed(speed);
|
setSpeed(speed);
|
||||||
|
|
||||||
// Calculate the first extra point time Calendar
|
// Calculate the first extra point time Calendar
|
||||||
Calendar firstExtraPointTimeCal = getTimeElapsedCalendarForFirstExtraPoint(lastInitPointTimeCal,
|
Calendar firstExtraPointTimeCal = getTimeElapsedCalendarForFirstExtraPoint(
|
||||||
elapsedHourForExtraPointValue,
|
lastInitPointTimeCal, elapsedHourForExtraPointValue,
|
||||||
elapsedMinuteForExtraPointValue);
|
elapsedMinuteForExtraPointValue);
|
||||||
|
|
||||||
//calculate the distance between the last Initial point and the first extra point
|
// calculate the distance between the last Initial point and the first
|
||||||
double distanceBetweenLastInitPointAndFirstExtraPoint = calculateDistanceBetweenLastInitPointAndFirstExtraPoint(speed,
|
// extra point
|
||||||
lastInitPointTimeCal, firstExtraPointTimeCal);
|
double distanceBetweenLastInitPointAndFirstExtraPoint = calculateDistanceBetweenLastInitPointAndFirstExtraPoint(
|
||||||
|
speed, lastInitPointTimeCal, firstExtraPointTimeCal);
|
||||||
|
|
||||||
// calculate the distance among extra points
|
// calculate the distance among extra points
|
||||||
double distanceForExtraPoint = calculateDistanceForExtraPoints(speed,
|
double distanceForExtraPoint = calculateDistanceForExtraPoints(speed,
|
||||||
|
@ -569,46 +607,52 @@ public class Track extends Line implements ITrack {
|
||||||
TrackPoint[] extrapTrackPointArray = calculateExtrapTrackPoints(gc,
|
TrackPoint[] extrapTrackPointArray = calculateExtrapTrackPoints(gc,
|
||||||
lastInitPointCoordinate, direction,
|
lastInitPointCoordinate, direction,
|
||||||
distanceBetweenLastInitPointAndFirstExtraPoint,
|
distanceBetweenLastInitPointAndFirstExtraPoint,
|
||||||
distanceForExtraPoint,
|
distanceForExtraPoint, extraDrawingPointNumber,
|
||||||
extraDrawingPointNumber, lastInitPointTimeCal,
|
lastInitPointTimeCal, firstExtraPointTimeCal,
|
||||||
firstExtraPointTimeCal,
|
elapsedHourForExtraPointValue, elapsedMinuteForExtraPointValue);
|
||||||
elapsedHourForExtraPointValue,
|
disableSomeTimeTagsDisplayBasedOnExtraPointTimeDisplayOption(
|
||||||
elapsedMinuteForExtraPointValue);
|
extrapTrackPointArray, extraPointTimeDisplayOption,
|
||||||
disableSomeTimeTagsDisplayBasedOnExtraPointTimeDisplayOption(extrapTrackPointArray,
|
skipFactorTextString);
|
||||||
extraPointTimeDisplayOption, skipFactorTextString);
|
|
||||||
|
|
||||||
return extrapTrackPointArray;
|
return extrapTrackPointArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void disableSomeTimeTagsDisplayBasedOnExtraPointTimeDisplayOption(TrackPoint[] extrapTrackPointArray,
|
private void disableSomeTimeTagsDisplayBasedOnExtraPointTimeDisplayOption(
|
||||||
ExtraPointTimeDisplayOption extraPointTimeDisplayOption, String skipFactorTextString) {
|
TrackPoint[] extrapTrackPointArray,
|
||||||
|
ExtraPointTimeDisplayOption extraPointTimeDisplayOption,
|
||||||
|
String skipFactorTextString) {
|
||||||
if (extrapTrackPointArray == null)
|
if (extrapTrackPointArray == null)
|
||||||
return;
|
return;
|
||||||
boolean[] extraPointTimeTagFlagArray = new boolean[extrapTrackPointArray.length];
|
boolean[] extraPointTimeTagFlagArray = new boolean[extrapTrackPointArray.length];
|
||||||
initializeBooleanArray(extraPointTimeTagFlagArray, true);
|
initializeBooleanArray(extraPointTimeTagFlagArray, true);
|
||||||
|
|
||||||
if (extraPointTimeDisplayOption == ITrack.ExtraPointTimeDisplayOption.SKIP_FACTOR) {
|
if (extraPointTimeDisplayOption == ITrack.ExtraPointTimeDisplayOption.SKIP_FACTOR) {
|
||||||
removeTimeTagsBasedOnSkipFactor(extrapTrackPointArray, skipFactorTextString, extraPointTimeTagFlagArray);
|
removeTimeTagsBasedOnSkipFactor(extrapTrackPointArray,
|
||||||
|
skipFactorTextString, extraPointTimeTagFlagArray);
|
||||||
} else if (extraPointTimeDisplayOption == ITrack.ExtraPointTimeDisplayOption.SHOW_FIRST_LAST) {
|
} else if (extraPointTimeDisplayOption == ITrack.ExtraPointTimeDisplayOption.SHOW_FIRST_LAST) {
|
||||||
removeTimeTagsBasedOnShowLastFirstOnly(extrapTrackPointArray, extraPointTimeTagFlagArray);
|
removeTimeTagsBasedOnShowLastFirstOnly(extrapTrackPointArray,
|
||||||
|
extraPointTimeTagFlagArray);
|
||||||
} else if (extraPointTimeDisplayOption == ITrack.ExtraPointTimeDisplayOption.ON_ONE_HOUR) {
|
} else if (extraPointTimeDisplayOption == ITrack.ExtraPointTimeDisplayOption.ON_ONE_HOUR) {
|
||||||
removeTimeTagsBasedOnHourMinuteValue(extrapTrackPointArray, true, extraPointTimeTagFlagArray);
|
removeTimeTagsBasedOnHourMinuteValue(extrapTrackPointArray, true,
|
||||||
|
extraPointTimeTagFlagArray);
|
||||||
} else if (extraPointTimeDisplayOption == ITrack.ExtraPointTimeDisplayOption.ON_HALF_HOUR) {
|
} else if (extraPointTimeDisplayOption == ITrack.ExtraPointTimeDisplayOption.ON_HALF_HOUR) {
|
||||||
removeTimeTagsBasedOnHourMinuteValue(extrapTrackPointArray, false, extraPointTimeTagFlagArray);
|
removeTimeTagsBasedOnHourMinuteValue(extrapTrackPointArray, false,
|
||||||
}
|
extraPointTimeTagFlagArray);
|
||||||
else {
|
} else {
|
||||||
removeTimeTagsBasedOnHourMinuteValue(extrapTrackPointArray, false, extraPointTimeTagFlagArray);
|
removeTimeTagsBasedOnHourMinuteValue(extrapTrackPointArray, false,
|
||||||
|
extraPointTimeTagFlagArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* set the updated boolean array back to the indicator,
|
* set the updated boolean array back to the indicator, in
|
||||||
* in displayElementFactory, this boolean array will be
|
* displayElementFactory, this boolean array will be used to indicate if
|
||||||
* used to indicate if a time text should be skipped
|
* a time text should be skipped
|
||||||
*/
|
*/
|
||||||
setExtraPointTimeTextDisplayIndicator(extraPointTimeTagFlagArray);
|
setExtraPointTimeTextDisplayIndicator(extraPointTimeTagFlagArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removeTimeTagsBasedOnShowLastFirstOnly(TrackPoint[] extrapTrackPointArray, boolean[] timeTagIndicatorArray) {
|
private void removeTimeTagsBasedOnShowLastFirstOnly(
|
||||||
|
TrackPoint[] extrapTrackPointArray, boolean[] timeTagIndicatorArray) {
|
||||||
if (extrapTrackPointArray.length < 3)
|
if (extrapTrackPointArray.length < 3)
|
||||||
return;
|
return;
|
||||||
for (int i = 1; i < (extrapTrackPointArray.length - 1); i++) {
|
for (int i = 1; i < (extrapTrackPointArray.length - 1); i++) {
|
||||||
|
@ -616,8 +660,9 @@ public class Track extends Line implements ITrack {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removeTimeTagsBasedOnSkipFactor(TrackPoint[] extrapTrackPointArray,
|
private void removeTimeTagsBasedOnSkipFactor(
|
||||||
String skipFactorTextString, boolean[] timeTagIndicatorArray) {
|
TrackPoint[] extrapTrackPointArray, String skipFactorTextString,
|
||||||
|
boolean[] timeTagIndicatorArray) {
|
||||||
if (skipFactorTextString == null)
|
if (skipFactorTextString == null)
|
||||||
return;
|
return;
|
||||||
/*
|
/*
|
||||||
|
@ -630,17 +675,15 @@ public class Track extends Line implements ITrack {
|
||||||
try {
|
try {
|
||||||
skipFactorIntValue = Integer.parseInt(skipFactorTextString);
|
skipFactorIntValue = Integer.parseInt(skipFactorTextString);
|
||||||
} catch (NumberFormatException nfe) {
|
} catch (NumberFormatException nfe) {
|
||||||
// log.error("The input of skipFactorTextString is invalid, skipFactorTextString="+
|
|
||||||
// skipFactorTextString);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 1. make sure skipFactorIntValue is a valid value
|
* 1. make sure skipFactorIntValue is a valid value 2. since the last
|
||||||
* 2. since the last and first extra points are always
|
* and first extra points are always displayed, thus do
|
||||||
* displayed, thus do skipFactorIntValue > (extrapTrackPointArray.length - 2)
|
* skipFactorIntValue > (extrapTrackPointArray.length - 2) check
|
||||||
* check
|
|
||||||
*/
|
*/
|
||||||
if(!(skipFactorIntValue > 0) || skipFactorIntValue > (extrapTrackPointArray.length - 2))
|
if (!(skipFactorIntValue > 0)
|
||||||
|
|| skipFactorIntValue > (extrapTrackPointArray.length - 2))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (int i = 1; i <= skipFactorIntValue; i++) {
|
for (int i = 1; i <= skipFactorIntValue; i++) {
|
||||||
|
@ -648,8 +691,9 @@ public class Track extends Line implements ITrack {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removeTimeTagsBasedOnHourMinuteValue(TrackPoint[] extrapTrackPointArray,
|
private void removeTimeTagsBasedOnHourMinuteValue(
|
||||||
boolean isExactHourDisplayed, boolean[] timeTagIndicatorArray) {
|
TrackPoint[] extrapTrackPointArray, boolean isExactHourDisplayed,
|
||||||
|
boolean[] timeTagIndicatorArray) {
|
||||||
for (int i = 0; i < (extrapTrackPointArray.length); i++) {
|
for (int i = 0; i < (extrapTrackPointArray.length); i++) {
|
||||||
TrackPoint targetTrackPoint = extrapTrackPointArray[i];
|
TrackPoint targetTrackPoint = extrapTrackPointArray[i];
|
||||||
Calendar targetPointTimeCal = targetTrackPoint.getTime();
|
Calendar targetPointTimeCal = targetTrackPoint.getTime();
|
||||||
|
@ -663,14 +707,16 @@ public class Track extends Line implements ITrack {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeBooleanArray(boolean[] booleanArray, boolean initValue) {
|
private void initializeBooleanArray(boolean[] booleanArray,
|
||||||
|
boolean initValue) {
|
||||||
if (booleanArray == null)
|
if (booleanArray == null)
|
||||||
return;
|
return;
|
||||||
for (int i = 0; i < booleanArray.length; i++)
|
for (int i = 0; i < booleanArray.length; i++)
|
||||||
booleanArray[i] = initValue;
|
booleanArray[i] = initValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isTimeTagDisplayable(Calendar targetPointTimeCal, boolean isExactHourDisplayed) {
|
private boolean isTimeTagDisplayable(Calendar targetPointTimeCal,
|
||||||
|
boolean isExactHourDisplayed) {
|
||||||
boolean isDisplayable = false;
|
boolean isDisplayable = false;
|
||||||
if (targetPointTimeCal == null)
|
if (targetPointTimeCal == null)
|
||||||
return isDisplayable;
|
return isDisplayable;
|
||||||
|
@ -680,29 +726,29 @@ public class Track extends Line implements ITrack {
|
||||||
if (minuteIntValue == 0)
|
if (minuteIntValue == 0)
|
||||||
isDisplayable = true;
|
isDisplayable = true;
|
||||||
} else {
|
} else {
|
||||||
// int hourIntValue = targetPointTimeCal.get(Calendar.HOUR_OF_DAY);
|
|
||||||
if (minuteIntValue == 0 || minuteIntValue == 30)
|
if (minuteIntValue == 0 || minuteIntValue == 30)
|
||||||
isDisplayable = true;
|
isDisplayable = true;
|
||||||
}
|
}
|
||||||
return isDisplayable;
|
return isDisplayable;
|
||||||
}
|
}
|
||||||
|
|
||||||
private double calculateDistanceBetweenLastInitPointAndFirstExtraPoint(double speed,
|
private double calculateDistanceBetweenLastInitPointAndFirstExtraPoint(
|
||||||
Calendar lastInitPointCal, Calendar firstExtraPointCal) {
|
double speed, Calendar lastInitPointCal, Calendar firstExtraPointCal) {
|
||||||
long timeDifferenceBetweenExtraPoints = getTimeDifferenceInMillisecond(lastInitPointCal,
|
long timeDifferenceBetweenExtraPoints = getTimeDifferenceInMillisecond(
|
||||||
firstExtraPointCal);
|
lastInitPointCal, firstExtraPointCal);
|
||||||
double distanceBetweenLastInitPointAndFirstExtraPoint = speed * timeDifferenceBetweenExtraPoints;
|
double distanceBetweenLastInitPointAndFirstExtraPoint = speed
|
||||||
|
* timeDifferenceBetweenExtraPoints;
|
||||||
return distanceBetweenLastInitPointAndFirstExtraPoint;
|
return distanceBetweenLastInitPointAndFirstExtraPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
private double calculateDistanceForExtraPoints(double speed,
|
private double calculateDistanceForExtraPoints(double speed,
|
||||||
Calendar firstExtraPointCal, int elapsedHourForExtraPoint,
|
Calendar firstExtraPointCal, int elapsedHourForExtraPoint,
|
||||||
int elapsedMinuteForExtraPoint) {
|
int elapsedMinuteForExtraPoint) {
|
||||||
Calendar nextExtraPointTimeCal = getTimeElapsedCalendar(firstExtraPointCal,
|
Calendar nextExtraPointTimeCal = getTimeElapsedCalendar(
|
||||||
elapsedHourForExtraPoint,
|
firstExtraPointCal, elapsedHourForExtraPoint,
|
||||||
elapsedMinuteForExtraPoint);
|
elapsedMinuteForExtraPoint);
|
||||||
long timeDifferenceBetweenExtraPoints = getTimeDifferenceInMillisecond(firstExtraPointCal,
|
long timeDifferenceBetweenExtraPoints = getTimeDifferenceInMillisecond(
|
||||||
nextExtraPointTimeCal);
|
firstExtraPointCal, nextExtraPointTimeCal);
|
||||||
double distanceForExtraPoint = speed * timeDifferenceBetweenExtraPoints;
|
double distanceForExtraPoint = speed * timeDifferenceBetweenExtraPoints;
|
||||||
return distanceForExtraPoint;
|
return distanceForExtraPoint;
|
||||||
}
|
}
|
||||||
|
@ -712,8 +758,7 @@ public class Track extends Line implements ITrack {
|
||||||
double distanceBetweenLastInitPointAndFirstExtraPoint,
|
double distanceBetweenLastInitPointAndFirstExtraPoint,
|
||||||
double distanceBetweenExtraPoint, int extraPointNumber,
|
double distanceBetweenExtraPoint, int extraPointNumber,
|
||||||
Calendar lastInitPointTimeCal, Calendar firstExtraPointTimeCal,
|
Calendar lastInitPointTimeCal, Calendar firstExtraPointTimeCal,
|
||||||
int elapsedHourForExtraPoint,
|
int elapsedHourForExtraPoint, int elapsedMinuteForExtraPoint) {
|
||||||
int elapsedMinuteForExtraPoint) {
|
|
||||||
double startLongitude = lastInitPointCoordinate.x;
|
double startLongitude = lastInitPointCoordinate.x;
|
||||||
double startLatitude = lastInitPointCoordinate.y;
|
double startLatitude = lastInitPointCoordinate.y;
|
||||||
TrackPoint[] trackPointArray = new TrackPoint[extraPointNumber];
|
TrackPoint[] trackPointArray = new TrackPoint[extraPointNumber];
|
||||||
|
@ -721,25 +766,29 @@ public class Track extends Line implements ITrack {
|
||||||
/*
|
/*
|
||||||
* Add the first extra point
|
* Add the first extra point
|
||||||
*/
|
*/
|
||||||
java.awt.geom.Point2D firstExtraPointPoint2dValue = getNextPoint2DValue(gc, startLongitude, startLatitude,
|
java.awt.geom.Point2D firstExtraPointPoint2dValue = getNextPoint2DValue(
|
||||||
direction, distanceBetweenLastInitPointAndFirstExtraPoint);
|
gc, startLongitude, startLatitude, direction,
|
||||||
|
distanceBetweenLastInitPointAndFirstExtraPoint);
|
||||||
startLongitude = firstExtraPointPoint2dValue.getX();
|
startLongitude = firstExtraPointPoint2dValue.getX();
|
||||||
startLatitude = firstExtraPointPoint2dValue.getY();
|
startLatitude = firstExtraPointPoint2dValue.getY();
|
||||||
Coordinate firstExtraPointCoordinate = new Coordinate(startLongitude, startLatitude);
|
Coordinate firstExtraPointCoordinate = new Coordinate(startLongitude,
|
||||||
TrackPoint firstExtraTrackPoint = new TrackPoint(firstExtraPointCoordinate, firstExtraPointTimeCal);
|
startLatitude);
|
||||||
|
TrackPoint firstExtraTrackPoint = new TrackPoint(
|
||||||
|
firstExtraPointCoordinate, firstExtraPointTimeCal);
|
||||||
trackPointArray[0] = firstExtraTrackPoint;
|
trackPointArray[0] = firstExtraTrackPoint;
|
||||||
|
|
||||||
|
|
||||||
Calendar newPointCal = firstExtraPointTimeCal;
|
Calendar newPointCal = firstExtraPointTimeCal;
|
||||||
for (int i = 1; i < (extraPointNumber); i++) {
|
for (int i = 1; i < (extraPointNumber); i++) {
|
||||||
java.awt.geom.Point2D pt = getNextPoint2DValue(gc, startLongitude, startLatitude,
|
java.awt.geom.Point2D pt = getNextPoint2DValue(gc, startLongitude,
|
||||||
direction, distanceBetweenExtraPoint);
|
startLatitude, direction, distanceBetweenExtraPoint);
|
||||||
startLongitude = pt.getX();
|
startLongitude = pt.getX();
|
||||||
startLatitude = pt.getY();
|
startLatitude = pt.getY();
|
||||||
Coordinate nextCoordinate = new Coordinate(startLongitude, startLatitude);
|
Coordinate nextCoordinate = new Coordinate(startLongitude,
|
||||||
newPointCal = getTimeElapsedCalendar(newPointCal, elapsedHourForExtraPoint,
|
startLatitude);
|
||||||
elapsedMinuteForExtraPoint);
|
newPointCal = getTimeElapsedCalendar(newPointCal,
|
||||||
TrackPoint eachTrackPoint = new TrackPoint(nextCoordinate, newPointCal);
|
elapsedHourForExtraPoint, elapsedMinuteForExtraPoint);
|
||||||
|
TrackPoint eachTrackPoint = new TrackPoint(nextCoordinate,
|
||||||
|
newPointCal);
|
||||||
trackPointArray[i] = eachTrackPoint;
|
trackPointArray[i] = eachTrackPoint;
|
||||||
}
|
}
|
||||||
return trackPointArray;
|
return trackPointArray;
|
||||||
|
@ -748,30 +797,34 @@ public class Track extends Line implements ITrack {
|
||||||
private java.awt.geom.Point2D getNextPoint2DValue(GeodeticCalculator gc,
|
private java.awt.geom.Point2D getNextPoint2DValue(GeodeticCalculator gc,
|
||||||
double startingPointLongitude, double startIngPointLatitude,
|
double startingPointLongitude, double startIngPointLatitude,
|
||||||
double direction, double distanceBetweenTwoPoints) {
|
double direction, double distanceBetweenTwoPoints) {
|
||||||
gc.setStartingGeographicPoint(startingPointLongitude, startIngPointLatitude);
|
gc.setStartingGeographicPoint(startingPointLongitude,
|
||||||
|
startIngPointLatitude);
|
||||||
gc.setDirection(direction, distanceBetweenTwoPoints);
|
gc.setDirection(direction, distanceBetweenTwoPoints);
|
||||||
java.awt.geom.Point2D pt = gc.getDestinationGeographicPoint();
|
java.awt.geom.Point2D pt = gc.getDestinationGeographicPoint();
|
||||||
return pt;
|
return pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
private long getTimeDifferenceInMillisecond(Calendar startTimeCal, Calendar endTimeCal) {
|
private long getTimeDifferenceInMillisecond(Calendar startTimeCal,
|
||||||
|
Calendar endTimeCal) {
|
||||||
long startTimeInMillisecond = startTimeCal.getTimeInMillis();
|
long startTimeInMillisecond = startTimeCal.getTimeInMillis();
|
||||||
long endTimeInMillisecond = endTimeCal.getTimeInMillis();
|
long endTimeInMillisecond = endTimeCal.getTimeInMillis();
|
||||||
|
|
||||||
long timeDiffInMillisecond = endTimeInMillisecond - startTimeInMillisecond;
|
long timeDiffInMillisecond = endTimeInMillisecond
|
||||||
|
- startTimeInMillisecond;
|
||||||
return timeDiffInMillisecond;
|
return timeDiffInMillisecond;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isCoordinateValid(Coordinate coordinate) {
|
private boolean isCoordinateValid(Coordinate coordinate) {
|
||||||
if(coordinate.x > 180.0 || coordinate.x < -180.0 || coordinate.y > 90.0 ||
|
if (coordinate.x > 180.0 || coordinate.x < -180.0
|
||||||
coordinate.y < -90.0)
|
|| coordinate.y > 90.0 || coordinate.y < -90.0)
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Calendar getIntervalCalendarByParsingString(String dateString,
|
private Calendar getIntervalCalendarByParsingString(String dateString,
|
||||||
String formatStringPattern, Calendar secondTimeCal) {
|
String formatStringPattern, Calendar secondTimeCal) {
|
||||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(formatStringPattern);
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(
|
||||||
|
formatStringPattern);
|
||||||
Calendar cal = null;
|
Calendar cal = null;
|
||||||
int elapsedHour = 1;
|
int elapsedHour = 1;
|
||||||
int elapsedMinute = 0;
|
int elapsedMinute = 0;
|
||||||
|
@ -783,7 +836,6 @@ public class Track extends Line implements ITrack {
|
||||||
elapsedHour = cal.get(Calendar.HOUR_OF_DAY);
|
elapsedHour = cal.get(Calendar.HOUR_OF_DAY);
|
||||||
elapsedMinute = cal.get(Calendar.MINUTE);
|
elapsedMinute = cal.get(Calendar.MINUTE);
|
||||||
} catch (ParseException pe) {
|
} catch (ParseException pe) {
|
||||||
// log.error("The input of dateString is invalid, parse fails, dateString="+dateString);
|
|
||||||
elapsedHour = 1;
|
elapsedHour = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -793,19 +845,20 @@ public class Track extends Line implements ITrack {
|
||||||
return cal;
|
return cal;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Calendar getTimeElapsedCalendarForFirstExtraPoint(Calendar startCalendar, int elapsedHour,
|
private Calendar getTimeElapsedCalendarForFirstExtraPoint(
|
||||||
int elapsedMinute) {
|
Calendar startCalendar, int elapsedHour, int elapsedMinute) {
|
||||||
Calendar nextCal = Calendar.getInstance();
|
Calendar nextCal = Calendar.getInstance();
|
||||||
nextCal.setTimeInMillis(startCalendar.getTimeInMillis());
|
nextCal.setTimeInMillis(startCalendar.getTimeInMillis());
|
||||||
/*
|
/*
|
||||||
* played with the nmap2 APP, get confused with the logic behind, right now, calculate
|
* played with the nmap2 APP, get confused with the logic behind, right
|
||||||
* the first extra point as the logic described below:
|
* now, calculate the first extra point as the logic described below: 1.
|
||||||
* 1. if elapsedHour > 1 hour, set the first extra point time as the next exact hour
|
* if elapsedHour > 1 hour, set the first extra point time as the next
|
||||||
* 2. if elapsedHour == 0 and last init. point MINUTE value >= elapsedMinute,
|
* exact hour 2. if elapsedHour == 0 and last init. point MINUTE value
|
||||||
* set the first time extra point as the next exact hour
|
* >= elapsedMinute, set the first time extra point as the next exact
|
||||||
* 3. if elapsedHour == 0 and last init. point MINUTE value < elapsedMinute,
|
* hour 3. if elapsedHour == 0 and last init. point MINUTE value <
|
||||||
* set the first time extra point as the exact hour of the last init. point + elapsedMinute
|
* elapsedMinute, set the first time extra point as the exact hour of
|
||||||
* In the future, this logic may be changed once the real logic is figured. Michael Gao comment.
|
* the last init. point + elapsedMinute In the future, this logic may be
|
||||||
|
* changed once the real logic is figured. Michael Gao comment.
|
||||||
*/
|
*/
|
||||||
if (elapsedHour >= 1) {
|
if (elapsedHour >= 1) {
|
||||||
nextCal.set(Calendar.MINUTE, 0);
|
nextCal.set(Calendar.MINUTE, 0);
|
||||||
|
@ -822,8 +875,8 @@ public class Track extends Line implements ITrack {
|
||||||
return nextCal;
|
return nextCal;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Calendar getTimeElapsedCalendar(Calendar startCalendar, int elapsedHour,
|
private Calendar getTimeElapsedCalendar(Calendar startCalendar,
|
||||||
int elapsedMinute) {
|
int elapsedHour, int elapsedMinute) {
|
||||||
Calendar nextCal = Calendar.getInstance();
|
Calendar nextCal = Calendar.getInstance();
|
||||||
nextCal.setTimeInMillis(startCalendar.getTimeInMillis());
|
nextCal.setTimeInMillis(startCalendar.getTimeInMillis());
|
||||||
nextCal.add(Calendar.HOUR_OF_DAY, elapsedHour);
|
nextCal.add(Calendar.HOUR_OF_DAY, elapsedHour);
|
||||||
|
@ -831,7 +884,6 @@ public class Track extends Line implements ITrack {
|
||||||
return nextCal;
|
return nextCal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* all override setters and getters of the instance variables go here
|
* all override setters and getters of the instance variables go here
|
||||||
*/
|
*/
|
||||||
|
@ -1011,16 +1063,20 @@ public class Track extends Line implements ITrack {
|
||||||
|
|
||||||
public double getFromdirection() {
|
public double getFromdirection() {
|
||||||
|
|
||||||
Coordinate initPointBeforeLastInitPointCoordinate = initTrackPoints[initTrackPoints.length - 2].getLocation();
|
Coordinate initPointBeforeLastInitPointCoordinate = initTrackPoints[initTrackPoints.length - 2]
|
||||||
Coordinate lastInitPointCoordinate = initTrackPoints[initTrackPoints.length - 1].getLocation();
|
.getLocation();
|
||||||
|
Coordinate lastInitPointCoordinate = initTrackPoints[initTrackPoints.length - 1]
|
||||||
|
.getLocation();
|
||||||
|
|
||||||
GeodeticCalculator gc = new GeodeticCalculator(DefaultEllipsoid.WGS84);
|
GeodeticCalculator gc = new GeodeticCalculator(DefaultEllipsoid.WGS84);
|
||||||
gc.setStartingGeographicPoint(lastInitPointCoordinate.x,
|
gc.setStartingGeographicPoint(lastInitPointCoordinate.x,
|
||||||
lastInitPointCoordinate.y);
|
lastInitPointCoordinate.y);
|
||||||
gc.setDestinationGeographicPoint(initPointBeforeLastInitPointCoordinate.x,
|
gc.setDestinationGeographicPoint(
|
||||||
|
initPointBeforeLastInitPointCoordinate.x,
|
||||||
initPointBeforeLastInitPointCoordinate.y);
|
initPointBeforeLastInitPointCoordinate.y);
|
||||||
double dir = gc.getAzimuth();
|
double dir = gc.getAzimuth();
|
||||||
if ( dir < 0 ) dir += 360;
|
if (dir < 0)
|
||||||
|
dir += 360;
|
||||||
return dir;
|
return dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1035,8 +1091,8 @@ public class Track extends Line implements ITrack {
|
||||||
public void setSpeed(double speed) {
|
public void setSpeed(double speed) {
|
||||||
this.speed = speed;
|
this.speed = speed;
|
||||||
/*
|
/*
|
||||||
* The original speed is meters / millisecond, now it needs
|
* The original speed is meters / millisecond, now it needs to be
|
||||||
* to be converted to following units
|
* converted to following units
|
||||||
*/
|
*/
|
||||||
this.speedInKnotOverHour = speed * 1944;
|
this.speedInKnotOverHour = speed * 1944;
|
||||||
this.speedInKilometerOverHour = speed * 3600;
|
this.speedInKilometerOverHour = speed * 3600;
|
||||||
|
@ -1046,19 +1102,21 @@ public class Track extends Line implements ITrack {
|
||||||
public double getSpeedInKnotOverHour() {
|
public double getSpeedInKnotOverHour() {
|
||||||
return speedInKnotOverHour;
|
return speedInKnotOverHour;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getSpeedInKilometerOverHour() {
|
public double getSpeedInKilometerOverHour() {
|
||||||
return speedInKilometerOverHour;
|
return speedInKilometerOverHour;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getSpeedInMileOverHour() {
|
public double getSpeedInMileOverHour() {
|
||||||
return speedInMileOverHour;
|
return speedInMileOverHour;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public ExtraPointTimeDisplayOption getExtraPointTimeDisplayOption() {
|
public ExtraPointTimeDisplayOption getExtraPointTimeDisplayOption() {
|
||||||
return extraPointTimeDisplayOption;
|
return extraPointTimeDisplayOption;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setExtraPointTimeDisplayOption(ExtraPointTimeDisplayOption extraPointTimeDisplayOption) {
|
public void setExtraPointTimeDisplayOption(
|
||||||
|
ExtraPointTimeDisplayOption extraPointTimeDisplayOption) {
|
||||||
this.extraPointTimeDisplayOption = extraPointTimeDisplayOption;
|
this.extraPointTimeDisplayOption = extraPointTimeDisplayOption;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1135,8 +1193,9 @@ public class Track extends Line implements ITrack {
|
||||||
*/
|
*/
|
||||||
this.intervalTimeString = _intervalTimeString;
|
this.intervalTimeString = _intervalTimeString;
|
||||||
|
|
||||||
Calendar intervalTimeCal = getIntervalCalendarByParsingString(_intervalTimeString,
|
Calendar intervalTimeCal = getIntervalCalendarByParsingString(
|
||||||
INTERVAL_TIME_FORMAT_PATTERN, getSecondTimeCalendar());
|
_intervalTimeString, INTERVAL_TIME_FORMAT_PATTERN,
|
||||||
|
getSecondTimeCalendar());
|
||||||
// setIntervalTimeCalendar(intervalTimeCal);
|
// setIntervalTimeCalendar(intervalTimeCal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1160,11 +1219,4 @@ public class Track extends Line implements ITrack {
|
||||||
public String getSkipFactorText() {
|
public String getSkipFactorText() {
|
||||||
return skipFactorTextString;
|
return skipFactorTextString;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public FontStyle getStyle() {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,6 +134,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
||||||
* 12/13 TTR904 B. Yin Added back the water zone string for Watch county list
|
* 12/13 TTR904 B. Yin Added back the water zone string for Watch county list
|
||||||
* 11/13 #1065 J. Wu Added Kink lines.
|
* 11/13 #1065 J. Wu Added Kink lines.
|
||||||
* 05/14 TTR995 J. Wu Set Text's 'auto" flag to false.
|
* 05/14 TTR995 J. Wu Set Text's 'auto" flag to false.
|
||||||
|
* 09/14 TTR716 J. Wu Use "-" for GFA Outlook's Vor text.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -735,6 +736,12 @@ public class ProductConverter {
|
||||||
gfa.setGfaValue("Type", fgfa.getType());
|
gfa.setGfaValue("Type", fgfa.getType());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// textVOR
|
||||||
|
String vorStr = fgfa.getTextVor();
|
||||||
|
if (vorStr != null) {
|
||||||
|
gfa.setGfaVorText(nvl(vorStr));
|
||||||
|
}
|
||||||
|
|
||||||
String cig = fgfa.getCig();
|
String cig = fgfa.getCig();
|
||||||
if (cig != null) {
|
if (cig != null) {
|
||||||
gfa.setGfaValue(Gfa.CIG, fgfa.getCig());
|
gfa.setGfaValue(Gfa.CIG, fgfa.getCig());
|
||||||
|
@ -1098,7 +1105,11 @@ public class ProductConverter {
|
||||||
}
|
}
|
||||||
|
|
||||||
// textVOR
|
// textVOR
|
||||||
fgfa.setTextVor(nvl(((Gfa) de).getGfaVorText()));
|
String vorStr = ((Gfa) de).getGfaVorText();
|
||||||
|
if (vorStr != null && ((Gfa) de).isOutlook()) {
|
||||||
|
vorStr = vorStr.replaceAll(" TO ", "-");
|
||||||
|
}
|
||||||
|
fgfa.setTextVor(nvl(vorStr));
|
||||||
|
|
||||||
fgfa.setFillPattern(nvl(((Gfa) de).getFillPattern()
|
fgfa.setFillPattern(nvl(((Gfa) de).getFillPattern()
|
||||||
.name()));
|
.name()));
|
||||||
|
|
|
@ -5,11 +5,11 @@
|
||||||
// Generated on: 2009.05.28 at 02:35:15 PM EDT
|
// Generated on: 2009.05.28 at 02:35:15 PM EDT
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
package gov.noaa.nws.ncep.ui.pgen.file;
|
package gov.noaa.nws.ncep.ui.pgen.file;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
@ -17,11 +17,13 @@ import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Java class for anonymous complex type.
|
* <p>
|
||||||
|
* Java class for anonymous complex type.
|
||||||
*
|
*
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>
|
||||||
|
* The following schema fragment specifies the expected content contained within
|
||||||
|
* this class.
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType>
|
* <complexType>
|
||||||
|
@ -38,6 +40,7 @@ import javax.xml.bind.annotation.XmlType;
|
||||||
* <attribute name="extrapLinePattern" type="{http://www.w3.org/2001/XMLSchema}string" />
|
* <attribute name="extrapLinePattern" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||||
* <attribute name="extrapMarker" type="{http://www.w3.org/2001/XMLSchema}string" />
|
* <attribute name="extrapMarker" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||||
* <attribute name="fontName" type="{http://www.w3.org/2001/XMLSchema}string" />
|
* <attribute name="fontName" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||||
|
* <attribute name="fontStyle" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||||
* <attribute name="fontNameComboSelectedIndex" type="{http://www.w3.org/2001/XMLSchema}int" />
|
* <attribute name="fontNameComboSelectedIndex" type="{http://www.w3.org/2001/XMLSchema}int" />
|
||||||
* <attribute name="fontSize" type="{http://www.w3.org/2001/XMLSchema}float" />
|
* <attribute name="fontSize" type="{http://www.w3.org/2001/XMLSchema}float" />
|
||||||
* <attribute name="fontSizeComboSelectedIndex" type="{http://www.w3.org/2001/XMLSchema}int" />
|
* <attribute name="fontSizeComboSelectedIndex" type="{http://www.w3.org/2001/XMLSchema}int" />
|
||||||
|
@ -60,67 +63,84 @@ import javax.xml.bind.annotation.XmlType;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
@XmlType(name = "", propOrder = {
|
@XmlType(name = "", propOrder = { "initialColor", "extrapColor",
|
||||||
"initialColor",
|
"initialPoints", "extrapPoints", "extraPointTimeTextDisplayIndicator" })
|
||||||
"extrapColor",
|
|
||||||
"initialPoints",
|
|
||||||
"extrapPoints",
|
|
||||||
"extraPointTimeTextDisplayIndicator"
|
|
||||||
})
|
|
||||||
@XmlRootElement(name = "Track")
|
@XmlRootElement(name = "Track")
|
||||||
public class Track {
|
public class Track {
|
||||||
|
|
||||||
@XmlElement(required = true)
|
@XmlElement(required = true)
|
||||||
protected ColorType initialColor;
|
protected ColorType initialColor;
|
||||||
|
|
||||||
@XmlElement(required = true)
|
@XmlElement(required = true)
|
||||||
protected ColorType extrapColor;
|
protected ColorType extrapColor;
|
||||||
|
|
||||||
@XmlElement(required = true)
|
@XmlElement(required = true)
|
||||||
protected List<TrackPoint> initialPoints;
|
protected List<TrackPoint> initialPoints;
|
||||||
|
|
||||||
@XmlElement(required = true)
|
@XmlElement(required = true)
|
||||||
protected List<TrackPoint> extrapPoints;
|
protected List<TrackPoint> extrapPoints;
|
||||||
|
|
||||||
@XmlElement(type = Boolean.class)
|
@XmlElement(type = Boolean.class)
|
||||||
protected List<Boolean> extraPointTimeTextDisplayIndicator;
|
protected List<Boolean> extraPointTimeTextDisplayIndicator;
|
||||||
|
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected String extraPointTimeDisplayOptionName;
|
protected String extraPointTimeDisplayOptionName;
|
||||||
|
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected String extrapLinePattern;
|
protected String extrapLinePattern;
|
||||||
|
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected String extrapMarker;
|
protected String extrapMarker;
|
||||||
|
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected String fontName;
|
protected String fontName;
|
||||||
|
|
||||||
|
@XmlAttribute
|
||||||
|
protected String fontStyle;
|
||||||
|
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected Integer fontNameComboSelectedIndex;
|
protected Integer fontNameComboSelectedIndex;
|
||||||
|
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected Float fontSize;
|
protected Float fontSize;
|
||||||
|
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected Integer fontSizeComboSelectedIndex;
|
protected Integer fontSizeComboSelectedIndex;
|
||||||
|
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected Integer fontStyleComboSelectedIndex;
|
protected Integer fontStyleComboSelectedIndex;
|
||||||
|
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected String initialLinePattern;
|
protected String initialLinePattern;
|
||||||
|
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected String initialMarker;
|
protected String initialMarker;
|
||||||
|
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected Integer intervalComboSelectedIndex;
|
protected Integer intervalComboSelectedIndex;
|
||||||
|
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected String intervalTimeTextString;
|
protected String intervalTimeTextString;
|
||||||
|
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected Float lineWidth;
|
protected Float lineWidth;
|
||||||
|
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected String pgenCategory;
|
protected String pgenCategory;
|
||||||
|
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected String pgenType;
|
protected String pgenType;
|
||||||
|
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected Boolean setTimeButtonSelected;
|
protected Boolean setTimeButtonSelected;
|
||||||
|
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected String skipFactorTextString;
|
protected String skipFactorTextString;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the initialColor property.
|
* Gets the value of the initialColor property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is {@link ColorType }
|
||||||
* possible object is
|
|
||||||
* {@link ColorType }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public ColorType getInitialColor() {
|
public ColorType getInitialColor() {
|
||||||
|
@ -131,8 +151,7 @@ public class Track {
|
||||||
* Sets the value of the initialColor property.
|
* Sets the value of the initialColor property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value
|
||||||
* allowed object is
|
* allowed object is {@link ColorType }
|
||||||
* {@link ColorType }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setInitialColor(ColorType value) {
|
public void setInitialColor(ColorType value) {
|
||||||
|
@ -142,9 +161,7 @@ public class Track {
|
||||||
/**
|
/**
|
||||||
* Gets the value of the extrapColor property.
|
* Gets the value of the extrapColor property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is {@link ColorType }
|
||||||
* possible object is
|
|
||||||
* {@link ColorType }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public ColorType getExtrapColor() {
|
public ColorType getExtrapColor() {
|
||||||
|
@ -155,8 +172,7 @@ public class Track {
|
||||||
* Sets the value of the extrapColor property.
|
* Sets the value of the extrapColor property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value
|
||||||
* allowed object is
|
* allowed object is {@link ColorType }
|
||||||
* {@link ColorType }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setExtrapColor(ColorType value) {
|
public void setExtrapColor(ColorType value) {
|
||||||
|
@ -167,13 +183,14 @@ public class Track {
|
||||||
* Gets the value of the initialPoints property.
|
* Gets the value of the initialPoints property.
|
||||||
*
|
*
|
||||||
* <p>
|
* <p>
|
||||||
* This accessor method returns a reference to the live list,
|
* This accessor method returns a reference to the live list, not a
|
||||||
* not a snapshot. Therefore any modification you make to the
|
* snapshot. Therefore any modification you make to the returned list will
|
||||||
* returned list will be present inside the JAXB object.
|
* be present inside the JAXB object. This is why there is not a
|
||||||
* This is why there is not a <CODE>set</CODE> method for the initialPoints property.
|
* <CODE>set</CODE> method for the initialPoints property.
|
||||||
*
|
*
|
||||||
* <p>
|
* <p>
|
||||||
* For example, to add a new item, do as follows:
|
* For example, to add a new item, do as follows:
|
||||||
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
* getInitialPoints().add(newItem);
|
* getInitialPoints().add(newItem);
|
||||||
* </pre>
|
* </pre>
|
||||||
|
@ -196,13 +213,14 @@ public class Track {
|
||||||
* Gets the value of the extrapPoints property.
|
* Gets the value of the extrapPoints property.
|
||||||
*
|
*
|
||||||
* <p>
|
* <p>
|
||||||
* This accessor method returns a reference to the live list,
|
* This accessor method returns a reference to the live list, not a
|
||||||
* not a snapshot. Therefore any modification you make to the
|
* snapshot. Therefore any modification you make to the returned list will
|
||||||
* returned list will be present inside the JAXB object.
|
* be present inside the JAXB object. This is why there is not a
|
||||||
* This is why there is not a <CODE>set</CODE> method for the extrapPoints property.
|
* <CODE>set</CODE> method for the extrapPoints property.
|
||||||
*
|
*
|
||||||
* <p>
|
* <p>
|
||||||
* For example, to add a new item, do as follows:
|
* For example, to add a new item, do as follows:
|
||||||
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
* getExtrapPoints().add(newItem);
|
* getExtrapPoints().add(newItem);
|
||||||
* </pre>
|
* </pre>
|
||||||
|
@ -225,21 +243,22 @@ public class Track {
|
||||||
* Gets the value of the extraPointTimeTextDisplayIndicator property.
|
* Gets the value of the extraPointTimeTextDisplayIndicator property.
|
||||||
*
|
*
|
||||||
* <p>
|
* <p>
|
||||||
* This accessor method returns a reference to the live list,
|
* This accessor method returns a reference to the live list, not a
|
||||||
* not a snapshot. Therefore any modification you make to the
|
* snapshot. Therefore any modification you make to the returned list will
|
||||||
* returned list will be present inside the JAXB object.
|
* be present inside the JAXB object. This is why there is not a
|
||||||
* This is why there is not a <CODE>set</CODE> method for the extraPointTimeTextDisplayIndicator property.
|
* <CODE>set</CODE> method for the extraPointTimeTextDisplayIndicator
|
||||||
|
* property.
|
||||||
*
|
*
|
||||||
* <p>
|
* <p>
|
||||||
* For example, to add a new item, do as follows:
|
* For example, to add a new item, do as follows:
|
||||||
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
* getExtraPointTimeTextDisplayIndicator().add(newItem);
|
* getExtraPointTimeTextDisplayIndicator().add(newItem);
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* <p>
|
* <p>
|
||||||
* Objects of the following type(s) are allowed in the list
|
* Objects of the following type(s) are allowed in the list {@link Boolean }
|
||||||
* {@link Boolean }
|
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -253,9 +272,7 @@ public class Track {
|
||||||
/**
|
/**
|
||||||
* Gets the value of the extraPointTimeDisplayOptionName property.
|
* Gets the value of the extraPointTimeDisplayOptionName property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is {@link String }
|
||||||
* possible object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public String getExtraPointTimeDisplayOptionName() {
|
public String getExtraPointTimeDisplayOptionName() {
|
||||||
|
@ -266,8 +283,7 @@ public class Track {
|
||||||
* Sets the value of the extraPointTimeDisplayOptionName property.
|
* Sets the value of the extraPointTimeDisplayOptionName property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value
|
||||||
* allowed object is
|
* allowed object is {@link String }
|
||||||
* {@link String }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setExtraPointTimeDisplayOptionName(String value) {
|
public void setExtraPointTimeDisplayOptionName(String value) {
|
||||||
|
@ -277,9 +293,7 @@ public class Track {
|
||||||
/**
|
/**
|
||||||
* Gets the value of the extrapLinePattern property.
|
* Gets the value of the extrapLinePattern property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is {@link String }
|
||||||
* possible object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public String getExtrapLinePattern() {
|
public String getExtrapLinePattern() {
|
||||||
|
@ -290,8 +304,7 @@ public class Track {
|
||||||
* Sets the value of the extrapLinePattern property.
|
* Sets the value of the extrapLinePattern property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value
|
||||||
* allowed object is
|
* allowed object is {@link String }
|
||||||
* {@link String }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setExtrapLinePattern(String value) {
|
public void setExtrapLinePattern(String value) {
|
||||||
|
@ -301,9 +314,7 @@ public class Track {
|
||||||
/**
|
/**
|
||||||
* Gets the value of the extrapMarker property.
|
* Gets the value of the extrapMarker property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is {@link String }
|
||||||
* possible object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public String getExtrapMarker() {
|
public String getExtrapMarker() {
|
||||||
|
@ -314,8 +325,7 @@ public class Track {
|
||||||
* Sets the value of the extrapMarker property.
|
* Sets the value of the extrapMarker property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value
|
||||||
* allowed object is
|
* allowed object is {@link String }
|
||||||
* {@link String }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setExtrapMarker(String value) {
|
public void setExtrapMarker(String value) {
|
||||||
|
@ -325,9 +335,7 @@ public class Track {
|
||||||
/**
|
/**
|
||||||
* Gets the value of the fontName property.
|
* Gets the value of the fontName property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is {@link String }
|
||||||
* possible object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public String getFontName() {
|
public String getFontName() {
|
||||||
|
@ -338,20 +346,38 @@ public class Track {
|
||||||
* Sets the value of the fontName property.
|
* Sets the value of the fontName property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value
|
||||||
* allowed object is
|
* allowed object is {@link String }
|
||||||
* {@link String }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setFontName(String value) {
|
public void setFontName(String value) {
|
||||||
this.fontName = value;
|
this.fontName = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the fontStyle property.
|
||||||
|
*
|
||||||
|
* @return possible object is {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getFontStyle() {
|
||||||
|
return fontStyle;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the fontStyle property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setFontStyle(String value) {
|
||||||
|
this.fontStyle = value;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the fontNameComboSelectedIndex property.
|
* Gets the value of the fontNameComboSelectedIndex property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is {@link Integer }
|
||||||
* possible object is
|
|
||||||
* {@link Integer }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public Integer getFontNameComboSelectedIndex() {
|
public Integer getFontNameComboSelectedIndex() {
|
||||||
|
@ -362,8 +388,7 @@ public class Track {
|
||||||
* Sets the value of the fontNameComboSelectedIndex property.
|
* Sets the value of the fontNameComboSelectedIndex property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value
|
||||||
* allowed object is
|
* allowed object is {@link Integer }
|
||||||
* {@link Integer }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setFontNameComboSelectedIndex(Integer value) {
|
public void setFontNameComboSelectedIndex(Integer value) {
|
||||||
|
@ -373,9 +398,7 @@ public class Track {
|
||||||
/**
|
/**
|
||||||
* Gets the value of the fontSize property.
|
* Gets the value of the fontSize property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is {@link Float }
|
||||||
* possible object is
|
|
||||||
* {@link Float }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public Float getFontSize() {
|
public Float getFontSize() {
|
||||||
|
@ -386,8 +409,7 @@ public class Track {
|
||||||
* Sets the value of the fontSize property.
|
* Sets the value of the fontSize property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value
|
||||||
* allowed object is
|
* allowed object is {@link Float }
|
||||||
* {@link Float }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setFontSize(Float value) {
|
public void setFontSize(Float value) {
|
||||||
|
@ -397,9 +419,7 @@ public class Track {
|
||||||
/**
|
/**
|
||||||
* Gets the value of the fontSizeComboSelectedIndex property.
|
* Gets the value of the fontSizeComboSelectedIndex property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is {@link Integer }
|
||||||
* possible object is
|
|
||||||
* {@link Integer }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public Integer getFontSizeComboSelectedIndex() {
|
public Integer getFontSizeComboSelectedIndex() {
|
||||||
|
@ -410,8 +430,7 @@ public class Track {
|
||||||
* Sets the value of the fontSizeComboSelectedIndex property.
|
* Sets the value of the fontSizeComboSelectedIndex property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value
|
||||||
* allowed object is
|
* allowed object is {@link Integer }
|
||||||
* {@link Integer }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setFontSizeComboSelectedIndex(Integer value) {
|
public void setFontSizeComboSelectedIndex(Integer value) {
|
||||||
|
@ -421,9 +440,7 @@ public class Track {
|
||||||
/**
|
/**
|
||||||
* Gets the value of the fontStyleComboSelectedIndex property.
|
* Gets the value of the fontStyleComboSelectedIndex property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is {@link Integer }
|
||||||
* possible object is
|
|
||||||
* {@link Integer }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public Integer getFontStyleComboSelectedIndex() {
|
public Integer getFontStyleComboSelectedIndex() {
|
||||||
|
@ -434,8 +451,7 @@ public class Track {
|
||||||
* Sets the value of the fontStyleComboSelectedIndex property.
|
* Sets the value of the fontStyleComboSelectedIndex property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value
|
||||||
* allowed object is
|
* allowed object is {@link Integer }
|
||||||
* {@link Integer }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setFontStyleComboSelectedIndex(Integer value) {
|
public void setFontStyleComboSelectedIndex(Integer value) {
|
||||||
|
@ -445,9 +461,7 @@ public class Track {
|
||||||
/**
|
/**
|
||||||
* Gets the value of the initialLinePattern property.
|
* Gets the value of the initialLinePattern property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is {@link String }
|
||||||
* possible object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public String getInitialLinePattern() {
|
public String getInitialLinePattern() {
|
||||||
|
@ -458,8 +472,7 @@ public class Track {
|
||||||
* Sets the value of the initialLinePattern property.
|
* Sets the value of the initialLinePattern property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value
|
||||||
* allowed object is
|
* allowed object is {@link String }
|
||||||
* {@link String }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setInitialLinePattern(String value) {
|
public void setInitialLinePattern(String value) {
|
||||||
|
@ -469,9 +482,7 @@ public class Track {
|
||||||
/**
|
/**
|
||||||
* Gets the value of the initialMarker property.
|
* Gets the value of the initialMarker property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is {@link String }
|
||||||
* possible object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public String getInitialMarker() {
|
public String getInitialMarker() {
|
||||||
|
@ -482,8 +493,7 @@ public class Track {
|
||||||
* Sets the value of the initialMarker property.
|
* Sets the value of the initialMarker property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value
|
||||||
* allowed object is
|
* allowed object is {@link String }
|
||||||
* {@link String }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setInitialMarker(String value) {
|
public void setInitialMarker(String value) {
|
||||||
|
@ -493,9 +503,7 @@ public class Track {
|
||||||
/**
|
/**
|
||||||
* Gets the value of the intervalComboSelectedIndex property.
|
* Gets the value of the intervalComboSelectedIndex property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is {@link Integer }
|
||||||
* possible object is
|
|
||||||
* {@link Integer }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public Integer getIntervalComboSelectedIndex() {
|
public Integer getIntervalComboSelectedIndex() {
|
||||||
|
@ -506,8 +514,7 @@ public class Track {
|
||||||
* Sets the value of the intervalComboSelectedIndex property.
|
* Sets the value of the intervalComboSelectedIndex property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value
|
||||||
* allowed object is
|
* allowed object is {@link Integer }
|
||||||
* {@link Integer }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setIntervalComboSelectedIndex(Integer value) {
|
public void setIntervalComboSelectedIndex(Integer value) {
|
||||||
|
@ -517,9 +524,7 @@ public class Track {
|
||||||
/**
|
/**
|
||||||
* Gets the value of the intervalTimeTextString property.
|
* Gets the value of the intervalTimeTextString property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is {@link String }
|
||||||
* possible object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public String getIntervalTimeTextString() {
|
public String getIntervalTimeTextString() {
|
||||||
|
@ -530,8 +535,7 @@ public class Track {
|
||||||
* Sets the value of the intervalTimeTextString property.
|
* Sets the value of the intervalTimeTextString property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value
|
||||||
* allowed object is
|
* allowed object is {@link String }
|
||||||
* {@link String }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setIntervalTimeTextString(String value) {
|
public void setIntervalTimeTextString(String value) {
|
||||||
|
@ -541,9 +545,7 @@ public class Track {
|
||||||
/**
|
/**
|
||||||
* Gets the value of the lineWidth property.
|
* Gets the value of the lineWidth property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is {@link Float }
|
||||||
* possible object is
|
|
||||||
* {@link Float }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public Float getLineWidth() {
|
public Float getLineWidth() {
|
||||||
|
@ -554,8 +556,7 @@ public class Track {
|
||||||
* Sets the value of the lineWidth property.
|
* Sets the value of the lineWidth property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value
|
||||||
* allowed object is
|
* allowed object is {@link Float }
|
||||||
* {@link Float }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setLineWidth(Float value) {
|
public void setLineWidth(Float value) {
|
||||||
|
@ -565,9 +566,7 @@ public class Track {
|
||||||
/**
|
/**
|
||||||
* Gets the value of the pgenCategory property.
|
* Gets the value of the pgenCategory property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is {@link String }
|
||||||
* possible object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public String getPgenCategory() {
|
public String getPgenCategory() {
|
||||||
|
@ -578,8 +577,7 @@ public class Track {
|
||||||
* Sets the value of the pgenCategory property.
|
* Sets the value of the pgenCategory property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value
|
||||||
* allowed object is
|
* allowed object is {@link String }
|
||||||
* {@link String }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setPgenCategory(String value) {
|
public void setPgenCategory(String value) {
|
||||||
|
@ -589,9 +587,7 @@ public class Track {
|
||||||
/**
|
/**
|
||||||
* Gets the value of the pgenType property.
|
* Gets the value of the pgenType property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is {@link String }
|
||||||
* possible object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public String getPgenType() {
|
public String getPgenType() {
|
||||||
|
@ -602,8 +598,7 @@ public class Track {
|
||||||
* Sets the value of the pgenType property.
|
* Sets the value of the pgenType property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value
|
||||||
* allowed object is
|
* allowed object is {@link String }
|
||||||
* {@link String }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setPgenType(String value) {
|
public void setPgenType(String value) {
|
||||||
|
@ -613,9 +608,7 @@ public class Track {
|
||||||
/**
|
/**
|
||||||
* Gets the value of the setTimeButtonSelected property.
|
* Gets the value of the setTimeButtonSelected property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is {@link Boolean }
|
||||||
* possible object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public Boolean isSetTimeButtonSelected() {
|
public Boolean isSetTimeButtonSelected() {
|
||||||
|
@ -626,8 +619,7 @@ public class Track {
|
||||||
* Sets the value of the setTimeButtonSelected property.
|
* Sets the value of the setTimeButtonSelected property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value
|
||||||
* allowed object is
|
* allowed object is {@link Boolean }
|
||||||
* {@link Boolean }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setSetTimeButtonSelected(Boolean value) {
|
public void setSetTimeButtonSelected(Boolean value) {
|
||||||
|
@ -637,9 +629,7 @@ public class Track {
|
||||||
/**
|
/**
|
||||||
* Gets the value of the skipFactorTextString property.
|
* Gets the value of the skipFactorTextString property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is {@link String }
|
||||||
* possible object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public String getSkipFactorTextString() {
|
public String getSkipFactorTextString() {
|
||||||
|
@ -650,8 +640,7 @@ public class Track {
|
||||||
* Sets the value of the skipFactorTextString property.
|
* Sets the value of the skipFactorTextString property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value
|
||||||
* allowed object is
|
* allowed object is {@link String }
|
||||||
* {@link String }
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setSkipFactorTextString(String value) {
|
public void setSkipFactorTextString(String value) {
|
||||||
|
|
|
@ -7,11 +7,17 @@
|
||||||
*/
|
*/
|
||||||
package gov.noaa.nws.ncep.ui.pgen.file;
|
package gov.noaa.nws.ncep.ui.pgen.file;
|
||||||
|
|
||||||
|
import gov.noaa.nws.ncep.ui.pgen.display.FillPatternList.FillPattern;
|
||||||
|
import gov.noaa.nws.ncep.ui.pgen.display.IText.FontStyle;
|
||||||
|
import gov.noaa.nws.ncep.ui.pgen.display.ITrack;
|
||||||
|
import gov.noaa.nws.ncep.ui.pgen.display.TrackPoint;
|
||||||
|
import gov.noaa.nws.ncep.ui.pgen.elements.Track;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.GregorianCalendar;
|
import java.util.GregorianCalendar;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.awt.Color;
|
|
||||||
|
|
||||||
import javax.xml.datatype.DatatypeConfigurationException;
|
import javax.xml.datatype.DatatypeConfigurationException;
|
||||||
import javax.xml.datatype.DatatypeFactory;
|
import javax.xml.datatype.DatatypeFactory;
|
||||||
|
@ -22,20 +28,16 @@ import org.geotools.referencing.datum.DefaultEllipsoid;
|
||||||
|
|
||||||
import com.vividsolutions.jts.geom.Coordinate;
|
import com.vividsolutions.jts.geom.Coordinate;
|
||||||
|
|
||||||
import gov.noaa.nws.ncep.ui.pgen.elements.Track;
|
|
||||||
import gov.noaa.nws.ncep.ui.pgen.display.ITrack;
|
|
||||||
import gov.noaa.nws.ncep.ui.pgen.display.TrackPoint;
|
|
||||||
import gov.noaa.nws.ncep.ui.pgen.display.FillPatternList.FillPattern;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define a ProductConverter Class - some methods to convert the products between XML format
|
* Define a ProductConverter Class - some methods to convert the products
|
||||||
* and the actual in-memory PGEN products.
|
* between XML format and the actual in-memory PGEN products.
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
* SOFTWARE HISTORY
|
* SOFTWARE HISTORY
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* 02/2012 TTR456 Q. Zhou Added speed, dir. Default to kts, no round
|
* 02/2012 TTR456 Q. Zhou Added speed, dir. Default to kts, no round
|
||||||
|
* 09/2014 TTR750 J. Wu Use FontStyle instead of "index".
|
||||||
* </pre>
|
* </pre>
|
||||||
* */
|
* */
|
||||||
public class TrackConverter {
|
public class TrackConverter {
|
||||||
|
@ -49,46 +51,90 @@ public class TrackConverter {
|
||||||
*/
|
*/
|
||||||
public static List<Track> getTrackElementListByTrackBeanList(
|
public static List<Track> getTrackElementListByTrackBeanList(
|
||||||
List<gov.noaa.nws.ncep.ui.pgen.file.Track> trackBeanList) {
|
List<gov.noaa.nws.ncep.ui.pgen.file.Track> trackBeanList) {
|
||||||
List<Track> trackElementList = new ArrayList<Track>(trackBeanList.size());
|
List<Track> trackElementList = new ArrayList<Track>(
|
||||||
|
trackBeanList.size());
|
||||||
|
|
||||||
for (gov.noaa.nws.ncep.ui.pgen.file.Track trackBean : trackBeanList) {
|
for (gov.noaa.nws.ncep.ui.pgen.file.Track trackBean : trackBeanList) {
|
||||||
Track trackElement = new Track();
|
Track trackElement = new Track();
|
||||||
|
|
||||||
trackElement.setInitialColor(getColorByColorTypeBean(trackBean.initialColor, true));
|
trackElement.setInitialColor(getColorByColorTypeBean(
|
||||||
trackElement.setExtrapColor(getColorByColorTypeBean(trackBean.extrapColor, false));
|
trackBean.initialColor, true));
|
||||||
|
trackElement.setExtrapColor(getColorByColorTypeBean(
|
||||||
|
trackBean.extrapColor, false));
|
||||||
|
|
||||||
trackElement.setInitTrackPoints(getTrackPointElementListByTrackPointBeanList(trackBean.getInitialPoints()).toArray(new TrackPoint[trackBean.getInitialPoints().size()]));
|
trackElement
|
||||||
trackElement.setExtrapPoints(getTrackPointElementListByTrackPointBeanList(trackBean.getExtrapPoints()).toArray(new TrackPoint[trackBean.getExtrapPoints().size()]));
|
.setInitTrackPoints(getTrackPointElementListByTrackPointBeanList(
|
||||||
|
trackBean.getInitialPoints())
|
||||||
|
.toArray(
|
||||||
|
new TrackPoint[trackBean.getInitialPoints()
|
||||||
|
.size()]));
|
||||||
|
trackElement
|
||||||
|
.setExtrapPoints(getTrackPointElementListByTrackPointBeanList(
|
||||||
|
trackBean.getExtrapPoints()).toArray(
|
||||||
|
new TrackPoint[trackBean.getExtrapPoints().size()]));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Now initialize track's firstTimeCalendar and secondTimeCalendar using initTrackPoints
|
* Now initialize track's firstTimeCalendar and secondTimeCalendar
|
||||||
|
* using initTrackPoints
|
||||||
*/
|
*/
|
||||||
trackElement.setFirstTimeCalendar(getFirstOrSecondTimeCalendarByTrackBean(trackBean, true));
|
trackElement
|
||||||
trackElement.setSecondTimeCalendar(getFirstOrSecondTimeCalendarByTrackBean(trackBean, false));
|
.setFirstTimeCalendar(getFirstOrSecondTimeCalendarByTrackBean(
|
||||||
|
trackBean, true));
|
||||||
|
trackElement
|
||||||
|
.setSecondTimeCalendar(getFirstOrSecondTimeCalendarByTrackBean(
|
||||||
|
trackBean, false));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Important note: the following two method calls are necessary.
|
* Important note: the following two method calls are necessary. 1.
|
||||||
* 1. combine init and extrap points to allow PgenSource to go over every point for drawing
|
* combine init and extrap points to allow PgenSource to go over
|
||||||
* 2. setLinePattern is from the parent class of Track, the name is kind of misleading
|
* every point for drawing 2. setLinePattern is from the parent
|
||||||
* It is hard coded now, for future, a new field is needed to the XSD file.
|
* class of Track, the name is kind of misleading It is hard coded
|
||||||
|
* now, for future, a new field is needed to the XSD file.
|
||||||
*/
|
*/
|
||||||
trackElement.setLinePointsValue(trackElement.getInitialPoints(), trackElement.getExtrapPoints());
|
trackElement.setLinePointsValue(trackElement.getInitialPoints(),
|
||||||
|
trackElement.getExtrapPoints());
|
||||||
|
|
||||||
trackElement.setExtraPointTimeTextDisplayIndicator(getBooleanArrayByBooleanList(trackBean.extraPointTimeTextDisplayIndicator));
|
trackElement
|
||||||
|
.setExtraPointTimeTextDisplayIndicator(getBooleanArrayByBooleanList(trackBean.extraPointTimeTextDisplayIndicator));
|
||||||
|
|
||||||
trackElement.setInitialLinePattern(trackBean.getInitialLinePattern());
|
trackElement.setInitialLinePattern(trackBean
|
||||||
|
.getInitialLinePattern());
|
||||||
trackElement.setExtrapLinePattern(trackBean.getExtrapLinePattern());
|
trackElement.setExtrapLinePattern(trackBean.getExtrapLinePattern());
|
||||||
trackElement.setInitialMarker(trackBean.getInitialMarker());
|
trackElement.setInitialMarker(trackBean.getInitialMarker());
|
||||||
trackElement.setExtrapMarker(trackBean.getExtrapMarker());
|
trackElement.setExtrapMarker(trackBean.getExtrapMarker());
|
||||||
trackElement.setFontName(trackBean.getFontName());
|
trackElement.setFontName(trackBean.getFontName());
|
||||||
|
|
||||||
|
// TTR 950 - Font Style
|
||||||
|
int styleInd = 0;
|
||||||
|
FontStyle dstyle = FontStyle.BOLD;
|
||||||
|
if (trackBean.getFontStyle() != null) {
|
||||||
|
int jj = 0;
|
||||||
|
for (FontStyle ft : FontStyle.values()) {
|
||||||
|
if (ft == FontStyle.valueOf(trackBean.getFontStyle()
|
||||||
|
.toUpperCase())) {
|
||||||
|
styleInd = jj;
|
||||||
|
dstyle = ft;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
jj++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
trackElement.setFontStyle(dstyle);
|
||||||
|
trackElement.setFontStyleComboSelectedIndex(styleInd);
|
||||||
|
|
||||||
if (trackBean.getLineWidth() != null)
|
if (trackBean.getLineWidth() != null)
|
||||||
trackElement.setLineWidth(trackBean.getLineWidth().floatValue());
|
trackElement
|
||||||
|
.setLineWidth(trackBean.getLineWidth().floatValue());
|
||||||
else
|
else
|
||||||
trackElement.setLineWidth((float)1.0); //set a 1.0 as the default value
|
trackElement.setLineWidth((float) 1.0); // set a 1.0 as the
|
||||||
|
// default value
|
||||||
if (trackBean.getFontSize() != null)
|
if (trackBean.getFontSize() != null)
|
||||||
trackElement.setFontSize(trackBean.getFontSize().floatValue());
|
trackElement.setFontSize(trackBean.getFontSize().floatValue());
|
||||||
else
|
else
|
||||||
trackElement.setFontSize((float)2.0); //set a 2.0 as the default value
|
trackElement.setFontSize((float) 2.0); // set a 2.0 as the
|
||||||
|
// default value
|
||||||
|
|
||||||
if (trackBean.getPgenCategory() == null)
|
if (trackBean.getPgenCategory() == null)
|
||||||
trackElement.setPgenCategory(Track.TRACK_PGEN_CATEGORY);
|
trackElement.setPgenCategory(Track.TRACK_PGEN_CATEGORY);
|
||||||
|
@ -105,19 +151,24 @@ public class TrackConverter {
|
||||||
*/
|
*/
|
||||||
TrackPoint[] initPts = trackElement.getInitTrackPoints();
|
TrackPoint[] initPts = trackElement.getInitTrackPoints();
|
||||||
int initPtsLength = initPts.length;
|
int initPtsLength = initPts.length;
|
||||||
Coordinate initPointBeforeLastInitPointCoordinate = initPts[initPtsLength - 2].getLocation();
|
Coordinate initPointBeforeLastInitPointCoordinate = initPts[initPtsLength - 2]
|
||||||
Coordinate lastInitPointCoordinate = initPts[initPtsLength - 1].getLocation();
|
.getLocation();
|
||||||
|
Coordinate lastInitPointCoordinate = initPts[initPtsLength - 1]
|
||||||
|
.getLocation();
|
||||||
|
|
||||||
GeodeticCalculator gc = new GeodeticCalculator(DefaultEllipsoid.WGS84);
|
GeodeticCalculator gc = new GeodeticCalculator(
|
||||||
gc.setStartingGeographicPoint(initPointBeforeLastInitPointCoordinate.x,
|
DefaultEllipsoid.WGS84);
|
||||||
|
gc.setStartingGeographicPoint(
|
||||||
|
initPointBeforeLastInitPointCoordinate.x,
|
||||||
initPointBeforeLastInitPointCoordinate.y);
|
initPointBeforeLastInitPointCoordinate.y);
|
||||||
gc.setDestinationGeographicPoint(lastInitPointCoordinate.x,
|
gc.setDestinationGeographicPoint(lastInitPointCoordinate.x,
|
||||||
lastInitPointCoordinate.y);
|
lastInitPointCoordinate.y);
|
||||||
double direction = gc.getAzimuth();
|
double direction = gc.getAzimuth();
|
||||||
|
|
||||||
double distanceInMeter = gc.getOrthodromicDistance();
|
double distanceInMeter = gc.getOrthodromicDistance();
|
||||||
long timeDifference = initPts[initPtsLength - 1].getTime().getTimeInMillis() -
|
long timeDifference = initPts[initPtsLength - 1].getTime()
|
||||||
initPts[initPtsLength - 2].getTime().getTimeInMillis();
|
.getTimeInMillis()
|
||||||
|
- initPts[initPtsLength - 2].getTime().getTimeInMillis();
|
||||||
double speed = distanceInMeter / (double) timeDifference;
|
double speed = distanceInMeter / (double) timeDifference;
|
||||||
|
|
||||||
trackElement.setDirectionForExtraPoints(direction);
|
trackElement.setDirectionForExtraPoints(direction);
|
||||||
|
@ -133,25 +184,34 @@ public class TrackConverter {
|
||||||
trackElement.setFillPattern(FillPattern.FILL_PATTERN_0);
|
trackElement.setFillPattern(FillPattern.FILL_PATTERN_0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following attributes are necessary to fill values for the pop-up
|
* The following attributes are necessary to fill values for the
|
||||||
* TrackAttiDlg window from the restored line images.
|
* pop-up TrackAttiDlg window from the restored line images.
|
||||||
*/
|
*/
|
||||||
boolean setTimeButtonSelectedFlag = true; // set the default value as TRUE
|
boolean setTimeButtonSelectedFlag = true; // set the default value
|
||||||
|
// as TRUE
|
||||||
if (trackBean.isSetTimeButtonSelected() != null)
|
if (trackBean.isSetTimeButtonSelected() != null)
|
||||||
setTimeButtonSelectedFlag = trackBean.isSetTimeButtonSelected().booleanValue();
|
setTimeButtonSelectedFlag = trackBean.isSetTimeButtonSelected()
|
||||||
|
.booleanValue();
|
||||||
trackElement.setSetTimeButtonSelected(setTimeButtonSelectedFlag);
|
trackElement.setSetTimeButtonSelected(setTimeButtonSelectedFlag);
|
||||||
|
|
||||||
int intervalComboSelectedIndexValue = 0; // set the default value
|
int intervalComboSelectedIndexValue = 0; // set the default value
|
||||||
if (trackBean.getIntervalComboSelectedIndex() != null)
|
if (trackBean.getIntervalComboSelectedIndex() != null)
|
||||||
intervalComboSelectedIndexValue = trackBean.getIntervalComboSelectedIndex().intValue();
|
intervalComboSelectedIndexValue = trackBean
|
||||||
trackElement.setIntervalComboSelectedIndex(intervalComboSelectedIndexValue);
|
.getIntervalComboSelectedIndex().intValue();
|
||||||
|
trackElement
|
||||||
|
.setIntervalComboSelectedIndex(intervalComboSelectedIndexValue);
|
||||||
|
|
||||||
trackElement.setIntervalTimeString(trackBean.getIntervalTimeTextString());
|
trackElement.setIntervalTimeString(trackBean
|
||||||
|
.getIntervalTimeTextString());
|
||||||
|
|
||||||
String extraPointTimeDisplayOptionName = ITrack.ExtraPointTimeDisplayOption.SKIP_FACTOR.name(); // set the default value
|
String extraPointTimeDisplayOptionName = ITrack.ExtraPointTimeDisplayOption.SKIP_FACTOR
|
||||||
|
.name(); // set the default value
|
||||||
if (trackBean.getExtraPointTimeDisplayOptionName() != null)
|
if (trackBean.getExtraPointTimeDisplayOptionName() != null)
|
||||||
extraPointTimeDisplayOptionName = trackBean.getExtraPointTimeDisplayOptionName();
|
extraPointTimeDisplayOptionName = trackBean
|
||||||
trackElement.setExtraPointTimeDisplayOption(ITrack.ExtraPointTimeDisplayOption.valueOf(extraPointTimeDisplayOptionName));
|
.getExtraPointTimeDisplayOptionName();
|
||||||
|
trackElement
|
||||||
|
.setExtraPointTimeDisplayOption(ITrack.ExtraPointTimeDisplayOption
|
||||||
|
.valueOf(extraPointTimeDisplayOptionName));
|
||||||
|
|
||||||
String skipFactorTextString = "0"; // set the default value
|
String skipFactorTextString = "0"; // set the default value
|
||||||
if (trackBean.getSkipFactorTextString() != null)
|
if (trackBean.getSkipFactorTextString() != null)
|
||||||
|
@ -160,18 +220,17 @@ public class TrackConverter {
|
||||||
|
|
||||||
int fontNameComboSelectedIndex = 0; // set the default value
|
int fontNameComboSelectedIndex = 0; // set the default value
|
||||||
if (trackBean.getFontNameComboSelectedIndex() != null)
|
if (trackBean.getFontNameComboSelectedIndex() != null)
|
||||||
fontNameComboSelectedIndex = trackBean.getFontNameComboSelectedIndex().intValue();
|
fontNameComboSelectedIndex = trackBean
|
||||||
trackElement.setFontNameComboSelectedIndex(fontNameComboSelectedIndex);
|
.getFontNameComboSelectedIndex().intValue();
|
||||||
|
trackElement
|
||||||
|
.setFontNameComboSelectedIndex(fontNameComboSelectedIndex);
|
||||||
|
|
||||||
int fontSizeComboSelectedIndex = 0; // set the default value
|
int fontSizeComboSelectedIndex = 0; // set the default value
|
||||||
if (trackBean.getFontSizeComboSelectedIndex() != null)
|
if (trackBean.getFontSizeComboSelectedIndex() != null)
|
||||||
fontSizeComboSelectedIndex = trackBean.getFontSizeComboSelectedIndex().intValue();
|
fontSizeComboSelectedIndex = trackBean
|
||||||
trackElement.setFontSizeComboSelectedIndex(fontSizeComboSelectedIndex);
|
.getFontSizeComboSelectedIndex().intValue();
|
||||||
|
trackElement
|
||||||
int fontStyleComboSelectedIndex = 0; //set the default value
|
.setFontSizeComboSelectedIndex(fontSizeComboSelectedIndex);
|
||||||
if(trackBean.getFontStyleComboSelectedIndex() != null)
|
|
||||||
fontStyleComboSelectedIndex = trackBean.getFontStyleComboSelectedIndex().intValue();
|
|
||||||
trackElement.setFontStyleComboSelectedIndex(fontStyleComboSelectedIndex);
|
|
||||||
|
|
||||||
trackElementList.add(trackElement);
|
trackElementList.add(trackElement);
|
||||||
}
|
}
|
||||||
|
@ -183,27 +242,55 @@ public class TrackConverter {
|
||||||
Track trackElement) {
|
Track trackElement) {
|
||||||
gov.noaa.nws.ncep.ui.pgen.file.Track trackBean = new gov.noaa.nws.ncep.ui.pgen.file.Track();
|
gov.noaa.nws.ncep.ui.pgen.file.Track trackBean = new gov.noaa.nws.ncep.ui.pgen.file.Track();
|
||||||
|
|
||||||
trackBean.setInitialColor(getColorTypeBeanByColorElement(trackElement.getInitialColor()));
|
trackBean.setInitialColor(getColorTypeBeanByColorElement(trackElement
|
||||||
trackBean.setExtrapColor(getColorTypeBeanByColorElement(trackElement.getExtrapColor()));
|
.getInitialColor()));
|
||||||
|
trackBean.setExtrapColor(getColorTypeBeanByColorElement(trackElement
|
||||||
|
.getExtrapColor()));
|
||||||
|
|
||||||
if (trackElement.getInitialPoints() != null) {
|
if (trackElement.getInitialPoints() != null) {
|
||||||
for (TrackPoint currentTrackPoint : trackElement.getInitialPoints()) {
|
for (TrackPoint currentTrackPoint : trackElement.getInitialPoints()) {
|
||||||
trackBean.getInitialPoints().add(getTrackPointBeanByTrackPointElement(currentTrackPoint));
|
trackBean
|
||||||
|
.getInitialPoints()
|
||||||
|
.add(getTrackPointBeanByTrackPointElement(currentTrackPoint));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (trackElement.getExtrapPoints() != null) {
|
if (trackElement.getExtrapPoints() != null) {
|
||||||
for (TrackPoint currentTrackPoint : trackElement.getExtrapPoints()) {
|
for (TrackPoint currentTrackPoint : trackElement.getExtrapPoints()) {
|
||||||
trackBean.getExtrapPoints().add(getTrackPointBeanByTrackPointElement(currentTrackPoint));
|
trackBean
|
||||||
|
.getExtrapPoints()
|
||||||
|
.add(getTrackPointBeanByTrackPointElement(currentTrackPoint));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
trackBean.getExtraPointTimeTextDisplayIndicator().addAll(getBooleanObjectList(trackElement.getExtraPointTimeTextDisplayIndicator()));
|
trackBean.getExtraPointTimeTextDisplayIndicator().addAll(
|
||||||
|
getBooleanObjectList(trackElement
|
||||||
|
.getExtraPointTimeTextDisplayIndicator()));
|
||||||
|
|
||||||
trackBean.setInitialLinePattern(trackElement.getInitialLinePattern());
|
trackBean.setInitialLinePattern(trackElement.getInitialLinePattern());
|
||||||
trackBean.setExtrapLinePattern(trackElement.getExtrapLinePattern());
|
trackBean.setExtrapLinePattern(trackElement.getExtrapLinePattern());
|
||||||
trackBean.setInitialMarker(trackElement.getInitialMarker());
|
trackBean.setInitialMarker(trackElement.getInitialMarker());
|
||||||
trackBean.setExtrapMarker(trackElement.getExtrapMarker());
|
trackBean.setExtrapMarker(trackElement.getExtrapMarker());
|
||||||
trackBean.setFontName(trackElement.getFontName());
|
trackBean.setFontName(trackElement.getFontName());
|
||||||
|
|
||||||
|
// Font style
|
||||||
|
int styleInd = 0;
|
||||||
|
FontStyle dstyle = FontStyle.BOLD;
|
||||||
|
if (trackElement.getFontStyle() != null) {
|
||||||
|
int jj = 0;
|
||||||
|
for (FontStyle ft : FontStyle.values()) {
|
||||||
|
if (ft == trackElement.getFontStyle()) {
|
||||||
|
styleInd = jj;
|
||||||
|
dstyle = ft;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
jj++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
trackBean.setFontStyle(dstyle.toString());
|
||||||
|
trackBean.setFontStyleComboSelectedIndex(styleInd);
|
||||||
|
|
||||||
trackBean.setFontSize(new Float(trackElement.getFontSize()));
|
trackBean.setFontSize(new Float(trackElement.getFontSize()));
|
||||||
trackBean.setLineWidth(new Float(trackElement.getLineWidth()));
|
trackBean.setLineWidth(new Float(trackElement.getLineWidth()));
|
||||||
|
|
||||||
|
@ -213,28 +300,39 @@ public class TrackConverter {
|
||||||
/*
|
/*
|
||||||
* The following attributes are not necessary to save the line images
|
* The following attributes are not necessary to save the line images
|
||||||
* and late to restore them back on the map. However, they are necessary
|
* and late to restore them back on the map. However, they are necessary
|
||||||
* values to pop-up and set up the correct attributes of the TrackAttrDlg
|
* values to pop-up and set up the correct attributes of the
|
||||||
|
* TrackAttrDlg
|
||||||
*/
|
*/
|
||||||
trackBean.setSetTimeButtonSelected(new Boolean(trackElement.isSetTimeButtonSelected()));
|
trackBean.setSetTimeButtonSelected(new Boolean(trackElement
|
||||||
trackBean.setIntervalComboSelectedIndex(new Integer(trackElement.getIntervalComboSelectedIndex()));
|
.isSetTimeButtonSelected()));
|
||||||
trackBean.setIntervalTimeTextString(trackElement.getIntervalTimeString());
|
trackBean.setIntervalComboSelectedIndex(new Integer(trackElement
|
||||||
trackBean.setExtraPointTimeDisplayOptionName(trackElement.getExtraPointTimeDisplayOption().name());
|
.getIntervalComboSelectedIndex()));
|
||||||
trackBean.setSkipFactorTextString(trackElement.getSkipFactorTextString());
|
trackBean.setIntervalTimeTextString(trackElement
|
||||||
trackBean.setFontNameComboSelectedIndex(new Integer(trackElement.getFontNameComboSelectedIndex()));
|
.getIntervalTimeString());
|
||||||
trackBean.setFontSizeComboSelectedIndex(new Integer(trackElement.getFontSizeComboSelectedIndex()));
|
trackBean.setExtraPointTimeDisplayOptionName(trackElement
|
||||||
trackBean.setFontStyleComboSelectedIndex(new Integer(trackElement.getFontStyleComboSelectedIndex()));
|
.getExtraPointTimeDisplayOption().name());
|
||||||
|
trackBean.setSkipFactorTextString(trackElement
|
||||||
|
.getSkipFactorTextString());
|
||||||
|
trackBean.setFontNameComboSelectedIndex(new Integer(trackElement
|
||||||
|
.getFontNameComboSelectedIndex()));
|
||||||
|
trackBean.setFontSizeComboSelectedIndex(new Integer(trackElement
|
||||||
|
.getFontSizeComboSelectedIndex()));
|
||||||
|
|
||||||
return trackBean;
|
return trackBean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* help methods for transferring objects back and forth between class objects and JAXB beans
|
* help methods for transferring objects back and forth between class
|
||||||
|
* objects and JAXB beans
|
||||||
*/
|
*/
|
||||||
private static Calendar getFirstOrSecondTimeCalendarByTrackBean(gov.noaa.nws.ncep.ui.pgen.file.Track trackBean, boolean isFirstTimeCalendar) {
|
private static Calendar getFirstOrSecondTimeCalendarByTrackBean(
|
||||||
|
gov.noaa.nws.ncep.ui.pgen.file.Track trackBean,
|
||||||
|
boolean isFirstTimeCalendar) {
|
||||||
int indexOffSet = 1;
|
int indexOffSet = 1;
|
||||||
if (isFirstTimeCalendar)
|
if (isFirstTimeCalendar)
|
||||||
indexOffSet++;
|
indexOffSet++;
|
||||||
List<TrackPoint> trackPointElementList = getTrackPointElementListByTrackPointBeanList(trackBean.getInitialPoints());
|
List<TrackPoint> trackPointElementList = getTrackPointElementListByTrackPointBeanList(trackBean
|
||||||
|
.getInitialPoints());
|
||||||
if (trackPointElementList == null || trackPointElementList.size() < 2) {
|
if (trackPointElementList == null || trackPointElementList.size() < 2) {
|
||||||
// log.error("Retrieved List<TrackPoint> trackPointElementList is NULL or the initial points are less than 2 points");
|
// log.error("Retrieved List<TrackPoint> trackPointElementList is NULL or the initial points are less than 2 points");
|
||||||
return null;
|
return null;
|
||||||
|
@ -243,34 +341,42 @@ public class TrackConverter {
|
||||||
return trackPointElementList.get(listSize - indexOffSet).getTime();
|
return trackPointElementList.get(listSize - indexOffSet).getTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static java.awt.Color getColorByColorTypeBean(gov.noaa.nws.ncep.ui.pgen.file.ColorType colorTypeBean,
|
private static java.awt.Color getColorByColorTypeBean(
|
||||||
|
gov.noaa.nws.ncep.ui.pgen.file.ColorType colorTypeBean,
|
||||||
boolean isInitColor) {
|
boolean isInitColor) {
|
||||||
if (colorTypeBean == null || colorTypeBean.getColor() == null) {
|
if (colorTypeBean == null || colorTypeBean.getColor() == null) {
|
||||||
if (isInitColor)
|
if (isInitColor)
|
||||||
return new Color(0, 0, 255); // return a default color as Blue
|
return new Color(0, 0, 255); // return a default color as Blue
|
||||||
else
|
else
|
||||||
return new Color(0, 192, 0); //return a green color as the default color for extrapPoint
|
return new Color(0, 192, 0); // return a green color as the
|
||||||
|
// default color for extrapPoint
|
||||||
}
|
}
|
||||||
gov.noaa.nws.ncep.ui.pgen.file.Color colorBean = colorTypeBean.getColor();
|
gov.noaa.nws.ncep.ui.pgen.file.Color colorBean = colorTypeBean
|
||||||
return new Color(colorBean.getRed(), colorBean.getGreen(), colorBean.getBlue(),
|
.getColor();
|
||||||
colorBean.getAlpha());
|
return new Color(colorBean.getRed(), colorBean.getGreen(),
|
||||||
|
colorBean.getBlue(), colorBean.getAlpha());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<TrackPoint> getTrackPointElementListByTrackPointBeanList(List<gov.noaa.nws.ncep.ui.pgen.file.TrackPoint> trackPointBeanList) {
|
private static List<TrackPoint> getTrackPointElementListByTrackPointBeanList(
|
||||||
List<TrackPoint> trackPointElementList = new ArrayList<TrackPoint>(trackPointBeanList.size());
|
List<gov.noaa.nws.ncep.ui.pgen.file.TrackPoint> trackPointBeanList) {
|
||||||
|
List<TrackPoint> trackPointElementList = new ArrayList<TrackPoint>(
|
||||||
|
trackPointBeanList.size());
|
||||||
for (gov.noaa.nws.ncep.ui.pgen.file.TrackPoint trackPointBean : trackPointBeanList) {
|
for (gov.noaa.nws.ncep.ui.pgen.file.TrackPoint trackPointBean : trackPointBeanList) {
|
||||||
java.util.Calendar currentCalendar = null;
|
java.util.Calendar currentCalendar = null;
|
||||||
if (trackPointBean.getTime() != null) {
|
if (trackPointBean.getTime() != null) {
|
||||||
currentCalendar = trackPointBean.getTime().toGregorianCalendar();
|
currentCalendar = trackPointBean.getTime()
|
||||||
|
.toGregorianCalendar();
|
||||||
}
|
}
|
||||||
Coordinate currentCoordinate = getCoordinateByTrackPointBean(trackPointBean);
|
Coordinate currentCoordinate = getCoordinateByTrackPointBean(trackPointBean);
|
||||||
TrackPoint currentTrackPointElement = new TrackPoint(currentCoordinate, currentCalendar);
|
TrackPoint currentTrackPointElement = new TrackPoint(
|
||||||
|
currentCoordinate, currentCalendar);
|
||||||
trackPointElementList.add(currentTrackPointElement);
|
trackPointElementList.add(currentTrackPointElement);
|
||||||
}
|
}
|
||||||
return trackPointElementList;
|
return trackPointElementList;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Coordinate getCoordinateByTrackPointBean(gov.noaa.nws.ncep.ui.pgen.file.TrackPoint trackPointBean) {
|
private static Coordinate getCoordinateByTrackPointBean(
|
||||||
|
gov.noaa.nws.ncep.ui.pgen.file.TrackPoint trackPointBean) {
|
||||||
Coordinate coordinate = new Coordinate();
|
Coordinate coordinate = new Coordinate();
|
||||||
if (trackPointBean.getLocation() != null) {
|
if (trackPointBean.getLocation() != null) {
|
||||||
coordinate.x = trackPointBean.getLocation().getLongitude();
|
coordinate.x = trackPointBean.getLocation().getLongitude();
|
||||||
|
@ -279,7 +385,8 @@ public class TrackConverter {
|
||||||
return coordinate;
|
return coordinate;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean[] getBooleanArrayByBooleanList(List<Boolean> booleanList) {
|
private static boolean[] getBooleanArrayByBooleanList(
|
||||||
|
List<Boolean> booleanList) {
|
||||||
boolean[] booleanArray = new boolean[booleanList.size()];
|
boolean[] booleanArray = new boolean[booleanList.size()];
|
||||||
int arrayIndex = 0;
|
int arrayIndex = 0;
|
||||||
for (Boolean currentBoolean : booleanList) {
|
for (Boolean currentBoolean : booleanList) {
|
||||||
|
@ -288,8 +395,8 @@ public class TrackConverter {
|
||||||
return booleanArray;
|
return booleanArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static gov.noaa.nws.ncep.ui.pgen.file.ColorType getColorTypeBeanByColorElement(
|
||||||
private static gov.noaa.nws.ncep.ui.pgen.file.ColorType getColorTypeBeanByColorElement(java.awt.Color colorElement) {
|
java.awt.Color colorElement) {
|
||||||
gov.noaa.nws.ncep.ui.pgen.file.ColorType colorTypeBean = new gov.noaa.nws.ncep.ui.pgen.file.ColorType();
|
gov.noaa.nws.ncep.ui.pgen.file.ColorType colorTypeBean = new gov.noaa.nws.ncep.ui.pgen.file.ColorType();
|
||||||
gov.noaa.nws.ncep.ui.pgen.file.Color colorBean = new gov.noaa.nws.ncep.ui.pgen.file.Color();
|
gov.noaa.nws.ncep.ui.pgen.file.Color colorBean = new gov.noaa.nws.ncep.ui.pgen.file.Color();
|
||||||
colorBean.setAlpha(colorElement.getAlpha());
|
colorBean.setAlpha(colorElement.getAlpha());
|
||||||
|
@ -300,14 +407,18 @@ public class TrackConverter {
|
||||||
return colorTypeBean;
|
return colorTypeBean;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static gov.noaa.nws.ncep.ui.pgen.file.TrackPoint getTrackPointBeanByTrackPointElement(TrackPoint trackPointElement) {
|
private static gov.noaa.nws.ncep.ui.pgen.file.TrackPoint getTrackPointBeanByTrackPointElement(
|
||||||
|
TrackPoint trackPointElement) {
|
||||||
gov.noaa.nws.ncep.ui.pgen.file.TrackPoint trackPointBean = new gov.noaa.nws.ncep.ui.pgen.file.TrackPoint();
|
gov.noaa.nws.ncep.ui.pgen.file.TrackPoint trackPointBean = new gov.noaa.nws.ncep.ui.pgen.file.TrackPoint();
|
||||||
|
|
||||||
if (trackPointElement.getTime() != null) {
|
if (trackPointElement.getTime() != null) {
|
||||||
GregorianCalendar gregorianCalendar = new GregorianCalendar();
|
GregorianCalendar gregorianCalendar = new GregorianCalendar();
|
||||||
gregorianCalendar.setTimeInMillis(trackPointElement.getTime().getTimeInMillis());
|
gregorianCalendar.setTimeInMillis(trackPointElement.getTime()
|
||||||
|
.getTimeInMillis());
|
||||||
try {
|
try {
|
||||||
XMLGregorianCalendar xmlGregorianCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(gregorianCalendar);
|
XMLGregorianCalendar xmlGregorianCalendar = DatatypeFactory
|
||||||
|
.newInstance().newXMLGregorianCalendar(
|
||||||
|
gregorianCalendar);
|
||||||
trackPointBean.setTime(xmlGregorianCalendar);
|
trackPointBean.setTime(xmlGregorianCalendar);
|
||||||
} catch (DatatypeConfigurationException dce) {
|
} catch (DatatypeConfigurationException dce) {
|
||||||
// log.error("Error, instantiating XMLGregorianCalendar failed, error="+dce.getMessage());
|
// log.error("Error, instantiating XMLGregorianCalendar failed, error="+dce.getMessage());
|
||||||
|
@ -315,8 +426,10 @@ public class TrackConverter {
|
||||||
}
|
}
|
||||||
if (trackPointElement.getLocation() != null) {
|
if (trackPointElement.getLocation() != null) {
|
||||||
trackPointBean.location = new gov.noaa.nws.ncep.ui.pgen.file.TrackPoint.Location();
|
trackPointBean.location = new gov.noaa.nws.ncep.ui.pgen.file.TrackPoint.Location();
|
||||||
trackPointBean.getLocation().setLongitude(trackPointElement.getLocation().x);
|
trackPointBean.getLocation().setLongitude(
|
||||||
trackPointBean.getLocation().setLatitude(trackPointElement.getLocation().y);
|
trackPointElement.getLocation().x);
|
||||||
|
trackPointBean.getLocation().setLatitude(
|
||||||
|
trackPointElement.getLocation().y);
|
||||||
}
|
}
|
||||||
return trackPointBean;
|
return trackPointBean;
|
||||||
}
|
}
|
||||||
|
@ -334,6 +447,4 @@ public class TrackConverter {
|
||||||
return booleanList;
|
return booleanList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -411,27 +411,52 @@
|
||||||
<xsd:sequence>
|
<xsd:sequence>
|
||||||
<xsd:element name="initialColor" type="ColorType"></xsd:element>
|
<xsd:element name="initialColor" type="ColorType"></xsd:element>
|
||||||
<xsd:element name="extrapColor" type="ColorType"></xsd:element>
|
<xsd:element name="extrapColor" type="ColorType"></xsd:element>
|
||||||
<xsd:element name="initialPoints" type="TrackPoint" maxOccurs="unbounded" minOccurs="1"></xsd:element>
|
<xsd:element name="initialPoints" type="TrackPoint"
|
||||||
<xsd:element name="extrapPoints" type="TrackPoint" maxOccurs="unbounded" minOccurs="1"></xsd:element>
|
maxOccurs="unbounded" minOccurs="1">
|
||||||
<xsd:element name="extraPointTimeTextDisplayIndicator" type="xsd:boolean" maxOccurs="unbounded" minOccurs="1"></xsd:element>
|
</xsd:element>
|
||||||
|
<xsd:element name="extrapPoints" type="TrackPoint"
|
||||||
|
maxOccurs="unbounded" minOccurs="1">
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="extraPointTimeTextDisplayIndicator"
|
||||||
|
type="xsd:boolean" maxOccurs="unbounded" minOccurs="1">
|
||||||
|
</xsd:element>
|
||||||
</xsd:sequence>
|
</xsd:sequence>
|
||||||
<xsd:attribute name="initialLinePattern" type="xsd:string"></xsd:attribute>
|
<xsd:attribute name="initialLinePattern"
|
||||||
|
type="xsd:string">
|
||||||
|
</xsd:attribute>
|
||||||
<xsd:attribute name="extrapLinePattern" type="xsd:string"></xsd:attribute>
|
<xsd:attribute name="extrapLinePattern" type="xsd:string"></xsd:attribute>
|
||||||
<xsd:attribute name="initialMarker" type="xsd:string"></xsd:attribute>
|
<xsd:attribute name="initialMarker" type="xsd:string"></xsd:attribute>
|
||||||
<xsd:attribute name="extrapMarker" type="xsd:string"></xsd:attribute>
|
<xsd:attribute name="extrapMarker" type="xsd:string"></xsd:attribute>
|
||||||
<xsd:attribute name="lineWidth" type="xsd:float"></xsd:attribute>
|
<xsd:attribute name="lineWidth" type="xsd:float"></xsd:attribute>
|
||||||
<xsd:attribute name="fontName" type="xsd:string"></xsd:attribute>
|
<xsd:attribute name="fontName" type="xsd:string"></xsd:attribute>
|
||||||
|
<xsd:attribute name="fontStyle" type="xsd:string"></xsd:attribute>
|
||||||
<xsd:attribute name="fontSize" type="xsd:float"></xsd:attribute>
|
<xsd:attribute name="fontSize" type="xsd:float"></xsd:attribute>
|
||||||
<xsd:attribute name="pgenType" type="xsd:string"></xsd:attribute>
|
<xsd:attribute name="pgenType" type="xsd:string"></xsd:attribute>
|
||||||
<xsd:attribute name="pgenCategory" type="xsd:string"></xsd:attribute>
|
<xsd:attribute name="pgenCategory" type="xsd:string"></xsd:attribute>
|
||||||
<xsd:attribute name="setTimeButtonSelected" type="xsd:boolean"></xsd:attribute>
|
<xsd:attribute name="setTimeButtonSelected"
|
||||||
<xsd:attribute name="intervalComboSelectedIndex" type="xsd:int"></xsd:attribute>
|
type="xsd:boolean">
|
||||||
<xsd:attribute name="intervalTimeTextString" type="xsd:string"></xsd:attribute>
|
</xsd:attribute>
|
||||||
<xsd:attribute name="extraPointTimeDisplayOptionName" type="xsd:string"></xsd:attribute>
|
<xsd:attribute name="intervalComboSelectedIndex"
|
||||||
<xsd:attribute name="skipFactorTextString" type="xsd:string"></xsd:attribute>
|
type="xsd:int">
|
||||||
<xsd:attribute name="fontNameComboSelectedIndex" type="xsd:int"></xsd:attribute>
|
</xsd:attribute>
|
||||||
<xsd:attribute name="fontSizeComboSelectedIndex" type="xsd:int"></xsd:attribute>
|
<xsd:attribute name="intervalTimeTextString"
|
||||||
<xsd:attribute name="fontStyleComboSelectedIndex" type="xsd:int"></xsd:attribute>
|
type="xsd:string">
|
||||||
|
</xsd:attribute>
|
||||||
|
<xsd:attribute name="extraPointTimeDisplayOptionName"
|
||||||
|
type="xsd:string">
|
||||||
|
</xsd:attribute>
|
||||||
|
<xsd:attribute name="skipFactorTextString"
|
||||||
|
type="xsd:string">
|
||||||
|
</xsd:attribute>
|
||||||
|
<xsd:attribute name="fontNameComboSelectedIndex"
|
||||||
|
type="xsd:int">
|
||||||
|
</xsd:attribute>
|
||||||
|
<xsd:attribute name="fontSizeComboSelectedIndex"
|
||||||
|
type="xsd:int">
|
||||||
|
</xsd:attribute>
|
||||||
|
<xsd:attribute name="fontStyleComboSelectedIndex"
|
||||||
|
type="xsd:int">
|
||||||
|
</xsd:attribute>
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
|
|
||||||
|
|
|
@ -14,10 +14,10 @@ import gov.noaa.nws.ncep.ui.pgen.elements.Product;
|
||||||
import gov.noaa.nws.ncep.ui.pgen.file.FileTools;
|
import gov.noaa.nws.ncep.ui.pgen.file.FileTools;
|
||||||
import gov.noaa.nws.ncep.ui.pgen.file.ProductConverter;
|
import gov.noaa.nws.ncep.ui.pgen.file.ProductConverter;
|
||||||
import gov.noaa.nws.ncep.ui.pgen.file.Products;
|
import gov.noaa.nws.ncep.ui.pgen.file.Products;
|
||||||
|
import gov.noaa.nws.ncep.ui.pgen.rsc.PgenResource;
|
||||||
import gov.noaa.nws.ncep.ui.pgen.store.PgenStorageException;
|
import gov.noaa.nws.ncep.ui.pgen.store.PgenStorageException;
|
||||||
import gov.noaa.nws.ncep.ui.pgen.store.StorageUtils;
|
import gov.noaa.nws.ncep.ui.pgen.store.StorageUtils;
|
||||||
import gov.noaa.nws.ncep.ui.pgen.tools.PgenCycleTool;
|
import gov.noaa.nws.ncep.ui.pgen.tools.PgenCycleTool;
|
||||||
import gov.noaa.nws.ncep.ui.pgen.rsc.PgenResource;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -61,6 +61,7 @@ import com.vividsolutions.jts.geom.GeometryFactory;
|
||||||
* 05/13 #610 J. Wu Implemented FZLVL range (TTR425)
|
* 05/13 #610 J. Wu Implemented FZLVL range (TTR425)
|
||||||
* 07/13 ? J. Wu Move state list ordering to GfaRules.
|
* 07/13 ? J. Wu Move state list ordering to GfaRules.
|
||||||
* 08/13 TTR714/715 J. Wu Fixed issue type and times.
|
* 08/13 TTR714/715 J. Wu Fixed issue type and times.
|
||||||
|
* 10/14 TTR714 J. Wu Check issue type in get_status.xml.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -70,7 +71,9 @@ import com.vividsolutions.jts.geom.GeometryFactory;
|
||||||
public class GfaGenerate {
|
public class GfaGenerate {
|
||||||
|
|
||||||
private static final String TEXT_TYPE = "TEXT";
|
private static final String TEXT_TYPE = "TEXT";
|
||||||
|
|
||||||
private GeometryFactory gf = new GeometryFactory();
|
private GeometryFactory gf = new GeometryFactory();
|
||||||
|
|
||||||
private static final String ISSUE_TYPE_FROM_OUTLOOK = "ISSUE_TYPE_FROM_OUTLOOK";
|
private static final String ISSUE_TYPE_FROM_OUTLOOK = "ISSUE_TYPE_FROM_OUTLOOK";
|
||||||
|
|
||||||
// private final static Logger logger = Logger.getLogger(GfaGenerate.class);
|
// private final static Logger logger = Logger.getLogger(GfaGenerate.class);
|
||||||
|
@ -120,9 +123,11 @@ public class GfaGenerate {
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find issue type for an Airmet's associated Outlook
|
* Find issue type for an Airmet's associated Outlook. Note: TTR 714 -
|
||||||
|
* J. Wu: this may cause other issues. Instead, we should check the
|
||||||
|
* issue types in "get_status.xsl".
|
||||||
*/
|
*/
|
||||||
trackOtlkIssueTypeToAirmet( adjusted );
|
// trackOtlkIssueTypeToAirmet(adjusted);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find GFA smears in each area and hazard category, generate xml, and
|
* Find GFA smears in each area and hazard category, generate xml, and
|
||||||
|
@ -163,11 +168,12 @@ public class GfaGenerate {
|
||||||
*/
|
*/
|
||||||
for (Gfa gss : ret) {
|
for (Gfa gss : ret) {
|
||||||
Gfa gfaCopy = gss.copy();
|
Gfa gfaCopy = gss.copy();
|
||||||
String otlkIssueType = nvl( gfaCopy.getGfaValue( ISSUE_TYPE_FROM_OUTLOOK ) );
|
/*
|
||||||
if ( !otlkIssueType.equals( "NRML" ) ) {
|
* String otlkIssueType = nvl(gfaCopy
|
||||||
gfaCopy.setGfaIssueType( otlkIssueType );
|
* .getGfaValue(ISSUE_TYPE_FROM_OUTLOOK)); if
|
||||||
}
|
* (!otlkIssueType.equals("NRML")) {
|
||||||
|
* gfaCopy.setGfaIssueType( otlkIssueType ); }
|
||||||
|
*/
|
||||||
if (fzlvlRange != null) {
|
if (fzlvlRange != null) {
|
||||||
gfaCopy.setGfaValue(Gfa.FZL_RANGE, fzlvlRange);
|
gfaCopy.setGfaValue(Gfa.FZL_RANGE, fzlvlRange);
|
||||||
}
|
}
|
||||||
|
@ -233,7 +239,8 @@ public class GfaGenerate {
|
||||||
* @param cats
|
* @param cats
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private static List<Gfa> filterSelected( List<Gfa> all, String area, String category) {
|
private static List<Gfa> filterSelected(List<Gfa> all, String area,
|
||||||
|
String category) {
|
||||||
|
|
||||||
ArrayList<Gfa> ret = new ArrayList<Gfa>();
|
ArrayList<Gfa> ret = new ArrayList<Gfa>();
|
||||||
|
|
||||||
|
@ -258,6 +265,7 @@ public class GfaGenerate {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String generateProduct(String prdxml, String category, String area) {
|
public String generateProduct(String prdxml, String category, String area) {
|
||||||
|
System.out.println("\nprdxml is:\n" + prdxml + "\n");
|
||||||
|
|
||||||
String xml1 = prdxml.replaceAll("TURB-HI", "TURB");
|
String xml1 = prdxml.replaceAll("TURB-HI", "TURB");
|
||||||
String xml = xml1.replaceAll("TURB-LO", "TURB");
|
String xml = xml1.replaceAll("TURB-LO", "TURB");
|
||||||
|
@ -279,6 +287,7 @@ public class GfaGenerate {
|
||||||
transformer.transform(xmlSource, result);
|
transformer.transform(xmlSource, result);
|
||||||
|
|
||||||
res = result.getWriter().toString().trim();
|
res = result.getWriter().toString().trim();
|
||||||
|
System.out.println("\nres is:\n" + res + "\n");
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// logger.error( "", e );
|
// logger.error( "", e );
|
||||||
|
@ -295,11 +304,13 @@ public class GfaGenerate {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new smear for smears with two FA areas and re-order the state list.
|
* Create a new smear for smears with two FA areas and re-order the state
|
||||||
|
* list.
|
||||||
*
|
*
|
||||||
* The States in the primary area precede states in the adjacent area.
|
* The States in the primary area precede states in the adjacent area.
|
||||||
*
|
*
|
||||||
* @param g Gfa to be processed
|
* @param g
|
||||||
|
* Gfa to be processed
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@ -438,7 +449,6 @@ public class GfaGenerate {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
String fzlRange = null;
|
String fzlRange = null;
|
||||||
String topStr = null;
|
String topStr = null;
|
||||||
String botStr = null;
|
String botStr = null;
|
||||||
|
@ -453,16 +463,14 @@ public class GfaGenerate {
|
||||||
topStr = padding(extRange[0]);
|
topStr = padding(extRange[0]);
|
||||||
botStr = padding(extRange[1]);
|
botStr = padding(extRange[1]);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
/*
|
/*
|
||||||
* First - find the worst range from existing FZL_RANGE in FZLVL airmets.
|
* First - find the worst range from existing FZL_RANGE in FZLVL
|
||||||
* If no existing range found, then find the worst top/bottom from
|
* airmets. If no existing range found, then find the worst
|
||||||
* FZLVLs' levels ( top = level + 40 and bottom = level - 40)
|
* top/bottom from FZLVLs' levels ( top = level + 40 and bottom =
|
||||||
* Second - find the worst top/bottom from M_FZLVLs
|
* level - 40) Second - find the worst top/bottom from M_FZLVLs
|
||||||
*
|
*
|
||||||
* Third - find the worst case range using info from step 1 and 2.
|
* Third - find the worst case range using info from step 1 and 2.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
int[] existingRange = findExistingFzlRange(all, selected, area);
|
int[] existingRange = findExistingFzlRange(all, selected, area);
|
||||||
int[] mfzlRange = findMfzlvlRange(all, selected, area);
|
int[] mfzlRange = findMfzlvlRange(all, selected, area);
|
||||||
|
@ -489,13 +497,13 @@ public class GfaGenerate {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Retrieve the worst FZLVL range from ranges existing in FZLVL airmet/outlook.
|
* Retrieve the worst FZLVL range from ranges existing in FZLVL
|
||||||
* Such existing range should be in the form as "MIA;160;40", retrievable as
|
* airmet/outlook. Such existing range should be in the form as
|
||||||
* gfa.getGfaValue( Gfa.FZL_RANGE ).
|
* "MIA;160;40", retrievable as gfa.getGfaValue( Gfa.FZL_RANGE ).
|
||||||
*/
|
*/
|
||||||
private int[] findExistingFzlRange( List<Gfa> all, List<Gfa> selected, String area ) {
|
private int[] findExistingFzlRange(List<Gfa> all, List<Gfa> selected,
|
||||||
|
String area) {
|
||||||
|
|
||||||
int[] topBot = { -1, 9999 };
|
int[] topBot = { -1, 9999 };
|
||||||
|
|
||||||
|
@ -510,25 +518,23 @@ public class GfaGenerate {
|
||||||
String range1 = elem.getGfaValue(Gfa.FZL_RANGE);
|
String range1 = elem.getGfaValue(Gfa.FZL_RANGE);
|
||||||
if (range1 != null) {
|
if (range1 != null) {
|
||||||
String[] rangeInfo = range1.split(";");
|
String[] rangeInfo = range1.split(";");
|
||||||
if ( rangeInfo.length >= 3 && rangeInfo[0].equalsIgnoreCase( area ) ) {
|
if (rangeInfo.length >= 3
|
||||||
|
&& rangeInfo[0].equalsIgnoreCase(area)) {
|
||||||
int top1 = -1;
|
int top1 = -1;
|
||||||
int bot1 = -1;
|
int bot1 = -1;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
top1 = Integer.parseInt(rangeInfo[1]);
|
top1 = Integer.parseInt(rangeInfo[1]);
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch ( Exception e ) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rangeInfo[2].equalsIgnoreCase("SFC")) {
|
if (rangeInfo[2].equalsIgnoreCase("SFC")) {
|
||||||
bot1 = 0;
|
bot1 = 0;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
try {
|
try {
|
||||||
bot1 = Integer.parseInt(rangeInfo[2]);
|
bot1 = Integer.parseInt(rangeInfo[2]);
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch ( Exception e ) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -545,8 +551,9 @@ public class GfaGenerate {
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Retrieve the worst range from existing top/bottom of M_FZLVL airmet/outlook.
|
* Retrieve the worst range from existing top/bottom of M_FZLVL
|
||||||
* Such top/bottom are retrievable as gfa.getGfaTop() & gfa.getGfaBottom().
|
* airmet/outlook. Such top/bottom are retrievable as gfa.getGfaTop() &
|
||||||
|
* gfa.getGfaBottom().
|
||||||
*/
|
*/
|
||||||
private int[] findMfzlvlRange(List<Gfa> all, List<Gfa> selected, String area) {
|
private int[] findMfzlvlRange(List<Gfa> all, List<Gfa> selected, String area) {
|
||||||
|
|
||||||
|
@ -566,8 +573,7 @@ public class GfaGenerate {
|
||||||
if (elem.getGfaTop() != null) {
|
if (elem.getGfaTop() != null) {
|
||||||
try {
|
try {
|
||||||
top2 = Integer.parseInt(elem.getGfaTop());
|
top2 = Integer.parseInt(elem.getGfaTop());
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch ( Exception e ) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -576,12 +582,10 @@ public class GfaGenerate {
|
||||||
if (botStr != null) {
|
if (botStr != null) {
|
||||||
if (botStr.equalsIgnoreCase("SFC")) {
|
if (botStr.equalsIgnoreCase("SFC")) {
|
||||||
bot2 = 0;
|
bot2 = 0;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
try {
|
try {
|
||||||
bot2 = Integer.parseInt(elem.getGfaBottom());
|
bot2 = Integer.parseInt(elem.getGfaBottom());
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch ( Exception e ) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -602,7 +606,8 @@ public class GfaGenerate {
|
||||||
* Retrieve the worst range from existing levels of FZLVL airmet/outlook.
|
* Retrieve the worst range from existing levels of FZLVL airmet/outlook.
|
||||||
* Such levels are retrievable as gfa.getGfaValue( Gfa.LEVEL ).
|
* Such levels are retrievable as gfa.getGfaValue( Gfa.LEVEL ).
|
||||||
*/
|
*/
|
||||||
private int[] findFzlvlLevelRange( List<Gfa> all, List<Gfa> selected, String area ) {
|
private int[] findFzlvlLevelRange(List<Gfa> all, List<Gfa> selected,
|
||||||
|
String area) {
|
||||||
|
|
||||||
int[] topBot = { -1, 9999 };
|
int[] topBot = { -1, 9999 };
|
||||||
for (Gfa elem : selected) {
|
for (Gfa elem : selected) {
|
||||||
|
@ -624,27 +629,23 @@ public class GfaGenerate {
|
||||||
if (levelStr.equalsIgnoreCase("SFC")) {
|
if (levelStr.equalsIgnoreCase("SFC")) {
|
||||||
top2 = 40;
|
top2 = 40;
|
||||||
bot2 = 0;
|
bot2 = 0;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
try {
|
try {
|
||||||
lvl = Integer.parseInt(levelStr);
|
lvl = Integer.parseInt(levelStr);
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch ( Exception e ) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lvl >= 0 && lvl <= 40) {
|
if (lvl >= 0 && lvl <= 40) {
|
||||||
top2 = 40;
|
top2 = 40;
|
||||||
bot2 = 0;
|
bot2 = 0;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
top2 = lvl + 40;
|
top2 = lvl + 40;
|
||||||
bot2 = lvl - 40;
|
bot2 = lvl - 40;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (top2 >= 0 && bot2 >= 0) {
|
if (top2 >= 0 && bot2 >= 0) {
|
||||||
topBot[0] = Math.max(topBot[0], top2);
|
topBot[0] = Math.max(topBot[0], top2);
|
||||||
topBot[1] = Math.min(topBot[1], bot2);
|
topBot[1] = Math.min(topBot[1], bot2);
|
||||||
|
@ -657,25 +658,28 @@ public class GfaGenerate {
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find the top and base levels for a FA area that is not intersected by any FZLVL
|
* Find the top and base levels for a FA area that is not intersected by any
|
||||||
* contours. It sorts all external fzlvls by distance from the area centroid, then
|
* FZLVL contours. It sorts all external fzlvls by distance from the area
|
||||||
* uses the level from that contour. If the contour is to the left of the area then
|
* centroid, then uses the level from that contour. If the contour is to the
|
||||||
* the answer is base = contour level, top = base + 040. If the contour is to the
|
* left of the area then the answer is base = contour level, top = base +
|
||||||
* right of the area then the answer top = contour level, base = top - 040.
|
* 040. If the contour is to the right of the area then the answer top =
|
||||||
|
* contour level, base = top - 040.
|
||||||
*
|
*
|
||||||
* See legacy af_getExternalFzlvlRng() in af_getAirmetXml.c.
|
* See legacy af_getExternalFzlvlRng() in af_getAirmetXml.c.
|
||||||
*
|
*
|
||||||
* Note (1) only FZLVLs are used, not M_FZLVLs.
|
* Note (1) only FZLVLs are used, not M_FZLVLs. (2) All FZLVLs are used,
|
||||||
* (2) All FZLVLs are used, including snapshots.
|
* including snapshots.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
private int[] findExernalFzlvlRange(List<Gfa> all, String area) {
|
private int[] findExernalFzlvlRange(List<Gfa> all, String area) {
|
||||||
|
|
||||||
int[] topBot = { -1, 9999 };
|
int[] topBot = { -1, 9999 };
|
||||||
|
|
||||||
HashMap<String, Geometry> areaBnds = GfaClip.getInstance().getFaAreaBounds();
|
HashMap<String, Geometry> areaBnds = GfaClip.getInstance()
|
||||||
|
.getFaAreaBounds();
|
||||||
|
|
||||||
Coordinate center = gf.createLinearRing( areaBnds.get(area ).getCoordinates() ).getCentroid().getCoordinate();
|
Coordinate center = gf
|
||||||
|
.createLinearRing(areaBnds.get(area).getCoordinates())
|
||||||
|
.getCentroid().getCoordinate();
|
||||||
|
|
||||||
Gfa closestGfa = null;
|
Gfa closestGfa = null;
|
||||||
double minDist = Double.MAX_VALUE;
|
double minDist = Double.MAX_VALUE;
|
||||||
|
@ -698,8 +702,8 @@ public class GfaGenerate {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (closestGfa != null) {
|
if (closestGfa != null) {
|
||||||
boolean isLeft = GfaSnap.getInstance().atLeft( center, closestGfa.getLinePoints(),
|
boolean isLeft = GfaSnap.getInstance().atLeft(center,
|
||||||
closestGfa.isClosedLine(), 0.0 );
|
closestGfa.getLinePoints(), closestGfa.isClosedLine(), 0.0);
|
||||||
|
|
||||||
String levelStr = closestGfa.getGfaValue(Gfa.LEVEL);
|
String levelStr = closestGfa.getGfaValue(Gfa.LEVEL);
|
||||||
int lvl = -1;
|
int lvl = -1;
|
||||||
|
@ -708,12 +712,10 @@ public class GfaGenerate {
|
||||||
|
|
||||||
if (levelStr.equalsIgnoreCase("SFC")) {
|
if (levelStr.equalsIgnoreCase("SFC")) {
|
||||||
lvl = 0;
|
lvl = 0;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
try {
|
try {
|
||||||
lvl = Integer.parseInt(levelStr);
|
lvl = Integer.parseInt(levelStr);
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch ( Exception e ) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -723,11 +725,11 @@ public class GfaGenerate {
|
||||||
if (!isLeft) { // FZLVL is at right of FA area
|
if (!isLeft) { // FZLVL is at right of FA area
|
||||||
topBot[0] = lvl + 40;
|
topBot[0] = lvl + 40;
|
||||||
topBot[1] = lvl;
|
topBot[1] = lvl;
|
||||||
}
|
} else { // FZLVL is at left of FA area
|
||||||
else { // FZLVL is at left of FA area
|
|
||||||
topBot[0] = lvl;
|
topBot[0] = lvl;
|
||||||
topBot[1] = lvl - 40;
|
topBot[1] = lvl - 40;
|
||||||
if ( topBot[1] < 0 ) topBot[1] = 0;
|
if (topBot[1] < 0)
|
||||||
|
topBot[1] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -744,12 +746,10 @@ public class GfaGenerate {
|
||||||
StringBuilder str = new StringBuilder();
|
StringBuilder str = new StringBuilder();
|
||||||
if (value <= 0) {
|
if (value <= 0) {
|
||||||
str.append("SFC");
|
str.append("SFC");
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (value < 100) {
|
if (value < 100) {
|
||||||
str.append("0" + value);
|
str.append("0" + value);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
str.append(value);
|
str.append(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -774,14 +774,12 @@ public class GfaGenerate {
|
||||||
if (gfa.isClosedLine()) {
|
if (gfa.isClosedLine()) {
|
||||||
dist = PgenResource.distanceFromLineSegment(loc,
|
dist = PgenResource.distanceFromLineSegment(loc,
|
||||||
(Coordinate) pts[ii], (Coordinate) pts[0]);
|
(Coordinate) pts[ii], (Coordinate) pts[0]);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
dist = PgenResource.distanceFromLineSegment(loc,
|
||||||
dist = PgenResource.distanceFromLineSegment( loc, (Coordinate) pts[ii],
|
(Coordinate) pts[ii], (Coordinate) pts[ii + 1]);
|
||||||
(Coordinate) pts[ii + 1]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dist < minDist) {
|
if (dist < minDist) {
|
||||||
|
@ -794,12 +792,17 @@ public class GfaGenerate {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find if a smear has an associated outlook that are generated from the same series of
|
* Find if a smear has an associated outlook that are generated from the
|
||||||
* snapshots (with same hazard type, tag and desk.
|
* same series of snapshots (with same hazard type, tag and desk.
|
||||||
*
|
*
|
||||||
* This is used to get around the issue when a pair of airmet and outlook is generated from
|
* This is used to get around the issue when a pair of airmet and outlook is
|
||||||
* the same series of snapshots, and the airmet's issue tyep is "NRML" while outlook's issue
|
* generated from the same series of snapshots, and the airmet's issue type
|
||||||
* type is not "NRML". In this case, the formatted header should show the outlook's issue type.
|
* is "NRML" while outlook's issue type is not "NRML". In this case, the
|
||||||
|
* formatted header should show the outlook's issue type.
|
||||||
|
*
|
||||||
|
* Note: TTR 714 - 10/2014: for the above case, we should modify
|
||||||
|
* "get_status.xsl" to get the formatted header by looping through all
|
||||||
|
* airmets and outlooks instead of modifying it here.
|
||||||
*
|
*
|
||||||
* @param all
|
* @param all
|
||||||
* @return
|
* @return
|
||||||
|
@ -809,12 +812,17 @@ public class GfaGenerate {
|
||||||
for (Gfa gg : all) {
|
for (Gfa gg : all) {
|
||||||
gg.setGfaValue(ISSUE_TYPE_FROM_OUTLOOK, "NRML");
|
gg.setGfaValue(ISSUE_TYPE_FROM_OUTLOOK, "NRML");
|
||||||
if (gg.isAirmet() && "NRML".equalsIgnoreCase(gg.getGfaIssueType())) {
|
if (gg.isAirmet() && "NRML".equalsIgnoreCase(gg.getGfaIssueType())) {
|
||||||
String akey = gg.getGfaHazard() + gg.getGfaTag() + gg.getGfaDesk();
|
String akey = gg.getGfaHazard() + gg.getGfaTag()
|
||||||
|
+ gg.getGfaDesk();
|
||||||
for (Gfa gotlk : all) {
|
for (Gfa gotlk : all) {
|
||||||
if ( gotlk.isOutlook() && !("NRML".equalsIgnoreCase( gotlk.getGfaIssueType() ) ) ) {
|
if (gotlk.isOutlook()
|
||||||
String okey = gotlk.getGfaHazard() + gotlk.getGfaTag() + gotlk.getGfaDesk();
|
&& !("NRML".equalsIgnoreCase(gotlk
|
||||||
|
.getGfaIssueType()))) {
|
||||||
|
String okey = gotlk.getGfaHazard() + gotlk.getGfaTag()
|
||||||
|
+ gotlk.getGfaDesk();
|
||||||
if (okey.equals(akey)) {
|
if (okey.equals(akey)) {
|
||||||
gg.setGfaValue( ISSUE_TYPE_FROM_OUTLOOK, gotlk.getGfaIssueType() );
|
gg.setGfaValue(ISSUE_TYPE_FROM_OUTLOOK,
|
||||||
|
gotlk.getGfaIssueType());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,12 @@
|
||||||
*/
|
*/
|
||||||
package gov.noaa.nws.ncep.ui.pgen.gfa;
|
package gov.noaa.nws.ncep.ui.pgen.gfa;
|
||||||
|
|
||||||
|
import static gov.noaa.nws.ncep.ui.pgen.gfa.Gfa.BOS;
|
||||||
|
import static gov.noaa.nws.ncep.ui.pgen.gfa.Gfa.CHI;
|
||||||
|
import static gov.noaa.nws.ncep.ui.pgen.gfa.Gfa.DFW;
|
||||||
|
import static gov.noaa.nws.ncep.ui.pgen.gfa.Gfa.MIA;
|
||||||
|
import static gov.noaa.nws.ncep.ui.pgen.gfa.Gfa.SFO;
|
||||||
|
import static gov.noaa.nws.ncep.ui.pgen.gfa.Gfa.SLC;
|
||||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
|
@ -20,8 +26,6 @@ import org.dom4j.Node;
|
||||||
import org.dom4j.io.SAXReader;
|
import org.dom4j.io.SAXReader;
|
||||||
import org.eclipse.swt.graphics.RGB;
|
import org.eclipse.swt.graphics.RGB;
|
||||||
|
|
||||||
import static gov.noaa.nws.ncep.ui.pgen.gfa.Gfa.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper class to read the GFA configuration.
|
* Helper class to read the GFA configuration.
|
||||||
*
|
*
|
||||||
|
@ -45,26 +49,34 @@ public class GfaInfo {
|
||||||
private static Document doc;
|
private static Document doc;
|
||||||
|
|
||||||
public static final String HAZARD_XPATH = "/root/hazard";
|
public static final String HAZARD_XPATH = "/root/hazard";
|
||||||
|
|
||||||
public static final String FCSTHR_XPATH = "/root/fcstHr";
|
public static final String FCSTHR_XPATH = "/root/fcstHr";
|
||||||
|
|
||||||
public static final String TAG_XPATH = "/root/tag";
|
public static final String TAG_XPATH = "/root/tag";
|
||||||
|
|
||||||
public static final String DESK_XPATH = "/root/desk";
|
public static final String DESK_XPATH = "/root/desk";
|
||||||
|
|
||||||
public static final String ISSUE_TYPE_XPATH = "/root/issueType";
|
public static final String ISSUE_TYPE_XPATH = "/root/issueType";
|
||||||
|
|
||||||
public static final String GFA_OTLKGEN_RATIO_XPATH = "/root/gfaOtlkgenRatio";
|
public static final String GFA_OTLKGEN_RATIO_XPATH = "/root/gfaOtlkgenRatio";
|
||||||
|
|
||||||
public static final String AIRMET_ELEMENT_XPATH = "/airmetcycle/element";
|
public static final String AIRMET_ELEMENT_XPATH = "/airmetcycle/element";
|
||||||
|
|
||||||
public static final String GFA_SNAPSHOT = "snapshot";
|
public static final String GFA_SNAPSHOT = "snapshot";
|
||||||
|
|
||||||
public static final String GFA_SMEAR = "smear";
|
public static final String GFA_SMEAR = "smear";
|
||||||
|
|
||||||
public static final String GFA_OUTLOOK = "outlook";
|
public static final String GFA_OUTLOOK = "outlook";
|
||||||
|
|
||||||
public static final int GFA_SMEAR_LINEWIDTH = 3;
|
public static final int GFA_SMEAR_LINEWIDTH = 3;
|
||||||
|
|
||||||
public static final int GFA_OUTLOOK_LINEWIDTH = 4;
|
public static final int GFA_OUTLOOK_LINEWIDTH = 4;
|
||||||
|
|
||||||
public static final int GFA_OTHER_LINEWIDTH = 2;
|
public static final int GFA_OTHER_LINEWIDTH = 2;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hazard type vs color array (index means the same as the position
|
* Hazard type vs color array (index means the same as the position in
|
||||||
* in fcstHr combo box)
|
* fcstHr combo box)
|
||||||
*/
|
*/
|
||||||
private static HashMap<String, RGB[]> rgbMap;
|
private static HashMap<String, RGB[]> rgbMap;
|
||||||
|
|
||||||
|
@ -109,7 +121,8 @@ public class GfaInfo {
|
||||||
*/
|
*/
|
||||||
private static void readOptions() {
|
private static void readOptions() {
|
||||||
File gfainfoFile = PgenStaticDataProvider.getProvider().getStaticFile(
|
File gfainfoFile = PgenStaticDataProvider.getProvider().getStaticFile(
|
||||||
PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + "gfa.xml");
|
PgenStaticDataProvider.getProvider().getPgenLocalizationRoot()
|
||||||
|
+ "gfa.xml");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
SAXReader reader = new SAXReader();
|
SAXReader reader = new SAXReader();
|
||||||
|
@ -243,8 +256,7 @@ public class GfaInfo {
|
||||||
gfaType = GFA_OUTLOOK;
|
gfaType = GFA_OUTLOOK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
gfaType = fcsthrNodes.get(0).valueOf("@type"); // from table
|
gfaType = fcsthrNodes.get(0).valueOf("@type"); // from table
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -271,9 +283,9 @@ public class GfaInfo {
|
||||||
|
|
||||||
int lineWidth = GFA_OTHER_LINEWIDTH;
|
int lineWidth = GFA_OTHER_LINEWIDTH;
|
||||||
if (fcsthrNodes.size() > 0) {
|
if (fcsthrNodes.size() > 0) {
|
||||||
lineWidth = Integer.parseInt( fcsthrNodes.get(0).valueOf("@linewidth") );
|
lineWidth = Integer.parseInt(fcsthrNodes.get(0).valueOf(
|
||||||
}
|
"@linewidth"));
|
||||||
else {
|
} else {
|
||||||
if (fcstHr.indexOf("-") >= 0) {
|
if (fcstHr.indexOf("-") >= 0) {
|
||||||
String second = fcstHr.split("-")[1];
|
String second = fcstHr.split("-")[1];
|
||||||
String hour = second.split(":")[0];
|
String hour = second.split(":")[0];
|
||||||
|
@ -310,8 +322,10 @@ public class GfaInfo {
|
||||||
for (Node n : nodes) {
|
for (Node n : nodes) {
|
||||||
String key = n.valueOf("@name");
|
String key = n.valueOf("@name");
|
||||||
String category = n.valueOf("@category");
|
String category = n.valueOf("@category");
|
||||||
HazardCategory cat = HazardCategory.valueOf(HazardCategory.class, category);
|
HazardCategory cat = HazardCategory.valueOf(
|
||||||
if(cat == null) cat = HazardCategory.NONE;
|
HazardCategory.class, category);
|
||||||
|
if (cat == null)
|
||||||
|
cat = HazardCategory.NONE;
|
||||||
hazardCategories.put(key, cat);
|
hazardCategories.put(key, cat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -337,41 +351,41 @@ public class GfaInfo {
|
||||||
if (stateOrderByArea == null) {
|
if (stateOrderByArea == null) {
|
||||||
stateOrderByArea = new HashMap<String, ArrayList<String>>();
|
stateOrderByArea = new HashMap<String, ArrayList<String>>();
|
||||||
ArrayList<String> bos = new ArrayList<String>();
|
ArrayList<String> bos = new ArrayList<String>();
|
||||||
String[] bosStr = new String[]{"ME","NH","VT","MA","RI","CT","NY",
|
String[] bosStr = new String[] { "ME", "NH", "VT", "MA", "RI",
|
||||||
"LO","PA","NJ","OH","LE","WV","MD",
|
"CT", "NY", "LO", "NJ", "PA", "OH", "LE", "WV", "MD", "DC",
|
||||||
"DC", "DE", "VA", "CSTL WTRS"};
|
"DE", "VA", "CSTL WTRS" };
|
||||||
for (String st : bosStr) {
|
for (String st : bosStr) {
|
||||||
bos.add(st);
|
bos.add(st);
|
||||||
}
|
}
|
||||||
stateOrderByArea.put(BOS, bos);
|
stateOrderByArea.put(BOS, bos);
|
||||||
|
|
||||||
ArrayList<String> mia = new ArrayList<String>();
|
ArrayList<String> mia = new ArrayList<String>();
|
||||||
String[] miaStr = new String[]{"NC", "SC", "GA", "FL" , "CSTL WTRS"};
|
String[] miaStr = new String[] { "NC", "SC", "GA", "FL",
|
||||||
|
"CSTL WTRS" };
|
||||||
for (String st : miaStr) {
|
for (String st : miaStr) {
|
||||||
mia.add(st);
|
mia.add(st);
|
||||||
}
|
}
|
||||||
stateOrderByArea.put(MIA, mia);
|
stateOrderByArea.put(MIA, mia);
|
||||||
|
|
||||||
ArrayList<String> chi = new ArrayList<String>();
|
ArrayList<String> chi = new ArrayList<String>();
|
||||||
String[] chiStr = new String[]{"ND", "SD", "NE", "KS", "MN", "IA",
|
String[] chiStr = new String[] { "ND", "SD", "NE", "KS", "MN",
|
||||||
"MO", "WI", "LM", "LS", "MI", "LH",
|
"IA", "MO", "WI", "LM", "LS", "MI", "LH", "IL", "IN", "KY" };
|
||||||
"IL", "IN", "KY"};
|
|
||||||
for (String st : chiStr) {
|
for (String st : chiStr) {
|
||||||
chi.add(st);
|
chi.add(st);
|
||||||
}
|
}
|
||||||
stateOrderByArea.put(CHI, chi);
|
stateOrderByArea.put(CHI, chi);
|
||||||
|
|
||||||
ArrayList<String> dfw = new ArrayList<String>();
|
ArrayList<String> dfw = new ArrayList<String>();
|
||||||
String[] dfwStr = new String[]{"OK", "TX", "AR", "TN", "LA", "MS",
|
String[] dfwStr = new String[] { "OK", "TX", "AR", "TN", "LA",
|
||||||
"AL", "CSTL WTRS"};
|
"MS", "AL", "CSTL WTRS" };
|
||||||
for (String st : dfwStr) {
|
for (String st : dfwStr) {
|
||||||
dfw.add(st);
|
dfw.add(st);
|
||||||
}
|
}
|
||||||
stateOrderByArea.put(DFW, dfw);
|
stateOrderByArea.put(DFW, dfw);
|
||||||
|
|
||||||
ArrayList<String> slc = new ArrayList<String>();
|
ArrayList<String> slc = new ArrayList<String>();
|
||||||
String[] slcStr = new String[]{"ID", "MT", "WY", "NV", "UT", "CO",
|
String[] slcStr = new String[] { "ID", "MT", "WY", "NV", "UT",
|
||||||
"AZ", "NM"} ;
|
"CO", "AZ", "NM" };
|
||||||
for (String st : slcStr) {
|
for (String st : slcStr) {
|
||||||
slc.add(st);
|
slc.add(st);
|
||||||
}
|
}
|
||||||
|
@ -390,8 +404,7 @@ public class GfaInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get colors for FZLVL SFC snapshot, smear, or outlook.
|
* Get colors for FZLVL SFC snapshot, smear, or outlook. Default is "sky".
|
||||||
* Default is "sky".
|
|
||||||
*/
|
*/
|
||||||
public static RGB getFzlvlSfcColor(String name) {
|
public static RGB getFzlvlSfcColor(String name) {
|
||||||
|
|
||||||
|
@ -404,13 +417,15 @@ public class GfaInfo {
|
||||||
if (fzlvlSfcColors == null) {
|
if (fzlvlSfcColors == null) {
|
||||||
fzlvlSfcColors = new HashMap<String, RGB>();
|
fzlvlSfcColors = new HashMap<String, RGB>();
|
||||||
for (Node nd : colorNodes) {
|
for (Node nd : colorNodes) {
|
||||||
fzlvlSfcColors.put( nd.valueOf("@name"), definedColors.get( nd.valueOf("@nmapcolor") ) );
|
fzlvlSfcColors.put(nd.valueOf("@name"),
|
||||||
|
definedColors.get(nd.valueOf("@nmapcolor")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RGB clr = fzlvlSfcColors.get(name);
|
RGB clr = fzlvlSfcColors.get(name);
|
||||||
|
|
||||||
if ( clr == null ) clr = definedColors.get( "sky" );
|
if (clr == null)
|
||||||
|
clr = definedColors.get("sky");
|
||||||
|
|
||||||
return clr;
|
return clr;
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -27,11 +27,9 @@ import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.Button;
|
import org.eclipse.swt.widgets.Button;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.Label;
|
import org.eclipse.swt.widgets.Label;
|
||||||
|
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.ui.PlatformUI;
|
import org.eclipse.ui.PlatformUI;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class controls PGEN layering in National Centers perspective.
|
* This class controls PGEN layering in National Centers perspective.
|
||||||
*
|
*
|
||||||
|
@ -54,21 +52,25 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
* Default color for the active layer name button.
|
* Default color for the active layer name button.
|
||||||
*/
|
*/
|
||||||
private final Color defaultLayerButtonColor = Color.lightGray;
|
private final Color defaultLayerButtonColor = Color.lightGray;
|
||||||
|
|
||||||
private final Color activeLayerButtonColor = Color.green;
|
private final Color activeLayerButtonColor = Color.green;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Layer name edit dialog.
|
* Layer name edit dialog.
|
||||||
*/
|
*/
|
||||||
protected PgenLayeringNameDialog layerNameDlg = null;
|
protected PgenLayeringNameDialog layerNameDlg = null;
|
||||||
protected PgenLayeringDisplayDialog displayDlg = null;
|
|
||||||
|
|
||||||
|
protected PgenLayeringDisplayDialog displayDlg = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of layers and buttons.
|
* List of layers and buttons.
|
||||||
*/
|
*/
|
||||||
private ArrayList<Layer> layerList = null;
|
private ArrayList<Layer> layerList = null;
|
||||||
|
|
||||||
private ArrayList<Button> layerNameBtns = null;
|
private ArrayList<Button> layerNameBtns = null;
|
||||||
|
|
||||||
private ArrayList<Button> displayOnOffBtns = null;
|
private ArrayList<Button> displayOnOffBtns = null;
|
||||||
|
|
||||||
private ArrayList<Button> colorModeBtns = null;
|
private ArrayList<Button> colorModeBtns = null;
|
||||||
|
|
||||||
private Button allOnOffBtn = null;
|
private Button allOnOffBtn = null;
|
||||||
|
@ -77,14 +79,18 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
* The layer & color mode button in use.
|
* The layer & color mode button in use.
|
||||||
*/
|
*/
|
||||||
private int layerInUse = -1;
|
private int layerInUse = -1;
|
||||||
|
|
||||||
private int colorModeBtnInUse = -1;
|
private int colorModeBtnInUse = -1;
|
||||||
|
|
||||||
private boolean allOnOff = false;
|
private boolean allOnOff = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Open dialog in compact mode or full mode.
|
* Open dialog in compact mode or full mode.
|
||||||
*/
|
*/
|
||||||
private Button arrowBtn = null;
|
private Button arrowBtn = null;
|
||||||
|
|
||||||
boolean compact = true;
|
boolean compact = true;
|
||||||
|
|
||||||
boolean openNameDialog = false;
|
boolean openNameDialog = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -94,7 +100,6 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
super(parentShell);
|
super(parentShell);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the title of the dialog.
|
* Sets the title of the dialog.
|
||||||
*/
|
*/
|
||||||
|
@ -102,9 +107,9 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
shell.setText("Layering");
|
shell.setText("Layering");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the default location.
|
* Set the default location.
|
||||||
|
*
|
||||||
* @param parent
|
* @param parent
|
||||||
*/
|
*/
|
||||||
public void setDefaultLocation(Shell parent) {
|
public void setDefaultLocation(Shell parent) {
|
||||||
|
@ -112,8 +117,7 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
if (shellLocation == null) {
|
if (shellLocation == null) {
|
||||||
Point pt = parent.getLocation();
|
Point pt = parent.getLocation();
|
||||||
shell.setLocation(pt.x + 255, pt.y + 146);
|
shell.setLocation(pt.x + 255, pt.y + 146);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
shell.setLocation(shellLocation);
|
shell.setLocation(shellLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,7 +132,6 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the dialog components.
|
* Initialize the dialog components.
|
||||||
*/
|
*/
|
||||||
|
@ -186,7 +189,6 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
if (!compact) {
|
if (!compact) {
|
||||||
|
|
||||||
Button editNameBtn = new Button(centeredComp, SWT.NONE);
|
Button editNameBtn = new Button(centeredComp, SWT.NONE);
|
||||||
|
@ -215,8 +217,7 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
|
|
||||||
if (compact) {
|
if (compact) {
|
||||||
arrowBtn.setText(">>");
|
arrowBtn.setText(">>");
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
arrowBtn.setText("<<");
|
arrowBtn.setText("<<");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -227,8 +228,7 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
|
|
||||||
if (compact) {
|
if (compact) {
|
||||||
arrowBtn.setText("<<");
|
arrowBtn.setText("<<");
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
arrowBtn.setText(">>");
|
arrowBtn.setText(">>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,7 +240,6 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create name, on/off, and color mode buttons for one layer
|
* Create name, on/off, and color mode buttons for one layer
|
||||||
*/
|
*/
|
||||||
|
@ -269,7 +268,8 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
nameBtn.setData(ii);
|
nameBtn.setData(ii);
|
||||||
nameBtn.addSelectionListener(new SelectionAdapter() {
|
nameBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
switchLayer( Integer.parseInt( event.widget.getData().toString() ) );
|
switchLayer(Integer.parseInt(event.widget.getData()
|
||||||
|
.toString()));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -280,7 +280,8 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
dispBtn.setData(ii);
|
dispBtn.setData(ii);
|
||||||
dispBtn.addSelectionListener(new SelectionAdapter() {
|
dispBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
turnOnDisplay( Integer.parseInt( event.widget.getData().toString() ) );
|
turnOnDisplay(Integer.parseInt(event.widget.getData()
|
||||||
|
.toString()));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -288,19 +289,16 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
|
|
||||||
if (!compact) {
|
if (!compact) {
|
||||||
Button clrBtn = new Button(layersComp, SWT.PUSH);
|
Button clrBtn = new Button(layersComp, SWT.PUSH);
|
||||||
if ( lyr.isMonoColor() ) {
|
clrBtn.setText(getDisplayString(lyr.isMonoColor(),
|
||||||
clrBtn.setText( "M/F" );
|
lyr.isFilled()));
|
||||||
}
|
|
||||||
else {
|
|
||||||
clrBtn.setText( "A/F" );
|
|
||||||
}
|
|
||||||
|
|
||||||
setButtonColor(clrBtn, lyr.getColor());
|
setButtonColor(clrBtn, lyr.getColor());
|
||||||
clrBtn.setData(ii);
|
clrBtn.setData(ii);
|
||||||
|
|
||||||
clrBtn.addSelectionListener(new SelectionAdapter() {
|
clrBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
colorModeBtnInUse = Integer.parseInt( event.widget.getData().toString() );
|
colorModeBtnInUse = Integer.parseInt(event.widget
|
||||||
|
.getData().toString());
|
||||||
editDisplayAttr();
|
editDisplayAttr();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -330,7 +328,6 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the product in the PgenResource.
|
* Initialize the product in the PgenResource.
|
||||||
*/
|
*/
|
||||||
|
@ -339,7 +336,8 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
if (currentProduct == null) {
|
if (currentProduct == null) {
|
||||||
|
|
||||||
currentProduct = new Product("Default", "Default", "Default",
|
currentProduct = new Product("Default", "Default", "Default",
|
||||||
new ProductInfo(), new ProductTime(), new ArrayList<Layer>() );
|
new ProductInfo(), new ProductTime(),
|
||||||
|
new ArrayList<Layer>());
|
||||||
|
|
||||||
drawingLayer.addProduct(currentProduct);
|
drawingLayer.addProduct(currentProduct);
|
||||||
drawingLayer.setActiveProduct(currentProduct);
|
drawingLayer.setActiveProduct(currentProduct);
|
||||||
|
@ -368,7 +366,6 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Update the active layer with a new name;
|
* Update the active layer with a new name;
|
||||||
*/
|
*/
|
||||||
|
@ -377,9 +374,9 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Update only if the new layer name is not empty and not
|
* Update only if the new layer name is not empty and not the same as
|
||||||
* the same as the layer names on the current product.
|
* the layer names on the current product. Also, the name should not be
|
||||||
* Also, the name should not be any variations of "Default".
|
* any variations of "Default".
|
||||||
*
|
*
|
||||||
* Note: we assume the layer names should be unique within a product.
|
* Note: we assume the layer names should be unique within a product.
|
||||||
*/
|
*/
|
||||||
|
@ -397,10 +394,9 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Rebuilds and opens the layering control dialog since the size
|
* Rebuilds and opens the layering control dialog since the size of the
|
||||||
* of the button will change with the length of the new name.
|
* button will change with the length of the new name.
|
||||||
*/
|
*/
|
||||||
if (update) {
|
if (update) {
|
||||||
|
|
||||||
|
@ -426,13 +422,8 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
protected void updateDisplayAttr(boolean mono, Color clr, boolean fill) {
|
protected void updateDisplayAttr(boolean mono, Color clr, boolean fill) {
|
||||||
|
|
||||||
if (colorModeBtnInUse >= 0) {
|
if (colorModeBtnInUse >= 0) {
|
||||||
|
colorModeBtns.get(colorModeBtnInUse).setText(
|
||||||
if ( mono ) {
|
getDisplayString(mono, fill));
|
||||||
colorModeBtns.get( colorModeBtnInUse ).setText( "M/F" );
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
colorModeBtns.get( colorModeBtnInUse ).setText( "A/F" );
|
|
||||||
}
|
|
||||||
|
|
||||||
layerList.get(colorModeBtnInUse).setMonoColor(mono);
|
layerList.get(colorModeBtnInUse).setMonoColor(mono);
|
||||||
layerList.get(colorModeBtnInUse).setColor(clr);
|
layerList.get(colorModeBtnInUse).setColor(clr);
|
||||||
|
@ -471,8 +462,10 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
/*
|
/*
|
||||||
* Pop up layer name editing window
|
* Pop up layer name editing window
|
||||||
*/
|
*/
|
||||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
|
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||||
if ( layerNameDlg == null) layerNameDlg = new PgenLayeringNameDialog( shell, this );
|
.getShell();
|
||||||
|
if (layerNameDlg == null)
|
||||||
|
layerNameDlg = new PgenLayeringNameDialog(shell, this);
|
||||||
|
|
||||||
if (layerNameDlg != null && !(layerNameDlg.isOpen())) {
|
if (layerNameDlg != null && !(layerNameDlg.isOpen())) {
|
||||||
layerNameDlg.open();
|
layerNameDlg.open();
|
||||||
|
@ -488,8 +481,10 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
/*
|
/*
|
||||||
* Pop up layer name editing window
|
* Pop up layer name editing window
|
||||||
*/
|
*/
|
||||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
|
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||||
if ( displayDlg == null) displayDlg = new PgenLayeringDisplayDialog( shell, this );
|
.getShell();
|
||||||
|
if (displayDlg == null)
|
||||||
|
displayDlg = new PgenLayeringDisplayDialog(shell, this);
|
||||||
|
|
||||||
if ((displayDlg.isOpen())) {
|
if ((displayDlg.isOpen())) {
|
||||||
displayDlg.close();
|
displayDlg.close();
|
||||||
|
@ -499,7 +494,6 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a new layer.
|
* Add a new layer.
|
||||||
*/
|
*/
|
||||||
|
@ -512,7 +506,6 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
int size1 = layerList.size() + 1;
|
int size1 = layerList.size() + 1;
|
||||||
String name = new String("Layer_" + size1);
|
String name = new String("Layer_" + size1);
|
||||||
|
|
||||||
|
|
||||||
for (int ii = 0; ii < layerList.size(); ii++) {
|
for (int ii = 0; ii < layerList.size(); ii++) {
|
||||||
if (name.equals(layerList.get(ii).getName())) {
|
if (name.equals(layerList.get(ii).getName())) {
|
||||||
name = new String("Layer_" + (size1++));
|
name = new String("Layer_" + (size1++));
|
||||||
|
@ -545,7 +538,8 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
|
|
||||||
if (!newLayer.equals(clayer)) {
|
if (!newLayer.equals(clayer)) {
|
||||||
for (int ii = 0; ii < layerNameBtns.size(); ii++) {
|
for (int ii = 0; ii < layerNameBtns.size(); ii++) {
|
||||||
if ( layerNameBtns.get(ii).getText().replace("&&", "&").equals( newLayer ) ) {
|
if (layerNameBtns.get(ii).getText().replace("&&", "&")
|
||||||
|
.equals(newLayer)) {
|
||||||
which = ii;
|
which = ii;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -558,7 +552,6 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Switch between layer.
|
* Switch between layer.
|
||||||
*/
|
*/
|
||||||
|
@ -576,8 +569,10 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
layerList.get(layerInUse).setInUse(true);
|
layerList.get(layerInUse).setInUse(true);
|
||||||
// layerList.get( layerInUse ).setOnOff( true );
|
// layerList.get( layerInUse ).setOnOff( true );
|
||||||
|
|
||||||
if ( layerNameDlg != null ) layerNameDlg.close();
|
if (layerNameDlg != null)
|
||||||
if ( displayDlg != null ) displayDlg.close();
|
layerNameDlg.close();
|
||||||
|
if (displayDlg != null)
|
||||||
|
displayDlg.close();
|
||||||
openNameDialog = false;
|
openNameDialog = false;
|
||||||
|
|
||||||
currentLayer = layerList.get(layerInUse);
|
currentLayer = layerList.get(layerInUse);
|
||||||
|
@ -591,12 +586,11 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
if (GfaAttrDlg.getInstance(this.getParent()).isGfaOpen()) {
|
if (GfaAttrDlg.getInstance(this.getParent()).isGfaOpen()) {
|
||||||
if (drawingLayer.getSelectedDE() != null) {
|
if (drawingLayer.getSelectedDE() != null) {
|
||||||
GfaAttrDlg.getInstance(this.getParent()).close();
|
GfaAttrDlg.getInstance(this.getParent()).close();
|
||||||
|
} else {
|
||||||
|
GfaAttrDlg.getInstance(this.getParent()).switchHazard(
|
||||||
|
currentLayer.getName());
|
||||||
}
|
}
|
||||||
else {
|
} else {
|
||||||
GfaAttrDlg.getInstance( this.getParent() ).switchHazard( currentLayer.getName() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
PgenUtil.setSelectingMode();
|
PgenUtil.setSelectingMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -618,12 +612,12 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
displayOnOffBtns.get(which).setSelection(true);
|
displayOnOffBtns.get(which).setSelection(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
layerList.get( which ).setOnOff( displayOnOffBtns.get( which ).getSelection() );
|
layerList.get(which).setOnOff(
|
||||||
|
displayOnOffBtns.get(which).getSelection());
|
||||||
|
|
||||||
PgenUtil.refresh();
|
PgenUtil.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Toggle the display on/off for all check buttons.
|
* Toggle the display on/off for all check buttons.
|
||||||
*/
|
*/
|
||||||
|
@ -632,8 +626,7 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
if (allOnOff) {
|
if (allOnOff) {
|
||||||
allOnOff = false;
|
allOnOff = false;
|
||||||
allOnOffBtn.setText("All On");
|
allOnOffBtn.setText("All On");
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
allOnOff = true;
|
allOnOff = true;
|
||||||
allOnOffBtn.setText("All Off");
|
allOnOffBtn.setText("All Off");
|
||||||
}
|
}
|
||||||
|
@ -654,7 +647,6 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the name of the layer on which the color mode button is clicked.
|
* Return the name of the layer on which the color mode button is clicked.
|
||||||
*/
|
*/
|
||||||
|
@ -667,7 +659,6 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exit layering.
|
* Exit layering.
|
||||||
*/
|
*/
|
||||||
|
@ -707,8 +698,10 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
/*
|
/*
|
||||||
* Dispose all layering dialogs.
|
* Dispose all layering dialogs.
|
||||||
*/
|
*/
|
||||||
if ( layerNameDlg != null ) layerNameDlg.close();
|
if (layerNameDlg != null)
|
||||||
if ( displayDlg != null ) displayDlg.close();
|
layerNameDlg.close();
|
||||||
|
if (displayDlg != null)
|
||||||
|
displayDlg.close();
|
||||||
|
|
||||||
close();
|
close();
|
||||||
// shell.dispose();
|
// shell.dispose();
|
||||||
|
@ -763,7 +756,7 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
|
|
||||||
// Close the dialog first.
|
// Close the dialog first.
|
||||||
if (isOpen()) {
|
if (isOpen()) {
|
||||||
shell.dispose();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close other dialogs as well.
|
// Close other dialogs as well.
|
||||||
|
@ -784,4 +777,25 @@ public class PgenLayeringControlDialog extends PgenLayeringDialog {
|
||||||
exitLayering();
|
exitLayering();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Build a string based on given Mono color and fill flags..
|
||||||
|
*/
|
||||||
|
private String getDisplayString(boolean monoClr, boolean fill) {
|
||||||
|
String dispStr = "";
|
||||||
|
if (monoClr) {
|
||||||
|
if (fill)
|
||||||
|
dispStr += "M/F ";
|
||||||
|
else
|
||||||
|
dispStr += "M/N";
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if (fill)
|
||||||
|
dispStr += "A/F ";
|
||||||
|
else
|
||||||
|
dispStr += "A/N ";
|
||||||
|
}
|
||||||
|
|
||||||
|
return dispStr;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -179,7 +179,7 @@ public class ProductManageDialog extends ProductDialog {
|
||||||
* Sets the title of the dialog.
|
* Sets the title of the dialog.
|
||||||
*/
|
*/
|
||||||
public void setTitle() {
|
public void setTitle() {
|
||||||
shell.setText("Product Center");
|
shell.setText("Activity Center");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -319,7 +319,7 @@ public class ProductManageDialog extends ProductDialog {
|
||||||
titleComp.setLayout(gl0);
|
titleComp.setLayout(gl0);
|
||||||
|
|
||||||
Label prds = new Label(titleComp, SWT.NONE);
|
Label prds = new Label(titleComp, SWT.NONE);
|
||||||
prds.setText("Products:");
|
prds.setText("Activities:");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* if ( !compact ) { Button multiSaveBtn = new Button( titleComp,
|
* if ( !compact ) { Button multiSaveBtn = new Button( titleComp,
|
||||||
|
@ -745,12 +745,8 @@ public class ProductManageDialog extends ProductDialog {
|
||||||
|
|
||||||
if (!compact) {
|
if (!compact) {
|
||||||
Button clrBtn = new Button(layersComp, SWT.PUSH);
|
Button clrBtn = new Button(layersComp, SWT.PUSH);
|
||||||
if (lyr.isMonoColor()) {
|
clrBtn.setText(getDisplayString(lyr.isMonoColor(),
|
||||||
clrBtn.setText("M/F");
|
lyr.isFilled()));
|
||||||
} else {
|
|
||||||
clrBtn.setText("A/F");
|
|
||||||
}
|
|
||||||
|
|
||||||
setButtonColor(clrBtn, lyr.getColor());
|
setButtonColor(clrBtn, lyr.getColor());
|
||||||
clrBtn.setData(ii);
|
clrBtn.setData(ii);
|
||||||
|
|
||||||
|
@ -852,12 +848,8 @@ public class ProductManageDialog extends ProductDialog {
|
||||||
protected void updateDisplayAttr(boolean mono, Color clr, boolean fill) {
|
protected void updateDisplayAttr(boolean mono, Color clr, boolean fill) {
|
||||||
|
|
||||||
if (colorModeBtnInUse >= 0) {
|
if (colorModeBtnInUse >= 0) {
|
||||||
|
colorModeBtns.get(colorModeBtnInUse).setText(
|
||||||
if (mono) {
|
getDisplayString(mono, fill));
|
||||||
colorModeBtns.get(colorModeBtnInUse).setText("M/F");
|
|
||||||
} else {
|
|
||||||
colorModeBtns.get(colorModeBtnInUse).setText("A/F");
|
|
||||||
}
|
|
||||||
|
|
||||||
layerList.get(colorModeBtnInUse).setMonoColor(mono);
|
layerList.get(colorModeBtnInUse).setMonoColor(mono);
|
||||||
layerList.get(colorModeBtnInUse).setColor(clr);
|
layerList.get(colorModeBtnInUse).setColor(clr);
|
||||||
|
@ -2188,4 +2180,25 @@ public class ProductManageDialog extends ProductDialog {
|
||||||
exitProductManage();
|
exitProductManage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Build a string based on given Mono color and fill flags..
|
||||||
|
*/
|
||||||
|
private String getDisplayString(boolean monoClr, boolean fill) {
|
||||||
|
String dispStr = "";
|
||||||
|
if (monoClr) {
|
||||||
|
if (fill)
|
||||||
|
dispStr += "M/F ";
|
||||||
|
else
|
||||||
|
dispStr += "M/N";
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if (fill)
|
||||||
|
dispStr += "A/F ";
|
||||||
|
else
|
||||||
|
dispStr += "A/N ";
|
||||||
|
}
|
||||||
|
|
||||||
|
return dispStr;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,10 +11,10 @@ import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||||
import gov.noaa.nws.ncep.ui.pgen.producttypes.PgenLayer;
|
import gov.noaa.nws.ncep.ui.pgen.producttypes.PgenLayer;
|
||||||
import gov.noaa.nws.ncep.ui.pgen.producttypes.ProductType;
|
import gov.noaa.nws.ncep.ui.pgen.producttypes.ProductType;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.awt.Color;
|
|
||||||
|
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.events.SelectionAdapter;
|
import org.eclipse.swt.events.SelectionAdapter;
|
||||||
|
@ -29,13 +29,13 @@ import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.Control;
|
import org.eclipse.swt.widgets.Control;
|
||||||
import org.eclipse.swt.widgets.Event;
|
import org.eclipse.swt.widgets.Event;
|
||||||
import org.eclipse.swt.widgets.FileDialog;
|
import org.eclipse.swt.widgets.FileDialog;
|
||||||
|
import org.eclipse.swt.widgets.Group;
|
||||||
import org.eclipse.swt.widgets.Label;
|
import org.eclipse.swt.widgets.Label;
|
||||||
import org.eclipse.swt.widgets.Listener;
|
import org.eclipse.swt.widgets.Listener;
|
||||||
import org.eclipse.swt.widgets.Menu;
|
import org.eclipse.swt.widgets.Menu;
|
||||||
import org.eclipse.swt.widgets.MenuItem;
|
import org.eclipse.swt.widgets.MenuItem;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.swt.widgets.Text;
|
import org.eclipse.swt.widgets.Text;
|
||||||
import org.eclipse.swt.widgets.Group;
|
|
||||||
import org.eclipse.swt.widgets.ToolBar;
|
import org.eclipse.swt.widgets.ToolBar;
|
||||||
import org.eclipse.swt.widgets.ToolItem;
|
import org.eclipse.swt.widgets.ToolItem;
|
||||||
|
|
||||||
|
@ -61,21 +61,29 @@ import org.eclipse.swt.widgets.ToolItem;
|
||||||
public class ProductNameDialog extends ProductDialog {
|
public class ProductNameDialog extends ProductDialog {
|
||||||
|
|
||||||
private Text nameText = null;
|
private Text nameText = null;
|
||||||
|
|
||||||
private Combo typeCombo = null;
|
private Combo typeCombo = null;
|
||||||
|
|
||||||
private Composite typeComp = null;
|
private Composite typeComp = null;
|
||||||
|
|
||||||
private Text typeText = null;
|
private Text typeText = null;
|
||||||
|
|
||||||
private ToolBar typeToolBar = null;
|
private ToolBar typeToolBar = null;
|
||||||
|
|
||||||
private Text forecasterText = null;
|
private Text forecasterText = null;
|
||||||
|
|
||||||
private Text centerText = null;
|
private Text centerText = null;
|
||||||
|
|
||||||
private Button saveLayerBtn = null;
|
private Button saveLayerBtn = null;
|
||||||
|
|
||||||
private Text outputFileTxt = null;
|
private Text outputFileTxt = null;
|
||||||
|
|
||||||
private Group layersGrp = null;
|
private Group layersGrp = null;
|
||||||
|
|
||||||
private String initialOutput = null;
|
private String initialOutput = null;
|
||||||
|
|
||||||
private ProductManageDialog prdManageDlg = null;
|
private ProductManageDialog prdManageDlg = null;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*/
|
*/
|
||||||
|
@ -91,7 +99,7 @@ public class ProductNameDialog extends ProductDialog {
|
||||||
* Sets the title of the dialog.
|
* Sets the title of the dialog.
|
||||||
*/
|
*/
|
||||||
public void setTitle() {
|
public void setTitle() {
|
||||||
shell.setText( "Edit Product" );
|
shell.setText("Edit Activity");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -106,9 +114,9 @@ public class ProductNameDialog extends ProductDialog {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the default location.
|
* Set the default location.
|
||||||
|
*
|
||||||
* @param parent
|
* @param parent
|
||||||
*/
|
*/
|
||||||
public void setDefaultLocation(Shell parent) {
|
public void setDefaultLocation(Shell parent) {
|
||||||
|
@ -122,13 +130,13 @@ public class ProductNameDialog extends ProductDialog {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the dialog components.
|
* Initialize the dialog components.
|
||||||
*/
|
*/
|
||||||
public void initializeComponents() {
|
public void initializeComponents() {
|
||||||
|
|
||||||
// initialOutput = prdManageDlg.getPrdOutputFile( prdManageDlg.getActiveProduct() );
|
// initialOutput = prdManageDlg.getPrdOutputFile(
|
||||||
|
// prdManageDlg.getActiveProduct() );
|
||||||
initialOutput = prdManageDlg.getActiveProduct().getOutputFile();
|
initialOutput = prdManageDlg.getActiveProduct().getOutputFile();
|
||||||
|
|
||||||
Composite main = new Composite(shell, SWT.NONE);
|
Composite main = new Composite(shell, SWT.NONE);
|
||||||
|
@ -188,11 +196,12 @@ public class ProductNameDialog extends ProductDialog {
|
||||||
for (String ptypName : prdManageDlg.prdTypesMap.keySet()) {
|
for (String ptypName : prdManageDlg.prdTypesMap.keySet()) {
|
||||||
|
|
||||||
ProductType prdType = prdManageDlg.prdTypesMap.get(ptypName);
|
ProductType prdType = prdManageDlg.prdTypesMap.get(ptypName);
|
||||||
LinkedHashMap<String, String> subtypesNalias = prdManageDlg.getSubtypes( prdType.getType(), true );
|
LinkedHashMap<String, String> subtypesNalias = prdManageDlg
|
||||||
|
.getSubtypes(prdType.getType(), true);
|
||||||
|
|
||||||
if ( (ptypName.equals( prdType.getName() ) &&
|
if ((ptypName.equals(prdType.getName()) && !prdType.getType()
|
||||||
!prdType.getType().equals( prdType.getName() ) ) ||
|
.equals(prdType.getName()))
|
||||||
!prdManageDlg.hasSubtypes( subtypesNalias.values() ) ) {
|
|| !prdManageDlg.hasSubtypes(subtypesNalias.values())) {
|
||||||
|
|
||||||
MenuItem typeItem = new MenuItem(mu, SWT.PUSH, ntyp);
|
MenuItem typeItem = new MenuItem(mu, SWT.PUSH, ntyp);
|
||||||
|
|
||||||
|
@ -200,7 +209,8 @@ public class ProductNameDialog extends ProductDialog {
|
||||||
typeItem.setData(ptypName);
|
typeItem.setData(ptypName);
|
||||||
typeItem.addSelectionListener(new SelectionAdapter() {
|
typeItem.addSelectionListener(new SelectionAdapter() {
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
String typeName = ((MenuItem)e.widget).getData().toString();
|
String typeName = ((MenuItem) e.widget).getData()
|
||||||
|
.toString();
|
||||||
typeText.setText(typeName);
|
typeText.setText(typeName);
|
||||||
typeText.pack();
|
typeText.pack();
|
||||||
typeComp.pack();
|
typeComp.pack();
|
||||||
|
@ -209,13 +219,11 @@ public class ProductNameDialog extends ProductDialog {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
|
|
||||||
if (typeUsed.contains(prdType.getType())) {
|
if (typeUsed.contains(prdType.getType())) {
|
||||||
continue;
|
continue;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
typeUsed.add(prdType.getType());
|
typeUsed.add(prdType.getType());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -234,7 +242,8 @@ public class ProductNameDialog extends ProductDialog {
|
||||||
|
|
||||||
subtypeItem.addSelectionListener(new SelectionAdapter() {
|
subtypeItem.addSelectionListener(new SelectionAdapter() {
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
String typeName = ((MenuItem)e.widget).getData().toString();
|
String typeName = ((MenuItem) e.widget).getData()
|
||||||
|
.toString();
|
||||||
typeText.setText(typeName);
|
typeText.setText(typeName);
|
||||||
typeText.pack();
|
typeText.pack();
|
||||||
typeComp.pack();
|
typeComp.pack();
|
||||||
|
@ -252,7 +261,8 @@ public class ProductNameDialog extends ProductDialog {
|
||||||
ti.addListener(SWT.Selection, new Listener() {
|
ti.addListener(SWT.Selection, new Listener() {
|
||||||
public void handleEvent(Event event) {
|
public void handleEvent(Event event) {
|
||||||
Rectangle bounds = ti.getBounds();
|
Rectangle bounds = ti.getBounds();
|
||||||
Point point = typeToolBar.toDisplay( bounds.x, bounds.y + bounds.height );
|
Point point = typeToolBar.toDisplay(bounds.x, bounds.y
|
||||||
|
+ bounds.height);
|
||||||
mu.setLocation(point);
|
mu.setLocation(point);
|
||||||
mu.setVisible(true);
|
mu.setVisible(true);
|
||||||
}
|
}
|
||||||
|
@ -288,7 +298,8 @@ public class ProductNameDialog extends ProductDialog {
|
||||||
psave.setText("Save Layers:");
|
psave.setText("Save Layers:");
|
||||||
|
|
||||||
saveLayerBtn = new Button(bot1, SWT.CHECK);
|
saveLayerBtn = new Button(bot1, SWT.CHECK);
|
||||||
saveLayerBtn.setSelection( prdManageDlg.getActiveProduct().isSaveLayers() );
|
saveLayerBtn.setSelection(prdManageDlg.getActiveProduct()
|
||||||
|
.isSaveLayers());
|
||||||
|
|
||||||
// Create a composite for output file name
|
// Create a composite for output file name
|
||||||
Label outputLbl = new Label(bot2, SWT.LEFT);
|
Label outputLbl = new Label(bot2, SWT.LEFT);
|
||||||
|
@ -300,8 +311,7 @@ public class ProductNameDialog extends ProductDialog {
|
||||||
|
|
||||||
if (initialOutput != null) {
|
if (initialOutput != null) {
|
||||||
outputFileTxt.setText(initialOutput);
|
outputFileTxt.setText(initialOutput);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
outputFileTxt.setText("");
|
outputFileTxt.setText("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -351,7 +361,6 @@ public class ProductNameDialog extends ProductDialog {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Update the product attributes in the product control window.
|
* Update the product attributes in the product control window.
|
||||||
*/
|
*/
|
||||||
|
@ -367,8 +376,7 @@ public class ProductNameDialog extends ProductDialog {
|
||||||
attr.put("center", centerText.getText());
|
attr.put("center", centerText.getText());
|
||||||
if (saveLayerBtn.getSelection()) {
|
if (saveLayerBtn.getSelection()) {
|
||||||
attr.put("saveLayers", "true");
|
attr.put("saveLayers", "true");
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
attr.put("saveLayers", "false");
|
attr.put("saveLayers", "false");
|
||||||
}
|
}
|
||||||
attr.put("outputfile", outputFileTxt.getText());
|
attr.put("outputfile", outputFileTxt.getText());
|
||||||
|
@ -379,27 +387,26 @@ public class ProductNameDialog extends ProductDialog {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Select a product type with confirmation.
|
* Select a product type with confirmation.
|
||||||
*/
|
*/
|
||||||
private void selectProductType() {
|
private void selectProductType() {
|
||||||
|
|
||||||
if ( !(typeCombo.getText().equals( prdManageDlg.getActiveProduct().getType() ) ) ) {
|
if (!(typeCombo.getText().equals(prdManageDlg.getActiveProduct()
|
||||||
|
.getType()))) {
|
||||||
/*
|
/*
|
||||||
MessageDialog confirmDlg = new MessageDialog(
|
* MessageDialog confirmDlg = new MessageDialog(
|
||||||
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
|
* PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
|
||||||
"Confirm type", null,
|
* "Confirm type", null,
|
||||||
"Are you sure you want to switch from type " +
|
* "Are you sure you want to switch from type " +
|
||||||
prdManageDlg.getActiveProduct().getType()
|
* prdManageDlg.getActiveProduct().getType() + " to type " +
|
||||||
+ " to type " + typeCombo.getText() + "?",
|
* typeCombo.getText() + "?", MessageDialog.QUESTION, new
|
||||||
MessageDialog.QUESTION, new String[]{"OK", "Cancel"}, 0);
|
* String[]{"OK", "Cancel"}, 0);
|
||||||
|
*
|
||||||
confirmDlg.open();
|
* confirmDlg.open();
|
||||||
|
*
|
||||||
if ( confirmDlg.getReturnCode() != MessageDialog.OK ) {
|
* if ( confirmDlg.getReturnCode() != MessageDialog.OK ) {
|
||||||
typeCombo.select( curType );
|
* typeCombo.select( curType ); }
|
||||||
}
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// typeCombo.select( curType );
|
// typeCombo.select( curType );
|
||||||
|
@ -424,10 +431,10 @@ public class ProductNameDialog extends ProductDialog {
|
||||||
if (initialFile != null) {
|
if (initialFile != null) {
|
||||||
int index = initialFile.lastIndexOf('/');
|
int index = initialFile.lastIndexOf('/');
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
defaultFile = initialFile.substring( index+1, initialFile.length() );
|
defaultFile = initialFile.substring(index + 1,
|
||||||
|
initialFile.length());
|
||||||
filterPath = initialFile.substring(0, index);
|
filterPath = initialFile.substring(0, index);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
defaultFile = new String(initialFile);
|
defaultFile = new String(initialFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -453,8 +460,8 @@ public class ProductNameDialog extends ProductDialog {
|
||||||
* @return dialog.open()
|
* @return dialog.open()
|
||||||
*/
|
*/
|
||||||
private String selectFile(Shell sh, int mode, String[] nameFilter,
|
private String selectFile(Shell sh, int mode, String[] nameFilter,
|
||||||
String[] extensionFilter, String pathFilter,
|
String[] extensionFilter, String pathFilter, String defaultFile,
|
||||||
String defaultFile, boolean overWrite ) {
|
boolean overWrite) {
|
||||||
|
|
||||||
FileDialog dialog = new FileDialog(sh, mode);
|
FileDialog dialog = new FileDialog(sh, mode);
|
||||||
dialog.setFilterNames(nameFilter);
|
dialog.setFilterNames(nameFilter);
|
||||||
|
@ -483,8 +490,8 @@ public class ProductNameDialog extends ProductDialog {
|
||||||
shell.pack(true);
|
shell.pack(true);
|
||||||
|
|
||||||
ProductType prdtype = prdManageDlg.prdTypesMap.get(typ);
|
ProductType prdtype = prdManageDlg.prdTypesMap.get(typ);
|
||||||
if ( prdtype == null || prdtype.getPgenLayer() == null ||
|
if (prdtype == null || prdtype.getPgenLayer() == null
|
||||||
prdtype.getPgenLayer().size() <= 0 ) {
|
|| prdtype.getPgenLayer().size() <= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -510,10 +517,9 @@ public class ProductNameDialog extends ProductDialog {
|
||||||
Button clrBtn = new Button(layersComp, SWT.PUSH);
|
Button clrBtn = new Button(layersComp, SWT.PUSH);
|
||||||
clrBtn.setText("A/F");
|
clrBtn.setText("A/F");
|
||||||
|
|
||||||
Color clr = new Color( lyr.getColor().getRed(),
|
Color clr = new Color(lyr.getColor().getRed(), lyr.getColor()
|
||||||
lyr.getColor().getGreen(),
|
.getGreen(), lyr.getColor().getBlue(), lyr.getColor()
|
||||||
lyr.getColor().getBlue(),
|
.getAlpha());
|
||||||
lyr.getColor().getAlpha() );
|
|
||||||
|
|
||||||
setButtonColor(clrBtn, clr);
|
setButtonColor(clrBtn, clr);
|
||||||
}
|
}
|
||||||
|
@ -522,7 +528,6 @@ public class ProductNameDialog extends ProductDialog {
|
||||||
shell.pack(true);
|
shell.pack(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Switch to a new type
|
* Switch to a new type
|
||||||
*/
|
*/
|
||||||
|
@ -543,14 +548,12 @@ public class ProductNameDialog extends ProductDialog {
|
||||||
outputFileTxt.setText(ptyp.getPgenSave().getOutputFile());
|
outputFileTxt.setText(ptyp.getPgenSave().getOutputFile());
|
||||||
}
|
}
|
||||||
if (ptyp.getPgenSave().isSaveLayers() != null) {
|
if (ptyp.getPgenSave().isSaveLayers() != null) {
|
||||||
saveLayerBtn.setSelection( ptyp.getPgenSave().isSaveLayers() );
|
saveLayerBtn
|
||||||
|
.setSelection(ptyp.getPgenSave().isSaveLayers());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -143,7 +143,9 @@ import com.vividsolutions.jts.geom.Point;
|
||||||
* 03/13 #927 B. Yin Implemented IContextMenuProvider interface
|
* 03/13 #927 B. Yin Implemented IContextMenuProvider interface
|
||||||
* 04/13 #874 B. Yin Added a method replaceElements with parameter parent.
|
* 04/13 #874 B. Yin Added a method replaceElements with parameter parent.
|
||||||
* 04/13 #977 S. Gilbert PGEN Database support
|
* 04/13 #977 S. Gilbert PGEN Database support
|
||||||
* 11/13 TTR 752 J. Wu Add methods for CCFP text auto placement.
|
* 09/14 TTR972 J. Wu "Filled" object on the active layer should be
|
||||||
|
* drawn as "filled" even if the "filled" flag for
|
||||||
|
* the layer is "false".
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author B. Yin
|
* @author B. Yin
|
||||||
|
@ -1841,6 +1843,12 @@ public class PgenResource extends
|
||||||
dprops.setLayerMonoColor(layer.isMonoColor());
|
dprops.setLayerMonoColor(layer.isMonoColor());
|
||||||
dprops.setLayerColor(layer.getColor());
|
dprops.setLayerColor(layer.getColor());
|
||||||
dprops.setLayerFilled(layer.isFilled());
|
dprops.setLayerFilled(layer.isFilled());
|
||||||
|
} else {
|
||||||
|
/*
|
||||||
|
* "Filled" should always be set to "true" for displaying the
|
||||||
|
* active layer.
|
||||||
|
*/
|
||||||
|
dprops.setLayerFilled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Iterator<DrawableElement> iterator = layer.createDEIterator();
|
Iterator<DrawableElement> iterator = layer.createDEIterator();
|
||||||
|
@ -1991,7 +1999,6 @@ public class PgenResource extends
|
||||||
PaintProperties paintProps, DisplayProperties dispProps) {
|
PaintProperties paintProps, DisplayProperties dispProps) {
|
||||||
|
|
||||||
if (filters.acceptOnce(de)) {
|
if (filters.acceptOnce(de)) {
|
||||||
|
|
||||||
if (!displayMap.containsKey(de)) {
|
if (!displayMap.containsKey(de)) {
|
||||||
AbstractElementContainer container = ElementContainerFactory
|
AbstractElementContainer container = ElementContainerFactory
|
||||||
.createContainer(de, descriptor, target);
|
.createContainer(de, descriptor, target);
|
||||||
|
|
|
@ -23,7 +23,6 @@ import gov.noaa.nws.ncep.ui.pgen.display.AbstractElementContainer;
|
||||||
import gov.noaa.nws.ncep.ui.pgen.display.DefaultElementContainer;
|
import gov.noaa.nws.ncep.ui.pgen.display.DefaultElementContainer;
|
||||||
import gov.noaa.nws.ncep.ui.pgen.display.DisplayElementFactory;
|
import gov.noaa.nws.ncep.ui.pgen.display.DisplayElementFactory;
|
||||||
import gov.noaa.nws.ncep.ui.pgen.elements.AbstractDrawableComponent;
|
import gov.noaa.nws.ncep.ui.pgen.elements.AbstractDrawableComponent;
|
||||||
import gov.noaa.nws.ncep.ui.pgen.elements.DECollection;
|
|
||||||
import gov.noaa.nws.ncep.ui.pgen.elements.DrawableElement;
|
import gov.noaa.nws.ncep.ui.pgen.elements.DrawableElement;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -53,10 +52,12 @@ import com.raytheon.uf.viz.core.map.IMapDescriptor;
|
||||||
|
|
||||||
public class PgenResourceGhost {
|
public class PgenResourceGhost {
|
||||||
public AbstractDrawableComponent component;
|
public AbstractDrawableComponent component;
|
||||||
|
|
||||||
Map<Object, AbstractElementContainer> componentMap = new HashMap<Object, AbstractElementContainer>();
|
Map<Object, AbstractElementContainer> componentMap = new HashMap<Object, AbstractElementContainer>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draw the ghost
|
* Draw the ghost
|
||||||
|
*
|
||||||
* @param target
|
* @param target
|
||||||
* @param paintProps
|
* @param paintProps
|
||||||
* @param df
|
* @param df
|
||||||
|
@ -66,8 +67,7 @@ public class PgenResourceGhost {
|
||||||
DisplayElementFactory df, IMapDescriptor descriptor) {
|
DisplayElementFactory df, IMapDescriptor descriptor) {
|
||||||
df.setLayerDisplayAttr(false, null, false);
|
df.setLayerDisplayAttr(false, null, false);
|
||||||
if (component != null) {
|
if (component != null) {
|
||||||
Iterator<DrawableElement> iterator = component
|
Iterator<DrawableElement> iterator = component.createDEIterator();
|
||||||
.createDEIterator();
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
DrawableElement element = iterator.next();
|
DrawableElement element = iterator.next();
|
||||||
|
@ -78,16 +78,22 @@ public class PgenResourceGhost {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates displayables for an element using an ElementContainer and call the
|
* Creates displayables for an element using an ElementContainer and call
|
||||||
* displayables' draw() method to draw the element.
|
* the displayables' draw() method to draw the element.
|
||||||
* @param target Graphic target
|
*
|
||||||
* @param paintProps Paint properties
|
* @param target
|
||||||
* @param df Display element factory
|
* Graphic target
|
||||||
* @param el Input drawable element
|
* @param paintProps
|
||||||
|
* Paint properties
|
||||||
|
* @param df
|
||||||
|
* Display element factory
|
||||||
|
* @param el
|
||||||
|
* Input drawable element
|
||||||
* @praram descriptor
|
* @praram descriptor
|
||||||
*/
|
*/
|
||||||
private void drawElement( IGraphicsTarget target, PaintProperties paintProps,
|
private void drawElement(IGraphicsTarget target,
|
||||||
DisplayElementFactory df, DrawableElement el, IMapDescriptor descriptor){
|
PaintProperties paintProps, DisplayElementFactory df,
|
||||||
|
DrawableElement el, IMapDescriptor descriptor) {
|
||||||
Object key = createKey(el);
|
Object key = createKey(el);
|
||||||
AbstractElementContainer graphic = componentMap.get(key);
|
AbstractElementContainer graphic = componentMap.get(key);
|
||||||
|
|
||||||
|
@ -106,6 +112,7 @@ public class PgenResourceGhost {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the ghost line for the PGEN drawing layer.
|
* Sets the ghost line for the PGEN drawing layer.
|
||||||
|
*
|
||||||
* @param ghost
|
* @param ghost
|
||||||
*/
|
*/
|
||||||
public void setGhostLine(AbstractDrawableComponent ghost) {
|
public void setGhostLine(AbstractDrawableComponent ghost) {
|
||||||
|
|
|
@ -197,6 +197,7 @@ public class PgenContoursTool extends AbstractPgenDrawingTool implements
|
||||||
|
|
||||||
if (button == 1) {
|
if (button == 1) {
|
||||||
drawContourMinmax(loc);
|
drawContourMinmax(loc);
|
||||||
|
((ContoursAttrDlg) attrDlg).updateSymbolAttrOnGUI(loc);
|
||||||
} else if (button == 3) {
|
} else if (button == 3) {
|
||||||
|
|
||||||
points.clear();
|
points.clear();
|
||||||
|
|
|
@ -3,13 +3,15 @@ package gov.noaa.nws.ncep.viz.overlays.resources;
|
||||||
import gov.noaa.nws.ncep.viz.resources.INatlCntrsResource;
|
import gov.noaa.nws.ncep.viz.resources.INatlCntrsResource;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.opengis.referencing.crs.CoordinateReferenceSystem;
|
import org.opengis.referencing.crs.CoordinateReferenceSystem;
|
||||||
|
|
||||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||||
import com.raytheon.uf.viz.core.PixelExtent;
|
import com.raytheon.uf.viz.core.PixelExtent;
|
||||||
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.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.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
|
@ -17,6 +19,8 @@ import com.raytheon.uf.viz.core.map.IMapDescriptor;
|
||||||
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
||||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||||
import com.vividsolutions.jts.geom.Coordinate;
|
import com.vividsolutions.jts.geom.Coordinate;
|
||||||
|
import com.vividsolutions.jts.geom.Geometry;
|
||||||
|
import com.vividsolutions.jts.geom.GeometryFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implements a drawing layer to draw lat/lon lines
|
* Implements a drawing layer to draw lat/lon lines
|
||||||
|
@ -52,9 +56,9 @@ public class LatLonOverlayResource extends
|
||||||
/** The wireframe object for drawing Longitude lines */
|
/** The wireframe object for drawing Longitude lines */
|
||||||
private IWireframeShape wireframeShapeForLonLineArray;
|
private IWireframeShape wireframeShapeForLonLineArray;
|
||||||
|
|
||||||
private List<Coordinate[]> latitudeCoordinatePointArrayList;
|
private Map<Double, Geometry> latitudeLineGeometries;
|
||||||
|
|
||||||
private List<Coordinate[]> longitudeCoordinatePointArrayList;
|
private Map<Double, Geometry> longitudeLineGeometries;
|
||||||
|
|
||||||
private double offset = 0; // 50000;
|
private double offset = 0; // 50000;
|
||||||
|
|
||||||
|
@ -75,17 +79,26 @@ public class LatLonOverlayResource extends
|
||||||
private double viewMaxX;
|
private double viewMaxX;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The four minimum and maximum of X and Y used to paint label
|
* The four effective view borders (map borders inside the viewable user
|
||||||
|
* window) used to paint label
|
||||||
*/
|
*/
|
||||||
private double effectiveMinX;
|
private Geometry effectiveLeftBorder;
|
||||||
|
|
||||||
private double effectiveMaxY;
|
private Geometry effectiveRightBorder;
|
||||||
|
|
||||||
private double effectiveMinY;
|
private Geometry effectiveBottomBorder;
|
||||||
|
|
||||||
private double effectiveMaxX;
|
private Geometry effectiveTopBorder;
|
||||||
|
|
||||||
private double latLonDrawingPointInterval = 1.0; // 0.7; //1.0; //0.5
|
private Geometry mapBoundary;
|
||||||
|
|
||||||
|
private Geometry mapMedianLine;
|
||||||
|
|
||||||
|
private final double latLonDrawingPointInterval = 1.0; // 0.7; //1.0; //0.5
|
||||||
|
|
||||||
|
private final double drawingGap = 120;
|
||||||
|
|
||||||
|
private double labelGap;
|
||||||
|
|
||||||
private boolean needsUpdate = true;
|
private boolean needsUpdate = true;
|
||||||
|
|
||||||
|
@ -114,8 +127,10 @@ public class LatLonOverlayResource extends
|
||||||
public void paintInternal(IGraphicsTarget target, PaintProperties paintProps)
|
public void paintInternal(IGraphicsTarget target, PaintProperties paintProps)
|
||||||
throws VizException {
|
throws VizException {
|
||||||
|
|
||||||
IFont lfont = target.initializeFont("Courier", 14, null);
|
IFont lfont = target.initializeFont("Courier", 14,
|
||||||
|
new Style[] { Style.BOLD });
|
||||||
float zoomFactor = paintProps.getZoomLevel();
|
float zoomFactor = paintProps.getZoomLevel();
|
||||||
|
labelGap = drawingGap * zoomFactor;
|
||||||
|
|
||||||
initializeViewMinAndMaxXAndY(paintProps);
|
initializeViewMinAndMaxXAndY(paintProps);
|
||||||
int latitudeDrawingLineNumber = getLatitudeDrawingLineNumber(latLonOverlayResourceData
|
int latitudeDrawingLineNumber = getLatitudeDrawingLineNumber(latLonOverlayResourceData
|
||||||
|
@ -128,17 +143,12 @@ public class LatLonOverlayResource extends
|
||||||
if (needsUpdate) {
|
if (needsUpdate) {
|
||||||
needsUpdate = false;
|
needsUpdate = false;
|
||||||
|
|
||||||
/*
|
|
||||||
* necessary???
|
|
||||||
*/
|
|
||||||
clearWireFrameShapeArray(wireframeShapeForLatLineArray);
|
clearWireFrameShapeArray(wireframeShapeForLatLineArray);
|
||||||
clearWireFrameShapeArray(wireframeShapeForLonLineArray);
|
clearWireFrameShapeArray(wireframeShapeForLonLineArray);
|
||||||
clearCoordinatePointArrayList(latitudeCoordinatePointArrayList);
|
|
||||||
clearCoordinatePointArrayList(longitudeCoordinatePointArrayList);
|
|
||||||
|
|
||||||
latitudeCoordinatePointArrayList = new ArrayList<Coordinate[]>(
|
latitudeLineGeometries = new HashMap<Double, Geometry>(
|
||||||
latitudeDrawingLineNumber);
|
latitudeDrawingLineNumber);
|
||||||
longitudeCoordinatePointArrayList = new ArrayList<Coordinate[]>(
|
longitudeLineGeometries = new HashMap<Double, Geometry>(
|
||||||
longitudeDrawingLineNumber);
|
longitudeDrawingLineNumber);
|
||||||
|
|
||||||
wireframeShapeForLatLineArray = target.createWireframeShape(false,
|
wireframeShapeForLatLineArray = target.createWireframeShape(false,
|
||||||
|
@ -149,19 +159,17 @@ public class LatLonOverlayResource extends
|
||||||
double latitudeValue = -90;
|
double latitudeValue = -90;
|
||||||
for (int i = 0; i < latitudeDrawingLineNumber
|
for (int i = 0; i < latitudeDrawingLineNumber
|
||||||
&& latitudeValue <= 90; i++) {
|
&& latitudeValue <= 90; i++) {
|
||||||
Coordinate[] latLonCoordinateArray = createCoordinateArrayForLatitudeLine(
|
double[][] latLonCoordinateArray = createCoordinateArrayForLatitudeLine(
|
||||||
latitudeValue, latLonDrawingPointInterval);
|
latitudeValue, latLonDrawingPointInterval);
|
||||||
latitudeCoordinatePointArrayList.add(latLonCoordinateArray);
|
|
||||||
|
|
||||||
if (!(latitudeValue == -90 || latitudeValue == 90)) {
|
if (!(latitudeValue == -90 || latitudeValue == 90)
|
||||||
|
&& latLonCoordinateArray.length > 0) {
|
||||||
wireframeShapeForLatLineArray
|
wireframeShapeForLatLineArray
|
||||||
.addLineSegment(latLonCoordinateArray);
|
.addLineSegment(latLonCoordinateArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
latitudeValue += latLonOverlayResourceData
|
latitudeValue += latLonOverlayResourceData
|
||||||
.getLatitudeInterval();
|
.getLatitudeInterval();
|
||||||
}
|
}
|
||||||
|
|
||||||
wireframeShapeForLatLineArray.compile();
|
wireframeShapeForLatLineArray.compile();
|
||||||
|
|
||||||
wireframeShapeForLonLineArray = target.createWireframeShape(false,
|
wireframeShapeForLonLineArray = target.createWireframeShape(false,
|
||||||
|
@ -172,39 +180,47 @@ public class LatLonOverlayResource extends
|
||||||
double longitudeValue = -180;
|
double longitudeValue = -180;
|
||||||
for (int i = 0; i < longitudeDrawingLineNumber
|
for (int i = 0; i < longitudeDrawingLineNumber
|
||||||
&& longitudeValue <= 180; i++) {
|
&& longitudeValue <= 180; i++) {
|
||||||
|
double[][] latLonCoordinateArray = createCoordinateArrayLongitudeLine(
|
||||||
Coordinate[] latLonCoordinateArray = createCoordinateArrayLongitudeLine(
|
|
||||||
longitudeValue, latLonDrawingPointInterval);
|
longitudeValue, latLonDrawingPointInterval);
|
||||||
longitudeCoordinatePointArrayList.add(latLonCoordinateArray);
|
|
||||||
|
if (latLonCoordinateArray.length > 0) {
|
||||||
wireframeShapeForLonLineArray
|
wireframeShapeForLonLineArray
|
||||||
.addLineSegment(latLonCoordinateArray);
|
.addLineSegment(latLonCoordinateArray);
|
||||||
|
}
|
||||||
longitudeValue += latLonOverlayResourceData
|
longitudeValue += latLonOverlayResourceData
|
||||||
.getLongitudeInterval();
|
.getLongitudeInterval();
|
||||||
}
|
}
|
||||||
wireframeShapeForLonLineArray.compile();
|
wireframeShapeForLonLineArray.compile();
|
||||||
}
|
}
|
||||||
|
|
||||||
double latitudeValue = -90;
|
double latitudeValue = -90;
|
||||||
updateEffectiveMinX(getMapMinX(), getViewMinX(), getViewMaxX());
|
|
||||||
|
|
||||||
for (int i = 0; i < latitudeDrawingLineNumber && latitudeValue <= 90; i++) {
|
for (int i = 0; i < latitudeDrawingLineNumber && latitudeValue <= 90; i++) {
|
||||||
|
Geometry latLine = latitudeLineGeometries.get(latitudeValue);
|
||||||
addDefaultLabelByPointIndex(wireframeShapeForLatLineArray,
|
if (latLine != null) {
|
||||||
String.valueOf((int) latitudeValue),
|
wireframeShapeForLatLineArray.clearLabels();
|
||||||
latitudeCoordinatePointArrayList.get(i), 0);
|
Coordinate intersection = null;
|
||||||
|
if (effectiveLeftBorder.intersects(latLine)) {
|
||||||
int pointIndexForAddingLabel = getPointLabelIndexForAddingLatitudeLabel(
|
intersection = effectiveLeftBorder.intersection(latLine)
|
||||||
latitudeCoordinatePointArrayList.get(i), zoomFactor,
|
.getCoordinate();
|
||||||
getEffectiveMinX(), getEffectiveMaxX(), getEffectiveMinY(),
|
} else if (latLine.within(mapBoundary)
|
||||||
getEffectiveMaxY());
|
&& mapMedianLine.intersects(latLine)) {
|
||||||
|
intersection = mapMedianLine.intersection(latLine)
|
||||||
if (!(pointIndexForAddingLabel < 0)) {
|
.getCoordinate();
|
||||||
addLabelOnLatLonLine(wireframeShapeForLatLineArray,
|
// Removes default latitude label if it is too close to the
|
||||||
latitudeCoordinatePointArrayList.get(i),
|
// bottom of the viewable edge to prevent the latitude label
|
||||||
pointIndexForAddingLabel,
|
// from being displayed over the longitude labels.
|
||||||
String.valueOf((int) latitudeValue));
|
if (intersection.y > effectiveBottomBorder.getCoordinate().y
|
||||||
|
- 2.5 * labelGap) {
|
||||||
|
intersection = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (intersection != null) {
|
||||||
|
wireframeShapeForLatLineArray
|
||||||
|
.addLabel(String.valueOf((int) latitudeValue),
|
||||||
|
new double[] { intersection.x + labelGap,
|
||||||
|
intersection.y });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
target.drawWireframeShape(wireframeShapeForLatLineArray,
|
target.drawWireframeShape(wireframeShapeForLatLineArray,
|
||||||
latLonOverlayResourceData.getColor(),
|
latLonOverlayResourceData.getColor(),
|
||||||
latLonOverlayResourceData.getLineWidth(),
|
latLonOverlayResourceData.getLineWidth(),
|
||||||
|
@ -212,18 +228,21 @@ public class LatLonOverlayResource extends
|
||||||
latitudeValue += latLonOverlayResourceData.getLatitudeInterval();
|
latitudeValue += latLonOverlayResourceData.getLatitudeInterval();
|
||||||
}
|
}
|
||||||
double longitudeValue = -180;
|
double longitudeValue = -180;
|
||||||
updateEffectiveMaxY(getMapMaxY(), getViewMinY(), getViewMaxY());
|
|
||||||
|
|
||||||
for (int i = 0; i < longitudeDrawingLineNumber && longitudeValue <= 180; i++) {
|
for (int i = 0; i < longitudeDrawingLineNumber && longitudeValue <= 180; i++) {
|
||||||
int pointIndexForAddingLabel = getPointLabelIndexForAddingLongitudeLabel(
|
Geometry lonLine = longitudeLineGeometries.get(longitudeValue);
|
||||||
longitudeCoordinatePointArrayList.get(i), zoomFactor,
|
if (lonLine != null) {
|
||||||
getEffectiveMinX(), getEffectiveMaxX(), getEffectiveMinY(),
|
wireframeShapeForLonLineArray.clearLabels();
|
||||||
getEffectiveMaxY());
|
if (lonLine.intersects(effectiveBottomBorder)) {
|
||||||
if (!(pointIndexForAddingLabel < 0)) {
|
Coordinate intersection = effectiveBottomBorder
|
||||||
addLabelOnLatLonLine(wireframeShapeForLonLineArray,
|
.intersection(lonLine).getCoordinate();
|
||||||
longitudeCoordinatePointArrayList.get(i),
|
int lonInt = (int) longitudeValue;
|
||||||
pointIndexForAddingLabel,
|
String label = Math.abs(lonInt) != 180 ? String
|
||||||
String.valueOf((int) longitudeValue));
|
.valueOf(lonInt) : "ID";
|
||||||
|
wireframeShapeForLonLineArray.clearLabels();
|
||||||
|
wireframeShapeForLonLineArray.addLabel(label, new double[] {
|
||||||
|
intersection.x, intersection.y - labelGap });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
target.drawWireframeShape(wireframeShapeForLonLineArray,
|
target.drawWireframeShape(wireframeShapeForLonLineArray,
|
||||||
latLonOverlayResourceData.getColor(),
|
latLonOverlayResourceData.getColor(),
|
||||||
|
@ -234,22 +253,27 @@ public class LatLonOverlayResource extends
|
||||||
lfont.dispose();
|
lfont.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addLabelOnLatLonLine(IWireframeShape wireframeShape,
|
|
||||||
Coordinate[] coordinateArray, int coordiantePointIndex, String label) {
|
|
||||||
double[] tmp = { coordinateArray[coordiantePointIndex].x,
|
|
||||||
coordinateArray[coordiantePointIndex].y };
|
|
||||||
double[] screenPixel = descriptor.worldToPixel(tmp);
|
|
||||||
if (screenPixel != null) {
|
|
||||||
wireframeShape.clearLabels();
|
|
||||||
wireframeShape.addLabel(label, screenPixel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initializeMapMinAndMaxXAndY() {
|
private void initializeMapMinAndMaxXAndY() {
|
||||||
mapMinX = descriptor.getGridGeometry().getGridRange().getLow(0);
|
mapMinX = descriptor.getGridGeometry().getGridRange().getLow(0);
|
||||||
mapMaxX = descriptor.getGridGeometry().getGridRange().getHigh(0);
|
mapMaxX = descriptor.getGridGeometry().getGridRange().getHigh(0);
|
||||||
mapMinY = descriptor.getGridGeometry().getGridRange().getLow(1);
|
mapMinY = descriptor.getGridGeometry().getGridRange().getLow(1);
|
||||||
mapMaxY = descriptor.getGridGeometry().getGridRange().getHigh(1);
|
mapMaxY = descriptor.getGridGeometry().getGridRange().getHigh(1);
|
||||||
|
|
||||||
|
double mapMidX = (mapMaxX - mapMinX) / 2;
|
||||||
|
double mapMidY = (mapMaxY - mapMinY) / 2;
|
||||||
|
mapMedianLine = new GeometryFactory()
|
||||||
|
.createLineString(new Coordinate[] {
|
||||||
|
new Coordinate(mapMidX, mapMinY),
|
||||||
|
new Coordinate(mapMidX, mapMidY) });
|
||||||
|
// Map boundary must be created in a continuous coordinate order to form
|
||||||
|
// a rectangle!
|
||||||
|
mapBoundary = new GeometryFactory().createPolygon(
|
||||||
|
new GeometryFactory().createLinearRing(new Coordinate[] {
|
||||||
|
new Coordinate(mapMinX, mapMinY),
|
||||||
|
new Coordinate(mapMinX, mapMaxY),
|
||||||
|
new Coordinate(mapMaxX, mapMaxY),
|
||||||
|
new Coordinate(mapMaxX, mapMinY),
|
||||||
|
new Coordinate(mapMinX, mapMinY) }), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeViewMinAndMaxXAndY(PaintProperties paintProps) {
|
private void initializeViewMinAndMaxXAndY(PaintProperties paintProps) {
|
||||||
|
@ -258,129 +282,48 @@ public class LatLonOverlayResource extends
|
||||||
viewMinY = paintProps.getView().getExtent().getMinY();
|
viewMinY = paintProps.getView().getExtent().getMinY();
|
||||||
viewMaxY = paintProps.getView().getExtent().getMaxY();
|
viewMaxY = paintProps.getView().getExtent().getMaxY();
|
||||||
|
|
||||||
effectiveMinX = viewMinX;
|
updateEffectiveView();
|
||||||
effectiveMaxX = viewMaxX;
|
|
||||||
effectiveMinY = viewMinY;
|
|
||||||
effectiveMaxY = viewMaxY;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateEffectiveMinX(double mapMinXValue, double viewMinXValue,
|
private void updateEffectiveView() {
|
||||||
double viewMaxXValue) {
|
double effectiveMinX = viewMinX;
|
||||||
if (isLeftEdgeOfMapInsideCurrentView(mapMinXValue, viewMinXValue,
|
double effectiveMaxX = viewMaxX;
|
||||||
viewMaxXValue)) {
|
double effectiveMinY = viewMinY;
|
||||||
effectiveMinX = mapMinXValue;
|
double effectiveMaxY = viewMaxY;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isLeftEdgeOfMapInsideCurrentView(double minXOfMap,
|
if (mapMinX > viewMinX && mapMinX < viewMaxX) {
|
||||||
double minXOfCurrentView, double maxXOfCurrentView) {
|
effectiveMinX = mapMinX;
|
||||||
boolean isInsideResult = false;
|
|
||||||
if (minXOfMap > minXOfCurrentView && minXOfMap < maxXOfCurrentView)
|
|
||||||
isInsideResult = true;
|
|
||||||
return isInsideResult;
|
|
||||||
}
|
}
|
||||||
|
if (mapMaxX > viewMinX && mapMaxX < viewMaxX) {
|
||||||
private void updateEffectiveMaxY(double mapMaxYValue, double viewMinYValue,
|
effectiveMaxX = mapMaxX;
|
||||||
double viewMaxYValue) {
|
|
||||||
if (isBottomEdgeOfMapInsideCurrentView(mapMaxYValue, viewMinYValue,
|
|
||||||
viewMaxYValue))
|
|
||||||
effectiveMaxY = mapMaxYValue;
|
|
||||||
}
|
}
|
||||||
|
if (mapMinY > viewMinY && mapMinY < viewMaxY) {
|
||||||
private boolean isBottomEdgeOfMapInsideCurrentView(double maxYOfMap,
|
effectiveMinY = mapMinY;
|
||||||
double minYOfCurrentView, double maxYOfCurrentView) {
|
|
||||||
boolean isInsideResult = false;
|
|
||||||
if (maxYOfMap > minYOfCurrentView && maxYOfMap < maxYOfCurrentView) {
|
|
||||||
isInsideResult = true;
|
|
||||||
}
|
}
|
||||||
return isInsideResult;
|
if (mapMaxY > viewMinY && mapMaxY < viewMaxY) {
|
||||||
|
effectiveMaxY = mapMaxY;
|
||||||
}
|
}
|
||||||
|
double cornerGap = 2.5 * labelGap;
|
||||||
private int getPointLabelIndexForAddingLongitudeLabel(
|
Coordinate[] leftBorderCoordinates = new Coordinate[] {
|
||||||
Coordinate[] latLonCoordinateArray, float zoomFactor, double minX,
|
new Coordinate(effectiveMinX, effectiveMinY + cornerGap),
|
||||||
double maxX, double minY, double maxY) {
|
new Coordinate(effectiveMinX, effectiveMaxY - cornerGap) };
|
||||||
int pointIndex = -1;
|
Coordinate[] rightBorderCoordinates = new Coordinate[] {
|
||||||
if (latLonCoordinateArray == null || latLonCoordinateArray.length == 0)
|
new Coordinate(effectiveMaxX, effectiveMinY + cornerGap),
|
||||||
return pointIndex;
|
new Coordinate(effectiveMaxX, effectiveMaxY - cornerGap) };
|
||||||
|
Coordinate[] bottomBorderCoordinates = new Coordinate[] {
|
||||||
double positionOffset = 120;
|
new Coordinate(effectiveMinX + cornerGap, effectiveMaxY),
|
||||||
for (int i = 0; i < latLonCoordinateArray.length; i++) {
|
new Coordinate(effectiveMaxX - cornerGap, effectiveMaxY) };
|
||||||
double[] tmp = { latLonCoordinateArray[i].x,
|
Coordinate[] topBorderCoordinates = new Coordinate[] {
|
||||||
latLonCoordinateArray[i].y };
|
new Coordinate(effectiveMinX + cornerGap, effectiveMinY),
|
||||||
double[] screenPixel = descriptor.worldToPixel(tmp);
|
new Coordinate(effectiveMaxX - cornerGap, effectiveMinY) };
|
||||||
if (isPointForPlacingLongituteLabel(screenPixel, positionOffset,
|
effectiveLeftBorder = new GeometryFactory()
|
||||||
zoomFactor, minX, maxX, minY, maxY)) {
|
.createLineString(leftBorderCoordinates);
|
||||||
pointIndex = i;
|
effectiveRightBorder = new GeometryFactory()
|
||||||
break;
|
.createLineString(rightBorderCoordinates);
|
||||||
}
|
effectiveBottomBorder = new GeometryFactory()
|
||||||
}
|
.createLineString(bottomBorderCoordinates);
|
||||||
return pointIndex;
|
effectiveTopBorder = new GeometryFactory()
|
||||||
}
|
.createLineString(topBorderCoordinates);
|
||||||
|
|
||||||
private int getPointLabelIndexForAddingLatitudeLabel(
|
|
||||||
Coordinate[] latLonCoordinateArray, float zoomFactor, double minX,
|
|
||||||
double maxX, double minY, double maxY) {
|
|
||||||
int pointIndex = -1;
|
|
||||||
if (latLonCoordinateArray == null || latLonCoordinateArray.length == 0)
|
|
||||||
return pointIndex;
|
|
||||||
|
|
||||||
double positionOffset = 120;
|
|
||||||
for (int i = 0; i < latLonCoordinateArray.length; i++) {
|
|
||||||
double[] tmp = { latLonCoordinateArray[i].x,
|
|
||||||
latLonCoordinateArray[i].y };
|
|
||||||
double[] screenPixel = descriptor.worldToPixel(tmp);
|
|
||||||
if (isPointForPlacingLatituteLabel(screenPixel, positionOffset,
|
|
||||||
zoomFactor, minX, maxX, minY, maxY)) {
|
|
||||||
pointIndex = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return pointIndex;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addDefaultLabelByPointIndex(IWireframeShape wireframeShape,
|
|
||||||
String labelValue, Coordinate[] latLonCoordinateArray,
|
|
||||||
int defaultPointIndex) {
|
|
||||||
double[] tmp = { latLonCoordinateArray[defaultPointIndex].x,
|
|
||||||
latLonCoordinateArray[defaultPointIndex].y };
|
|
||||||
double[] screenPixel = descriptor.worldToPixel(tmp);
|
|
||||||
if (screenPixel != null)
|
|
||||||
wireframeShape.addLabel(labelValue, screenPixel);
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isPointForPlacingLongituteLabel(double[] pixelValueArray,
|
|
||||||
double positionOffset, float zoomFactor, double minX, double maxX,
|
|
||||||
double minY, double maxY) {
|
|
||||||
double delta = 200;
|
|
||||||
boolean isPointForLabel = false;
|
|
||||||
if (pixelValueArray != null) {
|
|
||||||
if (pixelValueArray[0] > minX && pixelValueArray[0] < maxX
|
|
||||||
&& pixelValueArray[1] > minY && pixelValueArray[1] < maxY) {
|
|
||||||
if (Math.abs(pixelValueArray[1] - maxY) < delta) {
|
|
||||||
isPointForLabel = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return isPointForLabel;
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isPointForPlacingLatituteLabel(double[] pixelValueArray,
|
|
||||||
double positionOffset, float zoomFactor, double minX, double maxX,
|
|
||||||
double minY, double maxY) {
|
|
||||||
double delta = 200;
|
|
||||||
double adjustedOffset = positionOffset * zoomFactor;
|
|
||||||
boolean isPointForLabel = false;
|
|
||||||
if (pixelValueArray != null) {
|
|
||||||
if (pixelValueArray[0] > (minX + adjustedOffset)
|
|
||||||
&& pixelValueArray[0] < maxX && pixelValueArray[1] > minY
|
|
||||||
&& pixelValueArray[1] < maxY) {
|
|
||||||
if (Math.abs(pixelValueArray[0] - minX
|
|
||||||
- (positionOffset * zoomFactor)) < delta) {
|
|
||||||
isPointForLabel = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return isPointForLabel;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getLatitudeDrawingLineNumber(int latInterval) {
|
private int getLatitudeDrawingLineNumber(int latInterval) {
|
||||||
|
@ -402,28 +345,54 @@ public class LatLonOverlayResource extends
|
||||||
return lonLineNumber + 1;
|
return lonLineNumber + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Coordinate[] createCoordinateArrayForLatitudeLine(
|
private double[][] createCoordinateArrayForLatitudeLine(
|
||||||
double latitudeValue, double latLonPointInterval) {
|
double latitudeValue, double latLonPointInterval) {
|
||||||
int coordinateArrayLength = (int) (360 / latLonPointInterval) + 1;
|
int coordinateArrayLength = (int) (360 / latLonPointInterval) + 1;
|
||||||
Coordinate[] coordinateArray = new Coordinate[coordinateArrayLength];
|
ArrayList<Coordinate> latLineCoordinates = new ArrayList<Coordinate>(
|
||||||
|
coordinateArrayLength);
|
||||||
|
ArrayList<double[]> latLinePixels = new ArrayList<double[]>(
|
||||||
|
coordinateArrayLength);
|
||||||
double longitude = -180;
|
double longitude = -180;
|
||||||
for (int i = 0; i < coordinateArray.length && longitude <= 180; i++) {
|
for (int i = 0; i < coordinateArrayLength && longitude <= 180; i++) {
|
||||||
coordinateArray[i] = new Coordinate(longitude, latitudeValue);
|
double[] latLon = new double[] { longitude, latitudeValue };
|
||||||
|
double[] screenPixel = descriptor.worldToPixel(latLon);
|
||||||
|
if (screenPixel != null) {
|
||||||
|
latLinePixels.add(screenPixel);
|
||||||
|
latLineCoordinates.add(new Coordinate(screenPixel[0],
|
||||||
|
screenPixel[1]));
|
||||||
|
}
|
||||||
longitude += latLonPointInterval;
|
longitude += latLonPointInterval;
|
||||||
}
|
}
|
||||||
return coordinateArray;
|
if (!latLineCoordinates.isEmpty())
|
||||||
|
latitudeLineGeometries.put(latitudeValue, new GeometryFactory()
|
||||||
|
.createLineString(latLineCoordinates
|
||||||
|
.toArray(new Coordinate[] {})));
|
||||||
|
return latLinePixels.toArray(new double[][] {});
|
||||||
}
|
}
|
||||||
|
|
||||||
private Coordinate[] createCoordinateArrayLongitudeLine(
|
private double[][] createCoordinateArrayLongitudeLine(
|
||||||
double longitudeValue, double latLonPointInterval) {
|
double longitudeValue, double latLonPointInterval) {
|
||||||
int coordinateArrayLength = (int) ((180 - 10) / latLonPointInterval);
|
int coordinateArrayLength = (int) ((180 - 10) / latLonPointInterval);
|
||||||
Coordinate[] coordinateArray = new Coordinate[coordinateArrayLength];
|
ArrayList<Coordinate> lonLineCoordinates = new ArrayList<Coordinate>(
|
||||||
|
coordinateArrayLength);
|
||||||
|
ArrayList<double[]> lonLinePixels = new ArrayList<double[]>(
|
||||||
|
coordinateArrayLength);
|
||||||
double latitude = -90 + latLonPointInterval;
|
double latitude = -90 + latLonPointInterval;
|
||||||
for (int i = 0; i < coordinateArray.length && latitude <= 90; i++) {
|
for (int i = 0; i < coordinateArrayLength && latitude <= 90; i++) {
|
||||||
coordinateArray[i] = new Coordinate(longitudeValue, latitude);
|
double[] latLon = new double[] { longitudeValue, latitude };
|
||||||
|
double[] screenPixel = descriptor.worldToPixel(latLon);
|
||||||
|
if (screenPixel != null) {
|
||||||
|
lonLinePixels.add(screenPixel);
|
||||||
|
lonLineCoordinates.add(new Coordinate(screenPixel[0],
|
||||||
|
screenPixel[1]));
|
||||||
|
}
|
||||||
latitude += latLonPointInterval;
|
latitude += latLonPointInterval;
|
||||||
}
|
}
|
||||||
return coordinateArray;
|
if (!lonLineCoordinates.isEmpty())
|
||||||
|
longitudeLineGeometries.put(longitudeValue, new GeometryFactory()
|
||||||
|
.createLineString(lonLineCoordinates
|
||||||
|
.toArray(new Coordinate[] {})));
|
||||||
|
return lonLinePixels.toArray(new double[][] {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -432,9 +401,8 @@ public class LatLonOverlayResource extends
|
||||||
* @see com.raytheon.viz.core.rsc.IVizResource#dispose()
|
* @see com.raytheon.viz.core.rsc.IVizResource#dispose()
|
||||||
*/
|
*/
|
||||||
public void disposeInternal() {
|
public void disposeInternal() {
|
||||||
// clearWireFrameShapeArray(wireframeShapeForLatLineArray);
|
clearWireFrameShapeArray(wireframeShapeForLatLineArray);
|
||||||
// clearWireFrameShapeArray(wireframeShapeForLonLineArray);
|
clearWireFrameShapeArray(wireframeShapeForLonLineArray);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clearWireFrameShapeArray(IWireframeShape wireframeShapeArray) {
|
private void clearWireFrameShapeArray(IWireframeShape wireframeShapeArray) {
|
||||||
|
@ -444,16 +412,6 @@ public class LatLonOverlayResource extends
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clearCoordinatePointArrayList(
|
|
||||||
List<Coordinate[]> coordinatePointArrayList) {
|
|
||||||
if (coordinatePointArrayList != null) {
|
|
||||||
for (Coordinate[] eachCoordinateArray : coordinatePointArrayList) {
|
|
||||||
eachCoordinateArray = null;
|
|
||||||
}
|
|
||||||
coordinatePointArrayList = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* the getters for Map's Min and Max X and Y, View's Min and Max X and Y
|
* the getters for Map's Min and Max X and Y, View's Min and Max X and Y
|
||||||
*/
|
*/
|
||||||
|
@ -489,22 +447,6 @@ public class LatLonOverlayResource extends
|
||||||
return mapMaxX;
|
return mapMaxX;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getEffectiveMinX() {
|
|
||||||
return effectiveMinX;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getEffectiveMaxY() {
|
|
||||||
return effectiveMaxY;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getEffectiveMinY() {
|
|
||||||
return effectiveMinY;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getEffectiveMaxX() {
|
|
||||||
return effectiveMaxX;
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
public void resourceAttrsModified() {
|
public void resourceAttrsModified() {
|
||||||
needsUpdate = true;
|
needsUpdate = true;
|
||||||
|
@ -515,9 +457,9 @@ public class LatLonOverlayResource extends
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO : This has not been tested.
|
|
||||||
@Override
|
@Override
|
||||||
public void project(CoordinateReferenceSystem mapData) throws VizException {
|
public void project(CoordinateReferenceSystem mapData) throws VizException {
|
||||||
needsUpdate = true;
|
needsUpdate = true;
|
||||||
|
initializeMapMinAndMaxXAndY();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,6 +59,7 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
* 09/15/2014 B. Hebbard At CPC request, persist model selected across dialog close/open
|
* 09/15/2014 B. Hebbard At CPC request, persist model selected across dialog close/open
|
||||||
* even if resource not preselected (from existing RBD contents).
|
* even if resource not preselected (from existing RBD contents).
|
||||||
* (This now differs from non-NTRANS behavior.)
|
* (This now differs from non-NTRANS behavior.)
|
||||||
|
* 09/15/2014 B. Hebbard Remove bogus "km" from product group name if it appears (per CPC)
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -771,6 +772,23 @@ public class NtransSelectionControl extends ResourceSelectionControl {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
productLViewer.setLabelProvider(new LabelProvider() {
|
||||||
|
public String getText(Object element) {
|
||||||
|
String productName = (String) element;
|
||||||
|
// TODO investigate following -- already fixed separately?
|
||||||
|
// This happens intermittently; band-aid until cause located...
|
||||||
|
final String removeMe = "km";
|
||||||
|
if (productName.endsWith(removeMe)) {
|
||||||
|
System.out
|
||||||
|
.println("[WARNING: Caught a productName ending in '"
|
||||||
|
+ removeMe + "']");
|
||||||
|
return productName.substring(0, productName.length() - 2);
|
||||||
|
} else {
|
||||||
|
return productName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
rscAttrSetLViewer.setContentProvider(new IStructuredContentProvider() {
|
rscAttrSetLViewer.setContentProvider(new IStructuredContentProvider() {
|
||||||
@Override
|
@Override
|
||||||
public Object[] getElements(Object inputElement) {
|
public Object[] getElements(Object inputElement) {
|
||||||
|
|
|
@ -8,7 +8,6 @@ import gov.noaa.nws.ncep.viz.resources.manager.ResourceName;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.eclipse.core.runtime.IConfigurationElement;
|
import org.eclipse.core.runtime.IConfigurationElement;
|
||||||
import org.eclipse.core.runtime.IExtension;
|
import org.eclipse.core.runtime.IExtension;
|
||||||
|
@ -19,6 +18,7 @@ import org.eclipse.swt.graphics.RGB;
|
||||||
|
|
||||||
import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle;
|
import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
@ -34,7 +34,7 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
* 01/15/12 #606 Greg Hull add resource parameters
|
* 01/15/12 #606 Greg Hull add resource parameters
|
||||||
* 04/19/12 #606 Greg Hull add attributeName attribute for resource parameters
|
* 04/19/12 #606 Greg Hull add attributeName attribute for resource parameters
|
||||||
* 04/23/12 #606 Greg Hull add ConditionalFilter as a shortcut for the classname.
|
* 04/23/12 #606 Greg Hull add ConditionalFilter as a shortcut for the classname.
|
||||||
*
|
* - - S.Gurung Code formatter changes only
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author
|
* @author
|
||||||
|
@ -44,29 +44,44 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
public class ResourceExtPointMngr {
|
public class ResourceExtPointMngr {
|
||||||
|
|
||||||
private static final String NC_RESOURCE_EXT = "gov.noaa.nws.ncep.viz.resources.NC-Resource";
|
private static final String NC_RESOURCE_EXT = "gov.noaa.nws.ncep.viz.resources.NC-Resource";
|
||||||
|
|
||||||
private static final String RESOURCE_NAME_TAG = "name";
|
private static final String RESOURCE_NAME_TAG = "name";
|
||||||
|
|
||||||
private static final String RESOURCE_CLASS_TAG = "class";
|
private static final String RESOURCE_CLASS_TAG = "class";
|
||||||
|
|
||||||
private static final String EDIT_DLG_CLASS_TAG = "editDialogClass";
|
private static final String EDIT_DLG_CLASS_TAG = "editDialogClass";
|
||||||
|
|
||||||
private static final String NC_RESOURCE_PARAMS_EXT = "gov.noaa.nws.ncep.viz.resources.NC-ResourceParameter";
|
private static final String NC_RESOURCE_PARAMS_EXT = "gov.noaa.nws.ncep.viz.resources.NC-ResourceParameter";
|
||||||
|
|
||||||
private static final String RESOURCE_NAME_REF_TAG = "ncResourceName";
|
private static final String RESOURCE_NAME_REF_TAG = "ncResourceName";
|
||||||
|
|
||||||
private static final String RSC_PARAM_ELEMENT_NAME = "nc-resourceParameter";
|
private static final String RSC_PARAM_ELEMENT_NAME = "nc-resourceParameter";
|
||||||
|
|
||||||
private static final String PARAM_TYPE_TAG = "paramType";
|
private static final String PARAM_TYPE_TAG = "paramType";
|
||||||
|
|
||||||
private static final String PARAM_NAME_TAG = "paramName";
|
private static final String PARAM_NAME_TAG = "paramName";
|
||||||
|
|
||||||
private static final String ATTR_NAME_TAG = "attributeName";
|
private static final String ATTR_NAME_TAG = "attributeName";
|
||||||
|
|
||||||
private static final String PARAM_CLASS_TAG = "paramClass";
|
private static final String PARAM_CLASS_TAG = "paramClass";
|
||||||
|
|
||||||
private static final String CONSTRAINT_NAME_TAG = "constraintName";
|
private static final String CONSTRAINT_NAME_TAG = "constraintName";
|
||||||
|
|
||||||
// private static final String PARAM_REF_LOC_TAG = "paramRefLocation";
|
// private static final String PARAM_REF_LOC_TAG = "paramRefLocation";
|
||||||
private static final String DFLT_VAL_TAG = "defaultValue";
|
private static final String DFLT_VAL_TAG = "defaultValue";
|
||||||
|
|
||||||
|
|
||||||
public static enum ResourceParamType {
|
public static enum ResourceParamType {
|
||||||
EDITABLE_ATTRIBUTE("EDITABLE_ATTRIBUTE"),
|
EDITABLE_ATTRIBUTE("EDITABLE_ATTRIBUTE"), IMPLEMENTATION_PARAM(
|
||||||
IMPLEMENTATION_PARAM("IMPLEMENTATION_PARAM"), // used to instantiate the ResourceImplementation
|
"IMPLEMENTATION_PARAM"), // used to instantiate the
|
||||||
REQUEST_CONSTRAINT("REQUEST_CONSTRAINT"), // instantiates a Resource Implementation and also used as a request constraint
|
// ResourceImplementation
|
||||||
|
REQUEST_CONSTRAINT("REQUEST_CONSTRAINT"), // instantiates a Resource
|
||||||
|
// Implementation and also
|
||||||
|
// used as a request
|
||||||
|
// constraint
|
||||||
NON_EDITABLE_ATTRIBUTE("NON_EDITABLE_ATTRIBUTE");
|
NON_EDITABLE_ATTRIBUTE("NON_EDITABLE_ATTRIBUTE");
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
private ResourceParamType(String n) {
|
private ResourceParamType(String n) {
|
||||||
name = n;
|
name = n;
|
||||||
}
|
}
|
||||||
|
@ -74,14 +89,11 @@ public class ResourceExtPointMngr {
|
||||||
public static ResourceParamType getResourceParamType(String n) {
|
public static ResourceParamType getResourceParamType(String n) {
|
||||||
if (n.equalsIgnoreCase(REQUEST_CONSTRAINT.name)) {
|
if (n.equalsIgnoreCase(REQUEST_CONSTRAINT.name)) {
|
||||||
return REQUEST_CONSTRAINT;
|
return REQUEST_CONSTRAINT;
|
||||||
}
|
} else if (n.equalsIgnoreCase(EDITABLE_ATTRIBUTE.name)) {
|
||||||
else if( n.equalsIgnoreCase( EDITABLE_ATTRIBUTE.name ) ) {
|
|
||||||
return EDITABLE_ATTRIBUTE;
|
return EDITABLE_ATTRIBUTE;
|
||||||
}
|
} else if (n.equalsIgnoreCase(NON_EDITABLE_ATTRIBUTE.name)) {
|
||||||
else if( n.equalsIgnoreCase( NON_EDITABLE_ATTRIBUTE.name ) ) {
|
|
||||||
return NON_EDITABLE_ATTRIBUTE;
|
return NON_EDITABLE_ATTRIBUTE;
|
||||||
}
|
} else if (n.equalsIgnoreCase(IMPLEMENTATION_PARAM.name)) {
|
||||||
else if( n.equalsIgnoreCase( IMPLEMENTATION_PARAM.name ) ) {
|
|
||||||
return IMPLEMENTATION_PARAM;
|
return IMPLEMENTATION_PARAM;
|
||||||
}
|
}
|
||||||
return IMPLEMENTATION_PARAM;
|
return IMPLEMENTATION_PARAM;
|
||||||
|
@ -90,21 +102,28 @@ public class ResourceExtPointMngr {
|
||||||
|
|
||||||
public static class ResourceParamInfo {
|
public static class ResourceParamInfo {
|
||||||
private String paramName;
|
private String paramName;
|
||||||
private String constraintName; // usually the same as the paramName except for
|
|
||||||
|
private String constraintName; // usually the same as the paramName
|
||||||
|
// except for
|
||||||
// GDFILE which is modelName
|
// GDFILE which is modelName
|
||||||
|
|
||||||
// the name of the member variable in the java resourceData class.
|
// the name of the member variable in the java resourceData class.
|
||||||
// This will default to the paramName which will be the case for everything
|
// This will default to the paramName which will be the case for
|
||||||
|
// everything
|
||||||
// except the Grid resource which will be the same except lower case.
|
// except the Grid resource which will be the same except lower case.
|
||||||
//
|
//
|
||||||
private String attributeName;
|
private String attributeName;
|
||||||
|
|
||||||
private Class<?> paramClass;
|
private Class<?> paramClass;
|
||||||
|
|
||||||
private ResourceParamType paramType;
|
private ResourceParamType paramType;
|
||||||
|
|
||||||
private String dfltVal; // not implemented
|
private String dfltVal; // not implemented
|
||||||
|
|
||||||
// private String paramRefLocation; // for ref'd colorBars
|
// private String paramRefLocation; // for ref'd colorBars
|
||||||
|
|
||||||
ResourceParamInfo( String n, String c, String a, Class<?> clz, ResourceParamType ptype,
|
ResourceParamInfo(String n, String c, String a, Class<?> clz,
|
||||||
String dval ) { //, String prmRefLoc) {
|
ResourceParamType ptype, String dval) { // , String prmRefLoc) {
|
||||||
paramName = n;
|
paramName = n;
|
||||||
constraintName = c;
|
constraintName = c;
|
||||||
attributeName = a;
|
attributeName = a;
|
||||||
|
@ -113,30 +132,37 @@ public class ResourceExtPointMngr {
|
||||||
dfltVal = dval;
|
dfltVal = dval;
|
||||||
// paramRefLocation = prmRefLoc;
|
// paramRefLocation = prmRefLoc;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getParamName() {
|
public String getParamName() {
|
||||||
return paramName;
|
return paramName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getConstraintName() {
|
public String getConstraintName() {
|
||||||
return constraintName;
|
return constraintName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAttributeName() {
|
public String getAttributeName() {
|
||||||
return attributeName;
|
return attributeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Class<?> getParamClass() {
|
public Class<?> getParamClass() {
|
||||||
return paramClass;
|
return paramClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResourceParamType getParamType() {
|
public ResourceParamType getParamType() {
|
||||||
return paramType;
|
return paramType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDefaultValue() {
|
public String getDefaultValue() {
|
||||||
return dfltVal;
|
return dfltVal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static class ResourceExtPointInfo {
|
private static class ResourceExtPointInfo {
|
||||||
String rscName; //
|
String rscName; //
|
||||||
|
|
||||||
Class<?> rscDataClass;
|
Class<?> rscDataClass;
|
||||||
|
|
||||||
Class<?> rscDialogClass;
|
Class<?> rscDialogClass;
|
||||||
|
|
||||||
HashMap<String, ResourceParamInfo> rscParameters = null;
|
HashMap<String, ResourceParamInfo> rscParameters = null;
|
||||||
|
@ -149,16 +175,22 @@ public class ResourceExtPointMngr {
|
||||||
}
|
}
|
||||||
|
|
||||||
void addParameter(String prmName, String cName, String aName,
|
void addParameter(String prmName, String cName, String aName,
|
||||||
Class<?> prmClass, ResourceParamType pType, String dflt) { // , Object dfltVal ) {
|
Class<?> prmClass, ResourceParamType pType, String dflt) { // ,
|
||||||
|
// Object
|
||||||
|
// dfltVal
|
||||||
|
// )
|
||||||
|
// {
|
||||||
|
|
||||||
rscParameters.put( prmName,
|
rscParameters.put(prmName, new ResourceParamInfo(prmName, cName,
|
||||||
new ResourceParamInfo( prmName, cName, aName, prmClass, pType, dflt ) );
|
aName, prmClass, pType, dflt));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// map from the resource name to the resource info containing the rscData class,
|
// map from the resource name to the resource info containing the rscData
|
||||||
// the class that implements the edit dialog and a list of attributes from the
|
// class,
|
||||||
|
// the class that implements the edit dialog and a list of attributes from
|
||||||
|
// the
|
||||||
// attribute extension points
|
// attribute extension points
|
||||||
//
|
//
|
||||||
static HashMap<String, ResourceExtPointInfo> rscExtPointInfoMap = null;
|
static HashMap<String, ResourceExtPointInfo> rscExtPointInfoMap = null;
|
||||||
|
@ -168,8 +200,7 @@ public class ResourceExtPointMngr {
|
||||||
public static ResourceExtPointMngr getInstance() {
|
public static ResourceExtPointMngr getInstance() {
|
||||||
if (instance == null) {
|
if (instance == null) {
|
||||||
instance = new ResourceExtPointMngr();
|
instance = new ResourceExtPointMngr();
|
||||||
}
|
} else if (instance.rscExtPointInfoMap.size() == 0) {
|
||||||
else if( instance.rscExtPointInfoMap.size() == 0 ) {
|
|
||||||
instance = new ResourceExtPointMngr();
|
instance = new ResourceExtPointMngr();
|
||||||
}
|
}
|
||||||
return instance;
|
return instance;
|
||||||
|
@ -188,25 +219,30 @@ public class ResourceExtPointMngr {
|
||||||
IExtensionPoint extPoint = registry.getExtensionPoint(NC_RESOURCE_EXT);
|
IExtensionPoint extPoint = registry.getExtensionPoint(NC_RESOURCE_EXT);
|
||||||
|
|
||||||
if (extPoint == null) {
|
if (extPoint == null) {
|
||||||
System.out.println("Unable to get Extension Point : " + NC_RESOURCE_EXT );
|
System.out.println("Unable to get Extension Point : "
|
||||||
|
+ NC_RESOURCE_EXT);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
IExtension[] extensions = extPoint.getExtensions();
|
IExtension[] extensions = extPoint.getExtensions();
|
||||||
|
|
||||||
for (int i = 0; i < extensions.length; i++) {
|
for (int i = 0; i < extensions.length; i++) {
|
||||||
IConfigurationElement[] config = extensions[i].getConfigurationElements();
|
IConfigurationElement[] config = extensions[i]
|
||||||
|
.getConfigurationElements();
|
||||||
|
|
||||||
for (int j = 0; j < config.length; j++) {
|
for (int j = 0; j < config.length; j++) {
|
||||||
String rscName = config[j].getAttribute(RESOURCE_NAME_TAG);
|
String rscName = config[j].getAttribute(RESOURCE_NAME_TAG);
|
||||||
String rscClassName = config[j].getAttribute(RESOURCE_CLASS_TAG);
|
String rscClassName = config[j]
|
||||||
String editDlgClassName = config[j].getAttribute(EDIT_DLG_CLASS_TAG);
|
.getAttribute(RESOURCE_CLASS_TAG);
|
||||||
|
String editDlgClassName = config[j]
|
||||||
|
.getAttribute(EDIT_DLG_CLASS_TAG);
|
||||||
|
|
||||||
if (rscClassName == null) {
|
if (rscClassName == null) {
|
||||||
System.out.println(" " + rscClassName);
|
System.out.println(" " + rscClassName);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// for now this is optional since we can have NC resources that do not have
|
// for now this is optional since we can have NC resources that
|
||||||
|
// do not have
|
||||||
// editable attributes.
|
// editable attributes.
|
||||||
if (editDlgClassName == null) {
|
if (editDlgClassName == null) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -221,46 +257,56 @@ public class ResourceExtPointMngr {
|
||||||
rscClass = Class.forName(rscClassName);
|
rscClass = Class.forName(rscClassName);
|
||||||
editDlgClass = Class.forName(editDlgClassName);
|
editDlgClass = Class.forName(editDlgClassName);
|
||||||
|
|
||||||
rscExtPointInfoMap.put( rscName,
|
rscExtPointInfoMap.put(rscName, new ResourceExtPointInfo(
|
||||||
new ResourceExtPointInfo( rscName, rscClass, editDlgClass ) );
|
rscName, rscClass, editDlgClass));
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
System.out.println("Unable to load class "+rscClassName +" or "+ editDlgClassName );
|
System.out.println("Unable to load class " + rscClassName
|
||||||
|
+ " or " + editDlgClassName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// init the resourceAttrsMap from the NC-ResourceAttributes ext point
|
// init the resourceAttrsMap from the NC-ResourceAttributes ext point
|
||||||
private static void readResourceParameterssExtPoint() {
|
private static void readResourceParameterssExtPoint() {
|
||||||
|
|
||||||
IExtensionRegistry registry = Platform.getExtensionRegistry();
|
IExtensionRegistry registry = Platform.getExtensionRegistry();
|
||||||
IExtensionPoint extPoint = registry.getExtensionPoint( NC_RESOURCE_PARAMS_EXT );
|
IExtensionPoint extPoint = registry
|
||||||
|
.getExtensionPoint(NC_RESOURCE_PARAMS_EXT);
|
||||||
|
|
||||||
if (extPoint == null) {
|
if (extPoint == null) {
|
||||||
System.out.println("Unable to get Extension Point : "+ NC_RESOURCE_PARAMS_EXT );
|
System.out.println("Unable to get Extension Point : "
|
||||||
|
+ NC_RESOURCE_PARAMS_EXT);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
IExtension[] extensions = extPoint.getExtensions();
|
IExtension[] extensions = extPoint.getExtensions();
|
||||||
|
|
||||||
for (int i = 0; i < extensions.length; i++) {
|
for (int i = 0; i < extensions.length; i++) {
|
||||||
IConfigurationElement[] config = extensions[i].getConfigurationElements();
|
IConfigurationElement[] config = extensions[i]
|
||||||
|
.getConfigurationElements();
|
||||||
|
|
||||||
for (int j = 0; j < config.length; j++) {
|
for (int j = 0; j < config.length; j++) {
|
||||||
if( config[j].getName().equalsIgnoreCase( RSC_PARAM_ELEMENT_NAME ) ) {
|
if (config[j].getName()
|
||||||
String rscName = config[j].getAttribute(RESOURCE_NAME_REF_TAG);
|
.equalsIgnoreCase(RSC_PARAM_ELEMENT_NAME)) {
|
||||||
|
String rscName = config[j]
|
||||||
|
.getAttribute(RESOURCE_NAME_REF_TAG);
|
||||||
String prmName = config[j].getAttribute(PARAM_NAME_TAG);
|
String prmName = config[j].getAttribute(PARAM_NAME_TAG);
|
||||||
String attrName = config[j].getAttribute(ATTR_NAME_TAG);
|
String attrName = config[j].getAttribute(ATTR_NAME_TAG);
|
||||||
String prmClassName = config[j].getAttribute(PARAM_CLASS_TAG);
|
String prmClassName = config[j]
|
||||||
String constraintName = config[j].getAttribute(CONSTRAINT_NAME_TAG);
|
.getAttribute(PARAM_CLASS_TAG);
|
||||||
|
String constraintName = config[j]
|
||||||
|
.getAttribute(CONSTRAINT_NAME_TAG);
|
||||||
String prmType = config[j].getAttribute(PARAM_TYPE_TAG);
|
String prmType = config[j].getAttribute(PARAM_TYPE_TAG);
|
||||||
String dfltVal = config[j].getAttribute(DFLT_VAL_TAG);
|
String dfltVal = config[j].getAttribute(DFLT_VAL_TAG);
|
||||||
// String refLoc = config[j].getAttribute(PARAM_REF_LOC_TAG);
|
// String refLoc =
|
||||||
|
// config[j].getAttribute(PARAM_REF_LOC_TAG);
|
||||||
|
|
||||||
// sanity check ; these are required
|
// sanity check ; these are required
|
||||||
if( rscName == null || prmName == null || prmClassName == null || prmType == null) {
|
if (rscName == null || prmName == null
|
||||||
System.out.println( "Invalid Extension of Ext Point: "+ NC_RESOURCE_PARAMS_EXT );
|
|| prmClassName == null || prmType == null) {
|
||||||
|
System.out.println("Invalid Extension of Ext Point: "
|
||||||
|
+ NC_RESOURCE_PARAMS_EXT);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -271,8 +317,10 @@ public class ResourceExtPointMngr {
|
||||||
ResourceExtPointInfo repi = rscExtPointInfoMap.get(rscName);
|
ResourceExtPointInfo repi = rscExtPointInfoMap.get(rscName);
|
||||||
|
|
||||||
if (repi == null) {
|
if (repi == null) {
|
||||||
System.out.println("Error reading "+NC_RESOURCE_PARAMS_EXT + " Ext Point: The Resource " +
|
System.out.println("Error reading "
|
||||||
rscName + " is not defined." );
|
+ NC_RESOURCE_PARAMS_EXT
|
||||||
|
+ " Ext Point: The Resource " + rscName
|
||||||
|
+ " is not defined.");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -280,8 +328,10 @@ public class ResourceExtPointMngr {
|
||||||
constraintName = prmName;
|
constraintName = prmName;
|
||||||
}
|
}
|
||||||
|
|
||||||
// this only exists for Grids where the parameter name is upper case
|
// this only exists for Grids where the parameter name is
|
||||||
// and the attribute name (ie the name of the member variable in the
|
// upper case
|
||||||
|
// and the attribute name (ie the name of the member
|
||||||
|
// variable in the
|
||||||
// java class) is lowercase
|
// java class) is lowercase
|
||||||
//
|
//
|
||||||
if (attrName == null) {
|
if (attrName == null) {
|
||||||
|
@ -289,12 +339,14 @@ public class ResourceExtPointMngr {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
Class<?> rscPrmClass = Class.forName(prmClassName);
|
Class<?> rscPrmClass = Class.forName(prmClassName);
|
||||||
ResourceParamType rscPrmType = ResourceParamType.getResourceParamType( prmType );
|
ResourceParamType rscPrmType = ResourceParamType
|
||||||
|
.getResourceParamType(prmType);
|
||||||
|
|
||||||
repi.addParameter(prmName, constraintName, attrName,
|
repi.addParameter(prmName, constraintName, attrName,
|
||||||
rscPrmClass, rscPrmType, dfltVal);
|
rscPrmClass, rscPrmType, dfltVal);
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
System.out.println("Unable to load class: "+prmClassName );
|
System.out.println("Unable to load class: "
|
||||||
|
+ prmClassName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -308,13 +360,13 @@ public class ResourceExtPointMngr {
|
||||||
|
|
||||||
// if( rscCfgMngr == null ) {
|
// if( rscCfgMngr == null ) {
|
||||||
try {
|
try {
|
||||||
rscImplName = ResourceDefnsMngr.getInstance().getResourceImplementation( rscName.getRscType() );
|
rscImplName = ResourceDefnsMngr.getInstance()
|
||||||
|
.getResourceImplementation(rscName.getRscType());
|
||||||
} catch (VizException e) {
|
} catch (VizException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
ResourceExtPointInfo repi = rscExtPointInfoMap.get(rscImplName);
|
ResourceExtPointInfo repi = rscExtPointInfoMap.get(rscImplName);
|
||||||
|
|
||||||
return (repi == null ? null : repi.rscDialogClass);
|
return (repi == null ? null : repi.rscDialogClass);
|
||||||
|
@ -361,12 +413,14 @@ public class ResourceExtPointMngr {
|
||||||
// return ( repi == null ? null : repi.rscName );
|
// return ( repi == null ? null : repi.rscName );
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// public HashMap<String,ResourceAttrInfo> getResourceAttributes( ResourceName rscName ) {
|
// public HashMap<String,ResourceAttrInfo> getResourceAttributes(
|
||||||
|
// ResourceName rscName ) {
|
||||||
// String rscImplName = null;
|
// String rscImplName = null;
|
||||||
//
|
//
|
||||||
// // if( rscCfgMngr == null ) {
|
// // if( rscCfgMngr == null ) {
|
||||||
// try {
|
// try {
|
||||||
// rscImplName = ResourceDefnsMngr.getInstance().getResourceImplementation( rscName.getRscType() );
|
// rscImplName = ResourceDefnsMngr.getInstance().getResourceImplementation(
|
||||||
|
// rscName.getRscType() );
|
||||||
// } catch (VizException e) {
|
// } catch (VizException e) {
|
||||||
// e.printStackTrace();
|
// e.printStackTrace();
|
||||||
// }
|
// }
|
||||||
|
@ -377,9 +431,11 @@ public class ResourceExtPointMngr {
|
||||||
// return ( repi == null ? null : repi.rscAttributes );
|
// return ( repi == null ? null : repi.rscAttributes );
|
||||||
// }
|
// }
|
||||||
|
|
||||||
public HashMap<String,ResourceParamInfo> getParameterInfoForRscImplementation( ResourceName rscName ) {
|
public HashMap<String, ResourceParamInfo> getParameterInfoForRscImplementation(
|
||||||
|
ResourceName rscName) {
|
||||||
try {
|
try {
|
||||||
String rscImpl = ResourceDefnsMngr.getInstance().getResourceImplementation( rscName.getRscType() );
|
String rscImpl = ResourceDefnsMngr.getInstance()
|
||||||
|
.getResourceImplementation(rscName.getRscType());
|
||||||
|
|
||||||
return getResourceParameters(rscImpl);
|
return getResourceParameters(rscImpl);
|
||||||
} catch (VizException e) {
|
} catch (VizException e) {
|
||||||
|
@ -388,7 +444,8 @@ public class ResourceExtPointMngr {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public HashMap<String,ResourceParamInfo> getResourceParameters( String rscImpl ) {
|
public HashMap<String, ResourceParamInfo> getResourceParameters(
|
||||||
|
String rscImpl) {
|
||||||
ResourceExtPointInfo repi = rscExtPointInfoMap.get(rscImpl);
|
ResourceExtPointInfo repi = rscExtPointInfoMap.get(rscImpl);
|
||||||
return (repi == null ? null : repi.rscParameters);
|
return (repi == null ? null : repi.rscParameters);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,8 @@ import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import javax.measure.converter.ConversionException;
|
import javax.measure.converter.ConversionException;
|
||||||
|
|
||||||
|
@ -119,6 +121,7 @@ import com.sun.jna.ptr.IntByReference;
|
||||||
* 11/2013 845 T. Lee Implemented parameter scaling
|
* 11/2013 845 T. Lee Implemented parameter scaling
|
||||||
* 04/11/2014 981 D.Sushon Code cleanup, enforce explicit use of curly-brackets {}
|
* 04/11/2014 981 D.Sushon Code cleanup, enforce explicit use of curly-brackets {}
|
||||||
* 04/14/2014 S. Gilbert Remove dataUri from query - cleanup old unused methods.
|
* 04/14/2014 S. Gilbert Remove dataUri from query - cleanup old unused methods.
|
||||||
|
* 07/2014 T. Lee Fixed specific humidity scaling for NAM
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author tlee
|
* @author tlee
|
||||||
|
@ -1334,7 +1337,7 @@ public class Dgdriv {
|
||||||
outGridFlipped[kk] = -9999.0f;
|
outGridFlipped[kk] = -9999.0f;
|
||||||
kk++;
|
kk++;
|
||||||
} else {
|
} else {
|
||||||
outGridFlipped[kk] = inGrid[ii] / scale_parm;
|
outGridFlipped[kk] = inGrid[ii];
|
||||||
kk++;
|
kk++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1354,7 +1357,7 @@ public class Dgdriv {
|
||||||
if (inGrid[ii] < -900000.0) {
|
if (inGrid[ii] < -900000.0) {
|
||||||
outGridFlipped[ii] = -9999.0f;
|
outGridFlipped[ii] = -9999.0f;
|
||||||
} else {
|
} else {
|
||||||
outGridFlipped[ii] = inGrid[ii] / scale_parm;
|
outGridFlipped[ii] = inGrid[ii];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1405,8 +1408,6 @@ public class Dgdriv {
|
||||||
return outGridFlopped;
|
return outGridFlopped;
|
||||||
}
|
}
|
||||||
|
|
||||||
int scale_parm = 1;
|
|
||||||
|
|
||||||
private float[] retrieveDataFromRetriever(String dataURI)
|
private float[] retrieveDataFromRetriever(String dataURI)
|
||||||
throws VizException {
|
throws VizException {
|
||||||
|
|
||||||
|
@ -1425,8 +1426,6 @@ public class Dgdriv {
|
||||||
try {
|
try {
|
||||||
String gempakParm = cacheData.getGempakParam(dataURI);
|
String gempakParm = cacheData.getGempakParam(dataURI);
|
||||||
if (gempakParm != null) {
|
if (gempakParm != null) {
|
||||||
scale_parm = (int) Math.pow(10,
|
|
||||||
gempakParmInfo.getParmScale(gempakParm));
|
|
||||||
dataRetriever.setUnit(UnitConv.deserializer(gempakParmInfo
|
dataRetriever.setUnit(UnitConv.deserializer(gempakParmInfo
|
||||||
.getParmUnit(gempakParm)));
|
.getParmUnit(gempakParm)));
|
||||||
}
|
}
|
||||||
|
@ -1750,8 +1749,8 @@ public class Dgdriv {
|
||||||
String modelName = parms[0];
|
String modelName = parms[0];
|
||||||
String dbTag = parms[1];
|
String dbTag = parms[1];
|
||||||
String eventName = parms[2];
|
String eventName = parms[2];
|
||||||
// String tmStr = constructTimeStr(parms[3]);
|
String tmStr = constructTimeStr(parms[3]);
|
||||||
DataTime dtime = constructDataTime(parms[3]);
|
Pattern p = Pattern.compile(tmStr);
|
||||||
|
|
||||||
// logger.info("executeScript:modelname=" + modelName + " dbTag=" +dbTag
|
// logger.info("executeScript:modelname=" + modelName + " dbTag=" +dbTag
|
||||||
// + " eventName="+eventName + " time=" + tmStr);
|
// + " eventName="+eventName + " time=" + tmStr);
|
||||||
|
@ -1765,9 +1764,15 @@ public class Dgdriv {
|
||||||
eventName, ConstraintType.EQUALS));
|
eventName, ConstraintType.EQUALS));
|
||||||
}
|
}
|
||||||
|
|
||||||
rcMap.put(GridDBConstants.DATA_TIME_QUERY,
|
try {
|
||||||
new RequestConstraint(dtime.getURIString(),
|
String gempakTimeStrFFF = parms[3].split("f")[1];
|
||||||
|
int fhr = Integer.parseInt(gempakTimeStrFFF) * 3600;
|
||||||
|
rcMap.put(GridDBConstants.FORECAST_TIME_QUERY,
|
||||||
|
new RequestConstraint(Integer.toString(fhr),
|
||||||
ConstraintType.EQUALS));
|
ConstraintType.EQUALS));
|
||||||
|
} catch (NumberFormatException e1) {
|
||||||
|
// Don't worry if fcsthr not specified. we'll get em all
|
||||||
|
}
|
||||||
|
|
||||||
DbQueryRequest request = new DbQueryRequest();
|
DbQueryRequest request = new DbQueryRequest();
|
||||||
request.addRequestField(GridDBConstants.REF_TIME_QUERY);
|
request.addRequestField(GridDBConstants.REF_TIME_QUERY);
|
||||||
|
@ -1775,6 +1780,8 @@ public class Dgdriv {
|
||||||
request.setDistinct(true);
|
request.setDistinct(true);
|
||||||
request.setConstraints(rcMap);
|
request.setConstraints(rcMap);
|
||||||
|
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHH");
|
||||||
|
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
|
||||||
String retFileNames = "";
|
String retFileNames = "";
|
||||||
try {
|
try {
|
||||||
DbQueryResponse response = (DbQueryResponse) ThriftClient
|
DbQueryResponse response = (DbQueryResponse) ThriftClient
|
||||||
|
@ -1796,6 +1803,14 @@ public class Dgdriv {
|
||||||
GridDBConstants.REF_TIME_QUERY);
|
GridDBConstants.REF_TIME_QUERY);
|
||||||
if (fSecValue != null && fSecValue instanceof Integer
|
if (fSecValue != null && fSecValue instanceof Integer
|
||||||
&& refValue != null && refValue instanceof Date) {
|
&& refValue != null && refValue instanceof Date) {
|
||||||
|
|
||||||
|
String refString = sdf.format((Date) refValue);
|
||||||
|
logger.debug("executeScript: match " + refString);
|
||||||
|
logger.debug("executeScript: with " + tmStr);
|
||||||
|
Matcher m = p.matcher(refString);
|
||||||
|
if (!m.matches())
|
||||||
|
continue;
|
||||||
|
|
||||||
int fcstTimeInSec = ((Integer) fSecValue).intValue();
|
int fcstTimeInSec = ((Integer) fSecValue).intValue();
|
||||||
DataTime refTime = new DataTime((Date) refValue);
|
DataTime refTime = new DataTime((Date) refValue);
|
||||||
String[] dts = refTime.toString().split(" ");
|
String[] dts = refTime.toString().split(" ");
|
||||||
|
@ -1822,57 +1837,20 @@ public class Dgdriv {
|
||||||
return retFileNames;
|
return retFileNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
private String constructTimeStr(String gempakTimeStr) {
|
||||||
* Convert Gempak time string YYMMDD/HHMMfHHH to DataTime
|
String gempakTimeStrCycle = gempakTimeStr.split("f")[0];
|
||||||
*/
|
gempakTimeStrCycle = gempakTimeStrCycle.replace("[0-9]", ".");
|
||||||
private DataTime constructDataTime(String gempakTimeStr) {
|
if (gempakTimeStrCycle.length() < 10) {
|
||||||
|
return null;
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd/HH");
|
|
||||||
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
|
|
||||||
String[] times = gempakTimeStr.split("f");
|
|
||||||
|
|
||||||
DataTime dt;
|
|
||||||
|
|
||||||
try {
|
|
||||||
Date date = sdf.parse(times[0]);
|
|
||||||
int fcstTimeInSec = CommonDateFormatUtil
|
|
||||||
.getForecastTimeInSec(gempakTimeStr);
|
|
||||||
dt = new DataTime(date, fcstTimeInSec);
|
|
||||||
} catch (Exception e) {
|
|
||||||
dt = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return dt;
|
String timeStr = gempakTimeStrCycle.substring(0, 4)
|
||||||
|
+ gempakTimeStrCycle.substring(4, 6)
|
||||||
|
+ gempakTimeStrCycle.substring(6, 8)
|
||||||
|
+ gempakTimeStrCycle.substring(8, 10);
|
||||||
|
return timeStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// private String constructTimeStr(String gempakTimeStr) {
|
|
||||||
// String gempakTimeStrCycle = gempakTimeStr.split("f")[0];
|
|
||||||
// gempakTimeStrCycle = gempakTimeStrCycle.replace("[0-9]", "%");
|
|
||||||
// if (gempakTimeStrCycle.length() < 10) {
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// String gempakTimeStrFFF = gempakTimeStr.split("f")[1];
|
|
||||||
// gempakTimeStrFFF = gempakTimeStrFFF.replace("[0-9]", "%");
|
|
||||||
//
|
|
||||||
// String timeStr;
|
|
||||||
// try {
|
|
||||||
// int fhr = Integer.parseInt(gempakTimeStrFFF) / 3600;
|
|
||||||
//
|
|
||||||
// timeStr = gempakTimeStrCycle.substring(0, 4) + "-"
|
|
||||||
// + gempakTimeStrCycle.substring(4, 6) + "-"
|
|
||||||
// + gempakTimeStrCycle.substring(6, 8) + "_"
|
|
||||||
// + gempakTimeStrCycle.substring(8, 10) + "%_(" + fhr + ")%";
|
|
||||||
// } catch (NumberFormatException e) {
|
|
||||||
// timeStr = gempakTimeStrCycle.substring(0, 4) + "-"
|
|
||||||
// + gempakTimeStrCycle.substring(4, 6) + "-"
|
|
||||||
// + gempakTimeStrCycle.substring(6, 8) + "_"
|
|
||||||
// + gempakTimeStrCycle.substring(8, 10) + "%_("
|
|
||||||
// + gempakTimeStrFFF;
|
|
||||||
// }
|
|
||||||
// return timeStr;
|
|
||||||
// }
|
|
||||||
|
|
||||||
private String getDataURIFromAssembler(String parameters)
|
private String getDataURIFromAssembler(String parameters)
|
||||||
throws VizException {
|
throws VizException {
|
||||||
long t0 = System.currentTimeMillis();
|
long t0 = System.currentTimeMillis();
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
ncgm -- Computer Graphics Metafile interpreter and renderer
|
||||||
|
|
||||||
|
See also the other README.TXT, in sibling "jcgm" package.
|
||||||
|
|
||||||
|
This package contains classes which extend a limited subset of the classes
|
||||||
|
in the "jcgm" package.
|
||||||
|
|
||||||
|
(For more information about "jcgm", see: http://jcgm.sourceforge.net)
|
||||||
|
|
||||||
|
The key classes here are...
|
||||||
|
NcCGM (extends jcgm's CGM):
|
||||||
|
Builds (via NcCGM.read(DataInput)) and holds (as an ordered list
|
||||||
|
of "commands") a Java representation of a single CGM image.
|
||||||
|
NcCommand (extends jcgm's Command):
|
||||||
|
Builds (via *static* NcCommand.read(DataInput)) and returns
|
||||||
|
a single CGM command. The readCommand() method has been modified
|
||||||
|
from the jcgm original to "know" which commands have extensions
|
||||||
|
in ncgm, and to create them instead of the base jcgm versions.
|
||||||
|
INcCommand:
|
||||||
|
Interface whose implementation enables these ncgm extended
|
||||||
|
commands to know how to contribute themselves to an AWIPS II
|
||||||
|
image.
|
||||||
|
|
||||||
|
An AWIPS II image is constructed in an ImageBuilder object, by sequential
|
||||||
|
"execution" of these CGM commands.
|
||||||
|
|
||||||
|
We only extend the "jcgm" commands that are of interest to NTRANS. Any others
|
||||||
|
(if somehow encountered in an input metafile) will simply be ignored.
|
|
@ -72,7 +72,7 @@ import com.raytheon.viz.pointdata.PointDataRequest;
|
||||||
* 04/01/2014 1040 B. Hebbard In requestUpperAirData, (1) clear displayStationPlotBoolList for each new station, (2) call cond filter check with newInstance vs. metPrm
|
* 04/01/2014 1040 B. Hebbard In requestUpperAirData, (1) clear displayStationPlotBoolList for each new station, (2) call cond filter check with newInstance vs. metPrm
|
||||||
* 04/08/2014 1127 B. Hebbard In requestSurfaceData, exclude only those obs returned from HDF5 that don't match desired time; fix dataTime association;
|
* 04/08/2014 1127 B. Hebbard In requestSurfaceData, exclude only those obs returned from HDF5 that don't match desired time; fix dataTime association;
|
||||||
* removed redundant datatimes from constraint.
|
* removed redundant datatimes from constraint.
|
||||||
* 06/17/2014 932 S. Russell TTR 923, altered methods addToDerivedParamsList(), requestSurfaceData(), and newInstance()
|
* 06/17/2014 923 S. Russell TTR 923, altered methods addToDerivedParamsList(), requestSurfaceData(), and newInstance()
|
||||||
* 07/08/2014 TTR1028 B. Hebbard In requestSurfaceData() and requestUpperAirData(), prune out stations that already have all met params they need, to avoid unnecessary querying
|
* 07/08/2014 TTR1028 B. Hebbard In requestSurfaceData() and requestUpperAirData(), prune out stations that already have all met params they need, to avoid unnecessary querying
|
||||||
* 09/04/2014 1127 B. Hebbard Exempt forecast (e.g., MOS) datatimes from check in requestSurfaceData that sees if retrieved value matches desired time. This is because we retrieve only the refTime from HDF5 for comparison, which is sufficient for obs times, but not those with forecast component.
|
* 09/04/2014 1127 B. Hebbard Exempt forecast (e.g., MOS) datatimes from check in requestSurfaceData that sees if retrieved value matches desired time. This is because we retrieve only the refTime from HDF5 for comparison, which is sufficient for obs times, but not those with forecast component.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Reference in a new issue