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); } }
public void notifyNewMapSelectionAvailable() { aoi.setPoints(worldMapUI.getSelectionBox()); } }
height.setText(String.valueOf(sourceProducts[0].getSceneRasterHeight())); worldMapUI.getModel().setAutoZoomEnabled(true); worldMapUI.getModel().setProducts(sourceProducts); worldMapUI.getModel().setSelectedProduct(sourceProducts[0]); worldMapUI.getWorlMapPane().zoomToProduct(sourceProducts[0]); worldMapUI.setSelectionStart((float) coord[0].y, (float) coord[0].x); worldMapUI.setSelectionEnd((float) coord[2].y, (float) coord[2].x);
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 void updateGeoRegion() { try { geoRegion = new WKTReader().read(geoText.getText()); final Coordinate coord[] = geoRegion.getCoordinates(); worldMapUI.setSelectionStart((float) coord[0].y, (float) coord[0].x); worldMapUI.setSelectionEnd((float) coord[2].y, (float) coord[2].x); worldMapUI.getWorlMapPane().revalidate(); worldMapUI.getWorlMapPane().getLayerCanvas().updateUI(); } catch (Exception e) { SnapApp.getDefault().handleError("UpdateGeoRegion error reading wkt", e); } } }
private void populateFields() { nameField.setText(aoi.getName()); inputFolderField.setText(aoi.getInputFolder()); outputFolderField.setText(aoi.getOutputFolder()); graphField.setText(aoi.getProcessingGraph()); pairsCheckBox.setSelected(aoi.getFindSlaves()); maxSlavesField.setEnabled(aoi.getFindSlaves()); final GeoPos[] aoiPoints = aoi.getPoints(); if (aoiPoints.length > 2) { worldMapUI.setSelectionStart(aoiPoints[0].lat, aoiPoints[0].lon); worldMapUI.setSelectionEnd(aoiPoints[2].lat, aoiPoints[2].lon); } }
thumbnailPane.getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE); worldMapUI = new WorldMapUI(); worldMapUI.addListener(this); splitPaneV = new JSplitPane(JSplitPane.VERTICAL_SPLIT, tableViewPane, worldMapUI.getWorlMapPane()); splitPaneV.setOneTouchExpandable(true); splitPaneV.setResizeWeight(0.8);
private JPanel createCentrePanel() { final JideSplitPane splitPane1V = new JideSplitPane(JideSplitPane.VERTICAL_SPLIT); aoiTable = new JTable(); aoiTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); aoiTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); aoiTable.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(final MouseEvent e) { final int clickCount = e.getClickCount(); if (clickCount == 2) { performOpenAction(); } else if (clickCount == 1) { performSelectAction(); } } }); splitPane1V.add(new JScrollPane(aoiTable)); worldMapUI = new WorldMapUI(); splitPane1V.add(worldMapUI.getWorlMapPane()); return splitPane1V; }
pixelPanel.add(new JPanel(), pixgbc); final NestWorldMapPane worldPane = worldMapUI.getWorlMapPane(); worldPane.setPreferredSize(new Dimension(500, 130));
private void ShowAOIs(final AOI[] aoiList) { final AOITableModel tableModel = new AOITableModel(aoiList); final AOISortingDecorator sortedModel = new AOISortingDecorator(tableModel, aoiTable.getTableHeader()); aoiTable.setModel(sortedModel); aoiTable.setColumnModel(tableModel.getColumnModel()); updateStatusLabel(); final GeoPos[][] geoBoundaries = new GeoPos[aoiList.length][4]; int i = 0; for (GeoPosList aoi : aoiList) { geoBoundaries[i++] = aoi.getPoints(); } worldMapUI.setAdditionalGeoBoundaries(geoBoundaries); }
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); } }
contentPane.add(dbPane, BorderLayout.WEST); worldMapUI = new WorldMapUI(); worldMapUI.addListener(dbQueryListener); contentPane.add(worldMapUI.getWorlMapPane(), BorderLayout.EAST);
private void performSelectAction() { updateStatusLabel(); final AOI[] selectedAOIs = getSelectedAOIs(); enableOnSelection(selectedAOIs.length > 0); final GeoPos[][] geoBoundaries = new GeoPos[selectedAOIs.length][4]; int i = 0; for (GeoPosList aoi : selectedAOIs) { geoBoundaries[i++] = aoi.getPoints(); } worldMapUI.setSelectedGeoBoundaries(geoBoundaries); }
public void notifyNewMapSelectionAvailable() { dbPane.setSelectionRect(worldMapUI.getSelectionBox()); }
private void getGeoRegion() { geoRegion = null; geoText.setText(""); if (geoCoordRadio.isSelected()) { final GeoPos[] selectionBox = worldMapUI.getSelectionBox(); if (selectionBox != null) { final Coordinate[] coords = new Coordinate[selectionBox.length + 1]; for (int i = 0; i < selectionBox.length; ++i) { coords[i] = new Coordinate(selectionBox[i].getLon(), selectionBox[i].getLat()); } coords[selectionBox.length] = new Coordinate(selectionBox[0].getLon(), selectionBox[0].getLat()); final GeometryFactory geometryFactory = new GeometryFactory(); final LinearRing linearRing = geometryFactory.createLinearRing(coords); geoRegion = geometryFactory.createPolygon(linearRing, null); geoText.setText(geoRegion.toText()); } } }