当前位置: 首页>>代码示例>>Java>>正文


Java ImageSource类代码示例

本文整理汇总了Java中org.springframework.richclient.image.ImageSource的典型用法代码示例。如果您正苦于以下问题:Java ImageSource类的具体用法?Java ImageSource怎么用?Java ImageSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ImageSource类属于org.springframework.richclient.image包,在下文中一共展示了ImageSource类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testImageConfigurableWithNoImageFound

import org.springframework.richclient.image.ImageSource; //导入依赖的package包/类
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);

	EasyMock.verify(imageSource);
	EasyMock.verify(configurable);

}
 
开发者ID:shevek,项目名称:spring-rich-client,代码行数:24,代码来源:DefaultApplicationObjectConfigurerTests.java

示例2: getImage

import org.springframework.richclient.image.ImageSource; //导入依赖的package包/类
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;
    }
}
 
开发者ID:shevek,项目名称:spring-rich-client,代码行数:13,代码来源:Application.java

示例3: testImageConfigurable

import org.springframework.richclient.image.ImageSource; //导入依赖的package包/类
/**
 * Confirms that a {@link ImageConfigurable} object will have its image set
 * correctly, if the image source can find it using the key
 * 'objectName.image'.
 */
public void testImageConfigurable() {

	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);

	configurer.configure(configurable, objectName);

	EasyMock.verify(imageSource);
	EasyMock.verify(configurable);

}
 
开发者ID:shevek,项目名称:spring-rich-client,代码行数:32,代码来源:DefaultApplicationObjectConfigurerTests.java

示例4: getImageSource

import org.springframework.richclient.image.ImageSource; //导入依赖的package包/类
protected ImageSource getImageSource() {
    return (ImageSource)getService(ImageSource.class);
}
 
开发者ID:shevek,项目名称:spring-rich-client,代码行数:4,代码来源:ApplicationServicesAccessor.java

示例5: DefaultApplicationObjectConfigurer

import org.springframework.richclient.image.ImageSource; //导入依赖的package包/类
/**
 * Creates a new {@code DefaultApplicationObjectConfigurer} that will use
 * the given message, image and icon sources. If any of these services are
 * null, they will be retrieved using the application services locator.
 * 
 * @param messageSource The message source. May be null.
 * @param imageSource The image source. May be null.
 * @param iconSource The icon source. May be null.
 * @param securityControllerManager The security controller manager. May be
 * null.
 */
public DefaultApplicationObjectConfigurer(MessageSource messageSource, ImageSource imageSource,
		IconSource iconSource, SecurityControllerManager securityControllerManager) {

	this.messageSource = messageSource;
	this.imageSource = imageSource;
	this.iconSource = iconSource;
	this.securityControllerManager = securityControllerManager;

}
 
开发者ID:shevek,项目名称:spring-rich-client,代码行数:21,代码来源:DefaultApplicationObjectConfigurer.java

示例6: getPropertyImage

import org.springframework.richclient.image.ImageSource; //导入依赖的package包/类
/**
 * getPropertyImage.
 *
 * @param name String
 * @return ImageIcon
 */
ImageIcon getPropertyImage(final String name) {
    final ImageSource source = this.getImageSource();
    final Image image = source.getImage(name);
    return new ImageIcon(image);
}
 
开发者ID:pan-dora,项目名称:modeller,代码行数:12,代码来源:BagView.java

示例7: getImage

import org.springframework.richclient.image.ImageSource; //导入依赖的package包/类
/**
 * getImage.
 *
 * @param imageName String
 * @return imageName
 */
public static Image getImage(final String imageName) {
    final ImageSource source =
            (ImageSource) ApplicationServicesLocator.services().getService(ImageSource.class);
    return source.getImage(imageName);
}
 
开发者ID:pan-dora,项目名称:modeller,代码行数:12,代码来源:ApplicationContextUtil.java

示例8: setImageSource

import org.springframework.richclient.image.ImageSource; //导入依赖的package包/类
/**
 * Set the image source service implementation
 *
 * @param imageSource
 */
public void setImageSource( ImageSource imageSource ) {
    services.put( ImageSource.class, imageSource );
}
 
开发者ID:shevek,项目名称:spring-rich-client,代码行数:9,代码来源:DefaultApplicationServices.java

示例9: setImageSourceId

import org.springframework.richclient.image.ImageSource; //导入依赖的package包/类
/**
 * Set the image source service implementation bean id
 *
 * @param imageSourceId bean id
 */
public void setImageSourceId( String imageSourceId ) {
    services.put( ImageSource.class, imageSourceId );
}
 
开发者ID:shevek,项目名称:spring-rich-client,代码行数:9,代码来源:DefaultApplicationServices.java


注:本文中的org.springframework.richclient.image.ImageSource类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。