@Override public List<ProductLocation> getProductLocations() { return timeSeries.getProductLocations(); }
@Override public ProductLocation getElementAt(int index) { return timeSeries.getProductLocations().get(index); }
@Override public int getSize() { return timeSeries.getProductLocations().size(); }
@Override public void addFiles(File... files) { final int startIndex = timeSeries.getProductLocations().size(); for (File file : files) { timeSeries.addProductLocation(new ProductLocation(ProductLocationType.FILE, file.getAbsolutePath())); } final int stopIndex = timeSeries.getProductLocations().size() - 1; fireIntervalAdded(this, startIndex, stopIndex); }
public void remove(Product product) { AbstractTimeSeries timeSeries = map.remove(product); if (timeSeries != null) { List<ProductLocation> locationList = timeSeries.getProductLocations(); for (ProductLocation productLocation : locationList) { productLocation.closeProducts(); } timeSeries.dispose(); } }
@Override public void remove(int... indices) { final List<ProductLocation> locationList = timeSeries.getProductLocations(); final List<ProductLocation> toRemove = new ArrayList<ProductLocation>(); for (int index : indices) { toRemove.add(locationList.get(index)); } for (ProductLocation location : toRemove) { closeAssociatedViews(location); timeSeries.removeProductLocation(location); } if (!toRemove.isEmpty()) { fireContentsChanged(this, indices[0], indices[indices.length - 1]); } }
@Override public void addDirectory(File directory, boolean recursive) { timeSeries.addProductLocation( new ProductLocation(recursive ? ProductLocationType.DIRECTORY_REC : ProductLocationType.DIRECTORY, directory.getAbsolutePath())); final int index = timeSeries.getProductLocations().size() - 1; fireIntervalAdded(this, index, index); }
private List<Product> getCompatibleProducts() { List<Product> result = new ArrayList<Product>(); for (ProductLocation productLocation : timeSeries.getProductLocations()) { for (Product product : productLocation.getProducts(ProgressMonitor.NULL).values()) { for (String variable : timeSeries.getEoVariables()) { if (timeSeries.isProductCompatible(product, variable)) { if (timeSeries.isEoVariableSelected(variable)) { result.add(product); } } } } } return result; }