List<Band> getBandList(final String rasterName) { final String variableName = AbstractTimeSeries.rasterToVariableName(rasterName); return timeSeries.getBandsForVariable(variableName); }
private Band getNextBand(Band currentBand, int direction) { final String varName = AbstractTimeSeries.rasterToVariableName(currentBand.getName()); final List<Band> bandList = timeSeries.getBandsForVariable(varName); final int currentIndex = bandList.indexOf(currentBand); if (direction < 0) { if (currentIndex > 0) { return bandList.get(currentIndex - 1); } } else { if (currentIndex + 1 < bandList.size()) { return bandList.get(currentIndex + 1); } } return currentBand; }
private void showTimeSeriesView(String variableName) { final List<Band> bandList = currentTimeSeries.getBandsForVariable(variableName); final VisatApp app = VisatApp.getApp(); for (Band band : bandList) { final JInternalFrame internalFrame = app.findInternalFrame(band); if (internalFrame != null) { return; } } if (!bandList.isEmpty()) { app.openProductSceneView(bandList.get(0)); } }
void adaptToTimeSeries(AbstractTimeSeries timeSeries) { version.incrementAndGet(); eoVariableBands.clear(); final boolean hasData = timeSeries != null; if (hasData) { displayController = displayControllerMap.get(timeSeries); if (displayController == null) { displayController = new TimeSeriesGraphDisplayController(this); displayControllerMap.put(timeSeries, displayController); } displayController.adaptTo(timeSeries); for (String eoVariableName : displayController.getEoVariablesToDisplay()) { eoVariableBands.add(timeSeries.getBandsForVariable(eoVariableName)); } displayAxisMapping = createDisplayAxisMapping(timeSeries); } else { displayAxisMapping = new AxisMapping(); } validation.adaptTo(timeSeries, displayAxisMapping); updatePlot(hasData); }
@Override protected String doInBackground(ProgressMonitor pm) throws Exception { List<List<Band>> bandList = new ArrayList<List<Band>>(); final List<String> timeVariables = timeSeries.getEoVariables(); for (String timeVariable : timeVariables) { bandList.add(timeSeries.getBandsForVariable(timeVariable)); } final PlacemarkGroup pinGroup = timeSeries.getTsProduct().getPinGroup(); final ProductNode[] placemarkArray = pinGroup.toArray(); if (placemarkArray.length == 0) { return "There are no pins which could be exported."; } List<Placemark> placemarks = new ArrayList<Placemark>(); for (ProductNode placemark : placemarkArray) { placemarks.add((Placemark) placemark); } CsvExporter exporter = new TimeCsvExporter(bandList, placemarks, writer); exporter.exportCsv(pm); return null; }
private List<TimeSeries> computeRasterTimeSeries() { final List<Position> positionsToDisplay = new ArrayList<Position>(); final ArrayList<String> positionNames = new ArrayList<String>(); if (type.equals(TimeSeriesType.PIN)) { final Placemark[] pinPositionsToDisplay = dataSources.getPinPositionsToDisplay(); for (Placemark namedGeoPos : pinPositionsToDisplay) { positionsToDisplay.add(positionSupport.transformGeoPos(namedGeoPos.getGeoPos())); positionNames.add(namedGeoPos.getLabel()); } } else if (showCursorTimeSeries && cursorPosition != null) { positionsToDisplay.add(cursorPosition); positionNames.add(""); } final Set<String> aliasNames = displayAxisMapping.getAliasNames(); final List<TimeSeries> rasterTimeSeries = new ArrayList<TimeSeries>(); for (int i = 0, positionsToDisplaySize = positionsToDisplay.size(); i < positionsToDisplaySize; i++) { final Position position = positionsToDisplay.get(i); final String positionName = positionNames.get(i); for (String aliasName : aliasNames) { final List<String> rasterNames = displayAxisMapping.getRasterNames(aliasName); for (String rasterName : rasterNames) { final List<Band> bandsForVariable = timeSeries.getBandsForVariable(rasterName); final TimeSeries timeSeries = computeSingleTimeSeries(bandsForVariable, position.pixelX, position.pixelY, position.currentLevel, positionName); rasterTimeSeries.add(dataHandler.getValidatedTimeSeries(timeSeries, rasterName, type)); } } } return rasterTimeSeries; }
private void closeAssociatedViews(String varName) { final List<Band> bands = timeSeries.getBandsForVariable(varName); for (Band band : bands) { final JInternalFrame[] internalFrames = VisatApp.getApp().findInternalFrames(band); for (final JInternalFrame internalFrame : internalFrames) { try { internalFrame.setClosed(true); } catch (PropertyVetoException e) { Debug.trace(e); } } } }
@Override public void actionPerformed(ActionEvent e) { final AnimatedGifExport export = new AnimatedGifExport(TimeSeriesPlayerForm.this, "Export time series as animated gif"); final String varName = AbstractTimeSeries.rasterToVariableName(currentView.getRaster().getName()); export.createFrames(timeSeries.getBandsForVariable(varName)); export.executeWithBlocking(); } });
List<Band> bands = timeSeries.getBandsForVariable( AbstractTimeSeries.rasterToVariableName(view.getRaster().getName()));