private void showRepository(final ProductEntry[] productEntryList) { //System.out.println("ProductLibraryToolView.showRepository: productEntryList " + (productEntryList == null ? "is null" : productEntryList.length) + " " + currentListView.getClass()); if(productEntryList == null) return; currentListView.setProductEntryList(productEntryList); notifySelectionChanged(); final GeoPos[][] geoBoundaries = new GeoPos[productEntryList.length][4]; int i = 0; for (ProductEntry entry : productEntryList) { geoBoundaries[i++] = entry.getGeoBoundary(); } worldMapUI.setAdditionalGeoBoundaries(geoBoundaries); worldMapUI.setSelectedGeoBoundaries(null); }
private static File[] findCCDPairs(final ProductDB db, final ProductEntry master, final AOI aoi) { DBQuery dbQuery = aoi.getSlaveDBQuery(); if (dbQuery == null) dbQuery = new DBQuery(); dbQuery.setExcludeDir(new File(aoi.getInputFolder())); dbQuery.setFreeQuery(AbstractMetadata.PRODUCT + " <> '" + master.getName() + "'"); dbQuery.setSelectionRect(master.getGeoBoundary()); try { final ProductEntry[] entries = dbQuery.queryDatabase(db); return ProductEntry.getFileList(getClosestDatePairs(entries, master, aoi)); } catch (Throwable t) { Dialogs.showError("Query database error:"+t.getMessage()); return null; } }
public void notifySelectionChanged() { updateStatusLabel(); final ProductEntry[] selections = getSelectedProductEntries(); productLibraryActions.selectionChanged(selections); productLibraryActions.updateContextMenu(selections); dbPane.updateProductSelectionText(selections); if (selections != null) { final GeoPos[][] geoBoundaries = new GeoPos[selections.length][4]; int i = 0; for (ProductEntry entry : selections) { geoBoundaries[i++] = entry.getGeoBoundary(); } worldMapUI.setSelectedGeoBoundaries(geoBoundaries); } else { worldMapUI.setSelectedGeoBoundaries(null); } }
private void createPanel(final File[] productFileList) { final JPanel textPanel = createTextPanel("Instructions", getInstructions()); this.add(textPanel, BorderLayout.NORTH); final WorldMapUI worldMapUI = new WorldMapUI(); this.add(worldMapUI.getWorlMapPane(), BorderLayout.CENTER); final ProductEntry[] productEntryList =ProductEntry.createProductEntryList(productFileList); final GeoPos[][] geoBoundaries = new GeoPos[productEntryList.length][4]; int i = 0; for (ProductEntry entry : productEntryList) { geoBoundaries[i++] = entry.getGeoBoundary(); } worldMapUI.setAdditionalGeoBoundaries(geoBoundaries); } }
dbQuery.setSelectionRect(selections[0].getGeoBoundary());