Package org.springframework.richclient.image

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


  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

    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

Related Classes of org.springframework.richclient.image.ImageSource

Copyright © 2018 www.massapicom. 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.