Example usage for java.awt.image RenderedImage toString

List of usage examples for java.awt.image RenderedImage toString

Introduction

In this page you can find the example usage for java.awt.image RenderedImage toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:org.esa.beam.visat.toolviews.diag.TileCacheMonitor.java

private String getImageComment(RenderedImage image) {
    if (image instanceof RasterDataNodeOpImage) {
        RasterDataNodeOpImage rdnoi = (RasterDataNodeOpImage) image;
        return rdnoi.getRasterDataNode().getName();
    } else if (image instanceof VirtualBandOpImage) {
        VirtualBandOpImage vboi = (VirtualBandOpImage) image;
        return vboi.getExpression();
    } else {/*from  www .ja va 2  s . co  m*/
        final String s = image.toString();
        final int p1 = s.indexOf('[');
        final int p2 = s.indexOf(']', p1 + 1);
        if (p1 > 0 && p2 > p1) {
            return s.substring(p1 + 1, p2 - 1);
        }
        return s;
    }
}

From source file:org.photovault.image.PhotovaultImage.java

private void debugPrintGraph(RenderedImage img, String prefix) {
    Object opName = img.getProperty("org.photovault.opname");
    if (opName != null && opName instanceof String) {
        System.out.println(prefix + opName + " (" + img.getClass().getName() + ")");
    } else {// w w  w  .  jav  a  2  s .com
        System.out.println(prefix + "unnamed image" + " (" + img.getClass().getName() + ")");
    }

    System.out.println(prefix + "  " + img.toString());
    if (img instanceof RenderedOp) {
        RenderedOp op = (RenderedOp) img;
        System.out.println(prefix + "  operation name" + op.getOperationName());
        ParameterBlock pb = op.getParameterBlock();
        if (pb instanceof ParameterBlockJAI) {
            ParameterBlockJAI pbj = (ParameterBlockJAI) pb;
            String[] paramNames = pbj.getParameterListDescriptor().getParamNames();
            Vector params = pbj.getParameters();
            for (int n = 0; n < paramNames.length; n++) {
                System.out.println(prefix + "  " + paramNames[n] + params.get(n));
            }
        }
    }
    Vector<RenderedImage> sources = img.getSources();
    if (sources == null) {
        return;
    }
    for (RenderedImage parent : sources) {
        debugPrintGraph(parent, prefix + "    ");
    }
}