當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。