Issue #628 committing PGEN code received from Plummer on 4-19-2012.
Former-commit-id:295cbf95e5
[formerly253e8bc948
[formerly 0816cd253c86acc699cb90866131619c4679f631]] Former-commit-id:253e8bc948
Former-commit-id:fda897d2d0
This commit is contained in:
parent
c50fc8b423
commit
1d576ac27d
390 changed files with 60043 additions and 62390 deletions
|
@ -81,4 +81,11 @@
|
|||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="gov.noaa.nws.ncep.gempak.parameters.core"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
</feature>
|
||||
|
|
|
@ -28,8 +28,7 @@ Require-Bundle: com.raytheon.uf.common.serialization;bundle-version="1.11.12",
|
|||
com.raytheon.uf.edex.pointdata;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.pointdata;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.status;bundle-version="1.12.1174"
|
||||
Import-Package: gov.noaa.nws.ncep.common.log.logger,
|
||||
gov.noaa.nws.ncep.common.tools,
|
||||
Import-Package: gov.noaa.nws.ncep.common.tools,
|
||||
javax.measure.converter,
|
||||
javax.measure.quantity,
|
||||
javax.measure.unit
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<available file="../../../../../build.edex"
|
||||
property="build.dir.location"
|
||||
value="../../../../../build.edex"/>
|
||||
<available file="../build.edex" property="build.dir.location" value="../build.edex" />
|
||||
|
||||
<import file="${build.dir.location}/basebuilds/component_deploy_base.xml" />
|
||||
</project>
|
||||
|
|
38
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/common/stationTables/IStationField.java
Executable file → Normal file
38
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/common/stationTables/IStationField.java
Executable file → Normal file
|
@ -1,19 +1,19 @@
|
|||
package gov.noaa.nws.ncep.edex.common.stationTables;
|
||||
|
||||
public interface IStationField {
|
||||
|
||||
public static enum StationField {
|
||||
STID, // station id
|
||||
STNM, // station number
|
||||
NAME, // station name
|
||||
ST, // state
|
||||
CO, // country
|
||||
//LAT, // latitude
|
||||
//LON, // longitude
|
||||
//ELV, // elevation
|
||||
//PRI, // priority
|
||||
WFO, // WFO
|
||||
LOC // location
|
||||
}
|
||||
|
||||
}
|
||||
package gov.noaa.nws.ncep.edex.common.stationTables;
|
||||
|
||||
public interface IStationField {
|
||||
|
||||
public static enum StationField {
|
||||
STID, // station id
|
||||
STNM, // station number
|
||||
NAME, // station name
|
||||
ST, // state
|
||||
CO, // country
|
||||
//LAT, // latitude
|
||||
//LON, // longitude
|
||||
//ELV, // elevation
|
||||
//PRI, // priority
|
||||
WFO, // WFO
|
||||
LOC // location
|
||||
}
|
||||
|
||||
}
|
||||
|
|
336
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/common/stationTables/ObjectFactory.java
Executable file → Normal file
336
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/common/stationTables/ObjectFactory.java
Executable file → Normal file
|
@ -1,168 +1,168 @@
|
|||
//
|
||||
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
|
||||
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
|
||||
// Any modifications to this file will be lost upon recompilation of the source schema.
|
||||
// Generated on: 2009.06.08 at 02:36:43 PM EDT
|
||||
//
|
||||
|
||||
|
||||
package gov.noaa.nws.ncep.edex.common.stationTables;
|
||||
|
||||
import javax.xml.bind.JAXBElement;
|
||||
import javax.xml.bind.annotation.XmlElementDecl;
|
||||
import javax.xml.bind.annotation.XmlRegistry;
|
||||
import javax.xml.namespace.QName;
|
||||
|
||||
|
||||
/**
|
||||
* This object contains factory methods for each
|
||||
* Java content interface and Java element interface
|
||||
* generated in the gov.noaa.nws.ncep.viz.common.stnTables package.
|
||||
* <p>An ObjectFactory allows you to programatically
|
||||
* construct new instances of the Java representation
|
||||
* for XML content. The Java representation of XML
|
||||
* content can consist of schema derived interfaces
|
||||
* and classes representing the binding of schema
|
||||
* type definitions, element declarations and model
|
||||
* groups. Factory methods for each of these are
|
||||
* provided in this class.
|
||||
*
|
||||
*/
|
||||
@XmlRegistry
|
||||
public class ObjectFactory {
|
||||
|
||||
private final static QName _Wfo_QNAME = new QName("", "wfo");
|
||||
private final static QName _Stid_QNAME = new QName("", "stid");
|
||||
private final static QName _Stnnum_QNAME = new QName("", "stnnum");
|
||||
private final static QName _Location_QNAME = new QName("", "location");
|
||||
private final static QName _Priority_QNAME = new QName("", "priority");
|
||||
private final static QName _Elevation_QNAME = new QName("", "elevation");
|
||||
private final static QName _State_QNAME = new QName("", "state");
|
||||
private final static QName _Longitude_QNAME = new QName("", "longitude");
|
||||
private final static QName _Stnname_QNAME = new QName("", "stnname");
|
||||
private final static QName _Latitude_QNAME = new QName("", "latitude");
|
||||
private final static QName _Country_QNAME = new QName("", "country");
|
||||
|
||||
/**
|
||||
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: gov.noaa.nws.ncep.viz.common.stnTables
|
||||
*
|
||||
*/
|
||||
public ObjectFactory() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link StationList }
|
||||
*
|
||||
*/
|
||||
public StationList createStationList() {
|
||||
return new StationList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link Station }
|
||||
*
|
||||
*/
|
||||
public Station createStation() {
|
||||
return new Station();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "wfo")
|
||||
public JAXBElement<String> createWfo(String value) {
|
||||
return new JAXBElement<String>(_Wfo_QNAME, String.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "stid")
|
||||
public JAXBElement<String> createStid(String value) {
|
||||
return new JAXBElement<String>(_Stid_QNAME, String.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "stnnum")
|
||||
public JAXBElement<String> createStnnum(String value) {
|
||||
return new JAXBElement<String>(_Stnnum_QNAME, String.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "location")
|
||||
public JAXBElement<String> createLocation(String value) {
|
||||
return new JAXBElement<String>(_Location_QNAME, String.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link Integer }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "priority")
|
||||
public JAXBElement<Integer> createPriority(Integer value) {
|
||||
return new JAXBElement<Integer>(_Priority_QNAME, Integer.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link Integer }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "elevation")
|
||||
public JAXBElement<Integer> createElevation(Integer value) {
|
||||
return new JAXBElement<Integer>(_Elevation_QNAME, Integer.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "state")
|
||||
public JAXBElement<String> createState(String value) {
|
||||
return new JAXBElement<String>(_State_QNAME, String.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link Float }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "longitude")
|
||||
public JAXBElement<Float> createLongitude(Float value) {
|
||||
return new JAXBElement<Float>(_Longitude_QNAME, Float.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "stnname")
|
||||
public JAXBElement<String> createStnname(String value) {
|
||||
return new JAXBElement<String>(_Stnname_QNAME, String.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link Float }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "latitude")
|
||||
public JAXBElement<Float> createLatitude(Float value) {
|
||||
return new JAXBElement<Float>(_Latitude_QNAME, Float.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "country")
|
||||
public JAXBElement<String> createCountry(String value) {
|
||||
return new JAXBElement<String>(_Country_QNAME, String.class, null, value);
|
||||
}
|
||||
|
||||
}
|
||||
//
|
||||
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
|
||||
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
|
||||
// Any modifications to this file will be lost upon recompilation of the source schema.
|
||||
// Generated on: 2009.06.08 at 02:36:43 PM EDT
|
||||
//
|
||||
|
||||
|
||||
package gov.noaa.nws.ncep.edex.common.stationTables;
|
||||
|
||||
import javax.xml.bind.JAXBElement;
|
||||
import javax.xml.bind.annotation.XmlElementDecl;
|
||||
import javax.xml.bind.annotation.XmlRegistry;
|
||||
import javax.xml.namespace.QName;
|
||||
|
||||
|
||||
/**
|
||||
* This object contains factory methods for each
|
||||
* Java content interface and Java element interface
|
||||
* generated in the gov.noaa.nws.ncep.viz.common.stnTables package.
|
||||
* <p>An ObjectFactory allows you to programatically
|
||||
* construct new instances of the Java representation
|
||||
* for XML content. The Java representation of XML
|
||||
* content can consist of schema derived interfaces
|
||||
* and classes representing the binding of schema
|
||||
* type definitions, element declarations and model
|
||||
* groups. Factory methods for each of these are
|
||||
* provided in this class.
|
||||
*
|
||||
*/
|
||||
@XmlRegistry
|
||||
public class ObjectFactory {
|
||||
|
||||
private final static QName _Wfo_QNAME = new QName("", "wfo");
|
||||
private final static QName _Stid_QNAME = new QName("", "stid");
|
||||
private final static QName _Stnnum_QNAME = new QName("", "stnnum");
|
||||
private final static QName _Location_QNAME = new QName("", "location");
|
||||
private final static QName _Priority_QNAME = new QName("", "priority");
|
||||
private final static QName _Elevation_QNAME = new QName("", "elevation");
|
||||
private final static QName _State_QNAME = new QName("", "state");
|
||||
private final static QName _Longitude_QNAME = new QName("", "longitude");
|
||||
private final static QName _Stnname_QNAME = new QName("", "stnname");
|
||||
private final static QName _Latitude_QNAME = new QName("", "latitude");
|
||||
private final static QName _Country_QNAME = new QName("", "country");
|
||||
|
||||
/**
|
||||
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: gov.noaa.nws.ncep.viz.common.stnTables
|
||||
*
|
||||
*/
|
||||
public ObjectFactory() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link StationList }
|
||||
*
|
||||
*/
|
||||
public StationList createStationList() {
|
||||
return new StationList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link Station }
|
||||
*
|
||||
*/
|
||||
public Station createStation() {
|
||||
return new Station();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "wfo")
|
||||
public JAXBElement<String> createWfo(String value) {
|
||||
return new JAXBElement<String>(_Wfo_QNAME, String.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "stid")
|
||||
public JAXBElement<String> createStid(String value) {
|
||||
return new JAXBElement<String>(_Stid_QNAME, String.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "stnnum")
|
||||
public JAXBElement<String> createStnnum(String value) {
|
||||
return new JAXBElement<String>(_Stnnum_QNAME, String.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "location")
|
||||
public JAXBElement<String> createLocation(String value) {
|
||||
return new JAXBElement<String>(_Location_QNAME, String.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link Integer }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "priority")
|
||||
public JAXBElement<Integer> createPriority(Integer value) {
|
||||
return new JAXBElement<Integer>(_Priority_QNAME, Integer.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link Integer }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "elevation")
|
||||
public JAXBElement<Integer> createElevation(Integer value) {
|
||||
return new JAXBElement<Integer>(_Elevation_QNAME, Integer.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "state")
|
||||
public JAXBElement<String> createState(String value) {
|
||||
return new JAXBElement<String>(_State_QNAME, String.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link Float }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "longitude")
|
||||
public JAXBElement<Float> createLongitude(Float value) {
|
||||
return new JAXBElement<Float>(_Longitude_QNAME, Float.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "stnname")
|
||||
public JAXBElement<String> createStnname(String value) {
|
||||
return new JAXBElement<String>(_Stnname_QNAME, String.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link Float }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "latitude")
|
||||
public JAXBElement<Float> createLatitude(Float value) {
|
||||
return new JAXBElement<Float>(_Latitude_QNAME, Float.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "country")
|
||||
public JAXBElement<String> createCountry(String value) {
|
||||
return new JAXBElement<String>(_Country_QNAME, String.class, null, value);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
678
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/common/stationTables/Station.java
Executable file → Normal file
678
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/common/stationTables/Station.java
Executable file → Normal file
|
@ -1,339 +1,339 @@
|
|||
//
|
||||
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
|
||||
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
|
||||
// Any modifications to this file will be lost upon recompilation of the source schema.
|
||||
// Generated on: 2009.06.08 at 02:36:43 PM EDT
|
||||
//
|
||||
|
||||
|
||||
package gov.noaa.nws.ncep.edex.common.stationTables;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for anonymous complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType>
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element ref="{}stid" minOccurs="0"/>
|
||||
* <element ref="{}stnnum" minOccurs="0"/>
|
||||
* <element ref="{}stnname" minOccurs="0"/>
|
||||
* <element ref="{}state" minOccurs="0"/>
|
||||
* <element ref="{}country" minOccurs="0"/>
|
||||
* <element ref="{}latitude" minOccurs="0"/>
|
||||
* <element ref="{}longitude" minOccurs="0"/>
|
||||
* <element ref="{}elevation" minOccurs="0"/>
|
||||
* <element ref="{}priority" minOccurs="0"/>
|
||||
* <element ref="{}location" minOccurs="0"/>
|
||||
* <element ref="{}wfo" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "", propOrder = {
|
||||
"stid",
|
||||
"stnnum",
|
||||
"stnname",
|
||||
"state",
|
||||
"country",
|
||||
"latitude",
|
||||
"longitude",
|
||||
"elevation",
|
||||
"priority",
|
||||
"location",
|
||||
"wfo"
|
||||
})
|
||||
@XmlRootElement(name = "station")
|
||||
public class Station {
|
||||
|
||||
protected String stid;
|
||||
protected String stnnum;
|
||||
protected String stnname;
|
||||
protected String state;
|
||||
protected String country;
|
||||
protected Float latitude;
|
||||
protected Float longitude;
|
||||
protected Integer elevation;
|
||||
protected Integer priority;
|
||||
protected String location;
|
||||
protected String wfo;
|
||||
|
||||
/**
|
||||
* Gets the value of the stid property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getStid() {
|
||||
return stid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the stid property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setStid(String value) {
|
||||
this.stid = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the stnnum property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getStnnum() {
|
||||
return stnnum;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the stnnum property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setStnnum(String value) {
|
||||
this.stnnum = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the stnname property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getStnname() {
|
||||
return stnname;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the stnname property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setStnname(String value) {
|
||||
this.stnname = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the state property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the state property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setState(String value) {
|
||||
this.state = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the country property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the country property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setCountry(String value) {
|
||||
this.country = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the latitude property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link Float }
|
||||
*
|
||||
*/
|
||||
public Float getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the latitude property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link Float }
|
||||
*
|
||||
*/
|
||||
public void setLatitude(Float value) {
|
||||
this.latitude = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the longitude property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link Float }
|
||||
*
|
||||
*/
|
||||
public Float getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the longitude property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link Float }
|
||||
*
|
||||
*/
|
||||
public void setLongitude(Float value) {
|
||||
this.longitude = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the elevation property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link Integer }
|
||||
*
|
||||
*/
|
||||
public Integer getElevation() {
|
||||
return elevation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the elevation property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link Integer }
|
||||
*
|
||||
*/
|
||||
public void setElevation(Integer value) {
|
||||
this.elevation = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the priority property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link Integer }
|
||||
*
|
||||
*/
|
||||
public Integer getPriority() {
|
||||
return priority;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the priority property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link Integer }
|
||||
*
|
||||
*/
|
||||
public void setPriority(Integer value) {
|
||||
this.priority = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the location property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the location property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setLocation(String value) {
|
||||
this.location = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the wfo property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getWfo() {
|
||||
return wfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the wfo property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setWfo(String value) {
|
||||
this.wfo = value;
|
||||
}
|
||||
|
||||
}
|
||||
//
|
||||
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
|
||||
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
|
||||
// Any modifications to this file will be lost upon recompilation of the source schema.
|
||||
// Generated on: 2009.06.08 at 02:36:43 PM EDT
|
||||
//
|
||||
|
||||
|
||||
package gov.noaa.nws.ncep.edex.common.stationTables;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for anonymous complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType>
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element ref="{}stid" minOccurs="0"/>
|
||||
* <element ref="{}stnnum" minOccurs="0"/>
|
||||
* <element ref="{}stnname" minOccurs="0"/>
|
||||
* <element ref="{}state" minOccurs="0"/>
|
||||
* <element ref="{}country" minOccurs="0"/>
|
||||
* <element ref="{}latitude" minOccurs="0"/>
|
||||
* <element ref="{}longitude" minOccurs="0"/>
|
||||
* <element ref="{}elevation" minOccurs="0"/>
|
||||
* <element ref="{}priority" minOccurs="0"/>
|
||||
* <element ref="{}location" minOccurs="0"/>
|
||||
* <element ref="{}wfo" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "", propOrder = {
|
||||
"stid",
|
||||
"stnnum",
|
||||
"stnname",
|
||||
"state",
|
||||
"country",
|
||||
"latitude",
|
||||
"longitude",
|
||||
"elevation",
|
||||
"priority",
|
||||
"location",
|
||||
"wfo"
|
||||
})
|
||||
@XmlRootElement(name = "station")
|
||||
public class Station {
|
||||
|
||||
protected String stid;
|
||||
protected String stnnum;
|
||||
protected String stnname;
|
||||
protected String state;
|
||||
protected String country;
|
||||
protected Float latitude;
|
||||
protected Float longitude;
|
||||
protected Integer elevation;
|
||||
protected Integer priority;
|
||||
protected String location;
|
||||
protected String wfo;
|
||||
|
||||
/**
|
||||
* Gets the value of the stid property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getStid() {
|
||||
return stid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the stid property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setStid(String value) {
|
||||
this.stid = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the stnnum property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getStnnum() {
|
||||
return stnnum;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the stnnum property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setStnnum(String value) {
|
||||
this.stnnum = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the stnname property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getStnname() {
|
||||
return stnname;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the stnname property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setStnname(String value) {
|
||||
this.stnname = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the state property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the state property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setState(String value) {
|
||||
this.state = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the country property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the country property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setCountry(String value) {
|
||||
this.country = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the latitude property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link Float }
|
||||
*
|
||||
*/
|
||||
public Float getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the latitude property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link Float }
|
||||
*
|
||||
*/
|
||||
public void setLatitude(Float value) {
|
||||
this.latitude = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the longitude property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link Float }
|
||||
*
|
||||
*/
|
||||
public Float getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the longitude property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link Float }
|
||||
*
|
||||
*/
|
||||
public void setLongitude(Float value) {
|
||||
this.longitude = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the elevation property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link Integer }
|
||||
*
|
||||
*/
|
||||
public Integer getElevation() {
|
||||
return elevation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the elevation property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link Integer }
|
||||
*
|
||||
*/
|
||||
public void setElevation(Integer value) {
|
||||
this.elevation = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the priority property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link Integer }
|
||||
*
|
||||
*/
|
||||
public Integer getPriority() {
|
||||
return priority;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the priority property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link Integer }
|
||||
*
|
||||
*/
|
||||
public void setPriority(Integer value) {
|
||||
this.priority = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the location property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the location property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setLocation(String value) {
|
||||
this.location = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the wfo property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getWfo() {
|
||||
return wfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the wfo property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setWfo(String value) {
|
||||
this.wfo = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
120
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/common/stationTables/StationComparator.java
Executable file → Normal file
120
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/common/stationTables/StationComparator.java
Executable file → Normal file
|
@ -1,61 +1,61 @@
|
|||
package gov.noaa.nws.ncep.edex.common.stationTables;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
/**
|
||||
* Comparator for Station fields.
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 06/09 134 M. Li Initial Creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mli
|
||||
* @version 1
|
||||
*/
|
||||
|
||||
public class StationComparator implements Comparator<Station>, IStationField {
|
||||
|
||||
private StationField field;
|
||||
|
||||
public StationComparator(StationField f) {
|
||||
this.field = f;
|
||||
}
|
||||
|
||||
public int compare(Station o1, Station o2) {
|
||||
switch (field) {
|
||||
case STID:
|
||||
return o1.getStid().compareToIgnoreCase(o2.getStid());
|
||||
case STNM:
|
||||
return o1.getStnnum().compareToIgnoreCase(o2.getStnnum());
|
||||
case NAME:
|
||||
return o1.getStnnum().compareToIgnoreCase(o2.getStnnum());
|
||||
case ST:
|
||||
return o1.getState().compareToIgnoreCase(o2.getState());
|
||||
case CO:
|
||||
return o1.getCountry().compareToIgnoreCase(o2.getCountry());
|
||||
/*
|
||||
case LAT:
|
||||
return o1.getLatitude().compareTo(o2.getLatitude());
|
||||
case LON:
|
||||
return o1.getLongitude().compareTo(o2.getLongitude());
|
||||
case ELV:
|
||||
return o1.getElevation() - o2.getElevation();
|
||||
case PRI:
|
||||
return o1.getPriority() - o2.getPriority();
|
||||
*/
|
||||
case WFO:
|
||||
return o1.getWfo().compareToIgnoreCase(o2.getWfo());
|
||||
case LOC:
|
||||
return o1.getLocation().compareToIgnoreCase(o2.getLocation());
|
||||
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
package gov.noaa.nws.ncep.edex.common.stationTables;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
/**
|
||||
* Comparator for Station fields.
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 06/09 134 M. Li Initial Creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mli
|
||||
* @version 1
|
||||
*/
|
||||
|
||||
public class StationComparator implements Comparator<Station>, IStationField {
|
||||
|
||||
private StationField field;
|
||||
|
||||
public StationComparator(StationField f) {
|
||||
this.field = f;
|
||||
}
|
||||
|
||||
public int compare(Station o1, Station o2) {
|
||||
switch (field) {
|
||||
case STID:
|
||||
return o1.getStid().compareToIgnoreCase(o2.getStid());
|
||||
case STNM:
|
||||
return o1.getStnnum().compareToIgnoreCase(o2.getStnnum());
|
||||
case NAME:
|
||||
return o1.getStnnum().compareToIgnoreCase(o2.getStnnum());
|
||||
case ST:
|
||||
return o1.getState().compareToIgnoreCase(o2.getState());
|
||||
case CO:
|
||||
return o1.getCountry().compareToIgnoreCase(o2.getCountry());
|
||||
/*
|
||||
case LAT:
|
||||
return o1.getLatitude().compareTo(o2.getLatitude());
|
||||
case LON:
|
||||
return o1.getLongitude().compareTo(o2.getLongitude());
|
||||
case ELV:
|
||||
return o1.getElevation() - o2.getElevation();
|
||||
case PRI:
|
||||
return o1.getPriority() - o2.getPriority();
|
||||
*/
|
||||
case WFO:
|
||||
return o1.getWfo().compareToIgnoreCase(o2.getWfo());
|
||||
case LOC:
|
||||
return o1.getLocation().compareToIgnoreCase(o2.getLocation());
|
||||
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
152
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/common/stationTables/StationList.java
Executable file → Normal file
152
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/common/stationTables/StationList.java
Executable file → Normal file
|
@ -1,76 +1,76 @@
|
|||
//
|
||||
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
|
||||
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
|
||||
// Any modifications to this file will be lost upon recompilation of the source schema.
|
||||
// Generated on: 2009.06.08 at 02:36:43 PM EDT
|
||||
//
|
||||
|
||||
|
||||
package gov.noaa.nws.ncep.edex.common.stationTables;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for anonymous complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType>
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element ref="{}station" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "", propOrder = {
|
||||
"station"
|
||||
})
|
||||
@XmlRootElement(name = "stationList")
|
||||
public class StationList {
|
||||
|
||||
protected List<Station> station;
|
||||
|
||||
/**
|
||||
* Gets the value of the station property.
|
||||
*
|
||||
* <p>
|
||||
* This accessor method returns a reference to the live list,
|
||||
* not a snapshot. Therefore any modification you make to the
|
||||
* returned list will be present inside the JAXB object.
|
||||
* This is why there is not a <CODE>set</CODE> method for the station property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getStation().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link Station }
|
||||
*
|
||||
*
|
||||
*/
|
||||
public List<Station> getStation() {
|
||||
if (station == null) {
|
||||
station = new ArrayList<Station>();
|
||||
}
|
||||
return this.station;
|
||||
}
|
||||
|
||||
}
|
||||
//
|
||||
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
|
||||
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
|
||||
// Any modifications to this file will be lost upon recompilation of the source schema.
|
||||
// Generated on: 2009.06.08 at 02:36:43 PM EDT
|
||||
//
|
||||
|
||||
|
||||
package gov.noaa.nws.ncep.edex.common.stationTables;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for anonymous complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType>
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element ref="{}station" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "", propOrder = {
|
||||
"station"
|
||||
})
|
||||
@XmlRootElement(name = "stationList")
|
||||
public class StationList {
|
||||
|
||||
protected List<Station> station;
|
||||
|
||||
/**
|
||||
* Gets the value of the station property.
|
||||
*
|
||||
* <p>
|
||||
* This accessor method returns a reference to the live list,
|
||||
* not a snapshot. Therefore any modification you make to the
|
||||
* returned list will be present inside the JAXB object.
|
||||
* This is why there is not a <CODE>set</CODE> method for the station property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getStation().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link Station }
|
||||
*
|
||||
*
|
||||
*/
|
||||
public List<Station> getStation() {
|
||||
if (station == null) {
|
||||
station = new ArrayList<Station>();
|
||||
}
|
||||
return this.station;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
410
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/common/stationTables/StationTable.java
Executable file → Normal file
410
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/common/stationTables/StationTable.java
Executable file → Normal file
|
@ -1,91 +1,91 @@
|
|||
package gov.noaa.nws.ncep.edex.common.stationTables;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
package gov.noaa.nws.ncep.edex.common.stationTables;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import javax.xml.bind.Unmarshaller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import javax.xml.bind.Unmarshaller;
|
||||
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
import com.vividsolutions.jts.geom.Envelope;
|
||||
import com.vividsolutions.jts.index.quadtree.Quadtree;
|
||||
import org.geotools.referencing.GeodeticCalculator;
|
||||
|
||||
/**
|
||||
* This class reads a station table from an xml file and contains a list of stations.
|
||||
* This class also provide general station search functions given station field, and
|
||||
* field value.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 06/09 ? B. Yin Initial Creation
|
||||
* 06/09 134 M. Li Add station search
|
||||
/**
|
||||
* This class reads a station table from an xml file and contains a list of stations.
|
||||
* This class also provide general station search functions given station field, and
|
||||
* field value.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 06/09 ? B. Yin Initial Creation
|
||||
* 06/09 134 M. Li Add station search
|
||||
* 10/09 39/87/114 L. Lin Make "last" as private StationField.
|
||||
* 12/09 159 B. Yin Add getNearestStation(...)
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bingfan
|
||||
* @version 1
|
||||
*/
|
||||
|
||||
public class StationTable implements IStationField {
|
||||
|
||||
private final String PACKAGE = "gov.noaa.nws.ncep.edex.common.stationTables";
|
||||
|
||||
private List<Station> stationList;
|
||||
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bingfan
|
||||
* @version 1
|
||||
*/
|
||||
|
||||
public class StationTable implements IStationField {
|
||||
|
||||
private final String PACKAGE = "gov.noaa.nws.ncep.edex.common.stationTables";
|
||||
|
||||
private List<Station> stationList;
|
||||
|
||||
private StationField last = null;
|
||||
|
||||
private Quadtree stTree = null;
|
||||
|
||||
private final double DIST = 1.0;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* @param tableFileName - full path of the xml table file
|
||||
*/
|
||||
public StationTable( String tableFileName ) {
|
||||
|
||||
try{
|
||||
stationList = readStationTable( tableFileName );
|
||||
}
|
||||
catch ( JAXBException exp ){
|
||||
stationList = null;
|
||||
exp.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads the contents of the input station table file
|
||||
* @param xmlFilename - full path of the xml table name
|
||||
* @return - a list of stations
|
||||
* @throws JAXBException
|
||||
*/
|
||||
private List<Station> readStationTable( String xmlFilename ) throws JAXBException{
|
||||
|
||||
File xmlFile = new File(xmlFilename);
|
||||
|
||||
JAXBContext context = JAXBContext.newInstance(
|
||||
PACKAGE);
|
||||
Unmarshaller unmarshaller = context.createUnmarshaller();
|
||||
StationList stns = null;
|
||||
|
||||
try {
|
||||
stns = (StationList)unmarshaller.unmarshal(
|
||||
new FileReader(xmlFile));
|
||||
List<Station> listOfItems = stns.getStation();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* @param tableFileName - full path of the xml table file
|
||||
*/
|
||||
public StationTable( String tableFileName ) {
|
||||
|
||||
try{
|
||||
stationList = readStationTable( tableFileName );
|
||||
}
|
||||
catch ( JAXBException exp ){
|
||||
stationList = null;
|
||||
exp.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads the contents of the input station table file
|
||||
* @param xmlFilename - full path of the xml table name
|
||||
* @return - a list of stations
|
||||
* @throws JAXBException
|
||||
*/
|
||||
private List<Station> readStationTable( String xmlFilename ) throws JAXBException{
|
||||
|
||||
File xmlFile = new File(xmlFilename);
|
||||
|
||||
JAXBContext context = JAXBContext.newInstance(
|
||||
PACKAGE);
|
||||
Unmarshaller unmarshaller = context.createUnmarshaller();
|
||||
StationList stns = null;
|
||||
|
||||
try {
|
||||
stns = (StationList)unmarshaller.unmarshal(
|
||||
new FileReader(xmlFile));
|
||||
List<Station> listOfItems = stns.getStation();
|
||||
|
||||
/*
|
||||
* save stations in a Quadtree for efficient spatial query
|
||||
|
@ -97,136 +97,136 @@ public class StationTable implements IStationField {
|
|||
stTree.insert(env, st);
|
||||
}
|
||||
|
||||
return listOfItems;
|
||||
|
||||
} catch (FileNotFoundException e1) {
|
||||
e1.printStackTrace();
|
||||
|
||||
} catch (NullPointerException e2) {
|
||||
e2.printStackTrace();
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the list of the stations
|
||||
* @return - the list of stations
|
||||
*/
|
||||
public List<Station> getStationList(){
|
||||
|
||||
return stationList;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Search a station given a field, and search key value.
|
||||
*
|
||||
* @param sf
|
||||
* @param key
|
||||
* @return Station
|
||||
*/
|
||||
public Station getStation(StationField sf, String key) {
|
||||
if (stationList == null || stationList.isEmpty()) return null;
|
||||
|
||||
StationComparator comparator = new StationComparator(sf);
|
||||
if (last == null || (last != null && last != sf )) {
|
||||
Collections.sort(stationList, comparator);
|
||||
last = sf;
|
||||
}
|
||||
|
||||
Station s = getComparedStation(sf, key);
|
||||
int index = Collections.binarySearch(stationList, s, comparator);
|
||||
|
||||
if (index >= 0){
|
||||
return stationList.get(index);
|
||||
} else
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Search station list given a field, and search key value.
|
||||
*
|
||||
* @param sf
|
||||
* @param key
|
||||
* @return Station
|
||||
*/
|
||||
public List<Station> getStations(StationField sf, String key) {
|
||||
if (stationList == null || stationList.isEmpty()) return null;
|
||||
|
||||
StationComparator comparator = new StationComparator(sf);
|
||||
if (last == null || (last != null && last != sf )) {
|
||||
Collections.sort(stationList, comparator);
|
||||
last = sf;
|
||||
}
|
||||
|
||||
List<Station> list = new ArrayList<Station>();
|
||||
|
||||
Station s = getComparedStation(sf, key);
|
||||
int index;
|
||||
while ((index = Collections.binarySearch(stationList, s, comparator)) >= 0) {
|
||||
list.add(stationList.get(index));
|
||||
stationList.remove(index);
|
||||
}
|
||||
|
||||
if (list.size() > 0) {
|
||||
for (Station st : list) {
|
||||
stationList.add(st);
|
||||
}
|
||||
|
||||
last = null;
|
||||
return list;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Station getComparedStation(StationField sf, String key){
|
||||
Station station = new Station();
|
||||
switch (sf) {
|
||||
case STID:
|
||||
station.setStid((String)key);
|
||||
break;
|
||||
case STNM:
|
||||
station.setStnnum((String)key);
|
||||
break;
|
||||
case NAME:
|
||||
station.setStnname((String)key);
|
||||
break;
|
||||
case ST:
|
||||
station.setState((String)key);
|
||||
break;
|
||||
case CO:
|
||||
station.setCountry((String)key);
|
||||
break;
|
||||
/*
|
||||
case LAT:
|
||||
station.setLatitude((Float)key);
|
||||
break;
|
||||
case LON:
|
||||
station.setLongitude((Float)key);
|
||||
break;
|
||||
case ELV:
|
||||
station.setElevation((Integer)key);
|
||||
break;
|
||||
case PRI:
|
||||
station.setPriority((Integer)key);
|
||||
break;
|
||||
*/
|
||||
case WFO:
|
||||
station.setWfo((String)key);
|
||||
break;
|
||||
case LOC:
|
||||
station.setLocation((String)key);
|
||||
break;
|
||||
}
|
||||
|
||||
return station;
|
||||
}
|
||||
|
||||
return listOfItems;
|
||||
|
||||
} catch (FileNotFoundException e1) {
|
||||
e1.printStackTrace();
|
||||
|
||||
} catch (NullPointerException e2) {
|
||||
e2.printStackTrace();
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the list of the stations
|
||||
* @return - the list of stations
|
||||
*/
|
||||
public List<Station> getStationList(){
|
||||
|
||||
return stationList;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Search a station given a field, and search key value.
|
||||
*
|
||||
* @param sf
|
||||
* @param key
|
||||
* @return Station
|
||||
*/
|
||||
public Station getStation(StationField sf, String key) {
|
||||
if (stationList == null || stationList.isEmpty()) return null;
|
||||
|
||||
StationComparator comparator = new StationComparator(sf);
|
||||
if (last == null || (last != null && last != sf )) {
|
||||
Collections.sort(stationList, comparator);
|
||||
last = sf;
|
||||
}
|
||||
|
||||
Station s = getComparedStation(sf, key);
|
||||
int index = Collections.binarySearch(stationList, s, comparator);
|
||||
|
||||
if (index >= 0){
|
||||
return stationList.get(index);
|
||||
} else
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Search station list given a field, and search key value.
|
||||
*
|
||||
* @param sf
|
||||
* @param key
|
||||
* @return Station
|
||||
*/
|
||||
public List<Station> getStations(StationField sf, String key) {
|
||||
if (stationList == null || stationList.isEmpty()) return null;
|
||||
|
||||
StationComparator comparator = new StationComparator(sf);
|
||||
if (last == null || (last != null && last != sf )) {
|
||||
Collections.sort(stationList, comparator);
|
||||
last = sf;
|
||||
}
|
||||
|
||||
List<Station> list = new ArrayList<Station>();
|
||||
|
||||
Station s = getComparedStation(sf, key);
|
||||
int index;
|
||||
while ((index = Collections.binarySearch(stationList, s, comparator)) >= 0) {
|
||||
list.add(stationList.get(index));
|
||||
stationList.remove(index);
|
||||
}
|
||||
|
||||
if (list.size() > 0) {
|
||||
for (Station st : list) {
|
||||
stationList.add(st);
|
||||
}
|
||||
|
||||
last = null;
|
||||
return list;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Station getComparedStation(StationField sf, String key){
|
||||
Station station = new Station();
|
||||
switch (sf) {
|
||||
case STID:
|
||||
station.setStid((String)key);
|
||||
break;
|
||||
case STNM:
|
||||
station.setStnnum((String)key);
|
||||
break;
|
||||
case NAME:
|
||||
station.setStnname((String)key);
|
||||
break;
|
||||
case ST:
|
||||
station.setState((String)key);
|
||||
break;
|
||||
case CO:
|
||||
station.setCountry((String)key);
|
||||
break;
|
||||
/*
|
||||
case LAT:
|
||||
station.setLatitude((Float)key);
|
||||
break;
|
||||
case LON:
|
||||
station.setLongitude((Float)key);
|
||||
break;
|
||||
case ELV:
|
||||
station.setElevation((Integer)key);
|
||||
break;
|
||||
case PRI:
|
||||
station.setPriority((Integer)key);
|
||||
break;
|
||||
*/
|
||||
case WFO:
|
||||
station.setWfo((String)key);
|
||||
break;
|
||||
case LOC:
|
||||
station.setLocation((String)key);
|
||||
break;
|
||||
}
|
||||
|
||||
return station;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the nearest station from the input location
|
||||
* @param loc
|
||||
|
|
156
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/locations/IdftLocs.java
Executable file → Normal file
156
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/locations/IdftLocs.java
Executable file → Normal file
|
@ -1,78 +1,78 @@
|
|||
//
|
||||
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
|
||||
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
|
||||
// Any modifications to this file will be lost upon recompilation of the source schema.
|
||||
// Generated on: 2009.05.05 at 04:38:50 PM EDT
|
||||
//
|
||||
|
||||
|
||||
package gov.noaa.nws.ncep.edex.locations;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for anonymous complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType>
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element ref="{}idftPoint" maxOccurs="unbounded"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "", propOrder = {
|
||||
"idftPoint"
|
||||
})
|
||||
@XmlRootElement(name = "idftLocs")
|
||||
public class IdftLocs {
|
||||
|
||||
@XmlElement(required = true)
|
||||
protected List<IdftPoint> idftPoint;
|
||||
|
||||
/**
|
||||
* Gets the value of the idftPoint property.
|
||||
*
|
||||
* <p>
|
||||
* This accessor method returns a reference to the live list,
|
||||
* not a snapshot. Therefore any modification you make to the
|
||||
* returned list will be present inside the JAXB object.
|
||||
* This is why there is not a <CODE>set</CODE> method for the idftPoint property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getIdftPoint().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link IdftPoint }
|
||||
*
|
||||
*
|
||||
*/
|
||||
public List<IdftPoint> getIdftPoint() {
|
||||
if (idftPoint == null) {
|
||||
idftPoint = new ArrayList<IdftPoint>();
|
||||
}
|
||||
return this.idftPoint;
|
||||
}
|
||||
|
||||
}
|
||||
//
|
||||
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
|
||||
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
|
||||
// Any modifications to this file will be lost upon recompilation of the source schema.
|
||||
// Generated on: 2009.05.05 at 04:38:50 PM EDT
|
||||
//
|
||||
|
||||
|
||||
package gov.noaa.nws.ncep.edex.locations;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for anonymous complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType>
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element ref="{}idftPoint" maxOccurs="unbounded"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "", propOrder = {
|
||||
"idftPoint"
|
||||
})
|
||||
@XmlRootElement(name = "idftLocs")
|
||||
public class IdftLocs {
|
||||
|
||||
@XmlElement(required = true)
|
||||
protected List<IdftPoint> idftPoint;
|
||||
|
||||
/**
|
||||
* Gets the value of the idftPoint property.
|
||||
*
|
||||
* <p>
|
||||
* This accessor method returns a reference to the live list,
|
||||
* not a snapshot. Therefore any modification you make to the
|
||||
* returned list will be present inside the JAXB object.
|
||||
* This is why there is not a <CODE>set</CODE> method for the idftPoint property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getIdftPoint().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link IdftPoint }
|
||||
*
|
||||
*
|
||||
*/
|
||||
public List<IdftPoint> getIdftPoint() {
|
||||
if (idftPoint == null) {
|
||||
idftPoint = new ArrayList<IdftPoint>();
|
||||
}
|
||||
return this.idftPoint;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
140
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/locations/IdftLocsTableReader.java
Executable file → Normal file
140
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/locations/IdftLocsTableReader.java
Executable file → Normal file
|
@ -1,71 +1,71 @@
|
|||
/**
|
||||
* This function reads the Idft Point Location Table from idftLoc.xml
|
||||
* and unmarshall it.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 14May2009 98 F. J. Yen Initial Creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author Fee Jing Yen, SIB
|
||||
* @version 1
|
||||
*/
|
||||
package gov.noaa.nws.ncep.edex.locations;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import javax.xml.bind.Unmarshaller;
|
||||
|
||||
public class IdftLocsTableReader {
|
||||
|
||||
|
||||
private final String PACKAGE = "gov.noaa.nws.ncep.edex.locations";
|
||||
|
||||
private String xmlFilename = null;
|
||||
|
||||
public IdftLocsTableReader(String file) {
|
||||
/*
|
||||
* file is the full name including the path for the
|
||||
* idft point location xml file, idftLoc.xml
|
||||
*/
|
||||
|
||||
xmlFilename = file;
|
||||
}
|
||||
|
||||
public List<IdftPoint> getIdftLocsTable() throws JAXBException{
|
||||
|
||||
File xmlFile = new File(xmlFilename);
|
||||
|
||||
JAXBContext context = JAXBContext.newInstance(
|
||||
PACKAGE);
|
||||
Unmarshaller unmarshaller = context.createUnmarshaller();
|
||||
IdftLocs loc = null;
|
||||
|
||||
try {
|
||||
loc = (IdftLocs)unmarshaller.unmarshal(
|
||||
new FileReader(xmlFile));
|
||||
List<IdftPoint> listOfItems = loc.getIdftPoint();
|
||||
return listOfItems;
|
||||
|
||||
} catch (FileNotFoundException e1) {
|
||||
// TODO Auto-generated catch block
|
||||
e1.printStackTrace();
|
||||
|
||||
} catch (NullPointerException e2) {
|
||||
e2.printStackTrace();
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
/**
|
||||
* This function reads the Idft Point Location Table from idftLoc.xml
|
||||
* and unmarshall it.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 14May2009 98 F. J. Yen Initial Creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author Fee Jing Yen, SIB
|
||||
* @version 1
|
||||
*/
|
||||
package gov.noaa.nws.ncep.edex.locations;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import javax.xml.bind.Unmarshaller;
|
||||
|
||||
public class IdftLocsTableReader {
|
||||
|
||||
|
||||
private final String PACKAGE = "gov.noaa.nws.ncep.edex.locations";
|
||||
|
||||
private String xmlFilename = null;
|
||||
|
||||
public IdftLocsTableReader(String file) {
|
||||
/*
|
||||
* file is the full name including the path for the
|
||||
* idft point location xml file, idftLoc.xml
|
||||
*/
|
||||
|
||||
xmlFilename = file;
|
||||
}
|
||||
|
||||
public List<IdftPoint> getIdftLocsTable() throws JAXBException{
|
||||
|
||||
File xmlFile = new File(xmlFilename);
|
||||
|
||||
JAXBContext context = JAXBContext.newInstance(
|
||||
PACKAGE);
|
||||
Unmarshaller unmarshaller = context.createUnmarshaller();
|
||||
IdftLocs loc = null;
|
||||
|
||||
try {
|
||||
loc = (IdftLocs)unmarshaller.unmarshal(
|
||||
new FileReader(xmlFile));
|
||||
List<IdftPoint> listOfItems = loc.getIdftPoint();
|
||||
return listOfItems;
|
||||
|
||||
} catch (FileNotFoundException e1) {
|
||||
// TODO Auto-generated catch block
|
||||
e1.printStackTrace();
|
||||
|
||||
} catch (NullPointerException e2) {
|
||||
e2.printStackTrace();
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
406
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/locations/IdftPoint.java
Executable file → Normal file
406
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/locations/IdftPoint.java
Executable file → Normal file
|
@ -1,203 +1,203 @@
|
|||
//
|
||||
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
|
||||
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
|
||||
// Any modifications to this file will be lost upon recompilation of the source schema.
|
||||
// Generated on: 2009.05.05 at 04:38:50 PM EDT
|
||||
//
|
||||
|
||||
|
||||
package gov.noaa.nws.ncep.edex.locations;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for anonymous complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType>
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element ref="{}stid"/>
|
||||
* <element ref="{}stnnum"/>
|
||||
* <element ref="{}stnname"/>
|
||||
* <element ref="{}latitude"/>
|
||||
* <element ref="{}longitude"/>
|
||||
* <element ref="{}elevation"/>
|
||||
* <element ref="{}priority"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "", propOrder = {
|
||||
"stid",
|
||||
"stnnum",
|
||||
"stnname",
|
||||
"latitude",
|
||||
"longitude",
|
||||
"elevation",
|
||||
"priority"
|
||||
})
|
||||
@XmlRootElement(name = "idftPoint")
|
||||
public class IdftPoint {
|
||||
|
||||
@XmlElement(required = true)
|
||||
protected String stid;
|
||||
@XmlElement(required = true)
|
||||
protected String stnnum;
|
||||
@XmlElement(required = true)
|
||||
protected String stnname;
|
||||
protected float latitude;
|
||||
protected float longitude;
|
||||
protected int elevation;
|
||||
protected int priority;
|
||||
|
||||
/**
|
||||
* Gets the value of the stid property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getStid() {
|
||||
return stid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the stid property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setStid(String value) {
|
||||
this.stid = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the stnnum property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getStnnum() {
|
||||
return stnnum;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the stnnum property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setStnnum(String value) {
|
||||
this.stnnum = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the stnname property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getStnname() {
|
||||
return stnname;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the stnname property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setStnname(String value) {
|
||||
this.stnname = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the latitude property.
|
||||
*
|
||||
*/
|
||||
public float getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the latitude property.
|
||||
*
|
||||
*/
|
||||
public void setLatitude(float value) {
|
||||
this.latitude = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the longitude property.
|
||||
*
|
||||
*/
|
||||
public float getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the longitude property.
|
||||
*
|
||||
*/
|
||||
public void setLongitude(float value) {
|
||||
this.longitude = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the elevation property.
|
||||
*
|
||||
*/
|
||||
public int getElevation() {
|
||||
return elevation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the elevation property.
|
||||
*
|
||||
*/
|
||||
public void setElevation(int value) {
|
||||
this.elevation = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the priority property.
|
||||
*
|
||||
*/
|
||||
public int getPriority() {
|
||||
return priority;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the priority property.
|
||||
*
|
||||
*/
|
||||
public void setPriority(int value) {
|
||||
this.priority = value;
|
||||
}
|
||||
|
||||
}
|
||||
//
|
||||
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
|
||||
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
|
||||
// Any modifications to this file will be lost upon recompilation of the source schema.
|
||||
// Generated on: 2009.05.05 at 04:38:50 PM EDT
|
||||
//
|
||||
|
||||
|
||||
package gov.noaa.nws.ncep.edex.locations;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for anonymous complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType>
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element ref="{}stid"/>
|
||||
* <element ref="{}stnnum"/>
|
||||
* <element ref="{}stnname"/>
|
||||
* <element ref="{}latitude"/>
|
||||
* <element ref="{}longitude"/>
|
||||
* <element ref="{}elevation"/>
|
||||
* <element ref="{}priority"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "", propOrder = {
|
||||
"stid",
|
||||
"stnnum",
|
||||
"stnname",
|
||||
"latitude",
|
||||
"longitude",
|
||||
"elevation",
|
||||
"priority"
|
||||
})
|
||||
@XmlRootElement(name = "idftPoint")
|
||||
public class IdftPoint {
|
||||
|
||||
@XmlElement(required = true)
|
||||
protected String stid;
|
||||
@XmlElement(required = true)
|
||||
protected String stnnum;
|
||||
@XmlElement(required = true)
|
||||
protected String stnname;
|
||||
protected float latitude;
|
||||
protected float longitude;
|
||||
protected int elevation;
|
||||
protected int priority;
|
||||
|
||||
/**
|
||||
* Gets the value of the stid property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getStid() {
|
||||
return stid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the stid property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setStid(String value) {
|
||||
this.stid = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the stnnum property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getStnnum() {
|
||||
return stnnum;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the stnnum property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setStnnum(String value) {
|
||||
this.stnnum = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the stnname property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getStnname() {
|
||||
return stnname;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the stnname property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setStnname(String value) {
|
||||
this.stnname = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the latitude property.
|
||||
*
|
||||
*/
|
||||
public float getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the latitude property.
|
||||
*
|
||||
*/
|
||||
public void setLatitude(float value) {
|
||||
this.latitude = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the longitude property.
|
||||
*
|
||||
*/
|
||||
public float getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the longitude property.
|
||||
*
|
||||
*/
|
||||
public void setLongitude(float value) {
|
||||
this.longitude = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the elevation property.
|
||||
*
|
||||
*/
|
||||
public int getElevation() {
|
||||
return elevation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the elevation property.
|
||||
*
|
||||
*/
|
||||
public void setElevation(int value) {
|
||||
this.elevation = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the priority property.
|
||||
*
|
||||
*/
|
||||
public int getPriority() {
|
||||
return priority;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the priority property.
|
||||
*
|
||||
*/
|
||||
public void setPriority(int value) {
|
||||
this.priority = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
256
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/locations/ObjectFactory.java
Executable file → Normal file
256
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/locations/ObjectFactory.java
Executable file → Normal file
|
@ -1,128 +1,128 @@
|
|||
//
|
||||
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
|
||||
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
|
||||
// Any modifications to this file will be lost upon recompilation of the source schema.
|
||||
// Generated on: 2009.05.05 at 04:38:50 PM EDT
|
||||
//
|
||||
|
||||
|
||||
package gov.noaa.nws.ncep.edex.locations;
|
||||
|
||||
import javax.xml.bind.JAXBElement;
|
||||
import javax.xml.bind.annotation.XmlElementDecl;
|
||||
import javax.xml.bind.annotation.XmlRegistry;
|
||||
import javax.xml.namespace.QName;
|
||||
|
||||
|
||||
/**
|
||||
* This object contains factory methods for each
|
||||
* Java content interface and Java element interface
|
||||
* generated in the generated package.
|
||||
* <p>An ObjectFactory allows you to programatically
|
||||
* construct new instances of the Java representation
|
||||
* for XML content. The Java representation of XML
|
||||
* content can consist of schema derived interfaces
|
||||
* and classes representing the binding of schema
|
||||
* type definitions, element declarations and model
|
||||
* groups. Factory methods for each of these are
|
||||
* provided in this class.
|
||||
*
|
||||
*/
|
||||
@XmlRegistry
|
||||
public class ObjectFactory {
|
||||
|
||||
private final static QName _Stid_QNAME = new QName("", "stid");
|
||||
private final static QName _Stnnum_QNAME = new QName("", "stnnum");
|
||||
private final static QName _Priority_QNAME = new QName("", "priority");
|
||||
private final static QName _Elevation_QNAME = new QName("", "elevation");
|
||||
private final static QName _Longitude_QNAME = new QName("", "longitude");
|
||||
private final static QName _Stnname_QNAME = new QName("", "stnname");
|
||||
private final static QName _Latitude_QNAME = new QName("", "latitude");
|
||||
|
||||
/**
|
||||
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: generated
|
||||
*
|
||||
*/
|
||||
public ObjectFactory() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link IdftLocs }
|
||||
*
|
||||
*/
|
||||
public IdftLocs createIdftLocs() {
|
||||
return new IdftLocs();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link IdftPoint }
|
||||
*
|
||||
*/
|
||||
public IdftPoint createIdftPoint() {
|
||||
return new IdftPoint();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "stid")
|
||||
public JAXBElement<String> createStid(String value) {
|
||||
return new JAXBElement<String>(_Stid_QNAME, String.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "stnnum")
|
||||
public JAXBElement<String> createStnnum(String value) {
|
||||
return new JAXBElement<String>(_Stnnum_QNAME, String.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link Integer }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "priority")
|
||||
public JAXBElement<Integer> createPriority(Integer value) {
|
||||
return new JAXBElement<Integer>(_Priority_QNAME, Integer.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link Integer }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "elevation")
|
||||
public JAXBElement<Integer> createElevation(Integer value) {
|
||||
return new JAXBElement<Integer>(_Elevation_QNAME, Integer.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link Float }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "longitude")
|
||||
public JAXBElement<Float> createLongitude(Float value) {
|
||||
return new JAXBElement<Float>(_Longitude_QNAME, Float.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "stnname")
|
||||
public JAXBElement<String> createStnname(String value) {
|
||||
return new JAXBElement<String>(_Stnname_QNAME, String.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link Float }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "latitude")
|
||||
public JAXBElement<Float> createLatitude(Float value) {
|
||||
return new JAXBElement<Float>(_Latitude_QNAME, Float.class, null, value);
|
||||
}
|
||||
|
||||
}
|
||||
//
|
||||
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
|
||||
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
|
||||
// Any modifications to this file will be lost upon recompilation of the source schema.
|
||||
// Generated on: 2009.05.05 at 04:38:50 PM EDT
|
||||
//
|
||||
|
||||
|
||||
package gov.noaa.nws.ncep.edex.locations;
|
||||
|
||||
import javax.xml.bind.JAXBElement;
|
||||
import javax.xml.bind.annotation.XmlElementDecl;
|
||||
import javax.xml.bind.annotation.XmlRegistry;
|
||||
import javax.xml.namespace.QName;
|
||||
|
||||
|
||||
/**
|
||||
* This object contains factory methods for each
|
||||
* Java content interface and Java element interface
|
||||
* generated in the generated package.
|
||||
* <p>An ObjectFactory allows you to programatically
|
||||
* construct new instances of the Java representation
|
||||
* for XML content. The Java representation of XML
|
||||
* content can consist of schema derived interfaces
|
||||
* and classes representing the binding of schema
|
||||
* type definitions, element declarations and model
|
||||
* groups. Factory methods for each of these are
|
||||
* provided in this class.
|
||||
*
|
||||
*/
|
||||
@XmlRegistry
|
||||
public class ObjectFactory {
|
||||
|
||||
private final static QName _Stid_QNAME = new QName("", "stid");
|
||||
private final static QName _Stnnum_QNAME = new QName("", "stnnum");
|
||||
private final static QName _Priority_QNAME = new QName("", "priority");
|
||||
private final static QName _Elevation_QNAME = new QName("", "elevation");
|
||||
private final static QName _Longitude_QNAME = new QName("", "longitude");
|
||||
private final static QName _Stnname_QNAME = new QName("", "stnname");
|
||||
private final static QName _Latitude_QNAME = new QName("", "latitude");
|
||||
|
||||
/**
|
||||
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: generated
|
||||
*
|
||||
*/
|
||||
public ObjectFactory() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link IdftLocs }
|
||||
*
|
||||
*/
|
||||
public IdftLocs createIdftLocs() {
|
||||
return new IdftLocs();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link IdftPoint }
|
||||
*
|
||||
*/
|
||||
public IdftPoint createIdftPoint() {
|
||||
return new IdftPoint();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "stid")
|
||||
public JAXBElement<String> createStid(String value) {
|
||||
return new JAXBElement<String>(_Stid_QNAME, String.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "stnnum")
|
||||
public JAXBElement<String> createStnnum(String value) {
|
||||
return new JAXBElement<String>(_Stnnum_QNAME, String.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link Integer }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "priority")
|
||||
public JAXBElement<Integer> createPriority(Integer value) {
|
||||
return new JAXBElement<Integer>(_Priority_QNAME, Integer.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link Integer }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "elevation")
|
||||
public JAXBElement<Integer> createElevation(Integer value) {
|
||||
return new JAXBElement<Integer>(_Elevation_QNAME, Integer.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link Float }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "longitude")
|
||||
public JAXBElement<Float> createLongitude(Float value) {
|
||||
return new JAXBElement<Float>(_Longitude_QNAME, Float.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "stnname")
|
||||
public JAXBElement<String> createStnname(String value) {
|
||||
return new JAXBElement<String>(_Stnname_QNAME, String.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link Float }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "", name = "latitude")
|
||||
public JAXBElement<Float> createLatitude(Float value) {
|
||||
return new JAXBElement<Float>(_Latitude_QNAME, Float.class, null, value);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
8
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/locations/package-info.java
Executable file → Normal file
8
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/locations/package-info.java
Executable file → Normal file
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
* Contains supporting and test methods for reading and unmarshalling idftLocs.tbl
|
||||
*/
|
||||
package gov.noaa.nws.ncep.edex.locations;
|
||||
/**
|
||||
* Contains supporting and test methods for reading and unmarshalling idftLocs.tbl
|
||||
*/
|
||||
package gov.noaa.nws.ncep.edex.locations;
|
||||
|
|
102
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/locations/test_IdftLocsTableReader.java
Executable file → Normal file
102
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/locations/test_IdftLocsTableReader.java
Executable file → Normal file
|
@ -1,51 +1,51 @@
|
|||
/**
|
||||
* This function tests the Idft Point Location Table Reader, IdftLocsTableReader
|
||||
* by printing out all the elements in the XML file. It also gets the first and
|
||||
* last element from the list and prints them out
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 12May2009 98 F. J. Yen Initial Creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author Fee Jing Yen, SIB
|
||||
* @version 1
|
||||
*/
|
||||
package gov.noaa.nws.ncep.edex.locations;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class test_IdftLocsTableReader {
|
||||
|
||||
public static void main(String args[]) throws Exception{
|
||||
String idftLocsXmlName = "../build.edex/esb/data/utility/edex_static/base/ncep/stns/idftLoc.xml";
|
||||
IdftLocsTableReader myloc = new IdftLocsTableReader (idftLocsXmlName);
|
||||
List<IdftPoint> list = myloc.getIdftLocsTable();
|
||||
for(IdftPoint itm : list){
|
||||
System.out.println(
|
||||
" Stid = " + itm.getStid() +
|
||||
" Stnnum= " + itm.getStnnum() +
|
||||
" Stnname = " + itm.getStnname() +
|
||||
" Latitude = " + itm.getLatitude() +
|
||||
" Longitude =" + itm.getLongitude() +
|
||||
" Elevation =" + itm.getElevation() +
|
||||
" Priortiy =" + itm.getPriority() );
|
||||
}
|
||||
// Get the first and last elements of the list and print them along with the list size
|
||||
System.out.println(" Stid(0)=" + list.get(0).stid
|
||||
+ " Stnnum(0) = " + list.get(0).stnnum
|
||||
+ " Stnname(0) = " + list.get(0).stnname
|
||||
+ " Latitude(0) = " + list.get(0).latitude
|
||||
+ " Longitude(0) = " + list.get(0).longitude
|
||||
+ "\n Stid(206) = " + list.get(206).stid
|
||||
+ " Stnnum(206) = " + list.get(206).stnnum
|
||||
+ " Stnname(206) = " + list.get(206).stnname
|
||||
+ " Latitude(206) = " + list.get(206).latitude
|
||||
+ " Longitude(206) = " + list.get(206).longitude
|
||||
+ "\n size = " + list.size());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* This function tests the Idft Point Location Table Reader, IdftLocsTableReader
|
||||
* by printing out all the elements in the XML file. It also gets the first and
|
||||
* last element from the list and prints them out
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 12May2009 98 F. J. Yen Initial Creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author Fee Jing Yen, SIB
|
||||
* @version 1
|
||||
*/
|
||||
package gov.noaa.nws.ncep.edex.locations;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class test_IdftLocsTableReader {
|
||||
|
||||
public static void main(String args[]) throws Exception{
|
||||
String idftLocsXmlName = "../build.edex/esb/data/utility/edex_static/base/ncep/stns/idftLoc.xml";
|
||||
IdftLocsTableReader myloc = new IdftLocsTableReader (idftLocsXmlName);
|
||||
List<IdftPoint> list = myloc.getIdftLocsTable();
|
||||
for(IdftPoint itm : list){
|
||||
System.out.println(
|
||||
" Stid = " + itm.getStid() +
|
||||
" Stnnum= " + itm.getStnnum() +
|
||||
" Stnname = " + itm.getStnname() +
|
||||
" Latitude = " + itm.getLatitude() +
|
||||
" Longitude =" + itm.getLongitude() +
|
||||
" Elevation =" + itm.getElevation() +
|
||||
" Priortiy =" + itm.getPriority() );
|
||||
}
|
||||
// Get the first and last elements of the list and print them along with the list size
|
||||
System.out.println(" Stid(0)=" + list.get(0).stid
|
||||
+ " Stnnum(0) = " + list.get(0).stnnum
|
||||
+ " Stnname(0) = " + list.get(0).stnname
|
||||
+ " Latitude(0) = " + list.get(0).latitude
|
||||
+ " Longitude(0) = " + list.get(0).longitude
|
||||
+ "\n Stid(206) = " + list.get(206).stid
|
||||
+ " Stnnum(206) = " + list.get(206).stnnum
|
||||
+ " Stnname(206) = " + list.get(206).stnname
|
||||
+ " Latitude(206) = " + list.get(206).latitude
|
||||
+ " Longitude(206) = " + list.get(206).longitude
|
||||
+ "\n size = " + list.size());
|
||||
}
|
||||
}
|
||||
|
|
364
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/tools/decoder/LatLonLocTbl.java
Executable file → Normal file
364
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/tools/decoder/LatLonLocTbl.java
Executable file → Normal file
|
@ -1,182 +1,182 @@
|
|||
/**
|
||||
* LatLonLocTbl - A Java class to define some known VORs and Intlsig talbes
|
||||
* used to define convective/nonconvective/airmet/intl SIGMET locations.
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 12 Jun 2009 95/132 B. Hebbard Initial creation.
|
||||
* 10 Sep 2009 39/87/114 L. Lin Remove the temporary enum
|
||||
* and add xml for VORs and
|
||||
* Intlsig gempak tables.
|
||||
* 30 Sep 2009 3102 jkorman Changed printlns to logging statements.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* This code has been developed by the SIB for use in the AWIPS2 system.
|
||||
* @author L. Lin
|
||||
* @version 1.0
|
||||
*/
|
||||
package gov.noaa.nws.ncep.edex.tools.decoder;
|
||||
|
||||
import static com.raytheon.uf.common.localization.LocalizationContext.LocalizationType.EDEX_STATIC;
|
||||
import gov.noaa.nws.ncep.edex.common.stationTables.IStationField.StationField;
|
||||
import gov.noaa.nws.ncep.edex.common.stationTables.Station;
|
||||
import gov.noaa.nws.ncep.edex.common.stationTables.StationTable;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.raytheon.uf.common.localization.IPathManager;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.edex.decodertools.core.LatLonPoint;
|
||||
|
||||
public class LatLonLocTbl {
|
||||
private static Log logger = LogFactory.getLog(LatLonLocTbl.class);
|
||||
|
||||
static StationTable vorsloc = null;
|
||||
|
||||
static StationTable intlsigloc = null;
|
||||
|
||||
static StationTable myloc = null;
|
||||
|
||||
private double latitude;
|
||||
|
||||
private double longitude;
|
||||
|
||||
private LatLonLocTbl(double latitude, double longitude) {
|
||||
this.latitude = latitude;
|
||||
this.longitude = longitude;
|
||||
}
|
||||
|
||||
public static void readLocTable(String tableName) throws Exception {
|
||||
|
||||
final String NCEP_DIR = "ncep";
|
||||
final String stnsDir = "stns";
|
||||
final String vorsLocTableName = "vors.xml";
|
||||
|
||||
IPathManager manager = PathManagerFactory.getPathManager();
|
||||
|
||||
LocalizationContext baseContext = null;
|
||||
File baseDir = null;
|
||||
String stnsFileName = null;
|
||||
baseContext = manager.getContext(EDEX_STATIC, LocalizationLevel.BASE);
|
||||
baseContext.setContextName(NCEP_DIR);
|
||||
baseDir = manager.getFile(baseContext, "");
|
||||
if (tableName == "vors") {
|
||||
stnsFileName = baseDir + File.separator + stnsDir + File.separator
|
||||
+ vorsLocTableName;
|
||||
}
|
||||
logger.debug(" stnsFileName=" + stnsFileName);
|
||||
myloc = new StationTable(stnsFileName);
|
||||
|
||||
}
|
||||
|
||||
public double getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
|
||||
public double getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
|
||||
public LatLonPoint getLatLonPoint() {
|
||||
return new LatLonPoint(latitude, longitude, LatLonPoint.INDEGREES);
|
||||
}
|
||||
|
||||
private enum Direction {
|
||||
N, NNE, NE, ENE, E, ESE, SE, SSE, S, SSW, SW, WSW, W, WNW, NW, NNW;
|
||||
public double getDegrees() {
|
||||
return ordinal() * 22.5;
|
||||
}
|
||||
}
|
||||
|
||||
private static final double ONE_NM_RADIANS = Math.toRadians(1.0 / 60.0);
|
||||
|
||||
/**
|
||||
* Given a relative reference string, returns a LatLonPoint
|
||||
* (com.raytheon.uf.edex.decodertools.core.LatLonPoint).
|
||||
*
|
||||
* @param location
|
||||
* A String such as... "BOS" "20S EMI" "30 WNW BUM" " 40ENE HUH "
|
||||
* ...referencing a VOR listed in AC 00-45F (Appendix F),
|
||||
* optionally preceded by distance in nautical miles and 16-point
|
||||
* compass direction string.
|
||||
* @param locTable
|
||||
* A string such as "vors" referring to "vors" location table or
|
||||
* "intlsig" referring to intl location table
|
||||
* @return The decoded location as a LatLonPoint; null on error (such as
|
||||
* unrecognized VOR identifier or direction string).
|
||||
*
|
||||
*/
|
||||
public static LatLonPoint getLatLonPoint(String location, String locTable) {
|
||||
LatLonPoint point = null;
|
||||
Station vor = null;
|
||||
// Wrap decoding in a try block, in case of exception on
|
||||
// one of the xml or direction enum, or other problems.
|
||||
|
||||
try {
|
||||
location = location.trim();
|
||||
|
||||
// VOR is always last 3 nonblank char of location
|
||||
String navaid = location.substring(location.length() - 3);
|
||||
|
||||
// Read in the location table XML if not exists
|
||||
if (myloc == null) {
|
||||
readLocTable(locTable);
|
||||
logger.debug(" - read vors.xml to cache");
|
||||
}
|
||||
// Search station ID and return whole station record
|
||||
if (myloc != null) {
|
||||
logger.debug(" - navaid = " + navaid);
|
||||
vor = myloc.getStation(StationField.STID, navaid);
|
||||
} else {
|
||||
logger.debug(" - myloc is null");
|
||||
}
|
||||
|
||||
// Get LatLonPoint from lat/lon
|
||||
if (vor != null) {
|
||||
point = new LatLonPoint(vor.getLatitude(), vor.getLongitude(),
|
||||
LatLonPoint.INDEGREES);
|
||||
} else {
|
||||
logger.debug(" - DID NOT find station ID in vors.xml");
|
||||
}
|
||||
|
||||
// If there's an offset direction/bearing, process it
|
||||
if (location.length() > 3) {
|
||||
String u = location.substring(0, location.length() - 3);
|
||||
|
||||
Pattern p = Pattern.compile("^([0-9]+)\\s*([A-Z]+)");
|
||||
Matcher m = p.matcher(u);
|
||||
if (m.find()) {
|
||||
String distanceStr = m.group(1);
|
||||
|
||||
String bearingStr = m.group(2);
|
||||
|
||||
int distanceNM = Integer.parseInt(distanceStr);
|
||||
|
||||
double distanceRad = distanceNM * ONE_NM_RADIANS;
|
||||
// LatLonPoint.positionOf thinks bearing is CCW, not CW...
|
||||
double bearingDeg = 360.0 - Direction.valueOf(bearingStr)
|
||||
.getDegrees();
|
||||
double bearingRad = Math.toRadians(bearingDeg);
|
||||
point = point.positionOf(bearingRad, distanceRad);
|
||||
logger.debug(" - get a good latlon point");
|
||||
}
|
||||
}
|
||||
return point;
|
||||
} catch (Exception e) {
|
||||
logger.error("[Error decoding location in LatLonLocTbl: "
|
||||
+ location + "]");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* LatLonLocTbl - A Java class to define some known VORs and Intlsig talbes
|
||||
* used to define convective/nonconvective/airmet/intl SIGMET locations.
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 12 Jun 2009 95/132 B. Hebbard Initial creation.
|
||||
* 10 Sep 2009 39/87/114 L. Lin Remove the temporary enum
|
||||
* and add xml for VORs and
|
||||
* Intlsig gempak tables.
|
||||
* 30 Sep 2009 3102 jkorman Changed printlns to logging statements.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* This code has been developed by the SIB for use in the AWIPS2 system.
|
||||
* @author L. Lin
|
||||
* @version 1.0
|
||||
*/
|
||||
package gov.noaa.nws.ncep.edex.tools.decoder;
|
||||
|
||||
import static com.raytheon.uf.common.localization.LocalizationContext.LocalizationType.EDEX_STATIC;
|
||||
import gov.noaa.nws.ncep.edex.common.stationTables.IStationField.StationField;
|
||||
import gov.noaa.nws.ncep.edex.common.stationTables.Station;
|
||||
import gov.noaa.nws.ncep.edex.common.stationTables.StationTable;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.raytheon.uf.common.localization.IPathManager;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.edex.decodertools.core.LatLonPoint;
|
||||
|
||||
public class LatLonLocTbl {
|
||||
private static Log logger = LogFactory.getLog(LatLonLocTbl.class);
|
||||
|
||||
static StationTable vorsloc = null;
|
||||
|
||||
static StationTable intlsigloc = null;
|
||||
|
||||
static StationTable myloc = null;
|
||||
|
||||
private double latitude;
|
||||
|
||||
private double longitude;
|
||||
|
||||
private LatLonLocTbl(double latitude, double longitude) {
|
||||
this.latitude = latitude;
|
||||
this.longitude = longitude;
|
||||
}
|
||||
|
||||
public static void readLocTable(String tableName) throws Exception {
|
||||
|
||||
final String NCEP_DIR = "ncep";
|
||||
final String stnsDir = "stns";
|
||||
final String vorsLocTableName = "vors.xml";
|
||||
|
||||
IPathManager manager = PathManagerFactory.getPathManager();
|
||||
|
||||
LocalizationContext baseContext = null;
|
||||
File baseDir = null;
|
||||
String stnsFileName = null;
|
||||
baseContext = manager.getContext(EDEX_STATIC, LocalizationLevel.BASE);
|
||||
baseContext.setContextName(NCEP_DIR);
|
||||
baseDir = manager.getFile(baseContext, "");
|
||||
if (tableName == "vors") {
|
||||
stnsFileName = baseDir + File.separator + stnsDir + File.separator
|
||||
+ vorsLocTableName;
|
||||
}
|
||||
logger.debug(" stnsFileName=" + stnsFileName);
|
||||
myloc = new StationTable(stnsFileName);
|
||||
|
||||
}
|
||||
|
||||
public double getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
|
||||
public double getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
|
||||
public LatLonPoint getLatLonPoint() {
|
||||
return new LatLonPoint(latitude, longitude, LatLonPoint.INDEGREES);
|
||||
}
|
||||
|
||||
private enum Direction {
|
||||
N, NNE, NE, ENE, E, ESE, SE, SSE, S, SSW, SW, WSW, W, WNW, NW, NNW;
|
||||
public double getDegrees() {
|
||||
return ordinal() * 22.5;
|
||||
}
|
||||
}
|
||||
|
||||
private static final double ONE_NM_RADIANS = Math.toRadians(1.0 / 60.0);
|
||||
|
||||
/**
|
||||
* Given a relative reference string, returns a LatLonPoint
|
||||
* (com.raytheon.uf.edex.decodertools.core.LatLonPoint).
|
||||
*
|
||||
* @param location
|
||||
* A String such as... "BOS" "20S EMI" "30 WNW BUM" " 40ENE HUH "
|
||||
* ...referencing a VOR listed in AC 00-45F (Appendix F),
|
||||
* optionally preceded by distance in nautical miles and 16-point
|
||||
* compass direction string.
|
||||
* @param locTable
|
||||
* A string such as "vors" referring to "vors" location table or
|
||||
* "intlsig" referring to intl location table
|
||||
* @return The decoded location as a LatLonPoint; null on error (such as
|
||||
* unrecognized VOR identifier or direction string).
|
||||
*
|
||||
*/
|
||||
public static LatLonPoint getLatLonPoint(String location, String locTable) {
|
||||
LatLonPoint point = null;
|
||||
Station vor = null;
|
||||
// Wrap decoding in a try block, in case of exception on
|
||||
// one of the xml or direction enum, or other problems.
|
||||
|
||||
try {
|
||||
location = location.trim();
|
||||
|
||||
// VOR is always last 3 nonblank char of location
|
||||
String navaid = location.substring(location.length() - 3);
|
||||
|
||||
// Read in the location table XML if not exists
|
||||
if (myloc == null) {
|
||||
readLocTable(locTable);
|
||||
logger.debug(" - read vors.xml to cache");
|
||||
}
|
||||
// Search station ID and return whole station record
|
||||
if (myloc != null) {
|
||||
logger.debug(" - navaid = " + navaid);
|
||||
vor = myloc.getStation(StationField.STID, navaid);
|
||||
} else {
|
||||
logger.debug(" - myloc is null");
|
||||
}
|
||||
|
||||
// Get LatLonPoint from lat/lon
|
||||
if (vor != null) {
|
||||
point = new LatLonPoint(vor.getLatitude(), vor.getLongitude(),
|
||||
LatLonPoint.INDEGREES);
|
||||
} else {
|
||||
logger.debug(" - DID NOT find station ID in vors.xml");
|
||||
}
|
||||
|
||||
// If there's an offset direction/bearing, process it
|
||||
if (location.length() > 3) {
|
||||
String u = location.substring(0, location.length() - 3);
|
||||
|
||||
Pattern p = Pattern.compile("^([0-9]+)\\s*([A-Z]+)");
|
||||
Matcher m = p.matcher(u);
|
||||
if (m.find()) {
|
||||
String distanceStr = m.group(1);
|
||||
|
||||
String bearingStr = m.group(2);
|
||||
|
||||
int distanceNM = Integer.parseInt(distanceStr);
|
||||
|
||||
double distanceRad = distanceNM * ONE_NM_RADIANS;
|
||||
// LatLonPoint.positionOf thinks bearing is CCW, not CW...
|
||||
double bearingDeg = 360.0 - Direction.valueOf(bearingStr)
|
||||
.getDegrees();
|
||||
double bearingRad = Math.toRadians(bearingDeg);
|
||||
point = point.positionOf(bearingRad, distanceRad);
|
||||
logger.debug(" - get a good latlon point");
|
||||
}
|
||||
}
|
||||
return point;
|
||||
} catch (Exception e) {
|
||||
logger.error("[Error decoding location in LatLonLocTbl: "
|
||||
+ location + "]");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
1198
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/tools/decoder/MndTime.java
Executable file → Normal file
1198
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/tools/decoder/MndTime.java
Executable file → Normal file
File diff suppressed because it is too large
Load diff
1064
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/tools/decoder/VOR.java
Executable file → Normal file
1064
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/tools/decoder/VOR.java
Executable file → Normal file
File diff suppressed because it is too large
Load diff
8
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/tools/decoder/package-info.java
Executable file → Normal file
8
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/tools/decoder/package-info.java
Executable file → Normal file
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
* Contains tools for decoder plug-ins
|
||||
*/
|
||||
package gov.noaa.nws.ncep.edex.tools.decoder;
|
||||
/**
|
||||
* Contains tools for decoder plug-ins
|
||||
*/
|
||||
package gov.noaa.nws.ncep.edex.tools.decoder;
|
||||
|
|
244
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/util/UtilN.java
Executable file → Normal file
244
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/util/UtilN.java
Executable file → Normal file
|
@ -1,122 +1,122 @@
|
|||
/*
|
||||
*
|
||||
* Util
|
||||
*
|
||||
* This java class contains edex generic utility methods for use.
|
||||
*
|
||||
* T. Lee 11/2008 Creation
|
||||
* T. Lee 3/2009 Fixed roll-over cases; added String functions
|
||||
* T. Lee 4/2009 Added date to the base time
|
||||
* T. Lee
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 11/2008 14 T. Lee Creation
|
||||
* 3/2009 14 T. Lee Fixed roll-over cases; added String functions
|
||||
* 4/2009 14 T. Lee Added date to the base time
|
||||
* 5/2009 128 T. Lee Used UTC in findDataTime
|
||||
* </pre>
|
||||
*
|
||||
* @author T.Lee
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
package gov.noaa.nws.ncep.edex.util;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import com.raytheon.edex.util.Util;
|
||||
|
||||
public class UtilN {
|
||||
private static final Log logger = LogFactory.getLog(UtilN.class);
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public UtilN() {
|
||||
|
||||
}
|
||||
/**
|
||||
* Convert a string in ddhhmm format to a standard {@link Calendar} format where
|
||||
* ddhhmm is the GMT format while the standard time is in Calendar format with
|
||||
* Year and Month information. Usage: ddhhmm is the issue time whereas utcTime
|
||||
* can be the MDN time. The former comes "after" the latter.
|
||||
*
|
||||
* @parm ddhhmm day-hour-minute in GMT
|
||||
* @parm local Time UTC time in Calendar
|
||||
*/
|
||||
public static Calendar findDataTime (String ddhhmm, Calendar utcTime) {
|
||||
Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT")); ;
|
||||
if ( utcTime == null ) {
|
||||
try {
|
||||
return Util.findCurrentTime(ddhhmm);
|
||||
} catch (Exception e) {
|
||||
if ( logger.isInfoEnabled()) {
|
||||
logger.info( " Error in processing MND time; return current time ");
|
||||
}
|
||||
return cal;
|
||||
}
|
||||
|
||||
} else {
|
||||
int iDay = Integer.parseInt(ddhhmm.substring(0, 2).trim());
|
||||
int iHour = Integer.parseInt(ddhhmm.substring(2, 4).trim());
|
||||
int iMinute = Integer.parseInt(ddhhmm.substring(4, 6).trim());
|
||||
int iMonth = utcTime.get(Calendar.MONTH);
|
||||
int iYear = utcTime.get(Calendar.YEAR);
|
||||
|
||||
/*
|
||||
* adjust the month and year for roll-over situations
|
||||
*/
|
||||
if (iDay < utcTime.get(Calendar.DAY_OF_MONTH) ) {
|
||||
iMonth++;
|
||||
if ( iMonth == 12 ) {
|
||||
iMonth = Calendar.JANUARY;
|
||||
iYear++;
|
||||
}
|
||||
}
|
||||
cal.set(iYear,iMonth,iDay,iHour,iMinute);
|
||||
cal.set(Calendar.SECOND, 0);
|
||||
cal.set(Calendar.MILLISECOND, 0);
|
||||
return cal;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the leading spaces and tabs in a string.
|
||||
*/
|
||||
public static String removeLeadingWhiteSpaces (String str) {
|
||||
int i;
|
||||
for ( i = 0; i < str.length(); i++ ) {
|
||||
if ( !Character.isWhitespace(str.charAt(i))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return str.substring(i);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove multiple white spaces in a string.
|
||||
*/
|
||||
public static String removeExtraWhiteSpaces (String str) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
int i;
|
||||
char first = str.charAt(0);
|
||||
char second;
|
||||
for ( i = 1; i < str.length(); i++ ) {
|
||||
second = str.charAt(i);
|
||||
if ( !Character.isWhitespace(first) || !Character.isWhitespace(second)) {
|
||||
sb.append(first);
|
||||
first = second;
|
||||
}
|
||||
if ( i == ( str.length()-1) ) {
|
||||
sb.append(second);
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
/*
|
||||
*
|
||||
* Util
|
||||
*
|
||||
* This java class contains edex generic utility methods for use.
|
||||
*
|
||||
* T. Lee 11/2008 Creation
|
||||
* T. Lee 3/2009 Fixed roll-over cases; added String functions
|
||||
* T. Lee 4/2009 Added date to the base time
|
||||
* T. Lee
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 11/2008 14 T. Lee Creation
|
||||
* 3/2009 14 T. Lee Fixed roll-over cases; added String functions
|
||||
* 4/2009 14 T. Lee Added date to the base time
|
||||
* 5/2009 128 T. Lee Used UTC in findDataTime
|
||||
* </pre>
|
||||
*
|
||||
* @author T.Lee
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
package gov.noaa.nws.ncep.edex.util;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import com.raytheon.edex.util.Util;
|
||||
|
||||
public class UtilN {
|
||||
private static final Log logger = LogFactory.getLog(UtilN.class);
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public UtilN() {
|
||||
|
||||
}
|
||||
/**
|
||||
* Convert a string in ddhhmm format to a standard {@link Calendar} format where
|
||||
* ddhhmm is the GMT format while the standard time is in Calendar format with
|
||||
* Year and Month information. Usage: ddhhmm is the issue time whereas utcTime
|
||||
* can be the MDN time. The former comes "after" the latter.
|
||||
*
|
||||
* @parm ddhhmm day-hour-minute in GMT
|
||||
* @parm local Time UTC time in Calendar
|
||||
*/
|
||||
public static Calendar findDataTime (String ddhhmm, Calendar utcTime) {
|
||||
Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT")); ;
|
||||
if ( utcTime == null ) {
|
||||
try {
|
||||
return Util.findCurrentTime(ddhhmm);
|
||||
} catch (Exception e) {
|
||||
if ( logger.isInfoEnabled()) {
|
||||
logger.info( " Error in processing MND time; return current time ");
|
||||
}
|
||||
return cal;
|
||||
}
|
||||
|
||||
} else {
|
||||
int iDay = Integer.parseInt(ddhhmm.substring(0, 2).trim());
|
||||
int iHour = Integer.parseInt(ddhhmm.substring(2, 4).trim());
|
||||
int iMinute = Integer.parseInt(ddhhmm.substring(4, 6).trim());
|
||||
int iMonth = utcTime.get(Calendar.MONTH);
|
||||
int iYear = utcTime.get(Calendar.YEAR);
|
||||
|
||||
/*
|
||||
* adjust the month and year for roll-over situations
|
||||
*/
|
||||
if (iDay < utcTime.get(Calendar.DAY_OF_MONTH) ) {
|
||||
iMonth++;
|
||||
if ( iMonth == 12 ) {
|
||||
iMonth = Calendar.JANUARY;
|
||||
iYear++;
|
||||
}
|
||||
}
|
||||
cal.set(iYear,iMonth,iDay,iHour,iMinute);
|
||||
cal.set(Calendar.SECOND, 0);
|
||||
cal.set(Calendar.MILLISECOND, 0);
|
||||
return cal;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the leading spaces and tabs in a string.
|
||||
*/
|
||||
public static String removeLeadingWhiteSpaces (String str) {
|
||||
int i;
|
||||
for ( i = 0; i < str.length(); i++ ) {
|
||||
if ( !Character.isWhitespace(str.charAt(i))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return str.substring(i);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove multiple white spaces in a string.
|
||||
*/
|
||||
public static String removeExtraWhiteSpaces (String str) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
int i;
|
||||
char first = str.charAt(0);
|
||||
char second;
|
||||
for ( i = 1; i < str.length(); i++ ) {
|
||||
second = str.charAt(i);
|
||||
if ( !Character.isWhitespace(first) || !Character.isWhitespace(second)) {
|
||||
sb.append(first);
|
||||
first = second;
|
||||
}
|
||||
if ( i == ( str.length()-1) ) {
|
||||
sb.append(second);
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
|
8
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/util/package-info.java
Executable file → Normal file
8
ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/util/package-info.java
Executable file → Normal file
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
* Contains tools for decoder plug-ins
|
||||
*/
|
||||
package gov.noaa.nws.ncep.edex.util;
|
||||
/**
|
||||
* Contains tools for decoder plug-ins
|
||||
*/
|
||||
package gov.noaa.nws.ncep.edex.util;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package gov.noaa.nws.ncep.metparameters.dbquery.util;
|
||||
|
||||
import gov.noaa.nws.ncep.common.log.logger.NcepLogger;
|
||||
import gov.noaa.nws.ncep.common.log.logger.NcepLoggerManager;
|
||||
//import gov.noaa.nws.ncep.common.log.logger.NcepLogger;
|
||||
//import gov.noaa.nws.ncep.common.log.logger.NcepLoggerManager;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
|
@ -13,7 +13,7 @@ import java.util.List;
|
|||
|
||||
public class ClimateDataDbAccessImpl implements ClimateDataDbAccess {
|
||||
|
||||
private NcepLogger logger = NcepLoggerManager.getNcepLogger(this.getClass());
|
||||
// private NcepLogger logger = NcepLoggerManager.getNcepLogger(this.getClass());
|
||||
|
||||
@Override
|
||||
public double getTDYF(String stationId, String monthString, String monthDayString) {
|
||||
|
@ -57,7 +57,7 @@ public class ClimateDataDbAccessImpl implements ClimateDataDbAccess {
|
|||
try {
|
||||
// objectArrayList = DirectDbQuery.executeQuery(queryString, "ncep", QueryLanguage.SQL);
|
||||
} catch (Exception e1) {
|
||||
logger.error("VizException is thrown when trying to do DirectDbQuery.executeQuery to query stns.climo_data table, error="+e1.getMessage());
|
||||
// logger.error("VizException is thrown when trying to do DirectDbQuery.executeQuery to query stns.climo_data table, error="+e1.getMessage());
|
||||
e1.printStackTrace();
|
||||
}
|
||||
double retrievedValue = 0.0;
|
||||
|
|
3736
ncep/gov.noaa.nws.ncep.edex.common/utility/edex_static/base/ncep/stns/idftLoc.xml
Executable file → Normal file
3736
ncep/gov.noaa.nws.ncep.edex.common/utility/edex_static/base/ncep/stns/idftLoc.xml
Executable file → Normal file
File diff suppressed because it is too large
Load diff
324
ncep/gov.noaa.nws.ncep.edex.common/utility/edex_static/base/ncep/stns/stns.xsd
Executable file → Normal file
324
ncep/gov.noaa.nws.ncep.edex.common/utility/edex_static/base/ncep/stns/stns.xsd
Executable file → Normal file
|
@ -1,163 +1,163 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
elementFormDefault="qualified">
|
||||
|
||||
<xsd:element name="stid">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>The station ID</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:maxLength value="16"></xsd:maxLength>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="stnnum">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>The station number</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:maxLength value="10"></xsd:maxLength>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="stnname">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>The station name</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:maxLength value="35"></xsd:maxLength>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="state">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>state</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:maxLength value="2"></xsd:maxLength>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="country">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>country</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:maxLength value="2"></xsd:maxLength>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="latitude">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>The latitude</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:float">
|
||||
<xsd:maxInclusive value="90."></xsd:maxInclusive>
|
||||
<xsd:minInclusive value="-90."></xsd:minInclusive>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="longitude">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>The longitude</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:float">
|
||||
<xsd:maxInclusive value="180."></xsd:maxInclusive>
|
||||
<xsd:minInclusive value="-180."></xsd:minInclusive>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="elevation">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>The elevation</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:integer">
|
||||
<xsd:maxInclusive value="99999"></xsd:maxInclusive>
|
||||
<xsd:minInclusive value="-9999"></xsd:minInclusive>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="priority">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>The priority</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:integer">
|
||||
<xsd:maxInclusive value="99"></xsd:maxInclusive>
|
||||
<xsd:minInclusive value="0"></xsd:minInclusive>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="location">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Volcano location</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:maxLength value="32"></xsd:maxLength>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="wfo">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>WFO</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:maxLength value="15"></xsd:maxLength>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="stationList">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence maxOccurs="1" minOccurs="1">
|
||||
<xsd:element ref="station" maxOccurs="unbounded" minOccurs="0"></xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="station">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>A station</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:complexType>
|
||||
<xsd:sequence maxOccurs="1" minOccurs="1">
|
||||
<xsd:element ref="stid" maxOccurs="1" minOccurs="0"></xsd:element>
|
||||
<xsd:element ref="stnnum" maxOccurs="1" minOccurs="0"></xsd:element>
|
||||
<xsd:element ref="stnname" maxOccurs="1" minOccurs="0"></xsd:element>
|
||||
<xsd:element ref="state" maxOccurs="1" minOccurs="0"></xsd:element>
|
||||
<xsd:element ref="country" maxOccurs="1" minOccurs="0"></xsd:element>
|
||||
<xsd:element ref="latitude" maxOccurs="1" minOccurs="0"></xsd:element>
|
||||
<xsd:element ref="longitude" maxOccurs="1" minOccurs="0"></xsd:element>
|
||||
<xsd:element ref="elevation" maxOccurs="1" minOccurs="0"></xsd:element>
|
||||
<xsd:element ref="priority" maxOccurs="1" minOccurs="0"></xsd:element>
|
||||
<xsd:element ref="location" maxOccurs="1" minOccurs="0"></xsd:element>
|
||||
<xsd:element ref="wfo" maxOccurs="1" minOccurs="0"></xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
elementFormDefault="qualified">
|
||||
|
||||
<xsd:element name="stid">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>The station ID</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:maxLength value="16"></xsd:maxLength>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="stnnum">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>The station number</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:maxLength value="10"></xsd:maxLength>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="stnname">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>The station name</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:maxLength value="35"></xsd:maxLength>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="state">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>state</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:maxLength value="2"></xsd:maxLength>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="country">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>country</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:maxLength value="2"></xsd:maxLength>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="latitude">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>The latitude</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:float">
|
||||
<xsd:maxInclusive value="90."></xsd:maxInclusive>
|
||||
<xsd:minInclusive value="-90."></xsd:minInclusive>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="longitude">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>The longitude</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:float">
|
||||
<xsd:maxInclusive value="180."></xsd:maxInclusive>
|
||||
<xsd:minInclusive value="-180."></xsd:minInclusive>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="elevation">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>The elevation</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:integer">
|
||||
<xsd:maxInclusive value="99999"></xsd:maxInclusive>
|
||||
<xsd:minInclusive value="-9999"></xsd:minInclusive>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="priority">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>The priority</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:integer">
|
||||
<xsd:maxInclusive value="99"></xsd:maxInclusive>
|
||||
<xsd:minInclusive value="0"></xsd:minInclusive>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="location">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Volcano location</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:maxLength value="32"></xsd:maxLength>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="wfo">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>WFO</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:maxLength value="15"></xsd:maxLength>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="stationList">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence maxOccurs="1" minOccurs="1">
|
||||
<xsd:element ref="station" maxOccurs="unbounded" minOccurs="0"></xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="station">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>A station</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:complexType>
|
||||
<xsd:sequence maxOccurs="1" minOccurs="1">
|
||||
<xsd:element ref="stid" maxOccurs="1" minOccurs="0"></xsd:element>
|
||||
<xsd:element ref="stnnum" maxOccurs="1" minOccurs="0"></xsd:element>
|
||||
<xsd:element ref="stnname" maxOccurs="1" minOccurs="0"></xsd:element>
|
||||
<xsd:element ref="state" maxOccurs="1" minOccurs="0"></xsd:element>
|
||||
<xsd:element ref="country" maxOccurs="1" minOccurs="0"></xsd:element>
|
||||
<xsd:element ref="latitude" maxOccurs="1" minOccurs="0"></xsd:element>
|
||||
<xsd:element ref="longitude" maxOccurs="1" minOccurs="0"></xsd:element>
|
||||
<xsd:element ref="elevation" maxOccurs="1" minOccurs="0"></xsd:element>
|
||||
<xsd:element ref="priority" maxOccurs="1" minOccurs="0"></xsd:element>
|
||||
<xsd:element ref="location" maxOccurs="1" minOccurs="0"></xsd:element>
|
||||
<xsd:element ref="wfo" maxOccurs="1" minOccurs="0"></xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
|
||||
|
||||
|
14098
ncep/gov.noaa.nws.ncep.edex.common/utility/edex_static/base/ncep/stns/vors.xml
Executable file → Normal file
14098
ncep/gov.noaa.nws.ncep.edex.common/utility/edex_static/base/ncep/stns/vors.xml
Executable file → Normal file
File diff suppressed because it is too large
Load diff
94378
ncep/gov.noaa.nws.ncep.edex.common/utility/edex_static/base/ncep/stns/zones.xml
Executable file → Normal file
94378
ncep/gov.noaa.nws.ncep.edex.common/utility/edex_static/base/ncep/stns/zones.xml
Executable file → Normal file
File diff suppressed because it is too large
Load diff
|
@ -8,17 +8,18 @@ Require-Bundle: org.eclipse.ui;bundle-version="3.4.1",
|
|||
org.eclipse.core.runtime,
|
||||
org.apache.commons.lang;bundle-version="2.3.0",
|
||||
javax.measure;bundle-version="1.0.0",
|
||||
com.raytheon.uf.viz.core;bundle-version="1.11.31"
|
||||
com.raytheon.uf.viz.core;bundle-version="1.11.31",
|
||||
gov.noaa.nws.ncep.gempak.parameters.core
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Import-Package: gov.noaa.nws.ncep.viz.common.ui,
|
||||
Import-Package: gov.noaa.nws.ncep.gempak.parameters.core.contourinterval,
|
||||
gov.noaa.nws.ncep.gempak.parameters.core.util,
|
||||
gov.noaa.nws.ncep.viz.common.ui,
|
||||
gov.noaa.nws.ncep.viz.common.ui.color,
|
||||
gov.noaa.nws.ncep.viz.localization,
|
||||
org.junit
|
||||
Export-Package: gov.noaa.nws.ncep.gempak.parameters,
|
||||
gov.noaa.nws.ncep.gempak.parameters.categorymap,
|
||||
gov.noaa.nws.ncep.gempak.parameters.colors,
|
||||
gov.noaa.nws.ncep.gempak.parameters.contourinterval,
|
||||
gov.noaa.nws.ncep.gempak.parameters.discrete,
|
||||
gov.noaa.nws.ncep.gempak.parameters.dlines,
|
||||
gov.noaa.nws.ncep.gempak.parameters.gridlimits,
|
||||
|
@ -29,8 +30,5 @@ Export-Package: gov.noaa.nws.ncep.gempak.parameters,
|
|||
gov.noaa.nws.ncep.gempak.parameters.intext,
|
||||
gov.noaa.nws.ncep.gempak.parameters.line,
|
||||
gov.noaa.nws.ncep.gempak.parameters.marker,
|
||||
gov.noaa.nws.ncep.gempak.parameters.marshaller.garea,
|
||||
gov.noaa.nws.ncep.gempak.parameters.marshaller.garea.station,
|
||||
gov.noaa.nws.ncep.gempak.parameters.title,
|
||||
gov.noaa.nws.ncep.gempak.parameters.util
|
||||
gov.noaa.nws.ncep.gempak.parameters.title
|
||||
Bundle-ClassPath: ., jna.jar
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
package gov.noaa.nws.ncep.gempak.parameters.discrete;
|
||||
|
||||
|
||||
import gov.noaa.nws.ncep.gempak.parameters.util.StringUtil;
|
||||
import gov.noaa.nws.ncep.gempak.parameters.core.util.StringUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
package gov.noaa.nws.ncep.gempak.parameters.dlines;
|
||||
import gov.noaa.nws.ncep.gempak.parameters.util.StringUtil;
|
||||
import gov.noaa.nws.ncep.gempak.parameters.core.util.StringUtil;
|
||||
|
||||
/**<pre>
|
||||
* Parses an input <tt>String</tt> of the form <tt> yes or no;yes or no [ | epsilon ]</tt>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
package gov.noaa.nws.ncep.gempak.parameters.gridlimits;
|
||||
|
||||
import gov.noaa.nws.ncep.gempak.parameters.util.StringUtil;
|
||||
import gov.noaa.nws.ncep.gempak.parameters.core.util.StringUtil;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
|
||||
import gov.noaa.nws.ncep.gempak.parameters.infill.FINT;
|
||||
import gov.noaa.nws.ncep.gempak.parameters.contourinterval.ContourStringParser;
|
||||
import gov.noaa.nws.ncep.gempak.parameters.core.contourinterval.ContourStringParser;
|
||||
//import gov.noaa.nws.ncep.gempak.parameters.fillinterval.FINT.ZoomLevel;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package gov.noaa.nws.ncep.gempak.parameters.infill;
|
||||
|
||||
import gov.noaa.nws.ncep.gempak.parameters.util.StringUtil;
|
||||
import gov.noaa.nws.ncep.gempak.parameters.core.util.StringUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package gov.noaa.nws.ncep.gempak.parameters.inline;
|
||||
|
||||
import gov.noaa.nws.ncep.gempak.parameters.util.StringUtil;
|
||||
import gov.noaa.nws.ncep.gempak.parameters.core.util.StringUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
|
@ -8,23 +8,21 @@ Eclipse-RegisterBuddy: com.raytheon.viz.core,
|
|||
org.apache.log4j
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
org.eclipse.core.runtime,
|
||||
com.raytheon.uf.common.message,
|
||||
com.raytheon.viz.ui,
|
||||
com.raytheon.viz.core,
|
||||
org.geotools,
|
||||
gov.noaa.nws.ncep.viz.common;bundle-version="1.0.0",
|
||||
org.apache.log4j;bundle-version="1.0.0",
|
||||
com.sun.jna;bundle-version="3.0.9",
|
||||
gov.noaa.nws.ncep.viz.ui.display;bundle-version="1.0.0",
|
||||
gov.noaa.nws.ncep.edex.common;bundle-version="1.0.0",
|
||||
org.apache.commons.beanutils;bundle-version="1.6.1",
|
||||
com.raytheon.viz.core,
|
||||
com.raytheon.viz.ui,
|
||||
com.raytheon.viz.texteditor;bundle-version="1.11.22",
|
||||
gov.noaa.nws.ncep.viz.localization;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.message,
|
||||
com.raytheon.viz.core.gl;bundle-version="1.12.1174",
|
||||
org.dom4j,
|
||||
gov.noaa.nws.ncep.viz.tools;bundle-version="1.0.0",
|
||||
gov.noaa.nws.ncep.gempak.parameters;bundle-version="1.0.0",
|
||||
org.junit;bundle-version="1.0.0",
|
||||
com.raytheon.viz.core.gl;bundle-version="1.12.1174"
|
||||
gov.noaa.nws.ncep.edex.common;bundle-version="1.0.0",
|
||||
gov.noaa.nws.ncep.viz.common;bundle-version="1.0.0",
|
||||
gov.noaa.nws.ncep.viz.localization;bundle-version="1.0.0",
|
||||
gov.noaa.nws.ncep.gempak.parameters.core;bundle-version="1.0.0",
|
||||
gov.noaa.nws.ncep.viz.customprojection;bundle-version="1.0.0"
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Export-Package: gov.noaa.nws.ncep.ui.pgen,
|
||||
gov.noaa.nws.ncep.ui.pgen.attrDialog,
|
||||
|
@ -36,12 +34,14 @@ Export-Package: gov.noaa.nws.ncep.ui.pgen,
|
|||
gov.noaa.nws.ncep.ui.pgen.elements.tcm,
|
||||
gov.noaa.nws.ncep.ui.pgen.file,
|
||||
gov.noaa.nws.ncep.ui.pgen.gfa,
|
||||
gov.noaa.nws.ncep.ui.pgen.maps,
|
||||
gov.noaa.nws.ncep.ui.pgen.rsc,
|
||||
gov.noaa.nws.ncep.ui.pgen.sigmet,
|
||||
gov.noaa.nws.ncep.ui.pgen.tca,
|
||||
gov.noaa.nws.ncep.ui.pgen.tools
|
||||
Import-Package: com.raytheon.edex.meteoLib,
|
||||
gov.noaa.nws.ncep.viz.localization,
|
||||
com.raytheon.viz.core.gl,
|
||||
com.raytheon.viz.core.gl.images,
|
||||
gov.noaa.nws.ncep.common.staticdata,
|
||||
javax.measure.unit
|
||||
Bundle-ClassPath: .
|
||||
|
|
|
@ -10,7 +10,7 @@ package gov.noaa.nws.ncep.ui.pgen;
|
|||
import gov.noaa.nws.ncep.ui.pgen.controls.PgenCommandManager;
|
||||
import gov.noaa.nws.ncep.ui.pgen.palette.PgenPaletteWindow;
|
||||
import gov.noaa.nws.ncep.ui.pgen.rsc.PgenResource;
|
||||
import gov.noaa.nws.ncep.viz.ui.display.NmapUiUtils;
|
||||
//import gov.noaa.nws.ncep.viz.ui.display.NmapUiUtils;
|
||||
|
||||
/**
|
||||
* This singleton is intended to couple a PGEN Palette with a PGgenResource, so that
|
||||
|
@ -95,7 +95,8 @@ public class PgenSession {
|
|||
public PgenResource getPgenResource() {
|
||||
|
||||
if ( pgenResource == null ) {
|
||||
PgenResource rsc = PgenUtil.findPgenResource(NmapUiUtils.getActiveNatlCntrsEditor());
|
||||
// PgenResource rsc = PgenUtil.findPgenResource(NmapUiUtils.getActiveNatlCntrsEditor());
|
||||
PgenResource rsc = PgenUtil.findPgenResource(PgenUtil.getActiveEditor());
|
||||
if ( rsc != null ) {
|
||||
pgenResource = rsc;
|
||||
}
|
||||
|
|
|
@ -21,8 +21,9 @@ import gov.noaa.nws.ncep.ui.pgen.graphToGrid.CoordinateTransform;
|
|||
import gov.noaa.nws.ncep.ui.pgen.rsc.PgenResource;
|
||||
import gov.noaa.nws.ncep.ui.pgen.rsc.PgenResourceData;
|
||||
import gov.noaa.nws.ncep.ui.pgen.tca.TCAElement;
|
||||
import gov.noaa.nws.ncep.viz.ui.display.NCMapEditor;
|
||||
import gov.noaa.nws.ncep.viz.ui.display.NmapUiUtils;
|
||||
//import gov.noaa.nws.ncep.viz.ui.display.NCMapEditor;
|
||||
//import gov.noaa.nws.ncep.viz.ui.display.NCMapEditor;
|
||||
//import gov.noaa.nws.ncep.viz.ui.display.NmapUiUtils;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
|
@ -54,6 +55,7 @@ import org.opengis.referencing.operation.MathTransform;
|
|||
import com.raytheon.uf.common.geospatial.MapUtil;
|
||||
import com.raytheon.uf.viz.core.IDisplayPane;
|
||||
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
||||
import com.raytheon.uf.viz.core.drawables.IRenderableDisplay;
|
||||
import com.raytheon.uf.viz.core.drawables.ResourcePair;
|
||||
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
||||
import com.raytheon.uf.viz.core.map.IMapDescriptor;
|
||||
|
@ -61,6 +63,9 @@ import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
|||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||
import com.raytheon.uf.viz.core.rsc.ResourceList;
|
||||
import com.raytheon.viz.ui.EditorUtil;
|
||||
import com.raytheon.viz.ui.editor.AbstractEditor;
|
||||
import com.raytheon.viz.ui.editor.EditorInput;
|
||||
import com.raytheon.viz.ui.editor.ISelectedPanesChangedListener;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
import com.vividsolutions.jts.geom.Geometry;
|
||||
import com.vividsolutions.jts.geom.MultiPolygon;
|
||||
|
@ -149,14 +154,18 @@ public class PgenUtil {
|
|||
*/
|
||||
public static final String FOUR_ZERO = "0000";
|
||||
public static final String FIVE_ZERO = "00000";
|
||||
|
||||
//Default CAVE window title string
|
||||
public static final String CaveTitle = "CAVE";
|
||||
|
||||
/**
|
||||
* Check the given editor for a PgenResource. If editor is null then the current Nmap Editor is used. If found, return it.
|
||||
* @param editor
|
||||
* @return reference to a PgenResource
|
||||
*/
|
||||
public static final PgenResource findPgenResource(NCMapEditor editor) {
|
||||
return (PgenResource)NmapUiUtils.findResource( PgenResource.class, editor );
|
||||
public static final PgenResource findPgenResource(AbstractEditor editor) {
|
||||
// return (PgenResource)NmapUiUtils.findResource( PgenResource.class, editor );
|
||||
return (PgenResource)findResource( PgenResource.class, editor );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -539,7 +548,8 @@ public class PgenUtil {
|
|||
public static final PgenResource createNewResource() {
|
||||
|
||||
PgenResource drawingLayer = null;
|
||||
NCMapEditor editor = NmapUiUtils.getActiveNatlCntrsEditor();
|
||||
// NCMapEditor editor = NmapUiUtils.getActiveNatlCntrsEditor();
|
||||
AbstractEditor editor = getActiveEditor();
|
||||
if(editor != null){
|
||||
try {
|
||||
switch ( getPgenMode() ) {
|
||||
|
@ -585,8 +595,10 @@ public class PgenUtil {
|
|||
* Refresh the PGEN drawing editor.
|
||||
*/
|
||||
public static final void refresh() {
|
||||
if( NmapUiUtils.getActiveNatlCntrsEditor() != null )
|
||||
NmapUiUtils.getActiveNatlCntrsEditor().refresh();
|
||||
// if( NmapUiUtils.getActiveNatlCntrsEditor() != null )
|
||||
// NmapUiUtils.getActiveNatlCntrsEditor().refresh();
|
||||
if( getActiveEditor() != null )
|
||||
getActiveEditor().refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -933,7 +945,8 @@ public class PgenUtil {
|
|||
* @param loc - Location
|
||||
* @param me - map editor
|
||||
*/
|
||||
static public void mergeLabels(LabeledLine ll, Coordinate loc, NCMapEditor mapEditor ){
|
||||
// static public void mergeLabels(LabeledLine ll, Coordinate loc, NCMapEditor mapEditor ){
|
||||
static public void mergeLabels(LabeledLine ll, Coordinate loc, AbstractEditor mapEditor ){
|
||||
|
||||
//label at location loc.
|
||||
Label testLbl = null;
|
||||
|
@ -1580,4 +1593,130 @@ public class PgenUtil {
|
|||
|
||||
return wrappedLine.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a reference to the current editor, if it is a AbstractEditor.
|
||||
*
|
||||
* Copy from NmapUiUtils.getActiveNatlCntrsEditor() - to remove dependency on ui.display.
|
||||
*/
|
||||
public static final AbstractEditor getActiveEditor() {
|
||||
// bsteffen change to EditorUtils
|
||||
// if (VizApp.getCurrentEditor() instanceof NCMapEditor) {
|
||||
// return (NCMapEditor) VizApp.getCurrentEditor();
|
||||
if (EditorUtil.getActiveEditor() instanceof AbstractEditor) {
|
||||
return (AbstractEditor) EditorUtil.getActiveEditor();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Do we need to look in all the panes or just the active (or the
|
||||
// selected panes)
|
||||
//
|
||||
public static final AbstractVizResource findResource(
|
||||
Class<? extends AbstractVizResource> rscClass, AbstractEditor aEdit) {
|
||||
AbstractEditor editor = (aEdit != null ? aEdit : getActiveEditor());
|
||||
if (editor == null)
|
||||
return null;
|
||||
|
||||
IRenderableDisplay disp = editor.getActiveDisplayPane()
|
||||
.getRenderableDisplay();
|
||||
|
||||
if (disp == null)
|
||||
return null;
|
||||
|
||||
ResourceList rscList = disp.getDescriptor().getResourceList();
|
||||
|
||||
for (ResourcePair rp : rscList) {
|
||||
AbstractVizResource rsc = rp.getResource();
|
||||
|
||||
if (rsc.getClass() == rscClass) {
|
||||
return rsc;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify the title of the CAVE to "CAVE:title".
|
||||
*/
|
||||
public static final void setCaveTitle(String title) {
|
||||
if (PlatformUI.getWorkbench().getActiveWorkbenchWindow() != null
|
||||
&& PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell() != null) {
|
||||
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()
|
||||
.setText( CaveTitle + ":" + title );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the title of the CAVE to "CAVE".
|
||||
*/
|
||||
public static final void resetCaveTitle() {
|
||||
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()
|
||||
.setText( CaveTitle );
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the display ID for multipane editor
|
||||
*
|
||||
* Copy from NmapUiUtils.getNcDisplayID()
|
||||
*/
|
||||
public static int getDisplayID(String displayTitle) {
|
||||
int indx = displayTitle.indexOf("-");
|
||||
if (indx == -1 || indx > 3) {
|
||||
return -1;
|
||||
} else {
|
||||
return Integer.parseInt(displayTitle.substring(0, indx));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get an editor's name
|
||||
*
|
||||
* Copy from NCMapEditor.getDisplayName()
|
||||
*/
|
||||
public static String getDisplayName( AbstractEditor editor ) {
|
||||
return editor.getEditorInput().getName();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.ui.editor.IMultiPaneEditor#getNumberofPanes()
|
||||
*/
|
||||
public static int getNumberofPanes( AbstractEditor editor ) {
|
||||
return ((EditorInput)editor.getEditorInput()).getPaneManager().getNumberofPanes();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.viz.ui.editor.IMultiPaneEditor#addSelectedPaneChangedListener
|
||||
* (com.raytheon.viz.ui.editor.ISelectedPanesChangedListener)
|
||||
*/
|
||||
public static void addSelectedPaneChangedListener( AbstractEditor editor,
|
||||
ISelectedPanesChangedListener listener) {
|
||||
((EditorInput)editor.getEditorInput()).getPaneManager().addSelectedPaneChangedListener(listener);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.viz.ui.editor.IMultiPaneEditor#removeSelectedPaneChangedListener
|
||||
* (com.raytheon.viz.ui.editor.ISelectedPanesChangedListener)
|
||||
*/
|
||||
public static void removeSelectedPaneChangedListener( AbstractEditor editor,
|
||||
ISelectedPanesChangedListener listener) {
|
||||
((EditorInput)editor.getEditorInput()).getPaneManager().removeSelectedPaneChangedListener(listener);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.eclipse.jface.dialogs.Dialog;
|
|||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.viz.ui.editor.AbstractEditor;
|
||||
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.rsc.PgenResource;
|
||||
|
@ -31,7 +32,7 @@ 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.display.IAttribute;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.Jet;
|
||||
import gov.noaa.nws.ncep.viz.ui.display.NCMapEditor;
|
||||
//import gov.noaa.nws.ncep.viz.ui.display.NCMapEditor;
|
||||
import gov.noaa.nws.ncep.ui.pgen.sigmet.*;
|
||||
import gov.noaa.nws.ncep.ui.pgen.attrDialog.vaaDialog.*;
|
||||
|
||||
|
@ -74,7 +75,8 @@ public abstract class AttrDlg extends Dialog implements IAttribute {
|
|||
* A handler to the current map editor. The map editor is used to
|
||||
* redraw the drawing layer when user click on 'OK'.
|
||||
*/
|
||||
protected NCMapEditor mapEditor = null;
|
||||
// protected NCMapEditor mapEditor = null;
|
||||
protected AbstractEditor mapEditor = null;
|
||||
protected String pgenCategory = null;
|
||||
protected String pgenType = null;
|
||||
protected static final int CHK_WIDTH = 16;
|
||||
|
@ -140,7 +142,8 @@ public abstract class AttrDlg extends Dialog implements IAttribute {
|
|||
* Sets the map editor
|
||||
* @param me
|
||||
*/
|
||||
public void setMapEditor( NCMapEditor me ){
|
||||
// public void setMapEditor( NCMapEditor me ){
|
||||
public void setMapEditor( AbstractEditor me ){
|
||||
this.mapEditor = me;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,27 +8,24 @@
|
|||
|
||||
package gov.noaa.nws.ncep.ui.pgen.attrDialog;
|
||||
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.AbstractDrawableComponent;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.Text;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.Track;
|
||||
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.Products;
|
||||
import gov.noaa.nws.ncep.ui.pgen.productManage.ProductConfigureDialog;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import com.raytheon.uf.common.localization.LocalizationContext;
|
||||
import com.raytheon.uf.common.localization.LocalizationFile;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.*;
|
||||
|
||||
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.Products;
|
||||
import gov.noaa.nws.ncep.ui.pgen.productManage.ProductConfigureDialog;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager.NcPathConstants;
|
||||
|
||||
/**
|
||||
* Singleton for the default attribute settings of PGEN DrawableElements.
|
||||
*
|
||||
|
@ -56,7 +53,7 @@ public class AttrSettings {
|
|||
private static HashMap<String, AbstractDrawableComponent> settings = null;
|
||||
|
||||
private static String settingsTblLocal = "." + File.separator;
|
||||
private static String settingsFileName = "settings_tbl.xml";
|
||||
public static String settingsFileName = "settings_tbl.xml";
|
||||
|
||||
/**
|
||||
* Private constructor
|
||||
|
@ -139,8 +136,8 @@ public class AttrSettings {
|
|||
/*
|
||||
* Get the settings table file from localization
|
||||
*/
|
||||
File settingsFile = NcPathManager.getInstance().getStaticFile(
|
||||
NcPathConstants.PGEN_SETTINGS_TBL );
|
||||
File settingsFile = PgenStaticDataProvider.getProvider().getFile(
|
||||
PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + settingsFileName);
|
||||
|
||||
if ( settingsFile == null ) {
|
||||
System.out.println("Unable to fing pgen settings table");
|
||||
|
@ -159,13 +156,8 @@ public class AttrSettings {
|
|||
|
||||
String pt = ProductConfigureDialog.getProductTypes().get(prodName).getType();
|
||||
String pt1 = pt.replaceAll(" ", "_");
|
||||
// LocalizationContext userContext = NcPathManager.getInstance().getContext(
|
||||
// LocalizationType.CAVE_STATIC, LocalizationLevel.USER );
|
||||
|
||||
// LocalizationFile lFile1 = NcPathManager.getInstance().getLocalizationFile(
|
||||
// userContext, ProductConfigureDialog.getSettingFullPath(pt1));
|
||||
|
||||
LocalizationFile lFile = NcPathManager.getInstance().getStaticLocalizationFile(ProductConfigureDialog.getSettingFullPath(pt1));
|
||||
LocalizationFile lFile = PgenStaticDataProvider.getProvider().getStaticLocalizationFile(ProductConfigureDialog.getSettingFullPath(pt1));
|
||||
|
||||
String filePath = lFile.getFile().getAbsolutePath();
|
||||
if ( !new File( filePath).canRead()){
|
||||
|
|
|
@ -8,12 +8,11 @@
|
|||
|
||||
package gov.noaa.nws.ncep.ui.pgen.attrDialog;
|
||||
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.AbstractDrawableComponent;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.DrawableElement;
|
||||
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.ILine;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.AbstractDrawableComponent;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.DrawableElement;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.Line;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.MidCloudText;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.labeledLines.Cloud;
|
||||
|
@ -590,7 +589,6 @@ public class CloudAttrDlg extends AttrDlg implements ILine{
|
|||
public boolean close(){
|
||||
|
||||
if ( labelDlg != null ) labelDlg.close();
|
||||
PgenUtil.setSelectingMode();
|
||||
return super.close();
|
||||
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ import org.eclipse.ui.PlatformUI;
|
|||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
import gov.noaa.nws.ncep.gempak.parameters.contourinterval.CINT;
|
||||
import gov.noaa.nws.ncep.gempak.parameters.core.contourinterval.CINT;
|
||||
import gov.noaa.nws.ncep.ui.pgen.contours.ContourCircle;
|
||||
import gov.noaa.nws.ncep.ui.pgen.contours.ContourLine;
|
||||
import gov.noaa.nws.ncep.ui.pgen.contours.ContourMinmax;
|
||||
|
|
|
@ -14,9 +14,8 @@ import java.util.Calendar;
|
|||
import java.util.List;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.contours.IContours;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager.NcPathConstants;
|
||||
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.Node;
|
||||
|
@ -474,8 +473,9 @@ public class ContoursInfoDlg extends CaveJFACEDialog implements IContours {
|
|||
|
||||
if ( contoursInfoTbl == null) {
|
||||
try {
|
||||
String cntrInfoFile = NcPathManager.getInstance().getStaticFile(
|
||||
NcPathConstants.PGEN_CONTOURS_INFO ).getAbsolutePath();
|
||||
String cntrInfoFile = PgenStaticDataProvider.getProvider().getFileAbsolutePath(
|
||||
PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + "contoursInfo.xml" );
|
||||
|
||||
SAXReader reader = new SAXReader();
|
||||
contoursInfoTbl = reader.read(cntrInfoFile);
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -10,6 +10,7 @@ package gov.noaa.nws.ncep.ui.pgen.attrDialog;
|
|||
|
||||
import static gov.noaa.nws.ncep.ui.pgen.gfa.GfaInfo.*;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenSession;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.AbstractDrawableComponent;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.DrawableElement;
|
||||
|
@ -22,14 +23,12 @@ import gov.noaa.nws.ncep.ui.pgen.gfa.PreloadGfaDataThread;
|
|||
import gov.noaa.nws.ncep.ui.pgen.tools.PgenCycleTool;
|
||||
import gov.noaa.nws.ncep.viz.common.SnapUtil;
|
||||
import gov.noaa.nws.ncep.viz.common.ui.color.ColorButtonSelector;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager.NcPathConstants;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
//import org.apache.log4j.Logger;
|
||||
import org.dom4j.Node;
|
||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
import org.eclipse.jface.util.IPropertyChangeListener;
|
||||
|
@ -75,7 +74,8 @@ public class GfaAttrDlg extends LineAttrDlg implements IGfa {
|
|||
private static GfaAttrDlg instance = null;
|
||||
|
||||
/** Logger */
|
||||
private final static Logger log = Logger.getLogger(GfaAttrDlg.class);
|
||||
// private final static Logger log = Logger.getLogger(GfaAttrDlg.class);
|
||||
public static final String PGEN_RED_CROSS_IMG = "red_cross.png";
|
||||
|
||||
private final String[] LABELS = { "Hazard:", "Fcst Hr:", "Tag:", "Desk:", "Issue Type:", "", "" };
|
||||
|
||||
|
@ -130,8 +130,8 @@ public class GfaAttrDlg extends LineAttrDlg implements IGfa {
|
|||
private Label warning;
|
||||
|
||||
private final String RED_CROSS_PATH =
|
||||
NcPathManager.getInstance().getStaticFile(
|
||||
NcPathConstants.PGEN_RED_CROSS_IMG ).getAbsolutePath();
|
||||
PgenStaticDataProvider.getProvider().getFileAbsolutePath(
|
||||
PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + PGEN_RED_CROSS_IMG );
|
||||
|
||||
/** Digits, semicolon*/
|
||||
private final String TIME = "[01234569]?|12|[012345]?:|[012345]?:(0|1|3|4|00|15|30|45)";
|
||||
|
@ -158,7 +158,8 @@ public class GfaAttrDlg extends LineAttrDlg implements IGfa {
|
|||
try {
|
||||
instance = new GfaAttrDlg(parShell);
|
||||
} catch (VizException e) {
|
||||
log.error(e.getStackTrace());
|
||||
// log.error(e.getStackTrace());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return instance;
|
||||
|
|
|
@ -30,7 +30,7 @@ import java.util.HashMap;
|
|||
|
||||
import javax.xml.bind.JAXBException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
//import org.apache.log4j.Logger;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
|
@ -65,7 +65,7 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
|||
*/
|
||||
public class GfaFormatAttrDlg extends AttrDlg {
|
||||
|
||||
private final static Logger logger = Logger.getLogger(GfaFormatAttrDlg.class);
|
||||
// private final static Logger logger = Logger.getLogger(GfaFormatAttrDlg.class);
|
||||
|
||||
private static final String ZULU = "ZULU";
|
||||
private static final String TANGO = "TANGO";
|
||||
|
@ -131,7 +131,8 @@ public class GfaFormatAttrDlg extends AttrDlg {
|
|||
instance = new GfaFormatAttrDlg(parShell);
|
||||
|
||||
} catch (VizException e) {
|
||||
logger.error(e);
|
||||
// logger.error(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -317,10 +318,12 @@ public class GfaFormatAttrDlg extends AttrDlg {
|
|||
text.setText(sb.toString());
|
||||
} catch (IOException e) {
|
||||
text.setText("I/O Error");
|
||||
logger.error(e);
|
||||
// logger.error(e);
|
||||
e.printStackTrace();
|
||||
} catch (JAXBException e) {
|
||||
text.setText("Serialization Error");
|
||||
logger.error(e);
|
||||
// logger.error(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
getButton(OK_ID).setEnabled(false);
|
||||
|
|
|
@ -512,6 +512,7 @@ public class JetAttrDlg extends LineAttrDlg {
|
|||
if ( barbAttrDlg != null ) barbAttrDlg.close();
|
||||
if ( hashAttrDlg != null ) hashAttrDlg.close();
|
||||
if ( flAttrDlg != null ) flAttrDlg.close();
|
||||
jetTool = null; //prevent reseting mouse handler
|
||||
barbDlg.close();
|
||||
return super.close();
|
||||
|
||||
|
|
|
@ -8,47 +8,16 @@
|
|||
|
||||
package gov.noaa.nws.ncep.ui.pgen.attrDialog;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.awt.Color;
|
||||
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.Node;
|
||||
import org.dom4j.io.SAXReader;
|
||||
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.widgets.Group;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.graphics.RGB;
|
||||
import org.eclipse.swt.widgets.Slider;
|
||||
import org.eclipse.swt.widgets.Combo;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
import gov.noaa.nws.ncep.edex.common.stationTables.StationTable;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenSession;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.contours.IContours;
|
||||
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.ILine;
|
||||
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.display.IAttribute;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.Layer;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.Line;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.Outlook;
|
||||
|
@ -59,8 +28,36 @@ 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.graphToGrid.GraphToGridParamDialog;
|
||||
import gov.noaa.nws.ncep.viz.common.ui.color.ColorButtonSelector;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager.NcPathConstants;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.Node;
|
||||
import org.dom4j.io.SAXReader;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
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.Combo;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Group;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.swt.widgets.Slider;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
* Singleton attribute dialog for outlooks.
|
||||
|
@ -1280,8 +1277,8 @@ public class OutlookAttrDlg extends AttrDlg implements IContours, ILine{
|
|||
|
||||
if (outlookTbl == null) {
|
||||
try {
|
||||
String outlookTypeFile = NcPathManager.getInstance().getStaticFile(
|
||||
NcPathConstants.PGEN_OUTLOOK_TYPE ).getAbsolutePath();
|
||||
String outlookTypeFile = PgenStaticDataProvider.getProvider().getFileAbsolutePath(
|
||||
PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + "outlooktype.xml" );
|
||||
|
||||
SAXReader reader = new SAXReader();
|
||||
outlookTbl = reader.read(outlookTypeFile);
|
||||
|
@ -1465,9 +1462,9 @@ public class OutlookAttrDlg extends AttrDlg implements IContours, ILine{
|
|||
|
||||
settings = new HashMap<String, Line>();
|
||||
|
||||
String settingFile = NcPathManager.getInstance().getStaticFile(
|
||||
NcPathConstants.PGEN_OUTLOOK_SETTINGS ).getAbsolutePath();
|
||||
|
||||
String settingFile = PgenStaticDataProvider.getProvider().getFileAbsolutePath(
|
||||
PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + "outlooksettings.xml" );
|
||||
|
||||
gov.noaa.nws.ncep.ui.pgen.file.Products products = FileTools.read( settingFile );
|
||||
|
||||
if ( products != null ){
|
||||
|
|
|
@ -20,6 +20,7 @@ import javax.xml.parsers.DocumentBuilder;
|
|||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.Layer;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.Outlook;
|
||||
|
@ -27,8 +28,6 @@ import gov.noaa.nws.ncep.ui.pgen.elements.Product;
|
|||
import gov.noaa.nws.ncep.ui.pgen.elements.AbstractDrawableComponent;
|
||||
import gov.noaa.nws.ncep.ui.pgen.file.ProductConverter;
|
||||
import gov.noaa.nws.ncep.ui.pgen.file.Products;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager.NcPathConstants;
|
||||
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.Node;
|
||||
|
@ -411,9 +410,9 @@ public class OutlookFormatDlg extends CaveJFACEDialog{
|
|||
DOMSource ds = new DOMSource(sw);
|
||||
|
||||
//get style sheet file path
|
||||
String xsltPath = NcPathConstants.PGEN_ROOT + File.separator + "xslt" + File.separator + "outlook" + File.separator + "Outlook.xlt";
|
||||
String xsltPath = PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + File.separator + "xslt" + File.separator + "outlook" + File.separator + "Outlook.xlt";
|
||||
|
||||
LocalizationFile lFile = NcPathManager.getInstance().getStaticLocalizationFile(xsltPath);
|
||||
LocalizationFile lFile = PgenStaticDataProvider.getProvider().getStaticLocalizationFile(xsltPath);
|
||||
|
||||
if ( lFile != null ){
|
||||
msg = PgenUtil.applyStyleSheet( ds, lFile.getFile().getAbsolutePath());
|
||||
|
@ -500,8 +499,9 @@ public class OutlookFormatDlg extends CaveJFACEDialog{
|
|||
|
||||
if ( otlkTimesTbl == null) {
|
||||
try {
|
||||
String outlookTimesFile = NcPathManager.getInstance().getStaticFile(
|
||||
NcPathConstants.PGEN_OUTLOOK_TIMES ).getAbsolutePath();
|
||||
String outlookTimesFile = PgenStaticDataProvider.getProvider().getFileAbsolutePath(
|
||||
PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + "outlooktimes.xml" );
|
||||
|
||||
SAXReader reader = new SAXReader();
|
||||
otlkTimesTbl = reader.read(outlookTimesFile);
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -12,12 +12,11 @@ import java.util.ArrayList;
|
|||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.filter.ElementFilter;
|
||||
import gov.noaa.nws.ncep.ui.pgen.filter.ForecastHourFilter;
|
||||
import gov.noaa.nws.ncep.ui.pgen.rsc.PgenResource;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager.NcPathConstants;
|
||||
import gov.noaa.nws.ncep.viz.ui.display.NCMapEditor;
|
||||
//import gov.noaa.nws.ncep.viz.ui.display.NCMapEditor;
|
||||
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.Node;
|
||||
|
@ -37,6 +36,7 @@ import org.eclipse.swt.widgets.Shell;
|
|||
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
|
||||
import com.raytheon.viz.ui.editor.AbstractEditor;
|
||||
|
||||
/**
|
||||
* Implementation of a dialog to control filters.
|
||||
|
@ -65,7 +65,8 @@ public class PgenFilterDlg extends CaveJFACEDialog {
|
|||
private PgenResource drawingLayer;
|
||||
|
||||
//Map editor
|
||||
private NCMapEditor mapEditor;
|
||||
// private NCMapEditor mapEditor;
|
||||
private AbstractEditor mapEditor;
|
||||
|
||||
//top level container for all widgets
|
||||
private Composite top;
|
||||
|
@ -378,7 +379,8 @@ public class PgenFilterDlg extends CaveJFACEDialog {
|
|||
* @param resource
|
||||
* @param editor
|
||||
*/
|
||||
public void setResource(PgenResource resource, NCMapEditor editor){
|
||||
public void setResource(PgenResource resource, AbstractEditor editor){
|
||||
// public void setResource(PgenResource resource, NCMapEditor editor){
|
||||
this.drawingLayer = resource;
|
||||
this.mapEditor = editor;
|
||||
}
|
||||
|
@ -392,8 +394,8 @@ public class PgenFilterDlg extends CaveJFACEDialog {
|
|||
|
||||
if (HOURS == null) {
|
||||
try {
|
||||
String filterHourFile = NcPathManager.getInstance().getStaticFile(
|
||||
NcPathConstants.PGEN_FILTER_HOUR ).getAbsolutePath();
|
||||
String filterHourFile = PgenStaticDataProvider.getProvider().getFileAbsolutePath(
|
||||
PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + "filterHour.xml" );
|
||||
|
||||
SAXReader reader = new SAXReader();
|
||||
filterHourTbl = reader.read(filterHourFile);
|
||||
|
|
|
@ -13,6 +13,7 @@ import static gov.noaa.nws.ncep.ui.pgen.sigmet.SigmetInfo.ID_MAP;
|
|||
import static gov.noaa.nws.ncep.ui.pgen.sigmet.SigmetInfo.SIGMET_TYPES;
|
||||
import static gov.noaa.nws.ncep.ui.pgen.sigmet.SigmetInfo.VOL_NAME_BUCKET_ARRAY;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenSession;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.display.FillPatternList.FillPattern;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.AbstractDrawableComponent;
|
||||
|
@ -22,8 +23,6 @@ import gov.noaa.nws.ncep.ui.pgen.sigmet.Sigmet;
|
|||
import gov.noaa.nws.ncep.ui.pgen.sigmet.SigmetInfo;
|
||||
import gov.noaa.nws.ncep.viz.common.SnapUtil;
|
||||
import gov.noaa.nws.ncep.viz.common.ui.color.ColorButtonSelector;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager.NcPathConstants;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.beans.PropertyDescriptor;
|
||||
|
@ -2504,8 +2503,8 @@ GridData gdText = new GridData(); gdText.widthHint=66;
|
|||
|
||||
org.w3c.dom.NodeList nlist = null;
|
||||
|
||||
File file = NcPathManager.getInstance().getStaticFile(
|
||||
NcPathConstants.PGEN_PHENOMENONS );
|
||||
File file = PgenStaticDataProvider.getProvider().getStaticFile(
|
||||
PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + "phenomenons.xml" );
|
||||
|
||||
try {
|
||||
org.w3c.dom.Document doc =
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
package gov.noaa.nws.ncep.ui.pgen.attrDialog;
|
||||
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenSession;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.AbstractDrawableComponent;
|
||||
import gov.noaa.nws.ncep.ui.pgen.display.FillPatternList.FillPattern;
|
||||
|
@ -19,7 +20,6 @@ import gov.noaa.nws.ncep.ui.pgen.sigmet.ISigmet;
|
|||
import gov.noaa.nws.ncep.ui.pgen.sigmet.Sigmet;
|
||||
import gov.noaa.nws.ncep.ui.pgen.sigmet.SigmetInfo;
|
||||
import gov.noaa.nws.ncep.viz.common.SnapUtil;
|
||||
import gov.noaa.nws.ncep.viz.common.dbQuery.NcDirectDbQuery;
|
||||
import gov.noaa.nws.ncep.viz.common.ui.color.ColorButtonSelector;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.DrawableElement;
|
||||
|
||||
|
@ -878,18 +878,7 @@ public class SigmetCommAttrDlg extends AttrDlg implements ISigmet{
|
|||
//"id","bounds.greatlakesbnds"
|
||||
//"id","bounds.adjcstlbnds"
|
||||
public static List<Object[]> initAllStates(String field, String table){
|
||||
List<Object[]> list = null;
|
||||
String query = "Select AsBinary(the_geom_0_016), "+field+" FROM "+table;//mapdata.states";
|
||||
|
||||
try {
|
||||
list = NcDirectDbQuery.executeQuery( query, "ncep", QueryLanguage.SQL);
|
||||
}
|
||||
catch (Exception e ){
|
||||
System.out.println("___ Error: SigmetCommAttrDlg: initAllStates(): "+e.getMessage());
|
||||
list = new ArrayList<Object[]>();
|
||||
}
|
||||
|
||||
return list;
|
||||
return PgenStaticDataProvider.getProvider().queryNcepDB(field, table);
|
||||
}
|
||||
|
||||
public static List<String> getAreaStringList(Polygon cSigPoly, IMapDescriptor mapDescriptor, String field, String table){
|
||||
|
|
|
@ -47,6 +47,7 @@ import com.raytheon.uf.common.serialization.SerializationUtil;
|
|||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.display.IAttribute;
|
||||
import gov.noaa.nws.ncep.ui.pgen.tca.Basin;
|
||||
|
@ -55,8 +56,6 @@ import gov.noaa.nws.ncep.ui.pgen.tca.ITca;
|
|||
import gov.noaa.nws.ncep.ui.pgen.tca.StormAdvisoryNumber;
|
||||
import gov.noaa.nws.ncep.ui.pgen.tca.TropicalCycloneAdvisory;
|
||||
import gov.noaa.nws.ncep.ui.pgen.tools.PgenTcaTool;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager.NcPathConstants;
|
||||
|
||||
/**
|
||||
* Singleton attribute dialog for text.
|
||||
|
@ -84,7 +83,8 @@ public class TcaAttrDlg extends AttrDlg implements ITca, SelectionListener {
|
|||
private static final String CREATE_TEXT_LABEL = "Create Text";
|
||||
private static final int CANCEL_ID = IDialogConstants.CLIENT_ID + 7588;
|
||||
private static final String CANCEL_LABEL = "Cancel All";
|
||||
|
||||
public static final String PGEN_TCA_ATTR_INFO = "TCAinfo.xml";
|
||||
|
||||
private final String APPLY = "Apply";
|
||||
private final String DELETE_SEGMENT = "Delete Segment";
|
||||
private final String NEW_SEGMENT = "New Segment";
|
||||
|
@ -996,9 +996,8 @@ public class TcaAttrDlg extends AttrDlg implements ITca, SelectionListener {
|
|||
*/
|
||||
private static void readOptions() {
|
||||
|
||||
File tcainfoFile = NcPathManager.getInstance().getStaticFile(
|
||||
NcPathConstants.PGEN_TCA_ATTR_INFO );
|
||||
|
||||
File tcainfoFile = PgenStaticDataProvider.getProvider().getStaticFile(
|
||||
PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + PGEN_TCA_ATTR_INFO);
|
||||
|
||||
try {
|
||||
info = (TcaAttrInfo)SerializationUtil.jaxbUnmarshalFromXmlFile(tcainfoFile.getAbsoluteFile() );
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
package gov.noaa.nws.ncep.ui.pgen.attrDialog;
|
||||
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.display.IAttribute;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.DrawableElementFactory;
|
||||
|
@ -16,8 +17,6 @@ import gov.noaa.nws.ncep.ui.pgen.elements.tcm.ITcm;
|
|||
import gov.noaa.nws.ncep.ui.pgen.elements.tcm.Tcm;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.tcm.TcmFcst;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.tcm.TcmWindQuarters;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager.NcPathConstants;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Calendar;
|
||||
|
@ -156,8 +155,8 @@ public class TcmAttrDlg extends AttrDlg implements ITcm, SelectionListener {
|
|||
*/
|
||||
private static void readOptions() {
|
||||
|
||||
File tcainfoFile = NcPathManager.getInstance().getStaticFile(
|
||||
NcPathConstants.PGEN_TCA_ATTR_INFO );
|
||||
File tcainfoFile = PgenStaticDataProvider.getProvider().getStaticFile(
|
||||
PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + TcaAttrDlg.PGEN_TCA_ATTR_INFO);
|
||||
|
||||
|
||||
try {
|
||||
|
|
|
@ -64,8 +64,8 @@ import gov.noaa.nws.ncep.viz.common.ui.color.ColorButtonSelector;
|
|||
|
||||
public class TrackAttrDlg extends AttrDlg implements ITrack{
|
||||
|
||||
private final static org.apache.log4j.Logger log =
|
||||
org.apache.log4j.Logger.getLogger(TrackAttrDlg.class);
|
||||
// private final static org.apache.log4j.Logger log =
|
||||
// org.apache.log4j.Logger.getLogger(TrackAttrDlg.class);
|
||||
|
||||
public static enum FontSizeName { TINY, SMALL, MEDIUM, LARGE, HUGE, GIANT };
|
||||
public static int[] FontSizeValue = { 10, 12, 14, 18, 24, 34 };
|
||||
|
@ -380,7 +380,7 @@ public class TrackAttrDlg extends AttrDlg implements ITrack{
|
|||
GridLayout childGridLayout = new GridLayout( 2, false );
|
||||
|
||||
this.getShell().setText("Track Attributes");
|
||||
log.info("===now it is inside initializeComponents(...)");
|
||||
// log.info("===now it is inside initializeComponents(...)");
|
||||
|
||||
/**
|
||||
* Draw Frame/Set time buttons
|
||||
|
|
|
@ -45,8 +45,8 @@ import gov.noaa.nws.ncep.ui.pgen.elements.Track;
|
|||
|
||||
public class TrackExtrapPointInfoDlg extends AttrDlg {
|
||||
|
||||
private final static org.apache.log4j.Logger log =
|
||||
org.apache.log4j.Logger.getLogger(TrackExtrapPointInfoDlg.class);
|
||||
// private final static org.apache.log4j.Logger log =
|
||||
// org.apache.log4j.Logger.getLogger(TrackExtrapPointInfoDlg.class);
|
||||
|
||||
private static TrackExtrapPointInfoDlg INSTANCE = null;
|
||||
|
||||
|
@ -233,7 +233,7 @@ public class TrackExtrapPointInfoDlg extends AttrDlg {
|
|||
mainLayout.marginWidth = 3;
|
||||
top.setLayout(mainLayout);
|
||||
|
||||
log.info("===right before calling initializeComponents(...) in TrackExtrapPointInfoDlg");
|
||||
// log.info("===right before calling initializeComponents(...) in TrackExtrapPointInfoDlg");
|
||||
// Initialize all of the menus, controls, and layouts
|
||||
initializeComponents(top, parent);
|
||||
|
||||
|
|
|
@ -8,12 +8,11 @@
|
|||
|
||||
package gov.noaa.nws.ncep.ui.pgen.attrDialog;
|
||||
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.AvnText;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.DrawableElement;
|
||||
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.ILine;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.AvnText;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.DrawableElement;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.Line;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.labeledLines.LabeledLine;
|
||||
import gov.noaa.nws.ncep.ui.pgen.tools.ILabeledLine;
|
||||
|
@ -605,7 +604,6 @@ public class TurbAttrDlg extends AttrDlg implements ILine {
|
|||
@Override
|
||||
public boolean close(){
|
||||
|
||||
PgenUtil.setSelectingMode();
|
||||
return super.close();
|
||||
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ import org.eclipse.swt.widgets.Text;
|
|||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
import gov.noaa.nws.ncep.common.staticdata.SPCCounty;
|
||||
import gov.noaa.nws.ncep.edex.common.stationTables.Station;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.AbstractDrawableComponent;
|
||||
|
@ -43,7 +44,6 @@ import gov.noaa.nws.ncep.ui.pgen.display.IAttribute;
|
|||
import gov.noaa.nws.ncep.ui.pgen.display.IWatchBox;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.WatchBox;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.WatchBox.WatchShape;
|
||||
import gov.noaa.nws.ncep.ui.pgen.maps.County;
|
||||
import gov.noaa.nws.ncep.ui.pgen.tools.PgenWatchBoxModifyTool;
|
||||
import gov.noaa.nws.ncep.viz.common.ui.color.ColorButtonSelector;
|
||||
|
||||
|
@ -583,7 +583,8 @@ public class WatchBoxAttrDlg extends AttrDlg implements IWatchBox{
|
|||
* @param flag
|
||||
*/
|
||||
public void enableDspBtn( boolean flag){
|
||||
dispBtn.setEnabled(flag);
|
||||
if ( !dispBtn.isDisposed() )
|
||||
dispBtn.setEnabled(flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -591,6 +592,7 @@ public class WatchBoxAttrDlg extends AttrDlg implements IWatchBox{
|
|||
* Close the watch attribute dialog and the watch info dialog
|
||||
*/
|
||||
public boolean close(){
|
||||
wbTool = null;
|
||||
if( infoDlg != null ){
|
||||
infoDlg.close();
|
||||
}
|
||||
|
@ -752,7 +754,7 @@ public class WatchBoxAttrDlg extends AttrDlg implements IWatchBox{
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<County> getCountyList() {
|
||||
public List<SPCCounty> getCountyList() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -8,12 +8,11 @@
|
|||
|
||||
package gov.noaa.nws.ncep.ui.pgen.attrDialog;
|
||||
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.productManage.ProductConfigureDialog;
|
||||
import gov.noaa.nws.ncep.ui.pgen.productTypes.ProductType;
|
||||
import gov.noaa.nws.ncep.ui.pgen.tools.PgenToolUtils;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager.NcPathConstants;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
@ -61,7 +60,8 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
|
|||
public class WatchCoordDlg extends CaveJFACEDialog {
|
||||
|
||||
static final int LINE_LEN = 65;
|
||||
|
||||
public static final String PGEN_FORECASTER = "forecasters.xml";
|
||||
|
||||
//instance of watch info dialog
|
||||
static private WatchCoordDlg INSTANCE = null;
|
||||
|
||||
|
@ -501,9 +501,9 @@ public class WatchCoordDlg extends CaveJFACEDialog {
|
|||
|
||||
if (FORECASTERS == null) {
|
||||
try {
|
||||
String forecasterFile = NcPathManager.getInstance().getStaticFile(
|
||||
NcPathConstants.PGEN_FORECASTER ).getAbsolutePath();
|
||||
|
||||
String forecasterFile = PgenStaticDataProvider.getProvider().getFileAbsolutePath(
|
||||
PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + PGEN_FORECASTER );
|
||||
|
||||
SAXReader reader = new SAXReader();
|
||||
forecasterTbl = reader.read(forecasterFile);
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
package gov.noaa.nws.ncep.ui.pgen.attrDialog;
|
||||
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.Layer;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.Product;
|
||||
|
@ -16,8 +17,6 @@ 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.productManage.ProductConfigureDialog;
|
||||
import gov.noaa.nws.ncep.ui.pgen.productTypes.ProductType;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager.NcPathConstants;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
|
@ -239,9 +238,9 @@ public class WatchFormatMsgDlg extends CaveJFACEDialog {
|
|||
DOMSource ds = new DOMSource(sw);
|
||||
|
||||
//get style sheet file path
|
||||
String xsltPath = NcPathConstants.PGEN_ROOT + File.separator + "xslt" + File.separator + "watchbox" + File.separator + xslt;
|
||||
String xsltPath = PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + "xslt" + File.separator + "watchbox" + File.separator + xslt;
|
||||
|
||||
LocalizationFile lFile = NcPathManager.getInstance().getStaticLocalizationFile(xsltPath);
|
||||
LocalizationFile lFile = PgenStaticDataProvider.getProvider().getStaticLocalizationFile(xsltPath);
|
||||
|
||||
String outStr ="";
|
||||
if ( lFile != null ){
|
||||
|
|
|
@ -8,9 +8,10 @@
|
|||
|
||||
package gov.noaa.nws.ncep.ui.pgen.attrDialog;
|
||||
|
||||
import gov.noaa.nws.ncep.common.staticdata.SPCCounty;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.WatchBox;
|
||||
import gov.noaa.nws.ncep.ui.pgen.maps.County;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
@ -853,7 +854,7 @@ public class WatchInfoDlg extends CaveJFACEDialog {
|
|||
if ( fmtDlg != null ) fmtDlg.close();
|
||||
WatchCoordDlg.getInstance(WatchInfoDlg.this.getParentShell(),wbDlg).close();
|
||||
if ( wbDlg != null) {
|
||||
wbDlg.getWbTool().resetMouseHandler();
|
||||
if (wbDlg.getWbTool() != null ) wbDlg.getWbTool().resetMouseHandler();
|
||||
wbDlg.enableDspBtn(true);
|
||||
}
|
||||
|
||||
|
@ -894,31 +895,6 @@ public class WatchInfoDlg extends CaveJFACEDialog {
|
|||
return wfoStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the county table
|
||||
* @return
|
||||
*/
|
||||
/* static public List<Object[]>getAllCounties(){
|
||||
|
||||
|
||||
//read county table from database
|
||||
if ( allCounties == null ){
|
||||
String query = "Select AsBinary(the_geom), countyname, state, cwa, fips, time_zone, lon, lat, gid FROM mapdata.county";
|
||||
try {
|
||||
allCounties = NcDirectDbQuery.executeQuery(
|
||||
query, "maps", QueryLanguage.SQL);
|
||||
}
|
||||
catch (Exception e ){
|
||||
System.out.println("db exception!");
|
||||
}
|
||||
}
|
||||
|
||||
County.getAllCounties();
|
||||
|
||||
return allCounties;
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Enable/disable CWA in/out buttons
|
||||
* @param flag
|
||||
|
@ -955,7 +931,7 @@ public class WatchInfoDlg extends CaveJFACEDialog {
|
|||
* not set either button.
|
||||
*/
|
||||
public void setCwaBtns(){
|
||||
List<County> cntyInWb = wbDlg.getWatchBox().getCountyList();
|
||||
List<SPCCounty> cntyInWb = wbDlg.getWatchBox().getCountyList();
|
||||
for ( CwaComposite cwa : cwaComp){
|
||||
|
||||
//get number of counties of a CWA, which are inside of the watch box
|
||||
|
@ -968,7 +944,7 @@ public class WatchInfoDlg extends CaveJFACEDialog {
|
|||
}
|
||||
else {
|
||||
//get the total county number of the CWA
|
||||
int totalCounties = getCountiesOfCwa(cwa.lbl.getText(), County.getAllCounties());
|
||||
int totalCounties = getCountiesOfCwa(cwa.lbl.getText(), PgenStaticDataProvider.getProvider().getSPCCounties());
|
||||
if ( totalCounties == countiesIn ){
|
||||
cwa.inBtn.setSelection(true);
|
||||
cwa.outBtn.setSelection(false);
|
||||
|
@ -988,9 +964,9 @@ public class WatchInfoDlg extends CaveJFACEDialog {
|
|||
* @param counties
|
||||
* @return - number of counties
|
||||
*/
|
||||
private int getCountiesOfCwa(String cwa, List<County> counties){
|
||||
private int getCountiesOfCwa(String cwa, List<SPCCounty> counties){
|
||||
int total = 0;
|
||||
for ( County cnty : counties ){
|
||||
for ( SPCCounty cnty : counties ){
|
||||
if (cnty.getWfo() != null && cwa.equalsIgnoreCase(cnty.getWfo())){
|
||||
total++;
|
||||
}
|
||||
|
@ -1149,9 +1125,9 @@ public class WatchInfoDlg extends CaveJFACEDialog {
|
|||
|
||||
WatchBox newWb = (WatchBox)wbDlg.getWatchBox().copy();
|
||||
|
||||
List<County> counties = County.getCountiesInGeometry(watchGeo);
|
||||
List<SPCCounty> counties = PgenStaticDataProvider.getProvider().getCountiesInGeometry(watchGeo);
|
||||
|
||||
for ( County county : counties ){
|
||||
for ( SPCCounty county : counties ){
|
||||
if(isClusteringOn()){
|
||||
newWb.addClstCnty(county);
|
||||
}
|
||||
|
|
|
@ -14,12 +14,12 @@ import java.util.List;
|
|||
import java.util.TimeZone;
|
||||
|
||||
import gov.noaa.nws.ncep.edex.common.stationTables.Station;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.Line;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.WatchBox;
|
||||
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.stationTables.StationTableUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.tools.PgenToolUtils;
|
||||
|
||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
|
@ -272,7 +272,7 @@ public class WatchStatusDlg extends CaveJFACEDialog{
|
|||
Iterator<AbstractDrawableComponent> it = ((DECollection)adc).getComponentIterator();
|
||||
|
||||
//get anchor point list
|
||||
List<Station> anchors = StationTableUtil.getAnchorTbl().getStationList();
|
||||
List<Station> anchors = PgenStaticDataProvider.getProvider().getAnchorTbl().getStationList();
|
||||
|
||||
//loop through status lines and construct from lines.
|
||||
while ( it.hasNext() ){
|
||||
|
|
|
@ -8,12 +8,16 @@
|
|||
|
||||
package gov.noaa.nws.ncep.ui.pgen.attrDialog.vaaDialog;
|
||||
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.attrDialog.AttrDlg;
|
||||
import gov.noaa.nws.ncep.ui.pgen.display.IAttribute;
|
||||
import gov.noaa.nws.ncep.ui.pgen.sigmet.CcfpInfo;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.Writer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
import org.eclipse.swt.SWT;
|
||||
|
@ -32,20 +36,6 @@ import org.eclipse.swt.widgets.Text;
|
|||
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenSession;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.attrDialog.AttrDlg;
|
||||
import gov.noaa.nws.ncep.ui.pgen.display.IAttribute;
|
||||
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.ProductConverter;
|
||||
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.sigmet.CcfpInfo;
|
||||
import gov.noaa.nws.ncep.viz.common.ui.NmapCommon;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager.NcPathConstants;
|
||||
|
||||
/**
|
||||
* Singleton text product dialog for CCFP.
|
||||
*
|
||||
|
@ -63,6 +53,8 @@ public class CcfpMsgDlg extends AttrDlg{
|
|||
|
||||
// Constant for Button Update
|
||||
private static final int CCFP_CONSTANT_UPDATE = 20101007;
|
||||
public static final String PGEN_CCFP_XSLT = "xslt"+File.separator+
|
||||
"ccfp"+File.separator+"ccfpXml2Txt.xslt";
|
||||
|
||||
// singleton instance for this class
|
||||
private static CcfpMsgDlg INSTANCE = null;
|
||||
|
@ -134,8 +126,8 @@ public class CcfpMsgDlg extends AttrDlg{
|
|||
|
||||
String xmlFileName = CcfpInfo.saveCcfpXmlFile(getIssueTime(), getValidTime());
|
||||
txtFileContent = CcfpInfo.convertXml2Txt(xmlFileName,
|
||||
NcPathManager.getInstance().getStaticFile(
|
||||
NcPathConstants.PGEN_CCFP_XSLT).getAbsolutePath() );
|
||||
PgenStaticDataProvider.getProvider().getFileAbsolutePath(
|
||||
PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + PGEN_CCFP_XSLT ));
|
||||
txtInfo.setText(txtFileContent.trim());
|
||||
|
||||
}
|
||||
|
|
|
@ -9,11 +9,10 @@
|
|||
package gov.noaa.nws.ncep.ui.pgen.attrDialog.vaaDialog;
|
||||
|
||||
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.attrDialog.AttrDlg;
|
||||
import gov.noaa.nws.ncep.ui.pgen.display.IAttribute;
|
||||
import gov.noaa.nws.ncep.ui.pgen.sigmet.*;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager.NcPathConstants;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
@ -242,8 +241,8 @@ public class CcfpTimeDlg extends AttrDlg{
|
|||
//save CCFP xml file then apply style sheet to get text product
|
||||
String fileName = CcfpInfo.saveCcfpXmlFile(ccfpIssueTime, ccfpValidTime);
|
||||
String txtPrd = CcfpInfo.convertXml2Txt( fileName,
|
||||
NcPathManager.getInstance().getStaticFile(
|
||||
NcPathConstants.PGEN_CCFP_XSLT).getAbsolutePath() );
|
||||
PgenStaticDataProvider.getProvider().getFileAbsolutePath(
|
||||
PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + CcfpMsgDlg.PGEN_CCFP_XSLT ));
|
||||
|
||||
//close this dialog
|
||||
cancelPressed();
|
||||
|
@ -276,8 +275,9 @@ public class CcfpTimeDlg extends AttrDlg{
|
|||
|
||||
try {
|
||||
|
||||
File file = NcPathManager.getInstance().getStaticFile(
|
||||
NcPathConstants.PGEN_CCFP_TIMES );
|
||||
File file = PgenStaticDataProvider.getProvider().getFile(
|
||||
PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + "ccfpTimes.xml" );
|
||||
|
||||
DocumentBuilder builder = factory.newDocumentBuilder();
|
||||
doc = builder.parse( file.getAbsoluteFile() );
|
||||
} catch (Exception e) { System.out.println("-----------"+e.getMessage()); }
|
||||
|
|
|
@ -46,8 +46,6 @@ 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.sigmet.*;
|
||||
import gov.noaa.nws.ncep.ui.pgen.*;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager.NcPathConstants;
|
||||
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
|
||||
|
@ -88,6 +86,8 @@ public class VolcanoVaaAttrDlg extends AttrDlg implements ISigmet{
|
|||
*/
|
||||
private static int RESET_ID = 20100201+1;
|
||||
|
||||
private static final String PGEN_VAA_XSLT = "xslt"+File.separator+
|
||||
"vaa"+File.separator+"vaaXml2Txt.xslt";
|
||||
/**
|
||||
* top Composite for this dialog.
|
||||
*/
|
||||
|
@ -415,8 +415,8 @@ public class VolcanoVaaAttrDlg extends AttrDlg implements ISigmet{
|
|||
smDlg.setVolcano(volcano);
|
||||
|
||||
String xmlDir = PgenUtil.getWorkingDirectory();//LocalizationManager.getBaseDir();
|
||||
String xsltFile = NcPathManager.getInstance().getStaticFile(
|
||||
NcPathConstants.PGEN_VAA_XSLT).getAbsolutePath();
|
||||
String xsltFile = PgenStaticDataProvider.getProvider().getFileAbsolutePath(
|
||||
PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + PGEN_VAA_XSLT );
|
||||
smDlg.setTxtFileContent( convertXml2Txt(xmlDir+File.separator+volXMLFileName, xsltFile));
|
||||
|
||||
smDlg.open();
|
||||
|
|
|
@ -47,7 +47,7 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
|||
import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
|
||||
|
||||
import gov.noaa.nws.ncep.viz.common.ui.*;
|
||||
import gov.noaa.nws.ncep.viz.ui.display.NmapUiUtils;
|
||||
//import gov.noaa.nws.ncep.viz.ui.display.NmapUiUtils;
|
||||
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.AbstractDrawableComponent;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.Jet;
|
||||
|
@ -994,8 +994,10 @@ public class PgenFileManageDialog extends CaveJFACEDialog {
|
|||
*/
|
||||
private void setJetTool(java.util.List<gov.noaa.nws.ncep.ui.pgen.elements.Product> prods){
|
||||
|
||||
// PgenSnapJet st = new PgenSnapJet(PgenSession.getInstance().getPgenResource().getDescriptor(),
|
||||
// NmapUiUtils.getActiveNatlCntrsEditor(), null);
|
||||
PgenSnapJet st = new PgenSnapJet(PgenSession.getInstance().getPgenResource().getDescriptor(),
|
||||
NmapUiUtils.getActiveNatlCntrsEditor(), null);
|
||||
PgenUtil.getActiveEditor(), null);
|
||||
|
||||
for(gov.noaa.nws.ncep.ui.pgen.elements.Product prod : prods){
|
||||
for ( Layer layer : prod.getLayers() ) {
|
||||
|
|
|
@ -28,6 +28,7 @@ import org.eclipse.swt.graphics.Rectangle;
|
|||
import org.geotools.referencing.GeodeticCalculator;
|
||||
import org.geotools.referencing.datum.DefaultEllipsoid;
|
||||
|
||||
import gov.noaa.nws.ncep.common.staticdata.SPCCounty;
|
||||
import gov.noaa.nws.ncep.edex.common.stationTables.Station;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.display.CornerPatternApplicator.CornerPattern;
|
||||
|
@ -52,7 +53,6 @@ import gov.noaa.nws.ncep.ui.pgen.elements.tcm.TcmFcst;
|
|||
import gov.noaa.nws.ncep.ui.pgen.elements.tcm.ITcmWindQuarter;
|
||||
import gov.noaa.nws.ncep.ui.pgen.gfa.Gfa;
|
||||
import gov.noaa.nws.ncep.ui.pgen.gfa.IGfa;
|
||||
import gov.noaa.nws.ncep.ui.pgen.maps.County;
|
||||
import gov.noaa.nws.ncep.ui.pgen.tca.BPGeography;
|
||||
import gov.noaa.nws.ncep.ui.pgen.tca.ITca;
|
||||
import gov.noaa.nws.ncep.ui.pgen.tca.TropicalCycloneAdvisory;
|
||||
|
@ -419,7 +419,7 @@ public class DisplayElementFactory {
|
|||
*/
|
||||
ArrayList<IDisplayable> dlist = new ArrayList<IDisplayable>();
|
||||
|
||||
List<County> counties = watchBox.getCountyList();
|
||||
List<SPCCounty> counties = watchBox.getCountyList();
|
||||
if ( counties != null && !counties.isEmpty()){
|
||||
if ( watchBox.getFillFlag() ){
|
||||
|
||||
|
@ -429,7 +429,7 @@ public class DisplayElementFactory {
|
|||
Collection<Geometry> gCollection = new ArrayList<Geometry>();
|
||||
|
||||
//draw county border
|
||||
for ( County cnty : counties ){
|
||||
for ( SPCCounty cnty : counties ){
|
||||
Geometry countyGeo = cnty.getShape();
|
||||
|
||||
colors = watchBox.getColors();
|
||||
|
@ -492,7 +492,7 @@ public class DisplayElementFactory {
|
|||
}
|
||||
}
|
||||
else {
|
||||
for ( County cnty : counties ){
|
||||
for ( SPCCounty cnty : counties ){
|
||||
|
||||
Symbol cSymbol = new Symbol(null, watchBox.getColors(),
|
||||
watchBox.getWatchSymbolWidth(), watchBox.getWatchSymbolSize(), false,
|
||||
|
|
|
@ -24,9 +24,9 @@ package gov.noaa.nws.ncep.ui.pgen.display;
|
|||
*/
|
||||
|
||||
|
||||
import gov.noaa.nws.ncep.common.staticdata.SPCCounty;
|
||||
import gov.noaa.nws.ncep.edex.common.stationTables.Station;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.WatchBox.WatchShape;
|
||||
import gov.noaa.nws.ncep.ui.pgen.maps.County;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.List;
|
||||
|
@ -37,7 +37,7 @@ public interface IWatchBox extends IMultiPoint{
|
|||
public Color getFillColor();
|
||||
public WatchShape getWatchBoxShape();
|
||||
public Station[] getAnchors();
|
||||
public List<County> getCountyList();
|
||||
public List<SPCCounty> getCountyList();
|
||||
public String getWatchSymbolType();
|
||||
public float getWatchSymbolWidth();
|
||||
public double getWatchSymbolSize();
|
||||
|
|
|
@ -7,10 +7,9 @@
|
|||
*/
|
||||
package gov.noaa.nws.ncep.ui.pgen.display;
|
||||
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.display.ArrowHead.ArrowHeadType;
|
||||
import gov.noaa.nws.ncep.ui.pgen.display.PatternSegment.PatternType;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager.NcPathConstants;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.PrintWriter;
|
||||
|
@ -72,8 +71,10 @@ public class LinePatternManager {
|
|||
private void initialize() {
|
||||
|
||||
loadInternal();
|
||||
File patterns = NcPathManager.getInstance().getStaticFile(
|
||||
NcPathConstants.PGEN_LINE_PATTERNS );
|
||||
File patterns = PgenStaticDataProvider.getProvider().getStaticFile(
|
||||
PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + "linePatterns.xml");
|
||||
|
||||
|
||||
if ( patterns != null && patterns.exists() ) {
|
||||
loadPatternsFromFile( patterns.getAbsolutePath() );
|
||||
}
|
||||
|
|
|
@ -7,9 +7,7 @@
|
|||
*/
|
||||
package gov.noaa.nws.ncep.ui.pgen.display;
|
||||
|
||||
import gov.noaa.nws.ncep.viz.common.ui.NmapCommon;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager.NcPathConstants;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.PrintWriter;
|
||||
|
@ -73,8 +71,8 @@ public class SymbolPatternManager {
|
|||
private void initialize() {
|
||||
|
||||
loadInternal();
|
||||
File patterns = NcPathManager.getInstance().getStaticFile(
|
||||
NcPathConstants.PGEN_SYMBOL_PATTERNS );
|
||||
File patterns = PgenStaticDataProvider.getProvider().getStaticFile(
|
||||
PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + "symbolPatterns.xml");
|
||||
if ( patterns != null && patterns.exists() ) {
|
||||
loadPatternsFromFile( patterns.getAbsolutePath() );
|
||||
}
|
||||
|
|
|
@ -67,8 +67,8 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
*/
|
||||
public class DrawableElementFactory {
|
||||
|
||||
private final static org.apache.log4j.Logger log =
|
||||
org.apache.log4j.Logger.getLogger(DrawableElementFactory.class);
|
||||
// private final static org.apache.log4j.Logger log =
|
||||
// org.apache.log4j.Logger.getLogger(DrawableElementFactory.class);
|
||||
|
||||
public AbstractDrawableComponent create( DrawableType typeName, IAttribute attr,
|
||||
String pgenCategory, String pgenType,
|
||||
|
@ -224,7 +224,7 @@ public class DrawableElementFactory {
|
|||
/*
|
||||
* Do nothing.
|
||||
*/
|
||||
log.info( typeName + " is not supported.");
|
||||
// log.info( typeName + " is not supported.");
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.geotools.referencing.datum.DefaultEllipsoid;
|
|||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
import gov.noaa.nws.ncep.edex.common.stationTables.Station;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.contours.ContourLine;
|
||||
import gov.noaa.nws.ncep.ui.pgen.contours.ContourMinmax;
|
||||
|
@ -30,7 +31,6 @@ import gov.noaa.nws.ncep.ui.pgen.contours.Contours;
|
|||
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.Products;
|
||||
import gov.noaa.nws.ncep.ui.pgen.stationTables.StationTableUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.annotation.ElementOperations;
|
||||
import gov.noaa.nws.ncep.ui.pgen.annotation.Operation;
|
||||
//import gov.noaa.nws.ncep.ui.pgen.attrDialog.OutlookAttrDlg;
|
||||
|
@ -459,7 +459,7 @@ public class Outlook extends Contours {
|
|||
|
||||
String lnInfo = "";
|
||||
|
||||
List<Station> anchors = StationTableUtil.getAnchorTbl().getStationList();
|
||||
List<Station> anchors = PgenStaticDataProvider.getProvider().getAnchorTbl().getStationList();
|
||||
|
||||
Iterator<AbstractDrawableComponent> it = this.getComponentIterator();
|
||||
while( it.hasNext() ){
|
||||
|
@ -754,7 +754,7 @@ public class Outlook extends Contours {
|
|||
String rainTxt = "RISK OF RAINFALL EXCEEDING FFG TO THE RIGHT OF A LINE FROM";
|
||||
String fiveInch = "TOTAL RAINFALL AMOUNTS OF FIVE INCHES WILL BE POSSIBLE TO THE RIGHT OF A LINE FROM";
|
||||
|
||||
List<Station> sfstns = StationTableUtil.getSfstnTbl().getStationList();
|
||||
List<Station> sfstns = PgenStaticDataProvider.getProvider().getSfStnTbl().getStationList();
|
||||
|
||||
Iterator<AbstractDrawableComponent> it = this.getComponentIterator();
|
||||
while( it.hasNext() ){
|
||||
|
|
|
@ -13,6 +13,7 @@ import java.awt.Color;
|
|||
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
import gov.noaa.nws.ncep.common.staticdata.SPCCounty;
|
||||
import gov.noaa.nws.ncep.edex.common.stationTables.Station;
|
||||
import gov.noaa.nws.ncep.ui.pgen.display.ArrowHead.ArrowHeadType;
|
||||
import gov.noaa.nws.ncep.ui.pgen.display.FillPatternList.FillPattern;
|
||||
|
@ -30,7 +31,6 @@ import gov.noaa.nws.ncep.ui.pgen.display.LinePatternManager;
|
|||
import gov.noaa.nws.ncep.ui.pgen.display.SymbolPatternManager;
|
||||
import gov.noaa.nws.ncep.ui.pgen.display.TrackPoint;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.WatchBox.WatchShape;
|
||||
import gov.noaa.nws.ncep.ui.pgen.maps.County;
|
||||
import gov.noaa.nws.ncep.ui.pgen.tools.PgenCycleTool;
|
||||
|
||||
/**
|
||||
|
@ -758,7 +758,7 @@ class AttributeGenerator implements IArc, IAvnText, ICombo, IKink, IMidCloudText
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<County> getCountyList() {
|
||||
public List<SPCCounty> getCountyList() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -46,8 +46,8 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
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 org.apache.log4j.Logger log =
|
||||
// org.apache.log4j.Logger.getLogger(Track.class);
|
||||
|
||||
|
||||
private final static float DEFAULT_FONT_SIZE = 14.0f;
|
||||
|
@ -520,7 +520,7 @@ public class Track extends Line implements ITrack {
|
|||
ExtraPointTimeDisplayOption extraPointTimeDisplayOption,
|
||||
String skipFactorTextString) {
|
||||
if(initialPoints == null || initialPoints.length < 2) {
|
||||
log.error("Method:calculateExtrapTrackPoints, the input initialPoints is null or initialPoints.length less than 2");
|
||||
// log.error("Method:calculateExtrapTrackPoints, the input initialPoints is null or initialPoints.length less than 2");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -531,8 +531,8 @@ public class Track extends Line implements ITrack {
|
|||
!isCoordinateValid(lastInitPointCoordinate) ||
|
||||
initPointBeforeLastInitPointTimeCal == null ||
|
||||
lastInitPointTimeCal == null) {
|
||||
log.error("Method: calculateExtrapTrackPoints, find 4 possible invalid input: startPointCoordinate or "+
|
||||
"destPointCoordinate is invalid. firstTimeCal or secondTimeCal is null");
|
||||
// log.error("Method: calculateExtrapTrackPoints, find 4 possible invalid input: startPointCoordinate or "+
|
||||
// "destPointCoordinate is invalid. firstTimeCal or secondTimeCal is null");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -628,8 +628,8 @@ public class Track extends Line implements ITrack {
|
|||
try {
|
||||
skipFactorIntValue = Integer.parseInt(skipFactorTextString);
|
||||
} catch(NumberFormatException nfe) {
|
||||
log.error("The input of skipFactorTextString is invalid, skipFactorTextString="+
|
||||
skipFactorTextString);
|
||||
// log.error("The input of skipFactorTextString is invalid, skipFactorTextString="+
|
||||
// skipFactorTextString);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -781,7 +781,7 @@ public class Track extends Line implements ITrack {
|
|||
elapsedHour = cal.get(Calendar.HOUR_OF_DAY);
|
||||
elapsedMinute = cal.get(Calendar.MINUTE);
|
||||
} catch(ParseException pe) {
|
||||
log.error("The input of dateString is invalid, parse fails, dateString="+dateString);
|
||||
// log.error("The input of dateString is invalid, parse fails, dateString="+dateString);
|
||||
elapsedHour = 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,9 @@
|
|||
*/
|
||||
package gov.noaa.nws.ncep.ui.pgen.elements;
|
||||
|
||||
import gov.noaa.nws.ncep.common.staticdata.SPCCounty;
|
||||
import gov.noaa.nws.ncep.edex.common.stationTables.Station;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.annotation.ElementOperations;
|
||||
import gov.noaa.nws.ncep.ui.pgen.annotation.Operation;
|
||||
|
@ -16,9 +18,6 @@ import gov.noaa.nws.ncep.ui.pgen.display.IWatchBox;
|
|||
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.Products;
|
||||
import gov.noaa.nws.ncep.ui.pgen.maps.County;
|
||||
import gov.noaa.nws.ncep.ui.pgen.maps.USState;
|
||||
import gov.noaa.nws.ncep.ui.pgen.stationTables.StationTableUtil;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.geom.Point2D;
|
||||
|
@ -45,6 +44,7 @@ import com.vividsolutions.jts.geom.GeometryCollection;
|
|||
import com.vividsolutions.jts.geom.GeometryFactory;
|
||||
import com.vividsolutions.jts.geom.LinearRing;
|
||||
import com.vividsolutions.jts.geom.Polygon;
|
||||
|
||||
/**
|
||||
* Implementation of Pgen watch box element.
|
||||
*
|
||||
|
@ -88,7 +88,7 @@ public class WatchBox extends MultiPointElement implements IWatchBox{
|
|||
private boolean fillFlag;
|
||||
private Color fillColor;
|
||||
private Station anchors[];
|
||||
private List<County> countyList;
|
||||
private List<SPCCounty> countyList;
|
||||
|
||||
//Watch Issue Information
|
||||
private String issueStatus;
|
||||
|
@ -122,7 +122,7 @@ public class WatchBox extends MultiPointElement implements IWatchBox{
|
|||
|
||||
public WatchBox(){
|
||||
anchors = new Station[2];
|
||||
countyList = new ArrayList<County>();
|
||||
countyList = new ArrayList<SPCCounty>();
|
||||
issueFlag = 0;
|
||||
}
|
||||
|
||||
|
@ -326,7 +326,7 @@ public class WatchBox extends MultiPointElement implements IWatchBox{
|
|||
*/
|
||||
public Station getNearestVor(Coordinate loc ){
|
||||
|
||||
return StationTableUtil.getVorTbl().getNearestStation(loc);
|
||||
return PgenStaticDataProvider.getProvider().getVorTbl().getNearestStation(loc);
|
||||
|
||||
}
|
||||
|
||||
|
@ -390,18 +390,18 @@ public class WatchBox extends MultiPointElement implements IWatchBox{
|
|||
* Add the input county in the county list
|
||||
* @param cnty
|
||||
*/
|
||||
public void addCounty(County cnty){
|
||||
public void addCounty(SPCCounty cnty){
|
||||
countyList.add(cnty);
|
||||
}
|
||||
|
||||
public void removeCounty(County cnty){
|
||||
public void removeCounty(SPCCounty cnty){
|
||||
countyList.remove(cnty);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the county list
|
||||
*/
|
||||
public List<County> getCountyList(){
|
||||
public List<SPCCounty> getCountyList(){
|
||||
return countyList;
|
||||
}
|
||||
|
||||
|
@ -410,9 +410,9 @@ public class WatchBox extends MultiPointElement implements IWatchBox{
|
|||
* county to it
|
||||
* @param cl
|
||||
*/
|
||||
public void setCountyList(List<County> cl){
|
||||
List<County> newList = new ArrayList<County>();
|
||||
for( County cnty : cl ){
|
||||
public void setCountyList(List<SPCCounty> cl){
|
||||
List<SPCCounty> newList = new ArrayList<SPCCounty>();
|
||||
for( SPCCounty cnty : cl ){
|
||||
newList.add(cnty);
|
||||
}
|
||||
countyList = newList;
|
||||
|
@ -479,7 +479,7 @@ public class WatchBox extends MultiPointElement implements IWatchBox{
|
|||
ArrayList<String> wfos = new ArrayList<String>();
|
||||
|
||||
if ( countyList != null && !countyList.isEmpty()){
|
||||
for(County cnty: countyList ){
|
||||
for(SPCCounty cnty: countyList ){
|
||||
|
||||
String wfo = cnty.getWfo();
|
||||
//wfo can be more than one
|
||||
|
@ -504,7 +504,7 @@ public class WatchBox extends MultiPointElement implements IWatchBox{
|
|||
public List<String> getStates(){
|
||||
ArrayList<String> states = new ArrayList<String>();
|
||||
if ( countyList != null && !countyList.isEmpty()){
|
||||
for(County cnty : countyList ){
|
||||
for(SPCCounty cnty : countyList ){
|
||||
|
||||
if ( cnty.getState()!= null && !states.contains(cnty.getState())){
|
||||
states.add(cnty.getState());
|
||||
|
@ -524,9 +524,9 @@ public class WatchBox extends MultiPointElement implements IWatchBox{
|
|||
*/
|
||||
public void removeState(String state ){
|
||||
if ( countyList != null && !countyList.isEmpty()){
|
||||
Iterator<County> it = countyList.iterator();
|
||||
Iterator<SPCCounty> it = countyList.iterator();
|
||||
while( it.hasNext() ){
|
||||
County cnty = it.next();
|
||||
SPCCounty cnty = it.next();
|
||||
if (cnty.getState() != null && cnty.getState().equalsIgnoreCase(state)){
|
||||
it.remove();
|
||||
}
|
||||
|
@ -540,9 +540,9 @@ public class WatchBox extends MultiPointElement implements IWatchBox{
|
|||
*/
|
||||
public void removeCwa(String cwa ){
|
||||
if ( countyList != null && !countyList.isEmpty()){
|
||||
Iterator<County> it = countyList.iterator();
|
||||
Iterator<SPCCounty> it = countyList.iterator();
|
||||
while( it.hasNext() ){
|
||||
County cnty = it.next();
|
||||
SPCCounty cnty = it.next();
|
||||
if (cnty.getWfo() != null && cnty.getWfo().equalsIgnoreCase(cwa)){
|
||||
it.remove();
|
||||
}
|
||||
|
@ -556,10 +556,10 @@ public class WatchBox extends MultiPointElement implements IWatchBox{
|
|||
* @param cwa
|
||||
*/
|
||||
public void addCwa(String cwa ){
|
||||
List<County> allCounties = County.getAllCounties();
|
||||
List<SPCCounty> allCounties = PgenStaticDataProvider.getProvider().getSPCCounties();
|
||||
|
||||
if ( allCounties != null){
|
||||
for ( County cnty : allCounties ){
|
||||
for ( SPCCounty cnty : allCounties ){
|
||||
if ( cnty.getWfo() != null
|
||||
&& cnty.getWfo().equalsIgnoreCase(cwa)
|
||||
&& !countyList.contains(cnty) ) {
|
||||
|
@ -588,13 +588,13 @@ public class WatchBox extends MultiPointElement implements IWatchBox{
|
|||
* of the active county union
|
||||
* @return
|
||||
*/
|
||||
public List<County> getInactiveCountiesInWB(){
|
||||
public List<SPCCounty> getInactiveCountiesInWB(){
|
||||
|
||||
if ( countyList == null || countyList.isEmpty() ){
|
||||
return null;
|
||||
}
|
||||
|
||||
List<County> rt = new ArrayList<County>();
|
||||
List<SPCCounty> rt = new ArrayList<SPCCounty>();
|
||||
Geometry union = getCountyUnion();
|
||||
GeometryFactory gf = new GeometryFactory();
|
||||
|
||||
|
@ -615,7 +615,7 @@ public class WatchBox extends MultiPointElement implements IWatchBox{
|
|||
if ( area < 0.01 ) continue;
|
||||
|
||||
//Check any county centeriod inside the hole
|
||||
for ( County cnty : County.getAllCounties() ){
|
||||
for ( SPCCounty cnty : PgenStaticDataProvider.getProvider().getSPCCounties() ){
|
||||
|
||||
if ( p.contains(gf.createPoint(cnty.getCentriod()))){
|
||||
rt.add(cnty);
|
||||
|
@ -632,14 +632,14 @@ public class WatchBox extends MultiPointElement implements IWatchBox{
|
|||
* Get a list of active counties outside of the main watch box
|
||||
* @return
|
||||
*/
|
||||
public List<County> getActiveCountiesOutsideWB(){
|
||||
public List<SPCCounty> getActiveCountiesOutsideWB(){
|
||||
|
||||
if ( countyList == null || countyList.isEmpty() ){
|
||||
return null;
|
||||
}
|
||||
|
||||
//initialization
|
||||
List<County> rt = new ArrayList<County>();
|
||||
List<SPCCounty> rt = new ArrayList<SPCCounty>();
|
||||
Geometry union = getCountyUnion();
|
||||
GeometryFactory gf = new GeometryFactory();
|
||||
Polygon largestPoly = null;
|
||||
|
@ -658,7 +658,7 @@ public class WatchBox extends MultiPointElement implements IWatchBox{
|
|||
|
||||
//loop through the active county list and check if
|
||||
// any county is outside of the largest polygon
|
||||
for ( County cnty : countyList ){
|
||||
for ( SPCCounty cnty : countyList ){
|
||||
|
||||
if ( !largestPoly.contains(gf.createPoint(cnty.getCentriod()))){
|
||||
rt.add(cnty);
|
||||
|
@ -677,7 +677,7 @@ public class WatchBox extends MultiPointElement implements IWatchBox{
|
|||
|
||||
Collection<Geometry> gCollection = new ArrayList<Geometry>();;
|
||||
|
||||
for ( County cnty : countyList ){
|
||||
for ( SPCCounty cnty : countyList ){
|
||||
Geometry countyGeo = cnty.getShape();
|
||||
if ( countyGeo != null ){
|
||||
if ( !countyGeo.isValid() ) {
|
||||
|
@ -1500,13 +1500,13 @@ public class WatchBox extends MultiPointElement implements IWatchBox{
|
|||
Geometry union = this.getCountyUnion();
|
||||
Geometry bUnion = union.buffer(0.01);
|
||||
|
||||
List<County> counties = new ArrayList<County>();
|
||||
List<SPCCounty> counties = new ArrayList<SPCCounty>();
|
||||
|
||||
counties.addAll(County.getCountiesInGeometry(bUnion));
|
||||
counties.addAll(PgenStaticDataProvider.getProvider().getCountiesInGeometry(bUnion));
|
||||
ArrayList<String> nWFOs = new ArrayList<String>();
|
||||
|
||||
List<String> wfos = this.getWFOs();
|
||||
for(County cnty : counties ){
|
||||
for(SPCCounty cnty : counties ){
|
||||
String wfo = cnty.getWfo();
|
||||
//wfo can be more than one
|
||||
if ( wfo != null ) {
|
||||
|
@ -1526,20 +1526,8 @@ public class WatchBox extends MultiPointElement implements IWatchBox{
|
|||
* Get the state name hash map
|
||||
* @return
|
||||
*/
|
||||
public static HashMap<String, String> getStateName(){
|
||||
if (stateName == null ){
|
||||
stateName = new HashMap<String, String>();
|
||||
List<USState> states = USState.getAllStates();
|
||||
|
||||
if ( states != null ){
|
||||
for ( USState st : states ){
|
||||
stateName.put(st.getStateAbrv(), st.getName());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return stateName;
|
||||
public HashMap<String, String> getStateName(){
|
||||
return PgenStaticDataProvider.getProvider().getStateAbrvMap();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1550,7 +1538,7 @@ public class WatchBox extends MultiPointElement implements IWatchBox{
|
|||
*/
|
||||
public String createCountyInfo(String state, Calendar exp ){
|
||||
|
||||
if ( stateName == null ) getStateName();
|
||||
if ( stateName == null ) stateName = getStateName();
|
||||
|
||||
String ugcStr ="";
|
||||
String oneLine ="";
|
||||
|
@ -1563,7 +1551,7 @@ public class WatchBox extends MultiPointElement implements IWatchBox{
|
|||
int iCiti = 0;
|
||||
int iCnty = 0;
|
||||
|
||||
for ( County county : countyList ){
|
||||
for ( SPCCounty county : countyList ){
|
||||
if ( county.getState() != null && state.equalsIgnoreCase(county.getState())){
|
||||
if (ugcStr.isEmpty()){
|
||||
ugcStr = county.getUgcId();
|
||||
|
@ -1670,7 +1658,7 @@ public class WatchBox extends MultiPointElement implements IWatchBox{
|
|||
*/
|
||||
private List<String> findCntyInClst(String fips, List<String> rt){
|
||||
if ( rt == null ) rt = new ArrayList<String>();
|
||||
String value = StationTableUtil.getClstTbl().get(fips);
|
||||
String value = PgenStaticDataProvider.getProvider().getClstTbl().get(fips);
|
||||
if ( value != null ){
|
||||
int index = 0;
|
||||
do {
|
||||
|
@ -1698,12 +1686,12 @@ public class WatchBox extends MultiPointElement implements IWatchBox{
|
|||
* Remove counties from the watch box
|
||||
* @param county
|
||||
*/
|
||||
public void rmClstCnty(County county){
|
||||
public void rmClstCnty(SPCCounty county){
|
||||
if ( county.getFips().isEmpty() || county.getFips().equalsIgnoreCase("00000")){
|
||||
removeCounty( county);
|
||||
}
|
||||
for ( String fips : findCntyInClst(county.getFips(), null)){
|
||||
removeCounty(County.findCounty(fips));
|
||||
removeCounty(PgenStaticDataProvider.getProvider().findCounty(fips));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1711,13 +1699,13 @@ public class WatchBox extends MultiPointElement implements IWatchBox{
|
|||
* Add clustering counties to the watch box
|
||||
* @param county
|
||||
*/
|
||||
public void addClstCnty(County county){
|
||||
public void addClstCnty(SPCCounty county){
|
||||
if ( county.getFips().isEmpty() || county.getFips().equalsIgnoreCase("00000")){
|
||||
addCounty( county);
|
||||
}
|
||||
else {
|
||||
for ( String fips : findCntyInClst(county.getFips(), null)){
|
||||
County cnty = County.findCounty(fips);
|
||||
SPCCounty cnty = PgenStaticDataProvider.getProvider().findCounty(fips);
|
||||
if ( cnty != null && !countyList.contains(cnty)) addCounty(cnty);
|
||||
}
|
||||
}
|
||||
|
@ -1765,12 +1753,12 @@ public class WatchBox extends MultiPointElement implements IWatchBox{
|
|||
* @param countyList
|
||||
* @return
|
||||
*/
|
||||
public String formatCountyInfo( List<County> cntyList){
|
||||
public String formatCountyInfo( List<SPCCounty> cntyList){
|
||||
|
||||
String cntyInfo="";
|
||||
if ( cntyList != null && !cntyList.isEmpty() ){
|
||||
|
||||
for( County cnty : cntyList ){
|
||||
for( SPCCounty cnty : cntyList ){
|
||||
String cntyName = cnty.getName().replaceAll("City of ", "").replaceAll(" City", "");
|
||||
cntyInfo += String.format("%1$-7s%2$-5s%3$-12s%4$6.2f%5$8.2f%6$7s%7$5s",
|
||||
cnty.getUgcId(), cnty.getState(), cntyName,
|
||||
|
|
|
@ -9,9 +9,10 @@ package gov.noaa.nws.ncep.ui.pgen.file;
|
|||
|
||||
import java.net.URL;
|
||||
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.productTypes.ProductTypes;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
//import org.apache.log4j.Logger;
|
||||
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.common.serialization.SerializationUtil;
|
||||
|
@ -22,9 +23,6 @@ import javax.xml.transform.stream.StreamSource;
|
|||
import javax.xml.validation.*;
|
||||
import java.io.File;
|
||||
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager.NcPathConstants;
|
||||
|
||||
/**
|
||||
* Define a file tool for reading/writing PGEN products using JAXB.
|
||||
*
|
||||
|
@ -49,7 +47,7 @@ import gov.noaa.nws.ncep.viz.localization.NcPathManager.NcPathConstants;
|
|||
*/
|
||||
public class FileTools {
|
||||
|
||||
private static Logger log = Logger.getLogger(FileTools.class);
|
||||
// private static Logger log = Logger.getLogger(FileTools.class);
|
||||
|
||||
/**
|
||||
* Reads product in a file into a JAXB-based Products object
|
||||
|
@ -95,7 +93,8 @@ public class FileTools {
|
|||
SerializationUtil.jaxbMarshalToXmlFile(products, fileName);
|
||||
|
||||
} catch (SerializationException e) {
|
||||
log.error("SerializationException thrown", e);
|
||||
// log.error("SerializationException thrown", e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -111,7 +110,8 @@ public class FileTools {
|
|||
types = (ProductTypes) SerializationUtil.jaxbUnmarshalFromXmlFile(fileName);
|
||||
|
||||
} catch (SerializationException e) {
|
||||
log.error("SerializationException thrown", e);
|
||||
// log.error("SerializationException thrown", e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return types;
|
||||
|
@ -128,7 +128,8 @@ public class FileTools {
|
|||
SerializationUtil.jaxbMarshalToXmlFile(types, fileName);
|
||||
|
||||
} catch (SerializationException e) {
|
||||
log.error("SerializationException thrown", e);
|
||||
// log.error("SerializationException thrown", e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -143,8 +144,8 @@ public class FileTools {
|
|||
boolean valid = true;
|
||||
|
||||
if ( xsdFile == null ) {
|
||||
xsdFile = NcPathManager.getInstance().getStaticFile(
|
||||
NcPathConstants.PGEN_PROD_SCHEMA ).getAbsolutePath();
|
||||
xsdFile = PgenStaticDataProvider.getProvider().getFileAbsolutePath(
|
||||
PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + "product.xsd" );
|
||||
}
|
||||
|
||||
File xsdf = new File( fileName );
|
||||
|
|
|
@ -28,8 +28,10 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
import com.vividsolutions.jts.geom.LineString;
|
||||
import com.vividsolutions.jts.geom.Polygon;
|
||||
|
||||
import gov.noaa.nws.ncep.common.staticdata.SPCCounty;
|
||||
import gov.noaa.nws.ncep.edex.common.stationTables.Station;
|
||||
import gov.noaa.nws.ncep.edex.common.stationTables.IStationField.StationField;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.display.FillPatternList.FillPattern;
|
||||
import gov.noaa.nws.ncep.ui.pgen.display.IAvnText.AviationTextType;
|
||||
import gov.noaa.nws.ncep.ui.pgen.display.IText.DisplayType;
|
||||
|
@ -74,7 +76,6 @@ import gov.noaa.nws.ncep.ui.pgen.contours.ContourMinmax;
|
|||
import gov.noaa.nws.ncep.ui.pgen.contours.Contours;
|
||||
import gov.noaa.nws.ncep.ui.pgen.contours.ContourLine;
|
||||
import gov.noaa.nws.ncep.ui.pgen.tca.TCAElement;
|
||||
import gov.noaa.nws.ncep.ui.pgen.maps.County;
|
||||
import gov.noaa.nws.ncep.ui.pgen.sigmet.Sigmet;
|
||||
import gov.noaa.nws.ncep.ui.pgen.gfa.Gfa;
|
||||
import gov.noaa.nws.ncep.ui.pgen.gfa.GfaRules;
|
||||
|
@ -82,7 +83,6 @@ import gov.noaa.nws.ncep.ui.pgen.gfa.GfaWording;
|
|||
import gov.noaa.nws.ncep.ui.pgen.sigmet.CcfpInfo;
|
||||
import gov.noaa.nws.ncep.ui.pgen.sigmet.VaaInfo;
|
||||
import gov.noaa.nws.ncep.ui.pgen.sigmet.Volcano;
|
||||
import gov.noaa.nws.ncep.ui.pgen.stationTables.StationTableUtil;
|
||||
import gov.noaa.nws.ncep.viz.common.SnapUtil;
|
||||
|
||||
|
||||
|
@ -1887,7 +1887,7 @@ public class ProductConverter {
|
|||
}
|
||||
|
||||
//set county list
|
||||
for ( County cnty : wb.getCountyList()){
|
||||
for ( SPCCounty cnty : wb.getCountyList()){
|
||||
|
||||
String cntyName = "";
|
||||
if ( cnty.getName() != null ){
|
||||
|
@ -2128,13 +2128,13 @@ public class ProductConverter {
|
|||
Station anchors[] = new Station[fwb.getAnchorPoints().size()];
|
||||
nn = 0;
|
||||
for ( String str : fwb.getAnchorPoints()){
|
||||
anchors[nn++] = StationTableUtil.getAnchorTbl().getStation(StationField.STID, str.substring(0, 3));
|
||||
anchors[nn++] = PgenStaticDataProvider.getProvider().getAnchorTbl().getStation(StationField.STID, str.substring(0, 3));
|
||||
}
|
||||
wb.setAnchors(anchors[0], anchors[1]);
|
||||
|
||||
//set county list
|
||||
if ( !fwb.getCounties().isEmpty()){
|
||||
for ( County cnty : County.getAllCounties()){
|
||||
for ( SPCCounty cnty : PgenStaticDataProvider.getProvider().getSPCCounties()){
|
||||
if( cnty.getUgcId() != null ){
|
||||
Iterator<String> it = fwb.getCounties().iterator();
|
||||
while ( it.hasNext() ){
|
||||
|
|
|
@ -40,8 +40,8 @@ import gov.noaa.nws.ncep.ui.pgen.display.FillPatternList.FillPattern;
|
|||
* */
|
||||
public class TrackConverter {
|
||||
|
||||
private final static org.apache.log4j.Logger log =
|
||||
org.apache.log4j.Logger.getLogger(TrackConverter.class);
|
||||
// private final static org.apache.log4j.Logger log =
|
||||
// org.apache.log4j.Logger.getLogger(TrackConverter.class);
|
||||
|
||||
/*
|
||||
* Convert a XML file DrawableElement object to a list of PGEN in-memory
|
||||
|
@ -236,7 +236,7 @@ public class TrackConverter {
|
|||
indexOffSet++;
|
||||
List<TrackPoint> trackPointElementList = getTrackPointElementListByTrackPointBeanList(trackBean.getInitialPoints());
|
||||
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;
|
||||
}
|
||||
int listSize = trackPointElementList.size();
|
||||
|
@ -310,7 +310,7 @@ public class TrackConverter {
|
|||
XMLGregorianCalendar xmlGregorianCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(gregorianCalendar);
|
||||
trackPointBean.setTime(xmlGregorianCalendar);
|
||||
} catch(DatatypeConfigurationException dce) {
|
||||
log.error("Error, instantiating XMLGregorianCalendar failed, error="+dce.getMessage());
|
||||
// log.error("Error, instantiating XMLGregorianCalendar failed, error="+dce.getMessage());
|
||||
}
|
||||
}
|
||||
if(trackPointElement.getLocation() != null) {
|
||||
|
|
|
@ -7,10 +7,8 @@
|
|||
*/
|
||||
package gov.noaa.nws.ncep.ui.pgen.gfa;
|
||||
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.tools.PgenCycleTool;
|
||||
import gov.noaa.nws.ncep.viz.common.ui.NmapCommon;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager.NcPathConstants;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Calendar;
|
||||
|
@ -58,8 +56,9 @@ public class AirmetCycleInfo {
|
|||
private static void readAirmetCycle() {
|
||||
|
||||
try {
|
||||
File airmetCycleFile = NcPathManager.getInstance().getStaticFile(
|
||||
NcPathConstants.PGEN_AIRMET_CYCLE_TBL );
|
||||
File airmetCycleFile = PgenStaticDataProvider.getProvider().getStaticFile(
|
||||
PgenStaticDataProvider.getProvider().getPgenLocalizationRoot()+ "airmetcycle.xml" );
|
||||
|
||||
SAXReader reader = new SAXReader();
|
||||
airmetCycleDoc = reader.read(airmetCycleFile.getAbsoluteFile() );
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.util.Collection;
|
|||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
//import org.apache.log4j.Logger;
|
||||
import org.dom4j.Node;
|
||||
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
@ -53,7 +53,7 @@ import com.vividsolutions.jts.geom.Polygon;
|
|||
public class Gfa extends Line implements IGfa, Comparable<Gfa> {
|
||||
|
||||
/** Logger */
|
||||
private final static Logger logger = Logger.getLogger(Gfa.class);
|
||||
// private final static Logger logger = Logger.getLogger(Gfa.class);
|
||||
|
||||
private String hazard = "";
|
||||
private String fcstHr = "";
|
||||
|
@ -123,7 +123,7 @@ public class Gfa extends Line implements IGfa, Comparable<Gfa> {
|
|||
public Gfa() {
|
||||
super();
|
||||
|
||||
logger.trace("Gfa created");
|
||||
// logger.trace("Gfa created");
|
||||
}
|
||||
|
||||
public Gfa(IAttribute attr, ArrayList<Coordinate> points) {
|
||||
|
@ -135,7 +135,7 @@ public class Gfa extends Line implements IGfa, Comparable<Gfa> {
|
|||
|
||||
setLinePoints(points);
|
||||
|
||||
logger.trace("Gfa created");
|
||||
// logger.trace("Gfa created");
|
||||
}
|
||||
|
||||
public Gfa(Coordinate[] range, Color[] colors, float lineWidth, double sizeScale,
|
||||
|
|
|
@ -7,41 +7,52 @@
|
|||
*/
|
||||
package gov.noaa.nws.ncep.ui.pgen.gfa;
|
||||
|
||||
import gov.noaa.nws.ncep.common.staticdata.CostalWater;
|
||||
import gov.noaa.nws.ncep.common.staticdata.FAArea;
|
||||
import gov.noaa.nws.ncep.common.staticdata.FARegion;
|
||||
import gov.noaa.nws.ncep.common.staticdata.GreatLake;
|
||||
import gov.noaa.nws.ncep.common.staticdata.USState;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.display.FillPatternList.FillPattern;
|
||||
import gov.noaa.nws.ncep.ui.pgen.display.IText.*;
|
||||
import gov.noaa.nws.ncep.ui.pgen.display.IText.DisplayType;
|
||||
import gov.noaa.nws.ncep.ui.pgen.display.IText.FontStyle;
|
||||
import gov.noaa.nws.ncep.ui.pgen.display.IText.TextJustification;
|
||||
import gov.noaa.nws.ncep.ui.pgen.display.IText.TextRotation;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.Layer;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.Line;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.Product;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.ProductInfo;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.ProductTime;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.Text;
|
||||
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.Products;
|
||||
import gov.noaa.nws.ncep.ui.pgen.file.FileTools;
|
||||
import gov.noaa.nws.ncep.viz.common.SnapUtil.SnapVOR;
|
||||
|
||||
import gov.noaa.nws.ncep.viz.common.dbQuery.NcDirectDbQuery;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager.NcPathConstants;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
//import org.apache.log4j.Logger;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.Node;
|
||||
import org.dom4j.io.SAXReader;
|
||||
|
||||
|
||||
import com.raytheon.uf.viz.core.catalog.DirectDbQuery.QueryLanguage;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.vividsolutions.jts.geom.*;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
import com.vividsolutions.jts.geom.CoordinateList;
|
||||
import com.vividsolutions.jts.geom.Geometry;
|
||||
import com.vividsolutions.jts.geom.GeometryCollection;
|
||||
import com.vividsolutions.jts.geom.GeometryFactory;
|
||||
import com.vividsolutions.jts.geom.LineString;
|
||||
import com.vividsolutions.jts.geom.LinearRing;
|
||||
import com.vividsolutions.jts.geom.MultiPolygon;
|
||||
import com.vividsolutions.jts.geom.Point;
|
||||
import com.vividsolutions.jts.geom.Polygon;
|
||||
import com.vividsolutions.jts.geom.impl.CoordinateArraySequence;
|
||||
import com.vividsolutions.jts.io.WKBReader;
|
||||
|
||||
/**
|
||||
* GFA clipping functionality.
|
||||
|
@ -80,7 +91,7 @@ public class GfaClip {
|
|||
|
||||
private static GfaClip instance = new GfaClip();
|
||||
|
||||
private final static Logger logger = Logger.getLogger( GfaClip.class );
|
||||
// private final static Logger logger = Logger.getLogger( GfaClip.class );
|
||||
|
||||
/** Factory */
|
||||
private static GeometryFactory geometryFactory;
|
||||
|
@ -207,7 +218,7 @@ public class GfaClip {
|
|||
*/
|
||||
public ArrayList<Gfa> simpleclip(Gfa smear) {
|
||||
|
||||
logger.debug("clipping started");
|
||||
// logger.debug("clipping started");
|
||||
|
||||
ArrayList<Gfa> list = new ArrayList<Gfa>();
|
||||
for (String key : getFaRegionBounds().keySet()) {
|
||||
|
@ -377,9 +388,10 @@ public class GfaClip {
|
|||
* @throws VizException
|
||||
*/
|
||||
private void readFaRegionBounds() throws VizException {
|
||||
String sql = "select t.region, AsBinary(t.the_geom) from " + SCHEMA + "." + FA_REGION_TABLE + " t";
|
||||
faRegionBounds = readBounds( DATABASE, sql );
|
||||
|
||||
faRegionBounds = new HashMap<String, Geometry>();
|
||||
for ( FARegion fa : PgenStaticDataProvider.getProvider().getFARegions()){
|
||||
faRegionBounds.put(fa.getRegion(), fa.getGeometry());
|
||||
}
|
||||
loadFaRegionCommBounds();
|
||||
}
|
||||
|
||||
|
@ -389,8 +401,10 @@ public class GfaClip {
|
|||
* @throws VizException
|
||||
*/
|
||||
private void readFaAreaBounds() throws VizException {
|
||||
String sql = "select t.area, AsBinary(t.the_geom) from " + SCHEMA + "." + FA_AREA_TABLE + " t";
|
||||
faAreaBounds = readBounds( DATABASE, sql );
|
||||
faAreaBounds = new HashMap<String, Geometry>();
|
||||
for ( FAArea fa : PgenStaticDataProvider.getProvider().getFAAreas()){
|
||||
faAreaBounds.put(fa.getArea(), fa.getGeometry());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -399,8 +413,10 @@ public class GfaClip {
|
|||
* @throws VizException
|
||||
*/
|
||||
private void readFaAreaXBounds() throws VizException {
|
||||
String sql = "select t.area, AsBinary(t.the_geom) from " + SCHEMA + "." + FA_AREAX_TABLE + " t";
|
||||
faAreaXBounds = readBounds( DATABASE, sql );
|
||||
faAreaXBounds = new HashMap<String, Geometry>();
|
||||
for ( FAArea fa : PgenStaticDataProvider.getProvider().getFAAreaX()){
|
||||
faAreaXBounds.put(fa.getArea(), fa.getGeometry());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -410,7 +426,7 @@ public class GfaClip {
|
|||
*/
|
||||
private void readStateBounds() throws VizException {
|
||||
// TODO change to use SCHEMA, DATABASE, and STATE_BNDS_TABLE
|
||||
String sql = "select t.state, AsBinary(t.the_geom) from mapdata.states t";
|
||||
// String sql = "select t.state, AsBinary(t.the_geom) from mapdata.states t";
|
||||
// String sql = "select t.state, AsBinary(t.the_geom_0) from mapdata.states t";
|
||||
// String sql = "select t.state, AsBinary(t.the_geom_0_001) from mapdata.states t";
|
||||
// String sql = "select t.state, AsBinary(t.the_geom_0_004) from mapdata.states t";
|
||||
|
@ -422,7 +438,11 @@ public class GfaClip {
|
|||
// System.out.println("Time to load state bounds = " + (System.currentTimeMillis() - l1 ) );
|
||||
|
||||
|
||||
HashMap<String, Geometry> originalStateBounds = readBounds( "maps", sql );
|
||||
HashMap<String, Geometry> originalStateBounds = new HashMap<String, Geometry>();
|
||||
|
||||
for ( USState st : PgenStaticDataProvider.getProvider().getAllstates()){
|
||||
originalStateBounds.put(st.getStateAbrv(), st.getShape());
|
||||
}
|
||||
|
||||
//Exclude a few states.
|
||||
for ( String s : EXCLUDE_STATES ) {
|
||||
|
@ -439,8 +459,10 @@ public class GfaClip {
|
|||
* @throws VizException
|
||||
*/
|
||||
private void readGreatLakeBounds() throws VizException {
|
||||
String sql = "select t.id, AsBinary(t.the_geom) from " + SCHEMA + "." + GREATE_LAKE_BNDS_TABLE + " t";
|
||||
greatLakesBounds = readBounds( DATABASE, sql );
|
||||
greatLakesBounds = new HashMap<String, Geometry>();
|
||||
for ( GreatLake lake : PgenStaticDataProvider.getProvider().getGreatLakes()){
|
||||
greatLakesBounds.put(lake.getId(), lake.getGeometry());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -449,50 +471,10 @@ public class GfaClip {
|
|||
* @throws VizException
|
||||
*/
|
||||
private void readCoastalWaterBounds() throws VizException {
|
||||
String sql = "select t.id, AsBinary(t.the_geom) from " + SCHEMA + "." + COASTAL_WATER_BNDS_TABLE + " t";
|
||||
coastalWaterBounds = readBounds( DATABASE, sql );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Read bounds.
|
||||
*
|
||||
* @throws VizException
|
||||
*/
|
||||
private HashMap<String, Geometry> readBounds(String database, String sql) throws VizException {
|
||||
HashMap<String, Geometry> map = new HashMap<String, Geometry>();
|
||||
|
||||
List<Object[]> result = NcDirectDbQuery.executeQuery(sql, database, QueryLanguage.SQL);
|
||||
|
||||
WKBReader wkbReader = new WKBReader();
|
||||
if (result != null && !result.isEmpty()) {
|
||||
try {
|
||||
for (Object[] obj : result) {
|
||||
//Throw out if either the key or the Geometry is null.
|
||||
if ( obj[0] == null || obj[1] == null) continue;
|
||||
Geometry g = wkbReader.read((byte[]) obj[1]);
|
||||
|
||||
if(!g.isValid()) {
|
||||
// if ( sql.contains( GREATE_LAKE_BNDS_TABLE ) ) {
|
||||
// System.out.println( "Get lakes found for key: " + obj[0] + " but is invalid!" );
|
||||
// }
|
||||
// logger.warn("Skipped an invalid shape file for " + obj[0] + ": " + sql + "");
|
||||
continue;
|
||||
}
|
||||
|
||||
map.put( (String)obj[0], g );
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// cannot do anything here, wrong data
|
||||
// the same as database problem
|
||||
throw new VizException(e);
|
||||
}
|
||||
} else {
|
||||
throw new VizException("No bounds found, please check parameters");
|
||||
coastalWaterBounds = new HashMap<String, Geometry>();
|
||||
for ( CostalWater water : PgenStaticDataProvider.getProvider().getCostalWaters()){
|
||||
coastalWaterBounds.put(water.getId(), water.getGeometry());
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -504,7 +486,8 @@ public class GfaClip {
|
|||
try {
|
||||
readFaRegionBounds();
|
||||
} catch ( VizException e) {
|
||||
logger.error("Error ", e);
|
||||
// logger.error("Error ", e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -520,7 +503,8 @@ public class GfaClip {
|
|||
try {
|
||||
readFaAreaBounds();
|
||||
} catch ( VizException e ) {
|
||||
logger.error("Error ", e);
|
||||
// logger.error("Error ", e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -536,7 +520,8 @@ public class GfaClip {
|
|||
try {
|
||||
readFaAreaXBounds();
|
||||
} catch ( VizException e ) {
|
||||
logger.error("Error ", e);
|
||||
// logger.error("Error ", e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -553,7 +538,8 @@ public class GfaClip {
|
|||
try {
|
||||
readStateBounds();
|
||||
} catch ( VizException e ) {
|
||||
logger.error("Error ", e);
|
||||
// logger.error("Error ", e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -569,7 +555,8 @@ public class GfaClip {
|
|||
try {
|
||||
readGreatLakeBounds();
|
||||
} catch ( VizException e) {
|
||||
logger.error("Error ", e);
|
||||
// logger.error("Error ", e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -585,7 +572,8 @@ public class GfaClip {
|
|||
try {
|
||||
readCoastalWaterBounds();
|
||||
} catch ( VizException e ) {
|
||||
logger.error("Error ", e);
|
||||
// logger.error("Error ", e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1034,8 +1022,9 @@ public class GfaClip {
|
|||
|
||||
if ( mtObscTbl == null) {
|
||||
try {
|
||||
String mtObscFile = NcPathManager.getInstance().getStaticFile(
|
||||
NcPathConstants.PGEN_MNTN_OBSC_STATES ).getAbsolutePath();
|
||||
String mtObscFile = PgenStaticDataProvider.getProvider().getFileAbsolutePath(
|
||||
PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + "mt_obsc_states.xml");
|
||||
|
||||
SAXReader reader = new SAXReader();
|
||||
mtObscTbl = reader.read( mtObscFile );
|
||||
} catch ( Exception e ) {
|
||||
|
|
|
@ -27,7 +27,7 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
//import org.apache.log4j.Logger;
|
||||
|
||||
import com.vividsolutions.jts.algorithm.CGAlgorithms;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
@ -64,7 +64,7 @@ import com.vividsolutions.jts.geom.impl.CoordinateArraySequence;
|
|||
* @version 1
|
||||
*/
|
||||
public class GfaFormat {
|
||||
private final static Logger logger = Logger.getLogger(GfaFormat.class);
|
||||
// private final static Logger logger = Logger.getLogger(GfaFormat.class);
|
||||
|
||||
PgenResource drawingLayer;
|
||||
private static GeometryFactory geometryFactory;
|
||||
|
@ -92,7 +92,7 @@ public class GfaFormat {
|
|||
}
|
||||
}
|
||||
|
||||
logger.debug("formatting time: " + (System.currentTimeMillis() - time) + " ms");
|
||||
// logger.debug("formatting time: " + (System.currentTimeMillis() - time) + " ms");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -960,7 +960,8 @@ public class GfaFormat {
|
|||
else
|
||||
return 1;
|
||||
} catch (RuntimeException e) {
|
||||
logger.error("Comparator problem", e);
|
||||
// logger.error("Comparator problem", e);
|
||||
e.printStackTrace();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
package gov.noaa.nws.ncep.ui.pgen.gfa;
|
||||
|
||||
import static gov.noaa.nws.ncep.ui.pgen.gfa.Gfa.nvl;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.AbstractDrawableComponent;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.Layer;
|
||||
|
@ -15,8 +16,6 @@ import gov.noaa.nws.ncep.ui.pgen.elements.Product;
|
|||
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.tools.PgenCycleTool;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager.NcPathConstants;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
|
@ -34,7 +33,7 @@ import javax.xml.transform.TransformerFactory;
|
|||
import javax.xml.transform.stream.StreamResult;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
//import org.apache.log4j.Logger;
|
||||
|
||||
import com.raytheon.uf.common.serialization.SerializationUtil;
|
||||
import com.vividsolutions.jts.geom.Geometry;
|
||||
|
@ -59,11 +58,11 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
*/
|
||||
public class GfaGenerate {
|
||||
|
||||
private final static Logger logger = Logger.getLogger(GfaGenerate.class);
|
||||
// private final static Logger logger = Logger.getLogger(GfaGenerate.class);
|
||||
private Transformer transformer;
|
||||
private String XSLT_FILE = NcPathManager.getInstance().getStaticFile(
|
||||
NcPathConstants.PGEN_GFA_PROD_XSL ).getAbsolutePath();
|
||||
|
||||
private String XSLT_FILE = PgenStaticDataProvider.getProvider().getFileAbsolutePath(
|
||||
PgenStaticDataProvider.getProvider().getPgenLocalizationRoot()+ "xslt"+File.separator+
|
||||
"airmet"+File.separator+"gfa_product.xsl");
|
||||
|
||||
/**
|
||||
* Generates product text out of the list.
|
||||
|
@ -203,7 +202,8 @@ public class GfaGenerate {
|
|||
if (output != null)
|
||||
output.close();
|
||||
} catch ( IOException e ) {
|
||||
logger.error( e );
|
||||
// logger.error( e );
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -260,10 +260,11 @@ public class GfaGenerate {
|
|||
res = result.getWriter().toString().trim();
|
||||
|
||||
} catch ( Exception e ) {
|
||||
logger.error( "", e );
|
||||
// logger.error( "", e );
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
logger.debug( res );
|
||||
// logger.debug( res );
|
||||
|
||||
if ( res.contains("FRZLVL...")){
|
||||
res = wrapFrzl(res);
|
||||
|
|
|
@ -7,8 +7,7 @@
|
|||
*/
|
||||
package gov.noaa.nws.ncep.ui.pgen.gfa;
|
||||
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager.NcPathConstants;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.io.File;
|
||||
|
@ -101,8 +100,8 @@ public class GfaInfo {
|
|||
* Read the menu configuration from gfa.xml file
|
||||
*/
|
||||
private static void readOptions() {
|
||||
File gfainfoFile = NcPathManager.getInstance().getStaticFile(
|
||||
NcPathConstants.PGEN_GFA_ATTR_FILE );
|
||||
File gfainfoFile = PgenStaticDataProvider.getProvider().getStaticFile(
|
||||
PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + "gfa.xml");
|
||||
|
||||
try {
|
||||
SAXReader reader = new SAXReader();
|
||||
|
|
|
@ -15,7 +15,7 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
//import org.apache.log4j.Logger;
|
||||
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
import com.vividsolutions.jts.geom.Geometry;
|
||||
|
@ -44,7 +44,7 @@ import com.vividsolutions.jts.geom.Polygon;
|
|||
*/
|
||||
public class GfaReducePoint {
|
||||
|
||||
private final static Logger logger = Logger.getLogger(GfaClip.class);
|
||||
// private final static Logger logger = Logger.getLogger(GfaClip.class);
|
||||
|
||||
/**
|
||||
* SMEAR_INCR_PCT - maximum percentage allowed for the increase in size
|
||||
|
|
|
@ -27,7 +27,7 @@ import java.util.LinkedHashMap;
|
|||
import java.util.List;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
//import org.apache.log4j.Logger;
|
||||
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
import com.vividsolutions.jts.geom.Geometry;
|
||||
|
@ -65,7 +65,7 @@ public class GfaRules {
|
|||
public static final String WORDING = "WORDING";
|
||||
|
||||
/** Logger */
|
||||
private final static Logger logger = Logger.getLogger(GfaRules.class);
|
||||
// private final static Logger logger = Logger.getLogger(GfaRules.class);
|
||||
|
||||
/** Area limit in square nautical miles */
|
||||
public static final double AREA_LIMIT = 3000.0;
|
||||
|
@ -279,8 +279,8 @@ public class GfaRules {
|
|||
}
|
||||
smear.addAttribute( WORDING, wording );
|
||||
|
||||
logger.trace( smear.toString() );
|
||||
logger.debug( "\n" + wording );
|
||||
// logger.trace( smear.toString() );
|
||||
// logger.debug( "\n" + wording );
|
||||
|
||||
// create beginning and ending
|
||||
parseWording( smear, wording );
|
||||
|
@ -529,7 +529,7 @@ public class GfaRules {
|
|||
// sanity check - should never reach this place
|
||||
// check asssignXorO if this happens
|
||||
String err = "Snapshot type must be assigned by this time";
|
||||
logger.error(err);
|
||||
// logger.error(err);
|
||||
throw new IllegalArgumentException(err);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ package gov.noaa.nws.ncep.ui.pgen.gfa;
|
|||
import gov.noaa.nws.ncep.ui.pgen.sigmet.SigmetInfo;
|
||||
import gov.noaa.nws.ncep.ui.pgen.tools.PgenCycleTool;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
//import org.apache.log4j.Logger;
|
||||
|
||||
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
||||
|
||||
|
@ -38,7 +38,7 @@ public class PreloadGfaDataThread extends Thread {
|
|||
|
||||
public boolean started;
|
||||
|
||||
private final static Logger logger = Logger.getLogger(PreloadGfaDataThread.class);
|
||||
// private final static Logger logger = Logger.getLogger(PreloadGfaDataThread.class);
|
||||
|
||||
private String [] toLoad = {LocalizationManager.class.getName(),
|
||||
PgenCycleTool.class.getName(),
|
||||
|
@ -69,11 +69,12 @@ public class PreloadGfaDataThread extends Thread {
|
|||
ReduceGfaPointsUtil.getStationTable(); //put here because Gfa uses canFormatted
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error(e);
|
||||
logger.debug("LoadGfaClassesThread loading time: " + (System.currentTimeMillis() - time) + " ms");
|
||||
// logger.error(e);
|
||||
e.printStackTrace();
|
||||
// logger.debug("LoadGfaClassesThread loading time: " + (System.currentTimeMillis() - time) + " ms");
|
||||
}
|
||||
|
||||
logger.debug("LoadGfaClassesThread loading time: " + (System.currentTimeMillis() - time) + " ms");
|
||||
// logger.debug("LoadGfaClassesThread loading time: " + (System.currentTimeMillis() - time) + " ms");
|
||||
|
||||
loaded = true;
|
||||
}
|
||||
|
|
|
@ -9,10 +9,9 @@ package gov.noaa.nws.ncep.ui.pgen.gfa;
|
|||
|
||||
import gov.noaa.nws.ncep.edex.common.stationTables.Station;
|
||||
import gov.noaa.nws.ncep.edex.common.stationTables.StationTable;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.gfa.GfaSnap;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager.NcPathConstants;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
@ -61,9 +60,7 @@ public class ReduceGfaPointsUtil {
|
|||
static StationTable stationTable;
|
||||
|
||||
public static StationTable getStationTable() {
|
||||
stationTable = new StationTable(
|
||||
NcPathManager.getInstance().getStaticFile(
|
||||
NcPathConstants.VORS_STN_TBL ).getAbsolutePath() );
|
||||
stationTable = PgenStaticDataProvider.getProvider().getVorTbl();
|
||||
return stationTable;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,22 +7,19 @@
|
|||
*/
|
||||
package gov.noaa.nws.ncep.ui.pgen.graphToGrid;
|
||||
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.contours.ContourLine;
|
||||
import gov.noaa.nws.ncep.ui.pgen.contours.Contours;
|
||||
import gov.noaa.nws.ncep.viz.common.dbQuery.NcDirectDbQuery;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.raytheon.uf.viz.core.catalog.DirectDbQuery.QueryLanguage;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
|
||||
import com.vividsolutions.jts.geom.*;
|
||||
import com.vividsolutions.jts.io.ParseException;
|
||||
import com.vividsolutions.jts.io.WKBReader;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
import com.vividsolutions.jts.geom.Geometry;
|
||||
import com.vividsolutions.jts.geom.MultiPolygon;
|
||||
import com.vividsolutions.jts.geom.Point;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -41,7 +38,7 @@ import org.apache.log4j.Logger;
|
|||
|
||||
public class BoundPolygon {
|
||||
|
||||
private final static Logger logger = Logger.getLogger( BoundPolygon.class);
|
||||
// private final static Logger logger = Logger.getLogger( BoundPolygon.class);
|
||||
|
||||
/**
|
||||
* The bound specification string.
|
||||
|
@ -69,21 +66,6 @@ public class BoundPolygon {
|
|||
*/
|
||||
private Boolean inout;
|
||||
|
||||
/**
|
||||
* Database name, currently defaulted to "ncep".
|
||||
*/
|
||||
public String database = "ncep";
|
||||
|
||||
/**
|
||||
* Schema name, currently defaulted to "bounds".
|
||||
*/
|
||||
public String schema = "bounds";
|
||||
|
||||
/**
|
||||
* Factory
|
||||
* */
|
||||
private GeometryFactory geometryFactory = new GeometryFactory();
|
||||
|
||||
/**
|
||||
* Bound polygons retrieve for the specified bounds.
|
||||
*/
|
||||
|
@ -148,84 +130,9 @@ public class BoundPolygon {
|
|||
|
||||
// Parse the bound specification
|
||||
parseBounds();
|
||||
|
||||
// Query the bound table name in config.clo
|
||||
String bndsTable = "select t.table_name from config.clo t where t.alias_name = '" +
|
||||
boundsTableAlias.toUpperCase() + "'";
|
||||
|
||||
logger.debug( "bndsTable=" + bndsTable );
|
||||
|
||||
List<Object[]> tableFile = null;
|
||||
try {
|
||||
tableFile = NcDirectDbQuery.executeQuery(
|
||||
bndsTable, database, QueryLanguage.SQL );
|
||||
} catch (Exception e ) {
|
||||
logger.debug( "Cannot find table for " + boundsTableAlias );
|
||||
}
|
||||
|
||||
|
||||
String tableName = null;
|
||||
if ( tableFile.isEmpty() ){
|
||||
// no record, try to use it directly as a table name
|
||||
tableName = boundsTableAlias;
|
||||
} else {
|
||||
for (Object o : tableFile.get(0) ) {
|
||||
tableName = (String) o;
|
||||
}
|
||||
}
|
||||
|
||||
// Query the bounds from the table
|
||||
String queryBnds;
|
||||
queryBnds = "SELECT AsBinary(t.the_geom) FROM " + schema + "." + tableName;
|
||||
if ( columnName != null && columnValue != null ) {
|
||||
// queryBnds += " t" + " WHERE t." + columnName + " like '" + columnValue + "%'";
|
||||
queryBnds += " t" + " WHERE t." + columnName.toUpperCase() + " = '" +
|
||||
columnValue.toUpperCase() + "'";
|
||||
}
|
||||
|
||||
logger.debug( "queryBnds=" + queryBnds );
|
||||
|
||||
List<Object[]> bounds = null;
|
||||
try {
|
||||
bounds = NcDirectDbQuery.executeQuery(
|
||||
queryBnds, database, QueryLanguage.SQL );
|
||||
|
||||
} catch (Exception e ) {
|
||||
logger.debug( "Cannot find bounds for " + boundsTableAlias );
|
||||
}
|
||||
|
||||
|
||||
// Read and store it
|
||||
WKBReader wkbReader = new WKBReader();
|
||||
|
||||
if ( bounds != null && !bounds.isEmpty() ) {
|
||||
for ( Object[] bnd : bounds ){
|
||||
|
||||
if ( bnd[0] != null ){
|
||||
|
||||
MultiPolygon mpoly = null;
|
||||
try {
|
||||
Geometry g = wkbReader.read( (byte[]) bnd[0] );
|
||||
if ( g instanceof MultiPolygon ) {
|
||||
mpoly = (MultiPolygon) g;
|
||||
}
|
||||
else if ( g instanceof Polygon ) {
|
||||
mpoly = new MultiPolygon( new Polygon[]{ (Polygon)g },
|
||||
geometryFactory );
|
||||
}
|
||||
|
||||
} catch ( ParseException e) {
|
||||
logger.debug( "Error reading bound polygon" + e );
|
||||
}
|
||||
|
||||
if ( mpoly != null ) {
|
||||
multiPolygons.add( mpoly );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
multiPolygons = PgenStaticDataProvider.getProvider().getG2GBounds(boundsTableAlias, columnName, columnValue);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -237,7 +144,7 @@ public class BoundPolygon {
|
|||
private void parseBounds() {
|
||||
|
||||
String[] bndStr = bnds.split("\\|");
|
||||
logger.debug( "bnds=" + bnds );
|
||||
// logger.debug( "bnds=" + bnds );
|
||||
|
||||
inout = true;
|
||||
|
||||
|
@ -246,7 +153,7 @@ public class BoundPolygon {
|
|||
boundsTableAlias = bndStr[0];
|
||||
}
|
||||
|
||||
logger.debug( "boundsTableAlias=" + boundsTableAlias);
|
||||
// logger.debug( "boundsTableAlias=" + boundsTableAlias);
|
||||
|
||||
if ( bndStr.length > 1 ) {
|
||||
int inds = bndStr[1].indexOf("<");
|
||||
|
@ -258,8 +165,8 @@ public class BoundPolygon {
|
|||
}
|
||||
}
|
||||
|
||||
logger.debug( "columnName=" + columnName);
|
||||
logger.debug( "columnvale=" + columnValue);
|
||||
// logger.debug( "columnName=" + columnName);
|
||||
// logger.debug( "columnvale=" + columnValue);
|
||||
|
||||
if ( bndStr.length > 2 ) {
|
||||
if ( bndStr[2].trim().charAt(0) != 'T' &&
|
||||
|
@ -329,8 +236,8 @@ public class BoundPolygon {
|
|||
nn++;
|
||||
}
|
||||
|
||||
logger.debug( "# of bounds MultiPolygon found: " + nn );
|
||||
logger.debug( "# of bound Polygon found: " + mm );
|
||||
// logger.debug( "# of bounds MultiPolygon found: " + nn );
|
||||
// logger.debug( "# of bound Polygon found: " + mm );
|
||||
|
||||
return boundContours;
|
||||
}
|
||||
|
@ -347,7 +254,7 @@ public class BoundPolygon {
|
|||
ArrayList<BoundPolygon> allBounds = new ArrayList<BoundPolygon>();
|
||||
|
||||
String[] bndArray = bndStr.split("\\+");
|
||||
logger.debug( "Total # of bounds"+ bndArray.length );
|
||||
// logger.debug( "Total # of bounds"+ bndArray.length );
|
||||
|
||||
for ( String str : bndArray ) {
|
||||
if ( str.trim().length() > 0 ) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
package gov.noaa.nws.ncep.ui.pgen.graphToGrid;
|
||||
|
||||
import gov.noaa.nws.ncep.gempak.parameters.categorymap.CatMap;
|
||||
import gov.noaa.nws.ncep.gempak.parameters.core.categorymap.CatMap;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenSession;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.contours.ContourLine;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*/
|
||||
package gov.noaa.nws.ncep.ui.pgen.graphToGrid;
|
||||
|
||||
import gov.noaa.nws.ncep.gempak.parameters.categorymap.CatMap;
|
||||
import gov.noaa.nws.ncep.gempak.parameters.core.categorymap.CatMap;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenSession;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.rsc.PgenResource;
|
||||
|
@ -40,7 +40,7 @@ import com.vividsolutions.jts.geom.Point;
|
|||
import com.vividsolutions.jts.geom.Polygon;
|
||||
import com.vividsolutions.jts.geom.impl.CoordinateArraySequence;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
//import org.apache.log4j.Logger;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
|
@ -67,7 +67,7 @@ import org.eclipse.ui.PlatformUI;
|
|||
|
||||
public class ContoursToGrid extends GraphToGrid {
|
||||
|
||||
private final static Logger logger = Logger.getLogger( ContoursToGrid.class );
|
||||
// private final static Logger logger = Logger.getLogger( ContoursToGrid.class );
|
||||
|
||||
private static float smallestContourValue = Util.GRID_FILL_VALUE - 1;
|
||||
private static float largestContourValue = Util.GRID_FILL_VALUE + 1;
|
||||
|
@ -105,7 +105,7 @@ public class ContoursToGrid extends GraphToGrid {
|
|||
ky = Integer.parseInt( nkxky[1] );
|
||||
}
|
||||
else {
|
||||
logger.warn( "Invalid input for kx;ky - default to 63;28" );
|
||||
// logger.warn( "Invalid input for kx;ky - default to 63;28" );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -399,12 +399,12 @@ public class ContoursToGrid extends GraphToGrid {
|
|||
}
|
||||
|
||||
if ( gparm == null || gparm.trim().length() == 0 ) {
|
||||
logger.debug( "GPARM is not provided");
|
||||
// logger.debug( "GPARM is not provided");
|
||||
return;
|
||||
}
|
||||
|
||||
if ( glevel == null || glevel.trim().length() == 0 ) {
|
||||
logger.debug( "GLEVEL is not provided");
|
||||
// logger.debug( "GLEVEL is not provided");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -463,7 +463,8 @@ public class ContoursToGrid extends GraphToGrid {
|
|||
*/
|
||||
String cpyfil = new String(" ");
|
||||
String anlyss = new String(" ");
|
||||
|
||||
|
||||
/*
|
||||
logger.debug( "G2G parameters for writing GEMPAK grid file:");
|
||||
logger.debug( "hstgrd="+histgrd);
|
||||
logger.debug( "path="+path);
|
||||
|
@ -478,7 +479,7 @@ public class ContoursToGrid extends GraphToGrid {
|
|||
logger.debug( "kxky="+ckxky);
|
||||
logger.debug( "proj="+proj);
|
||||
logger.debug( "gdarea="+gdarea);
|
||||
|
||||
*/
|
||||
g2gNative.g2g_write( grid, hist, histgrd,
|
||||
fullFile, proj, cpyfil, gdarea, anlyss, ckxky,
|
||||
maxgrd, gparm, gdatim, gvcord, glevel );
|
||||
|
@ -539,7 +540,7 @@ public class ContoursToGrid extends GraphToGrid {
|
|||
interval = Math.abs( Float.parseFloat( cint ) );
|
||||
}
|
||||
catch( Exception e) {
|
||||
logger.debug( "Invalid contour interval - " + e );
|
||||
// logger.debug( "Invalid contour interval - " + e );
|
||||
}
|
||||
|
||||
if ( interval > 0. && (gmin + interval) < gmax ) {
|
||||
|
|
|
@ -7,13 +7,14 @@
|
|||
*/
|
||||
package gov.noaa.nws.ncep.ui.pgen.graphToGrid;
|
||||
|
||||
import gov.noaa.nws.ncep.viz.tools.customProjection.CustomProjectionServiceImpl;
|
||||
import gov.noaa.nws.ncep.viz.tools.customProjection.ICustomProjectionService;
|
||||
import gov.noaa.nws.ncep.gempak.parameters.marshaller.garea.GraphicsAreaCoordinates;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager.NcPathConstants;
|
||||
import java.io.File;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.viz.customprojection.CustomProjectionServiceImpl;
|
||||
import gov.noaa.nws.ncep.viz.customprojection.ICustomProjectionService;
|
||||
import gov.noaa.nws.ncep.gempak.parameters.core.marshaller.garea.GraphicsAreaCoordinates;
|
||||
|
||||
//import org.apache.log4j.Logger;
|
||||
import org.geotools.coverage.grid.GeneralGridGeometry;
|
||||
import org.geotools.referencing.operation.DefaultMathTransformFactory;
|
||||
import org.opengis.referencing.crs.CoordinateReferenceSystem;
|
||||
|
@ -50,15 +51,14 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
|
||||
public class CoordinateTransform {
|
||||
|
||||
private final static Logger logger = Logger.getLogger( CoordinateTransform.class );
|
||||
// private final static Logger logger = Logger.getLogger( CoordinateTransform.class );
|
||||
|
||||
/*
|
||||
* Configure the two files in the extension
|
||||
*/
|
||||
private final String geogFilePath = NcPathManager.getInstance().getStaticFile(
|
||||
NcPathConstants.GEOG_TBL ).getAbsolutePath();
|
||||
private final String stationFilePath = NcPathManager.getInstance().getStaticFile(
|
||||
NcPathConstants.SFSTNS_TBL ).getAbsolutePath();
|
||||
private final String geogFilePath = PgenStaticDataProvider.getProvider().getGeogFile().getAbsolutePath();
|
||||
|
||||
private final String stationFilePath = PgenStaticDataProvider.getProvider().getSfcStnFile().getAbsolutePath();
|
||||
|
||||
/*
|
||||
* Max dimension for holding intersections defined in grphgd.cmn
|
||||
|
@ -204,35 +204,35 @@ public class CoordinateTransform {
|
|||
*/
|
||||
if ( this.projection == null || this.projection.length() == 0 ) {
|
||||
this.projection = "DEF";
|
||||
logger.warn( "Invalid input for PROJ - default to DEF");
|
||||
// logger.warn( "Invalid input for PROJ - default to DEF");
|
||||
}
|
||||
|
||||
if ( this.garea == null || this.garea.length() == 0 ) {
|
||||
this.garea = "US";
|
||||
logger.warn( "Invalid input for GAREA - default to US");
|
||||
// logger.warn( "Invalid input for GAREA - default to US");
|
||||
}
|
||||
|
||||
if ( this.kx <= 0 ) {
|
||||
this.kx = 63;
|
||||
logger.warn( "Invalid input for kx - default to 63");
|
||||
// logger.warn( "Invalid input for kx - default to 63");
|
||||
}
|
||||
|
||||
if ( this.ky <= 0 ) {
|
||||
this.ky = 28;
|
||||
logger.warn( "Invalid input for ky - default to 28");
|
||||
// logger.warn( "Invalid input for ky - default to 28");
|
||||
}
|
||||
|
||||
if ( ( kx * ky ) > LLMXTG || ( kx + ky ) > MAXDIM ) {
|
||||
this.kx = 63;
|
||||
this.ky = 28;
|
||||
logger.warn( "Grid is too large - default to 63 x 28");
|
||||
// logger.warn( "Grid is too large - default to 63 x 28");
|
||||
}
|
||||
|
||||
/*
|
||||
* Parse the garea and projection.
|
||||
*/
|
||||
logger.debug( "Projection/garea/kx/ky are " + projection + "/" + garea +
|
||||
"/" + kx + "/" + ky );
|
||||
// logger.debug( "Projection/garea/kx/ky are " + projection + "/" + garea +
|
||||
// "/" + kx + "/" + ky );
|
||||
|
||||
GraphicsAreaCoordinates gareaCoordObj = new GraphicsAreaCoordinates( garea );
|
||||
|
||||
|
@ -296,11 +296,13 @@ public class CoordinateTransform {
|
|||
yscale = ysize / (ky - 1);
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error( "Failed to create CoordinateTransform", e );
|
||||
// logger.error( "Failed to create CoordinateTransform", e );
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
} catch ( Exception e) {
|
||||
logger.error( "Failed to create CoordinateTransform", e );
|
||||
// logger.error( "Failed to create CoordinateTransform", e );
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -328,7 +330,8 @@ public class CoordinateTransform {
|
|||
try {
|
||||
worldToGeneralGrid.transform( lonlat, 0, outp, 0, numPts );
|
||||
} catch (Exception e) {
|
||||
logger.error( "Failed to transform from world to grid coordinate", e );
|
||||
// logger.error( "Failed to transform from world to grid coordinate", e );
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -383,8 +386,9 @@ public class CoordinateTransform {
|
|||
lonlat = new double[ numPts * 2 ];
|
||||
generalGridToWorld.transform( outp, 0, lonlat, 0, numPts );
|
||||
} catch (Exception e) {
|
||||
logger.error( "Failed to transform from grid to world coordinate", e );
|
||||
}
|
||||
// logger.error( "Failed to transform from grid to world coordinate", e );
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -413,7 +417,8 @@ public class CoordinateTransform {
|
|||
try {
|
||||
worldToGeneralGrid.transform( lonlat, 0, gridout, 0, numPts );
|
||||
} catch (Exception e) {
|
||||
logger.error( "Failed to transform from world to grid coordinate", e );
|
||||
// logger.error( "Failed to transform from world to grid coordinate", e );
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -444,8 +449,9 @@ public class CoordinateTransform {
|
|||
lonlat = new double[ numPts * 2 ];
|
||||
generalGridToWorld.transform( gridin, 0, lonlat, 0, numPts );
|
||||
} catch (Exception e) {
|
||||
logger.error( "Failed to transform from grid to world coordinate", e );
|
||||
}
|
||||
// logger.error( "Failed to transform from grid to world coordinate", e );
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
package gov.noaa.nws.ncep.ui.pgen.graphToGrid;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
//import org.apache.log4j.Logger;
|
||||
|
||||
import com.sun.jna.Library;
|
||||
import com.sun.jna.Native;
|
||||
|
@ -34,7 +34,7 @@ import com.sun.jna.Native;
|
|||
|
||||
public class G2GNativeLibrary {
|
||||
|
||||
private final static Logger logger = Logger.getLogger( G2GNativeLibrary.class);
|
||||
// private final static Logger logger = Logger.getLogger( G2GNativeLibrary.class);
|
||||
|
||||
/** Setting up Singleton */
|
||||
private static G2GNativeLibrary instance;
|
||||
|
@ -77,9 +77,9 @@ public class G2GNativeLibrary {
|
|||
* Test
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
logger.debug("Test G2G native library");
|
||||
// logger.debug("Test G2G native library");
|
||||
G2GNative INSTANCE = (G2GNative) Native.loadLibrary("g2g", G2GNative.class);
|
||||
logger.debug("Finish test G2G native library");
|
||||
// logger.debug("Finish test G2G native library");
|
||||
}
|
||||
|
||||
|
||||
|
@ -102,7 +102,7 @@ public class G2GNativeLibrary {
|
|||
String catmap, String hstgrd, String discrete,
|
||||
String dlines, String gglimt, String edgeopts ) {
|
||||
|
||||
logger.debug( "Start G2G native calculation ......");
|
||||
// logger.debug( "Start G2G native calculation ......");
|
||||
|
||||
int ier = g2gNative.g2g_driver( grid, hist, kx, ky, nlines,
|
||||
nlatlons, latPts, lonPts,
|
||||
|
@ -114,7 +114,7 @@ public class G2GNativeLibrary {
|
|||
catmap, hstgrd, discrete, dlines,
|
||||
gglimt, edgeopts );
|
||||
|
||||
logger.debug( "Finish G2G native calculation - ier = " + ier );
|
||||
// logger.debug( "Finish G2G native calculation - ier = " + ier );
|
||||
|
||||
return ier;
|
||||
}
|
||||
|
@ -128,13 +128,13 @@ public class G2GNativeLibrary {
|
|||
String maxgrd, String gparm, String gdatim,
|
||||
String gvcord, String glevel ) {
|
||||
|
||||
logger.debug( "Writing G2G grid to file ......");
|
||||
// logger.debug( "Writing G2G grid to file ......");
|
||||
|
||||
int ier = g2gNative.g2g_writer( grid, hist, hstgrd,
|
||||
gdfile, proj, cpyfil, gdarea, anlyss, kxky,
|
||||
maxgrd, gparm, gdatim, gvcord, glevel );
|
||||
|
||||
logger.debug( "Finish writing G2G grid - ier = " + ier );
|
||||
// logger.debug( "Finish writing G2G grid - ier = " + ier );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -13,11 +13,11 @@ import java.util.HashMap;
|
|||
import java.util.LinkedHashMap;
|
||||
import java.util.Scanner;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
//import org.apache.log4j.Logger;
|
||||
|
||||
import gov.noaa.nws.ncep.gempak.parameters.categorymap.CatMap;
|
||||
import gov.noaa.nws.ncep.gempak.parameters.core.categorymap.CatMap;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.AbstractDrawableComponent;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -38,7 +38,7 @@ import gov.noaa.nws.ncep.viz.localization.NcPathManager;
|
|||
|
||||
public abstract class GraphToGrid {
|
||||
|
||||
private final static Logger logger = Logger.getLogger( GraphToGrid.class);
|
||||
// private final static Logger logger = Logger.getLogger( GraphToGrid.class);
|
||||
|
||||
AbstractDrawableComponent currentGraph;
|
||||
|
||||
|
@ -230,8 +230,8 @@ public abstract class GraphToGrid {
|
|||
|
||||
//Check if the given file exists and readable.
|
||||
String fname = null;
|
||||
if ( NcPathManager.getInstance().getStaticFile( localizationName ) != null ) {
|
||||
fname = NcPathManager.getInstance().getStaticFile( localizationName ).getAbsolutePath();
|
||||
if ( PgenStaticDataProvider.getProvider().getStaticFile( localizationName ) != null ) {
|
||||
fname = PgenStaticDataProvider.getProvider().getStaticFile( localizationName ).getAbsolutePath();
|
||||
}
|
||||
|
||||
File thisFile = null;
|
||||
|
@ -306,7 +306,7 @@ public abstract class GraphToGrid {
|
|||
return mapVals;
|
||||
}
|
||||
else {
|
||||
logger.debug( "Cannot find input for " + paramName );
|
||||
// logger.debug( "Cannot find input for " + paramName );
|
||||
return new String("");
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
package gov.noaa.nws.ncep.ui.pgen.graphToGrid;
|
||||
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenSession;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.rsc.PgenResource;
|
||||
import gov.noaa.nws.ncep.ui.pgen.attrDialog.AttrDlg;
|
||||
|
@ -20,9 +21,8 @@ import gov.noaa.nws.ncep.ui.pgen.contours.Contours;
|
|||
import gov.noaa.nws.ncep.ui.pgen.contours.IContours;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.DECollection;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.DrawableElement;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager.NcPathConstants;
|
||||
import gov.noaa.nws.ncep.viz.ui.display.NmapUiUtils;
|
||||
import gov.noaa.nws.ncep.viz.ui.display.NCMapEditor;
|
||||
//import gov.noaa.nws.ncep.viz.ui.display.NmapUiUtils;
|
||||
//import gov.noaa.nws.ncep.viz.ui.display.NCMapEditor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
|
@ -30,7 +30,7 @@ import java.util.HashMap;
|
|||
import java.util.LinkedHashMap;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
//import org.apache.log4j.Logger;
|
||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
import org.eclipse.swt.SWT;
|
||||
|
||||
|
@ -52,6 +52,7 @@ import org.eclipse.swt.widgets.Text;
|
|||
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
|
||||
import com.raytheon.viz.ui.editor.AbstractEditor;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.io.File;
|
||||
|
@ -76,12 +77,12 @@ import java.io.File;
|
|||
|
||||
public class GraphToGridParamDialog extends CaveJFACEDialog {
|
||||
|
||||
private final static Logger logger = Logger.getLogger( GraphToGridParamDialog.class );
|
||||
// private final static Logger logger = Logger.getLogger( GraphToGridParamDialog.class );
|
||||
|
||||
private static LinkedHashMap<String, String> productMaps = null;
|
||||
private static HashMap<String, String> currentProductParams = null;
|
||||
private static ArrayList<String> productNames = null;
|
||||
private static String grphgdTblName = NcPathConstants.PGEN_G2G_GRPHGD; // "grphgd.tbl";
|
||||
private static String grphgdTblName = PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + "grphgd.tbl"; // "grphgd.tbl";
|
||||
private static ArrayList< HashMap<String, String> > productDefaults = null;
|
||||
|
||||
private static final int BASIC_ADV_ID = IDialogConstants.CLIENT_ID + 7585;
|
||||
|
@ -141,7 +142,7 @@ public class GraphToGridParamDialog extends CaveJFACEDialog {
|
|||
String fileName = value.substring( value.lastIndexOf('/') + 1 );
|
||||
|
||||
HashMap<String, String> map = GraphToGrid.loadParameters(
|
||||
NcPathConstants.PGEN_ROOT+File.separator+fileName );
|
||||
PgenStaticDataProvider.getProvider().getPgenLocalizationRoot()+File.separator+fileName );
|
||||
|
||||
if ( map.size() > 0 ) {
|
||||
productDefaults.add( map );
|
||||
|
@ -717,7 +718,8 @@ public class GraphToGridParamDialog extends CaveJFACEDialog {
|
|||
*/
|
||||
private void showExtension() {
|
||||
|
||||
NCMapEditor currentEditor = NmapUiUtils.getActiveNatlCntrsEditor();
|
||||
// AbstractEditor currentEditor = NmapUiUtils.getActiveNatlCntrsEditor();
|
||||
AbstractEditor currentEditor = PgenUtil.getActiveEditor();
|
||||
PgenResource drawingLayer = PgenSession.getInstance().getPgenResource();
|
||||
|
||||
Contours cnt = getCurrentContours();
|
||||
|
@ -739,7 +741,7 @@ public class GraphToGridParamDialog extends CaveJFACEDialog {
|
|||
ky = Integer.parseInt( nkxky[1] );
|
||||
}
|
||||
else {
|
||||
logger.warn( "Invalid input for kx;ky - default to 63;28" );
|
||||
// logger.warn( "Invalid input for kx;ky - default to 63;28" );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@ package gov.noaa.nws.ncep.ui.pgen.layering;
|
|||
import java.awt.Color;
|
||||
|
||||
import gov.noaa.nws.ncep.viz.common.ui.color.ColorButtonSelector;
|
||||
import gov.noaa.nws.ncep.viz.common.ui.color.ColorMatrixSelector;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
|
|
|
@ -7,7 +7,7 @@ import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
|||
import gov.noaa.nws.ncep.ui.pgen.elements.Layer;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.Product;
|
||||
import gov.noaa.nws.ncep.ui.pgen.rsc.PgenResource;
|
||||
import gov.noaa.nws.ncep.viz.ui.display.NmapUiUtils;
|
||||
//import gov.noaa.nws.ncep.viz.ui.display.NmapUiUtils;
|
||||
|
||||
import org.eclipse.core.commands.AbstractHandler;
|
||||
import org.eclipse.core.commands.ExecutionEvent;
|
||||
|
@ -30,7 +30,8 @@ public class PgenLayeringHotKeyHandler extends AbstractHandler {
|
|||
}
|
||||
|
||||
int layerIndex = Integer.parseInt(layerIndexStr);
|
||||
PgenResource pgenResource = PgenUtil.findPgenResource(NmapUiUtils.getActiveNatlCntrsEditor());
|
||||
// PgenResource pgenResource = PgenUtil.findPgenResource(NmapUiUtils.getActiveNatlCntrsEditor());
|
||||
PgenResource pgenResource = PgenUtil.findPgenResource(PgenUtil.getActiveEditor());
|
||||
if(pgenResource != null && layerIndex > 0){
|
||||
Product activeProduct = pgenResource.getActiveProduct();
|
||||
int layerListSize = activeProduct.getLayers().size();
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
package gov.noaa.nws.ncep.ui.pgen.palette;
|
||||
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||
import gov.noaa.nws.ncep.viz.ui.display.NCMapEditor;
|
||||
//import gov.noaa.nws.ncep.viz.ui.display.NCMapEditor;
|
||||
|
||||
import org.eclipse.core.commands.AbstractHandler;
|
||||
import org.eclipse.core.commands.ExecutionEvent;
|
||||
|
@ -34,7 +34,8 @@ public class PgenPaletteAction extends AbstractHandler {
|
|||
*/
|
||||
|
||||
AbstractEditor editor = (AbstractEditor) EditorUtil.getActiveEditor();
|
||||
if( editor instanceof NCMapEditor ) {//&& ((NCMapEditor) editor).getApplicationName().equals("NA") ) {
|
||||
// if( editor instanceof NCMapEditor ) {//&& ((NCMapEditor) editor).getApplicationName().equals("NA") ) {
|
||||
if( editor instanceof AbstractEditor ) {//&& ((NCMapEditor) editor).getApplicationName().equals("NA") ) {
|
||||
IWorkbenchPage wpage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
|
||||
|
||||
IViewPart vpart = wpage.findView( PgenUtil.VIEW_ID );
|
||||
|
|
|
@ -80,8 +80,8 @@ import gov.noaa.nws.ncep.ui.pgen.productManage.ProductDialogStarter;
|
|||
import gov.noaa.nws.ncep.ui.pgen.rsc.PgenResource;
|
||||
import gov.noaa.nws.ncep.ui.pgen.tools.PgenCycleTool;
|
||||
import gov.noaa.nws.ncep.viz.common.ui.NmapCommon;
|
||||
import gov.noaa.nws.ncep.viz.ui.display.NmapUiUtils;
|
||||
import gov.noaa.nws.ncep.viz.ui.display.NCMapEditor;
|
||||
//import gov.noaa.nws.ncep.viz.ui.display.NmapUiUtils;
|
||||
//import gov.noaa.nws.ncep.viz.ui.display.NCMapEditor;
|
||||
|
||||
/**
|
||||
* The PGEN View is used for all interaction with the objects in the PGEN Resource,
|
||||
|
@ -161,7 +161,7 @@ public class PgenPaletteWindow extends ViewPart implements SelectionListener,
|
|||
private List<String> buttonList = null; // Names of items that should appear on the palette
|
||||
private IContextActivation pgenContextActivation;
|
||||
|
||||
private NCMapEditor currentIsMultiPane = null;
|
||||
private AbstractEditor currentIsMultiPane = null;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
@ -247,10 +247,6 @@ public class PgenPaletteWindow extends ViewPart implements SelectionListener,
|
|||
* change the title to show cycle day and cycle hour
|
||||
*/
|
||||
PgenCycleTool.updateTitle();
|
||||
if( !PreloadGfaDataThread.loaded ) {
|
||||
// preload the classes to reduce the first GFA format time
|
||||
new PreloadGfaDataThread().start();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -296,7 +292,8 @@ public class PgenPaletteWindow extends ViewPart implements SelectionListener,
|
|||
/*
|
||||
* change the title back to "CAVE"
|
||||
*/
|
||||
NmapUiUtils.resetCaveTitle();
|
||||
// NmapUiUtils.resetCaveTitle();
|
||||
PgenUtil.resetCaveTitle();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -536,7 +533,7 @@ public class PgenPaletteWindow extends ViewPart implements SelectionListener,
|
|||
public void widgetSelected( SelectionEvent se ) {
|
||||
|
||||
IEditorPart editor = VizWorkbenchManager.getInstance().getActiveEditor();
|
||||
if( editor instanceof NCMapEditor ){//&& ((NCMapEditor) editor).getApplicationName().equals("NA") ) {
|
||||
if( editor instanceof AbstractEditor ){//&& ((NCMapEditor) editor).getApplicationName().equals("NA") ) {
|
||||
|
||||
|
||||
|
||||
|
@ -735,19 +732,20 @@ public class PgenPaletteWindow extends ViewPart implements SelectionListener,
|
|||
IWorkbenchPart part = partRef.getPart(false);
|
||||
//System.out.println("Something Activated: "+part.getClass().getCanonicalName() );
|
||||
//if ( part instanceof NCMapEditor &&((NCMapEditor) part).getApplicationName().equals("NA")) {
|
||||
if ( part instanceof NCMapEditor ) {
|
||||
if ( part instanceof AbstractEditor ) {
|
||||
|
||||
PgenResource rsc = PgenUtil.findPgenResource((NCMapEditor)part);
|
||||
PgenResource rsc = PgenUtil.findPgenResource((AbstractEditor)part);
|
||||
if ( (rsc==null) && (PgenUtil.getPgenMode()==PgenMode.SINGLE) ) rsc = PgenUtil.createNewResource();
|
||||
if ( rsc != null )rsc.setCatFilter(new CategoryFilter((currentCategory==null)?"Any":currentCategory));
|
||||
PgenSession.getInstance().setResource(rsc);
|
||||
|
||||
NCMapEditor editor = (NCMapEditor)part;
|
||||
if ( editor.getNumberofPanes() > 1 ) {
|
||||
AbstractEditor editor = (AbstractEditor)part;
|
||||
// if ( editor.getNumberofPanes() > 1 ) {
|
||||
if ( PgenUtil.getNumberofPanes( editor) > 1 ) {
|
||||
currentIsMultiPane = editor;
|
||||
editor.addSelectedPaneChangedListener( this );
|
||||
// editor.addSelectedPaneChangedListener( this );
|
||||
PgenUtil.addSelectedPaneChangedListener( editor, this );
|
||||
}
|
||||
|
||||
activatePGENContext();
|
||||
}
|
||||
|
||||
|
@ -755,7 +753,8 @@ public class PgenPaletteWindow extends ViewPart implements SelectionListener,
|
|||
activatePGENContext();
|
||||
|
||||
//found NCMapEditor
|
||||
NCMapEditor editor = NmapUiUtils.getActiveNatlCntrsEditor();
|
||||
// AbstractEditor editor = NmapUiUtils.getActiveNatlCntrsEditor();
|
||||
AbstractEditor editor = PgenUtil.getActiveEditor();
|
||||
if( editor != null ) {
|
||||
IRenderableDisplay display = editor.getActiveDisplayPane().getRenderableDisplay();
|
||||
ResourceList rscList = display.getDescriptor().getResourceList();
|
||||
|
@ -785,13 +784,14 @@ public class PgenPaletteWindow extends ViewPart implements SelectionListener,
|
|||
//System.out.println("Something BroughtToTop: "+part.getClass().getCanonicalName() );
|
||||
partActivated(partRef);
|
||||
|
||||
if ( part instanceof NCMapEditor ) {
|
||||
NCMapEditor editor = (NCMapEditor)part;
|
||||
PgenResource rsc = PgenUtil.findPgenResource((NCMapEditor)part);
|
||||
if ( part instanceof AbstractEditor ) {
|
||||
AbstractEditor editor = (AbstractEditor)part;
|
||||
PgenResource rsc = PgenUtil.findPgenResource((AbstractEditor)part);
|
||||
|
||||
if ( (rsc != null) && (PgenUtil.getPgenMode()==PgenMode.SINGLE)
|
||||
&& (PgenUtil.doesLayerLink() ) ) {
|
||||
int id = NmapUiUtils.getNcDisplayID( editor.getDisplayName() );
|
||||
// int id = NmapUiUtils.getNcDisplayID( editor.getDisplayName() );
|
||||
int id = PgenUtil.getDisplayID( PgenUtil.getDisplayName( editor ) );
|
||||
|
||||
if ( id > 0 && rsc != null ) {
|
||||
|
||||
|
@ -831,10 +831,13 @@ public class PgenPaletteWindow extends ViewPart implements SelectionListener,
|
|||
}
|
||||
}
|
||||
|
||||
if ( currentIsMultiPane != null ) currentIsMultiPane.removeSelectedPaneChangedListener( this );
|
||||
// if ( currentIsMultiPane != null ) currentIsMultiPane.removeSelectedPaneChangedListener( this );
|
||||
if ( currentIsMultiPane != null ) {
|
||||
PgenUtil.removeSelectedPaneChangedListener( currentIsMultiPane, this );
|
||||
}
|
||||
}
|
||||
else if ( part instanceof NCMapEditor ) {
|
||||
PgenResource pgen = PgenUtil.findPgenResource( (NCMapEditor) part );
|
||||
else if ( part instanceof AbstractEditor ) {
|
||||
PgenResource pgen = PgenUtil.findPgenResource( (AbstractEditor) part );
|
||||
if ( pgen != null ){
|
||||
pgen.closeDialogs();
|
||||
}
|
||||
|
@ -846,21 +849,23 @@ public class PgenPaletteWindow extends ViewPart implements SelectionListener,
|
|||
IWorkbenchPart part = partRef.getPart(false);
|
||||
//System.out.println("Something Deactivated: "+part.getClass().getCanonicalName() );
|
||||
|
||||
if ( part instanceof NCMapEditor ) {
|
||||
if ( part instanceof AbstractEditor ) {
|
||||
|
||||
PgenResource pgen = PgenUtil.findPgenResource( (NCMapEditor) part );
|
||||
PgenResource pgen = PgenUtil.findPgenResource( (AbstractEditor) part );
|
||||
if ( pgen != null ){
|
||||
pgen.removeGhostLine();
|
||||
pgen.removeSelected();
|
||||
//pgen.closeDialogs();
|
||||
deactivatePGENContext();
|
||||
((NCMapEditor) part).refresh();
|
||||
((AbstractEditor) part).refresh();
|
||||
}
|
||||
|
||||
NCMapEditor editor = (NCMapEditor)part;
|
||||
if ( editor.getNumberofPanes() > 1 ) {
|
||||
AbstractEditor editor = (AbstractEditor)part;
|
||||
// if ( editor.getNumberofPanes() > 1 ) {
|
||||
if ( PgenUtil.getNumberofPanes( editor) > 1 ) {
|
||||
currentIsMultiPane = null;
|
||||
editor.removeSelectedPaneChangedListener( this );
|
||||
// editor.removeSelectedPaneChangedListener( this );
|
||||
PgenUtil.removeSelectedPaneChangedListener(editor, this );
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -873,8 +878,8 @@ public class PgenPaletteWindow extends ViewPart implements SelectionListener,
|
|||
|
||||
@Override
|
||||
public void partOpened(IWorkbenchPartReference partRef) {
|
||||
//IWorkbenchPart part = partRef.getPart(false);
|
||||
//System.out.println("Something Opened: "+part.getClass().getCanonicalName() );
|
||||
// IWorkbenchPart part = partRef.getPart(false);
|
||||
// System.out.println("Something Opened: "+part.getClass().getCanonicalName() );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -882,8 +887,8 @@ public class PgenPaletteWindow extends ViewPart implements SelectionListener,
|
|||
IWorkbenchPart part = partRef.getPart(false);
|
||||
//System.out.println("Something Hidden: "+part.getClass().getCanonicalName() );
|
||||
|
||||
if ( part instanceof NCMapEditor ) {
|
||||
PgenResource pgen = PgenUtil.findPgenResource( (NCMapEditor) part );
|
||||
if ( part instanceof AbstractEditor ) {
|
||||
PgenResource pgen = PgenUtil.findPgenResource( (AbstractEditor) part );
|
||||
if ( pgen != null ){
|
||||
pgen.closeDialogs();
|
||||
}
|
||||
|
@ -897,8 +902,14 @@ public class PgenPaletteWindow extends ViewPart implements SelectionListener,
|
|||
|
||||
@Override
|
||||
public void partVisible(IWorkbenchPartReference partRef) {
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
IWorkbenchPart part = partRef.getPart(false);
|
||||
//System.out.println("Something Opened: "+part.getClass().getCanonicalName() );
|
||||
if(part instanceof AbstractEditor && !PreloadGfaDataThread.loaded ) {
|
||||
// preload the classes to reduce the first GFA format time
|
||||
new PreloadGfaDataThread().start();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void unloadPgenResource(AbstractEditor editor) {
|
||||
|
||||
|
|
|
@ -7,8 +7,7 @@
|
|||
*/
|
||||
package gov.noaa.nws.ncep.ui.pgen.productManage;
|
||||
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager.NcPathConstants;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
|
@ -186,9 +185,8 @@ public class PgenHelpDialog extends ProductDialog {
|
|||
* Get the help file from the localization
|
||||
*/
|
||||
helpContent = "";
|
||||
File prdHelpFile = NcPathManager.getInstance().getStaticFile(
|
||||
NcPathConstants.PGEN_HELP_FILE );
|
||||
|
||||
File prdHelpFile = PgenStaticDataProvider.getProvider().getStaticFile(
|
||||
PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + "PgenHelp.txt" );
|
||||
|
||||
if( prdHelpFile != null && prdHelpFile.exists() && prdHelpFile.canRead() ) {
|
||||
|
||||
|
|
|
@ -8,10 +8,9 @@
|
|||
|
||||
package gov.noaa.nws.ncep.ui.pgen.productManage;
|
||||
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.productTypes.ProdType;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager.NcPathConstants;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
|
@ -280,10 +279,10 @@ public class ProdTypeDialog extends Dialog {
|
|||
}
|
||||
else {
|
||||
//put into localization
|
||||
LocalizationContext userContext = NcPathManager.getInstance().getContext(
|
||||
LocalizationContext userContext = PgenStaticDataProvider.getProvider().getLocalizationContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.USER );
|
||||
|
||||
LocalizationFile lFile = NcPathManager.getInstance().getLocalizationFile(
|
||||
LocalizationFile lFile = PgenStaticDataProvider.getProvider().getLocalizationFile(
|
||||
userContext, getStyleSheetFileName(nameTxt.getText()));
|
||||
|
||||
//check file
|
||||
|
@ -332,7 +331,7 @@ public class ProdTypeDialog extends Dialog {
|
|||
|
||||
String pn = prodName.replaceAll(" ", "_");
|
||||
|
||||
return NcPathConstants.PGEN_ROOT + File.separator + "xslt" + File.separator + "prod" + File.separator + pn + ".xslt";
|
||||
return PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + File.separator + "xslt" + File.separator + "prod" + File.separator + pn + ".xslt";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -58,16 +58,16 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
|||
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenPreferences;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenSession;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.Activator;
|
||||
|
||||
import gov.noaa.nws.ncep.ui.pgen.attrDialog.AttrSettings;
|
||||
import gov.noaa.nws.ncep.ui.pgen.file.FileTools;
|
||||
|
||||
import gov.noaa.nws.ncep.ui.pgen.palette.PgenPaletteWindow;
|
||||
import gov.noaa.nws.ncep.ui.pgen.productTypes.*;
|
||||
import gov.noaa.nws.ncep.viz.common.ui.color.ColorButtonSelector;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager.NcPathConstants;
|
||||
|
||||
/**
|
||||
* This class allows the user to configure and edit the product types.
|
||||
|
@ -102,7 +102,8 @@ public class ProductConfigureDialog extends ProductDialog {
|
|||
"Delete current activity type", "Ignore changes and exit" };
|
||||
private final String[] typeTabNames = { "Palette", "Settings", "Layer", "Save", "Filter",
|
||||
"Share", "Clip", "Products" };
|
||||
|
||||
private static final String PGEN_PRODUCT_TYPES ="productTypes.xml";
|
||||
|
||||
private HashMap<String, IConfigurationElement> itemMap = null; // map of PGEN configuration elements
|
||||
|
||||
private static ArrayList<String> controls = null;
|
||||
|
@ -579,8 +580,8 @@ public class ProductConfigureDialog extends ProductDialog {
|
|||
|
||||
ProductTypes ptyps = new ProductTypes();
|
||||
|
||||
prdTypesFile = NcPathManager.getInstance().getStaticLocalizationFile(
|
||||
NcPathConstants.PGEN_PRODUCT_TYPES );
|
||||
prdTypesFile = PgenStaticDataProvider.getProvider().getStaticLocalizationFile(
|
||||
PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + PGEN_PRODUCT_TYPES);
|
||||
|
||||
if( prdTypesFile != null && prdTypesFile.getFile().exists() &&
|
||||
prdTypesFile.getFile().canRead() ) {
|
||||
|
@ -836,10 +837,10 @@ public class ProductConfigureDialog extends ProductDialog {
|
|||
|
||||
if ( !settings.equalsIgnoreCase("settings_tbl.xml")){ //don't delete the default file
|
||||
|
||||
LocalizationContext userContext = NcPathManager.getInstance().getContext(
|
||||
LocalizationContext userContext = PgenStaticDataProvider.getProvider().getLocalizationContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.USER );
|
||||
|
||||
LocalizationFile lFile = NcPathManager.getInstance().getLocalizationFile(
|
||||
LocalizationFile lFile = PgenStaticDataProvider.getProvider().getLocalizationFile(
|
||||
userContext, settings);
|
||||
|
||||
lFile.delete();
|
||||
|
@ -952,11 +953,11 @@ public class ProductConfigureDialog extends ProductDialog {
|
|||
}
|
||||
else { // create a user-level context and create/get a new localization file
|
||||
|
||||
LocalizationContext userContext = NcPathManager.getInstance().getContext(
|
||||
LocalizationContext userContext = PgenStaticDataProvider.getProvider().getLocalizationContext(
|
||||
prdTypesFile.getContext().getLocalizationType(),
|
||||
LocalizationLevel.USER );
|
||||
prdTypesFile = NcPathManager.getInstance().getLocalizationFile(
|
||||
userContext, NcPathConstants.PGEN_PRODUCT_TYPES );
|
||||
prdTypesFile = PgenStaticDataProvider.getProvider().getLocalizationFile(
|
||||
userContext, PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + PGEN_PRODUCT_TYPES );
|
||||
}
|
||||
File ptypFile = prdTypesFile.getFile();
|
||||
|
||||
|
@ -3034,10 +3035,10 @@ public class ProductConfigureDialog extends ProductDialog {
|
|||
ptyp.setPgenSettingsFile( "" );
|
||||
|
||||
//put into localization
|
||||
LocalizationContext userContext = NcPathManager.getInstance().getContext(
|
||||
LocalizationContext userContext = PgenStaticDataProvider.getProvider().getLocalizationContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.USER );
|
||||
|
||||
LocalizationFile lFile = NcPathManager.getInstance().getLocalizationFile(
|
||||
LocalizationFile lFile = PgenStaticDataProvider.getProvider().getLocalizationFile(
|
||||
userContext, getSettingFullPath(pdName));
|
||||
|
||||
//check file
|
||||
|
@ -3129,10 +3130,10 @@ public class ProductConfigureDialog extends ProductDialog {
|
|||
//remove style sheets
|
||||
String xsltFile = ProdTypeDialog.getStyleSheetFileName( pt.getName());
|
||||
if ( xsltFile != null && !xsltFile.isEmpty()){
|
||||
LocalizationContext userContext = NcPathManager.getInstance().getContext(
|
||||
LocalizationContext userContext = PgenStaticDataProvider.getProvider().getLocalizationContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.USER );
|
||||
|
||||
LocalizationFile lFile = NcPathManager.getInstance().getLocalizationFile(
|
||||
LocalizationFile lFile = PgenStaticDataProvider.getProvider().getLocalizationFile(
|
||||
userContext, xsltFile);
|
||||
|
||||
lFile.delete();
|
||||
|
@ -3333,7 +3334,7 @@ public class ProductConfigureDialog extends ProductDialog {
|
|||
*/
|
||||
static public String getSettingFullPath( String prodType ){
|
||||
|
||||
return NcPathConstants.PGEN_ROOT + getSettingFileName( prodType );
|
||||
return PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + getSettingFileName( prodType );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3356,14 +3357,14 @@ public class ProductConfigureDialog extends ProductDialog {
|
|||
* @return
|
||||
*/
|
||||
private String getCurrentSetting( String prodType ){
|
||||
File settingsFile = NcPathManager.getInstance().getStaticFile(
|
||||
File settingsFile = PgenStaticDataProvider.getProvider().getStaticFile(
|
||||
getSettingFullPath( prodType));
|
||||
|
||||
String fileName = "";
|
||||
if ( settingsFile == null || !settingsFile.exists() ){
|
||||
fileName = "settings_tbl.xml";
|
||||
settingsFile = NcPathManager.getInstance().getStaticFile(
|
||||
NcPathConstants.PGEN_SETTINGS_TBL);
|
||||
settingsFile = PgenStaticDataProvider.getProvider().getStaticFile(
|
||||
PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + AttrSettings.settingsFileName);
|
||||
}
|
||||
else {
|
||||
fileName = getSettingFileName( prodType );
|
||||
|
|
|
@ -8,15 +8,12 @@
|
|||
|
||||
package gov.noaa.nws.ncep.ui.pgen.productTypes;
|
||||
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
|
||||
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
|
||||
import gov.noaa.nws.ncep.ui.pgen.elements.Product;
|
||||
import gov.noaa.nws.ncep.ui.pgen.file.ProductConverter;
|
||||
import gov.noaa.nws.ncep.ui.pgen.productManage.ProdTypeDialog;
|
||||
import gov.noaa.nws.ncep.ui.pgen.productManage.ProductConfigureDialog;
|
||||
import gov.noaa.nws.ncep.viz.localization.NcPathManager;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.StringReader;
|
||||
import java.io.StringWriter;
|
||||
import java.util.ArrayList;
|
||||
|
@ -39,9 +36,6 @@ import javax.xml.transform.stream.StreamSource;
|
|||
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import com.raytheon.uf.common.localization.LocalizationContext;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
||||
import com.raytheon.uf.common.localization.LocalizationFile;
|
||||
import com.raytheon.uf.common.serialization.SerializationUtil;
|
||||
|
||||
|
@ -270,13 +264,8 @@ public class ProdType {
|
|||
private String getStyleSheetFilePath(){
|
||||
String ret = "";
|
||||
try {
|
||||
// LocalizationContext userContext = NcPathManager.getInstance().getContext(
|
||||
// LocalizationType.CAVE_STATIC, LocalizationLevel.USER );
|
||||
|
||||
// LocalizationFile lFile = NcPathManager.getInstance().getLocalizationFile(
|
||||
// userContext, ProdTypeDialog.getStyleSheetFileName(name) );
|
||||
|
||||
LocalizationFile lFile = NcPathManager.getInstance().getStaticLocalizationFile(ProdTypeDialog.getStyleSheetFileName(name) );
|
||||
LocalizationFile lFile = PgenStaticDataProvider.getProvider().getStaticLocalizationFile(ProdTypeDialog.getStyleSheetFileName(name) );
|
||||
|
||||
ret = lFile.getFile().getAbsolutePath();
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue