/** * Checks the image and its sources are all deferred loaded, that is, there is no BufferedImage * in the chain * * @param image */ protected void assertDeferredLoading(RenderedImage image) { if (image instanceof BufferedImage) { fail( "Found a buffered image in the chain, the original image is not fully deferred loaded"); } else { for (RenderedImage ri : image.getSources()) { assertDeferredLoading(ri); } } }
public Vector<RenderedImage> getSources() { return adaptee.getSources(); }
String operationName = ((RenderedOp) localImage).getOperationName(); if ("BandMerge".equalsIgnoreCase(operationName)) { Vector<RenderedImage> sources = localImage.getSources(); if (!sources.isEmpty()) { localImage = sources.get(0);
/** * {@inheritDoc } */ @Override public Vector<RenderedImage> getSources() { return origin.getSources(); }
public int getChildCount(Object parent) { RenderedImage ro = (RenderedImage) parent; if (ro.getSources() != null) { return ro.getSources().size(); } return 0; }
public int getChildCount(Object parent) { RenderedImage ro = (RenderedImage) parent; if (ro.getSources() != null) { return ro.getSources().size(); } return 0; }
public Object getChild(Object parent, int index) { RenderedImage ro = (RenderedImage) parent; return ro.getSources().get(index); }
public Object getChild(Object parent, int index) { RenderedImage ro = (RenderedImage) parent; return ro.getSources().get(index); }
public int getIndexOfChild(Object parent, Object child) { RenderedImage ro = (RenderedImage) parent; Vector sources = ro.getSources(); for (int i = 0; i < sources.size(); i++) { if (sources.get(i).equals(child)) { return i; } } return -1; }
public int getIndexOfChild(Object parent, Object child) { RenderedImage ro = (RenderedImage) parent; Vector sources = ro.getSources(); for (int i = 0; i < sources.size(); i++) { if (sources.get(i).equals(child)) { return i; } } return -1; }
private void eleminateSources(Vector<RenderedImage> sources, Set<RenderedImage> rootEntries) { if (sources != null) { for (RenderedImage renderedImage : sources) { if (rootEntries.contains(renderedImage)) { rootEntries.remove(renderedImage); } eleminateSources(renderedImage.getSources(), rootEntries); } } }
private void eleminateSources(Vector<RenderedImage> sources, Set<RenderedImage> rootEntries) { if (sources != null) { for (RenderedImage renderedImage : sources) { if (rootEntries.contains(renderedImage)) { rootEntries.remove(renderedImage); } eleminateSources(renderedImage.getSources(), rootEntries); } } }
/** * Removes from the specified collection the specified image and its dependencies. * This method invokes itself recursively in order to scan down the sources tree. */ private static void deepRemove(final Collection/*<?>*/ sinks, final RenderedImage image) { /* * The following must be unchecked, because PlanarImage.getSources() * violates RenderedImage.getSources() contract on parameterized type. */ //@SuppressWarning("unchecked") final List sources = image.getSources(); if (sources != null) { for (final Iterator it=sources.iterator(); it.hasNext();) { final Object dependency = it.next(); sinks.remove(dependency); if (dependency instanceof RenderedImage) { deepRemove(sinks, (RenderedImage) dependency); } } } } }
private void printSources(String prefix, Vector<RenderedImage> sources, Map<RenderedImage, Integer> ownerMap, Map<RenderedImage, Long> sizeMap) { if (sources != null) { for (RenderedImage image : sources) { System.out.print(prefix + "->"); if (ownerMap.containsKey(image)) { printImage(image, ownerMap.get(image), sizeMap.get(image)); } else { printImage(image, 0, 0L); } printSources("--" + prefix, image.getSources(), ownerMap, sizeMap); } } }
private void printSources(String prefix, Vector<RenderedImage> sources, Map<RenderedImage, Integer> ownerMap, Map<RenderedImage, Long> sizeMap) { if (sources != null) { for (RenderedImage image : sources) { System.out.print(prefix + "->"); if (ownerMap.containsKey(image)) { printImage(image, ownerMap.get(image), sizeMap.get(image)); } else { printImage(image, 0, 0L); } printSources("--" + prefix, image.getSources(), ownerMap, sizeMap); } } }
Vector<RenderedImage> sources = image.getSources(); eleminateSources(sources, rootEntries); printSources("", image.getSources(), ownerMap, sizeMap);
Vector<RenderedImage> sources = image.getSources(); eleminateSources(sources, rootEntries); printSources("", image.getSources(), ownerMap, sizeMap);
/** * Returns the root node of a tree with all sources and parameters for the given source. * * @param image The last image from an operation chain. * @param locale The locale for tree node names. * @return The tree for the given image and all its sources. */ private static MutableTreeNode getNode(final RenderedImage image, final Locale locale) { final DefaultMutableTreeNode root = new NamedTreeNode(getName(image), image); final List sources = image.getSources(); if (sources != null) { final int n = sources.size(); for (int i=0; i<n; i++) { root.add(getNode((RenderedImage)sources.get(i), locale)); } } if (image instanceof OperationNode) { addParameters(root, (OperationNode)image, locale); } return root; }
List<RenderedImage> sources = image.getSources(); final int size; if ((sources != null) && !sources.isEmpty())
List<RenderedImage> sources = image.getSources(); final int size; if ((sources != null) && !sources.isEmpty())