use nctextui rsc and db packages

Former-commit-id: 408b8fc5799eee29831271a622b6f82a9ab04406 [formerly 2b3f3a053b]
Former-commit-id: d852942dd1
This commit is contained in:
AWIPS User 2015-04-17 09:35:22 -06:00
parent b4c1b0d356
commit ec3addefdb
4 changed files with 65 additions and 60 deletions

View file

@ -18,9 +18,9 @@ Require-Bundle: org.eclipse.ui,
Eclipse-LazyStart: true Eclipse-LazyStart: true
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: SIB Bundle-Vendor: SIB
Import-Package: com.raytheon.uf.common.inventory.exception, Import-Package: com.raytheon.uf.common.dataplugin,
com.raytheon.uf.common.dataplugin,
com.raytheon.uf.common.dataplugin.obs.metar, com.raytheon.uf.common.dataplugin.obs.metar,
com.raytheon.uf.common.inventory.exception,
com.raytheon.uf.common.pointdata, com.raytheon.uf.common.pointdata,
com.raytheon.uf.viz.core, com.raytheon.uf.viz.core,
com.raytheon.uf.viz.core.drawables, com.raytheon.uf.viz.core.drawables,
@ -29,6 +29,8 @@ Import-Package: com.raytheon.uf.common.inventory.exception,
com.raytheon.uf.viz.core.rsc, com.raytheon.uf.viz.core.rsc,
com.raytheon.viz.pointdata, com.raytheon.viz.pointdata,
com.vividsolutions.jts.geom, com.vividsolutions.jts.geom,
gov.noaa.nws.ncep.ui.nctextui.dbutil,
gov.noaa.nws.ncep.ui.nctextui.rsc,
gov.noaa.nws.ncep.viz.common.ui, gov.noaa.nws.ncep.viz.common.ui,
gov.noaa.nws.ncep.viz.localization, gov.noaa.nws.ncep.viz.localization,
gov.noaa.nws.ncep.viz.overlays, gov.noaa.nws.ncep.viz.overlays,
@ -38,4 +40,3 @@ Import-Package: com.raytheon.uf.common.inventory.exception,
org.geotools.referencing, org.geotools.referencing,
org.geotools.referencing.datum, org.geotools.referencing.datum,
org.opengis.referencing.crs org.opengis.referencing.crs
Export-Package: edu.ucar.unidata.ui.ncradarui.rsc

View file

@ -5,8 +5,8 @@
<extension <extension
point="org.eclipse.ui.commands"> point="org.eclipse.ui.commands">
<command <command
id="edu.ucar.unidata.ui.ncradarui.palette" id="edu.ucar.unidata.ui.ncradarui.palette"
name="Ncradar"> name="Ncradar">
</command> </command>
<command <command
id="edu.ucar.unidata.ui.ncradarui.rsc.NcradaruiTool" id="edu.ucar.unidata.ui.ncradarui.rsc.NcradaruiTool"
@ -39,26 +39,30 @@
--> -->
</extension> </extension>
<extension <extension
point="org.eclipse.ui.views"> point="org.eclipse.ui.views">
<category <category
id="gov.noaa.nws.ncep.viz.ui.nmap" id="edu.ucar.unidata.ui.ncradarui.view"
name="NMAP Views"/> name="Ncradar Views"/>
<view <view
category="gov.noaa.nws.ncep.viz.ui.nmap" allowMultiple="false"
allowMultiple="false" category="edu.ucar.unidata.ui.ncradarui.view"
restorable="true" class="edu.ucar.unidata.ui.ncradarui.palette.NcradaruiPaletteWindow"
class="edu.ucar.unidata.ui.ncradarui.palette.NcradaruiPaletteWindow" id="edu.ucar.unidata.ui.NCRADARUI"
id="edu.ucar.unidata.ui.NCRADARUI" name="NCRADAR"
name="NCRADAR"/> restorable="true">
</extension> </view>
</extension>
<extension <extension
point="com.raytheon.uf.viz.core.classContext"> point="com.raytheon.uf.viz.core.classContext">
<classContext
class="edu.ucar.unidata.ui.ncradarui.classContext1">
</classContext>
<classContext <classContext
class="edu.ucar.unidata.ui.ncradarui.palette.NcradaruiPaletteWindow"> class="edu.ucar.unidata.ui.ncradarui.palette.NcradaruiPaletteWindow">
<contextId <contextId
id="gov.noaa.nws.ncep.viz.ui.display.NCMapContext"> id="gov.noaa.nws.ncep.viz.ui.display.NCMapContext">
</contextId> </contextId>
</classContext> </classContext>
</extension> </extension>
<!-- <!--

View file

@ -23,7 +23,7 @@ import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PlatformUI; import org.eclipse.ui.PlatformUI;
import edu.ucar.unidata.ui.ncradarui.rsc.NcradaruiResource; import gov.noaa.nws.ncep.ui.nctextui.rsc.NctextuiResource;
public class NcradaruiPaletteAction extends AbstractHandler { public class NcradaruiPaletteAction extends AbstractHandler {
@ -45,8 +45,8 @@ public class NcradaruiPaletteAction extends AbstractHandler {
vpart = wpage.showView( "edu.ucar.unidata.ui.NCRADARUI" ); vpart = wpage.showView( "edu.ucar.unidata.ui.NCRADARUI" );
if (PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() != null) { if (PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() != null) {
NcradaruiResource ncradarMapResource = NcradaruiResource.getNcradaruiResource(); NctextuiResource nctextMapResource = NctextuiResource.getNctextuiResource();
ncradarMapResource.setPoints(null); nctextMapResource.setPoints(null);
} }
} }
else { else {

View file

@ -1,6 +1,6 @@
/** /*
* *
* edu.ucar.unidata.ui.ncradarui.palette.ncradarPaletteWindow * edu.ucar.unidata.ui.ncradarui.palette.NcradaruiPaletteWindow
* *
* This java class performs the NCRADAR GUI construction. * This java class performs the NCRADAR GUI construction.
* This code has been developed by the SIB for use in the AWIPS2 system. * This code has been developed by the SIB for use in the AWIPS2 system.
@ -22,10 +22,10 @@
*/ */
package edu.ucar.unidata.ui.ncradarui.palette; package edu.ucar.unidata.ui.ncradarui.palette;
import edu.ucar.unidata.ui.ncradarui.dbutil.EReportTimeRange; import gov.noaa.nws.ncep.ui.nctextui.dbutil.EReportTimeRange;
import edu.ucar.unidata.ui.ncradarui.dbutil.NcradarDbQuery; import gov.noaa.nws.ncep.ui.nctextui.dbutil.NctextDbQuery;
import edu.ucar.unidata.ui.ncradarui.dbutil.NcradarStationInfo; import gov.noaa.nws.ncep.ui.nctextui.dbutil.NctextStationInfo;
import edu.ucar.unidata.ui.ncradarui.rsc.NcradaruiResource; import gov.noaa.nws.ncep.ui.nctextui.rsc.NctextuiResource;
import gov.noaa.nws.ncep.viz.ui.display.NatlCntrsEditor; import gov.noaa.nws.ncep.viz.ui.display.NatlCntrsEditor;
import gov.noaa.nws.ncep.viz.ui.display.NcDisplayMngr; import gov.noaa.nws.ncep.viz.ui.display.NcDisplayMngr;
@ -73,7 +73,7 @@ public class NcradaruiPaletteWindow extends ViewPart implements
private org.eclipse.swt.widgets.List typeWdgList = null; private org.eclipse.swt.widgets.List typeWdgList = null;
private NcradarDbQuery query; private NctextDbQuery query;
private EReportTimeRange timeCovered = EReportTimeRange.TWELVE_HOURS; private EReportTimeRange timeCovered = EReportTimeRange.TWELVE_HOURS;
@ -121,7 +121,7 @@ public class NcradaruiPaletteWindow extends ViewPart implements
private Button nextBtn, prevBtn; private Button nextBtn, prevBtn;
private java.util.List<NcradarStationInfo> points = new ArrayList<NcradarStationInfo>(); private java.util.List<NctextStationInfo> points = new ArrayList<NctextStationInfo>();
// private static NCMapEditor mapEditor = null; // private static NCMapEditor mapEditor = null;
private HandlePrinting printingHandle; private HandlePrinting printingHandle;
@ -158,11 +158,11 @@ public class NcradaruiPaletteWindow extends ViewPart implements
this.currentTextReports = currentTextReports; this.currentTextReports = currentTextReports;
} }
public java.util.List<NcradarStationInfo> getPoints() { public java.util.List<NctextStationInfo> getPoints() {
return points; return points;
} }
public void setPoints(java.util.List<NcradarStationInfo> points) { public void setPoints(java.util.List<NctextStationInfo> points) {
this.points = points; this.points = points;
} }
@ -296,7 +296,7 @@ public class NcradaruiPaletteWindow extends ViewPart implements
pie.printStackTrace(); pie.printStackTrace();
} }
NcradaruiResource.registerMouseHandler(); NctextuiResource.registerMouseHandler();
page = site.getPage(); page = site.getPage();
page.addPartListener(this); page.addPartListener(this);
@ -309,12 +309,12 @@ public class NcradaruiPaletteWindow extends ViewPart implements
// System.out.println("NcradaruiPaletteWindow dispose me, isEditorVisible="+ // System.out.println("NcradaruiPaletteWindow dispose me, isEditorVisible="+
// isEditorVisible); // isEditorVisible);
if (!isEditorVisible) { if (!isEditorVisible) {
NcradaruiResource.unregisterMouseHandler(); NctextuiResource.unregisterMouseHandler();
return; return;
} else { } else {
super.dispose(); super.dispose();
NatlCntrsEditor editor = NcradaruiResource.getMapEditor(); NatlCntrsEditor editor = NctextuiResource.getMapEditor();
if (editor != null) { if (editor != null) {
for (IRenderableDisplay display : UiUtil for (IRenderableDisplay display : UiUtil
@ -322,8 +322,8 @@ public class NcradaruiPaletteWindow extends ViewPart implements
// System.out.println("display " + display.toString()); // System.out.println("display " + display.toString());
for (ResourcePair rp : display.getDescriptor() for (ResourcePair rp : display.getDescriptor()
.getResourceList()) { .getResourceList()) {
if (rp.getResource() instanceof NcradaruiResource) { if (rp.getResource() instanceof NctextuiResource) {
NcradaruiResource rsc = (NcradaruiResource) rp NctextuiResource rsc = (NctextuiResource) rp
.getResource(); .getResource();
rsc.unload(); rsc.unload();
} }
@ -394,7 +394,7 @@ public class NcradaruiPaletteWindow extends ViewPart implements
gpWdgList.setBounds(dataTypeGp.getBounds().x + btnGapX, gpWdgList.setBounds(dataTypeGp.getBounds().x + btnGapX,
dataTypeGp.getBounds().y + labelGap, colWidth, listHeight); dataTypeGp.getBounds().y + labelGap, colWidth, listHeight);
// query gp list form ncradardbrsc // query gp list form ncradardbrsc
query = NcradarDbQuery.getAccess(); query = NctextDbQuery.getAccess();
// query = ncradarDbQueryX.getAccess(); // query = ncradarDbQueryX.getAccess();
java.util.List<String> groupList = query.getDataTypeGpList(); java.util.List<String> groupList = query.getDataTypeGpList();
@ -485,8 +485,8 @@ public class NcradaruiPaletteWindow extends ViewPart implements
points = query.getProductStaList(selectedType, timeCovered); points = query.getProductStaList(selectedType, timeCovered);
if (points != null && points.size() == 1) { if (points != null && points.size() == 1) {
NcradaruiResource.getNcradaruiResource().setPoints(points); NctextuiResource.getNctextuiResource().setPoints(points);
NcradaruiResource.getNcradaruiResource().setPickedStnPt(points); NctextuiResource.getNctextuiResource().setPickedStnPt(points);
displayProduct(points.get(0)); displayProduct(points.get(0));
} else { } else {
@ -497,15 +497,15 @@ public class NcradaruiPaletteWindow extends ViewPart implements
} }
nextBtn.setEnabled(false); nextBtn.setEnabled(false);
prevBtn.setEnabled(false); prevBtn.setEnabled(false);
NatlCntrsEditor mapEditor = NcradaruiResource.getMapEditor(); NatlCntrsEditor mapEditor = NctextuiResource.getMapEditor();
if (mapEditor != null) { if (mapEditor != null) {
mapEditor.refresh(); mapEditor.refresh();
PlatformUI.getWorkbench().getActiveWorkbenchWindow() PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getActivePage().bringToTop(mapEditor); .getActivePage().bringToTop(mapEditor);
} }
NcradaruiResource.getNcradaruiResource().setPoints(points); NctextuiResource.getNctextuiResource().setPoints(points);
NcradaruiResource.getNcradaruiResource().setPickedStnPt(null); NctextuiResource.getNctextuiResource().setPickedStnPt(null);
// ncradaruiModalTool.setModal(); // ncradaruiModalTool.setModal();
} }
} }
@ -513,8 +513,8 @@ public class NcradaruiPaletteWindow extends ViewPart implements
private void handleStnMarkingRequestByBtn() { private void handleStnMarkingRequestByBtn() {
points = query.getProductStaList(selectedType, timeCovered); points = query.getProductStaList(selectedType, timeCovered);
if (points != null && points.size() == 1) { if (points != null && points.size() == 1) {
NcradaruiResource.getNcradaruiResource().setPoints(points); NctextuiResource.getNctextuiResource().setPoints(points);
NcradaruiResource.getNcradaruiResource().setPickedStnPt(points); NctextuiResource.getNctextuiResource().setPickedStnPt(points);
displayProduct(points.get(0)); displayProduct(points.get(0));
} else { } else {
if ((points != null) && (points.size() != 0)) { if ((points != null) && (points.size() != 0)) {
@ -528,16 +528,16 @@ public class NcradaruiPaletteWindow extends ViewPart implements
nextBtn.setEnabled(false); nextBtn.setEnabled(false);
prevBtn.setEnabled(false); prevBtn.setEnabled(false);
NatlCntrsEditor mapEditor = NcradaruiResource.getMapEditor(); NatlCntrsEditor mapEditor = NctextuiResource.getMapEditor();
if (mapEditor != null) { if (mapEditor != null) {
mapEditor.refresh(); mapEditor.refresh();
PlatformUI.getWorkbench().getActiveWorkbenchWindow() PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getActivePage().bringToTop(mapEditor); .getActivePage().bringToTop(mapEditor);
} }
NcradaruiResource.getNcradaruiResource().setPoints(points); NctextuiResource.getNctextuiResource().setPoints(points);
if (replaceText) if (replaceText)
NcradaruiResource.getNcradaruiResource().setPickedStnPt(null); NctextuiResource.getNctextuiResource().setPickedStnPt(null);
// ncradaruiModalTool.setModal(); // ncradaruiModalTool.setModal();
} }
@ -858,7 +858,7 @@ public class NcradaruiPaletteWindow extends ViewPart implements
@Override @Override
public void partActivated(IWorkbenchPart part) { public void partActivated(IWorkbenchPart part) {
if (part instanceof NcradaruiPaletteWindow) { if (part instanceof NcradaruiPaletteWindow) {
NcradaruiResource rsc = NcradaruiResource.getNcradaruiResource(); NctextuiResource rsc = NctextuiResource.getNctextuiResource();
if (rsc != null) if (rsc != null)
rsc.setEditable(true); rsc.setEditable(true);
} }
@ -905,21 +905,21 @@ public class NcradaruiPaletteWindow extends ViewPart implements
} }
public void displayProduct(NcradarStationInfo StnPt) { public void displayProduct(NctextStationInfo StnPt) {
NatlCntrsEditor mapEditor = NcradaruiResource.getMapEditor(); NatlCntrsEditor mapEditor = NctextuiResource.getMapEditor();
if (StnPt != null && (mapEditor != null)) { if (StnPt != null && (mapEditor != null)) {
// add RED "X" marker(s) on picked stn // add RED "X" marker(s) on picked stn
List<NcradarStationInfo> rtnStateStnLst = new ArrayList<NcradarStationInfo>(); List<NctextStationInfo> rtnStateStnLst = new ArrayList<NctextStationInfo>();
if (ncradaruiPaletteWindow.isState() == true) { if (ncradaruiPaletteWindow.isState() == true) {
List<NcradarStationInfo> stateStnLst = query List<NctextStationInfo> stateStnLst = query
.getStateStationInfoList(ncradaruiPaletteWindow .getStateStationInfoList(ncradaruiPaletteWindow
.getCurrentProductName() + StnPt.getState()); .getCurrentProductName() + StnPt.getState());
// need to filter out those stns does not have reports in DB // need to filter out those stns does not have reports in DB
// now, use points list for reference // now, use points list for reference
for (NcradarStationInfo stnInState : stateStnLst) { for (NctextStationInfo stnInState : stateStnLst) {
for (NcradarStationInfo stnHasRpt : points) { for (NctextStationInfo stnHasRpt : points) {
if (stnInState.getStnid().equals(stnHasRpt.getStnid()) == true) { if (stnInState.getStnid().equals(stnHasRpt.getStnid()) == true) {
rtnStateStnLst.add(stnInState); rtnStateStnLst.add(stnInState);
break; break;
@ -932,10 +932,10 @@ public class NcradaruiPaletteWindow extends ViewPart implements
Text text = ncradaruiPaletteWindow.getText(); Text text = ncradaruiPaletteWindow.getText();
if (ncradaruiPaletteWindow.isReplaceText() == false) { if (ncradaruiPaletteWindow.isReplaceText() == false) {
// APPEND mode // APPEND mode
// List<NcradarStationInfo> prevPickedStnLst = // List<NctextStationInfo> prevPickedStnLst =
// ncradaruiPaletteWindow.getncradaruiResource().getPickedStnPt(); // ncradaruiPaletteWindow.getncradaruiResource().getPickedStnPt();
List<NcradarStationInfo> prevPickedStnLst = NcradaruiResource List<NctextStationInfo> prevPickedStnLst = NctextuiResource
.getNcradaruiResource().getPickedStnPt(); .getNctextuiResource().getPickedStnPt();
if (prevPickedStnLst.size() > 0) { if (prevPickedStnLst.size() > 0) {
if (rtnStateStnLst.addAll(prevPickedStnLst) == false) { if (rtnStateStnLst.addAll(prevPickedStnLst) == false) {
// System.out.println("handleMouseUp : add picked stn failed"); // System.out.println("handleMouseUp : add picked stn failed");
@ -947,7 +947,7 @@ public class NcradaruiPaletteWindow extends ViewPart implements
text.setText(""); text.setText("");
} }
// ncradaruiPaletteWindow.getncradaruiResource().setPickedStnPt(rtnStateStnLst); // ncradaruiPaletteWindow.getncradaruiResource().setPickedStnPt(rtnStateStnLst);
NcradaruiResource.getNcradaruiResource().setPickedStnPt( NctextuiResource.getNctextuiResource().setPickedStnPt(
rtnStateStnLst); rtnStateStnLst);
mapEditor.refresh(); mapEditor.refresh();
// ncradaruiModalTool.setModal(); // ncradaruiModalTool.setModal();