Examples of ImageSource


Examples of org.apache.xmlgraphics.image.loader.ImageSource

     * accidental/unwanted use by a component further downstream.
     * @param src the Source object
     */
    public static void removeStreams(Source src) {
        if (src instanceof ImageSource) {
            ImageSource isrc = (ImageSource)src;
            isrc.setImageInputStream(null);
        } else if (src instanceof StreamSource) {
            StreamSource ssrc = (StreamSource)src;
            ssrc.setInputStream(null);
            ssrc.setReader(null);
        } else if (src instanceof SAXSource) {
View Full Code Here

Examples of org.apache.xmlgraphics.image.loader.ImageSource

            IOUtils.closeQuietly(streamSource.getInputStream());
            streamSource.setInputStream(null);
            IOUtils.closeQuietly(streamSource.getReader());
            streamSource.setReader(null);
        } else if (src instanceof ImageSource) {
            ImageSource imageSource = (ImageSource)src;
            if (imageSource.getImageInputStream() != null) {
                try {
                    imageSource.getImageInputStream().close();
                } catch (IOException ioe) {
                    //ignore
                }
                imageSource.setImageInputStream(null);
            }
        } else if (src instanceof SAXSource) {
            InputSource is = ((SAXSource)src).getInputSource();
            if (is != null) {
                IOUtils.closeQuietly(is.getByteStream());
View Full Code Here

Examples of org.springframework.richclient.image.ImageSource

    String objectName = "bogusImageConfigurable";
    String iconKey = objectName + ".image";
    Image expectedImage = new BufferedImage(32, 32, BufferedImage.TYPE_INT_RGB);

    // Create the required mock objects
    ImageSource imageSource = (ImageSource) EasyMock.createMock(ImageSource.class);
    ImageConfigurable configurable = (ImageConfigurable) EasyMock.createMock(ImageConfigurable.class);

    // Create the configurer with the mock image source
    DefaultApplicationObjectConfigurer configurer = new DefaultApplicationObjectConfigurer(null, imageSource, null,
        null);

    EasyMock.expect(imageSource.getImage(iconKey)).andReturn(expectedImage);
    configurable.setImage(expectedImage);

    EasyMock.replay(imageSource);
    EasyMock.replay(configurable);
View Full Code Here

Examples of org.springframework.richclient.image.ImageSource

  public void testImageConfigurableWithNoImageFound() {
    String objectName = "bogusImageConfigurable";
    String iconKey = objectName + ".image";

    // Create the required mock objects
    ImageSource imageSource = (ImageSource) EasyMock.createMock(ImageSource.class);
    ImageConfigurable configurable = (ImageConfigurable) EasyMock.createMock(ImageConfigurable.class);

    // Create the configurer with the mock image source
    DefaultApplicationObjectConfigurer configurer = new DefaultApplicationObjectConfigurer(null, imageSource, null,
        null);

    EasyMock.expect(imageSource.getImage(iconKey)).andReturn(null);

    EasyMock.replay(imageSource);
    EasyMock.replay(configurable);

    configurer.configure(configurable, objectName);
View Full Code Here

Examples of org.springframework.richclient.image.ImageSource

    public Image getImage() {
        if( descriptor != null && descriptor.getImage() != null )
            return descriptor.getImage();

        try {
          ImageSource isrc = (ImageSource) services().getService(ImageSource.class);
          return isrc.getImage(DEFAULT_APPLICATION_IMAGE_KEY);
        }
        catch (NoSuchImageResourceException e) {
          return null;
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.