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


Java ImageView类代码示例

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


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

示例1: checkImages

import javax.swing.text.html.ImageView; //导入依赖的package包/类
private static void checkImages() throws Exception {
    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            HTMLEditorKit c = new HTMLEditorKit();
            HTMLDocument doc = new HTMLDocument();

            try {
                c.read(new StringReader("<HTML><TITLE>Test</TITLE><BODY><IMG id=test></BODY></HTML>"), doc, 0);
            } catch (Exception e) {
                throw new RuntimeException("The test failed", e);
            }

            Element elem = doc.getElement("test");
            ImageView iv = new ImageView(elem);

            if (iv.getLoadingImageIcon() == null) {
                throw new RuntimeException("getLoadingImageIcon returns null");
            }

            if (iv.getNoImageIcon() == null) {
                throw new RuntimeException("getNoImageIcon returns null");
            }
        }
    });
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:26,代码来源:Test6933784.java

示例2: getViewFactory

import javax.swing.text.html.ImageView; //导入依赖的package包/类
@Override
public ViewFactory getViewFactory() {
	return new HTMLFactory() {

		@Override
		public View create(Element elem) {
			View view = super.create(elem);
			if (view instanceof ImageView) {
				((ImageView) view).setLoadsSynchronously(true);
			}
			return view;
		}
	};
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:15,代码来源:DefaultHtmlPrintElement.java

示例3: create

import javax.swing.text.html.ImageView; //导入依赖的package包/类
@Override
public View create(Element elem) {
    View view = super.create(elem);

    if (view instanceof ImageView) {
        ((ImageView)view).setLoadsSynchronously(true);
    }
    return view;
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:10,代码来源:BasicHyperlinkUI.java

示例4: create

import javax.swing.text.html.ImageView; //导入依赖的package包/类
public View create(Element elem) {
	View view = super.create(elem);

	if (view instanceof ImageView) {
		((ImageView)view).setLoadsSynchronously(true);
	}
	return view;
}
 
开发者ID:Actelion,项目名称:openchemlib,代码行数:9,代码来源:ScaledEditorKit.java

示例5: create

import javax.swing.text.html.ImageView; //导入依赖的package包/类
public View create(Element elem) {
	View result;
	result = oldFactory.create(elem);
	if (result instanceof ImageView) {
		String src = (String)elem.getAttributes().
		getAttribute(HTML.Attribute.SRC);
		if ("res:".equals(src.substring(0, 4))) {
			result = new NewImageView(elem);
		}
	}
	return result;
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:13,代码来源:FCHtmlEditorKit.java

示例6: canBePaintedSafely

import javax.swing.text.html.ImageView; //导入依赖的package包/类
private boolean canBePaintedSafely(View delegate)
{
    if (delegate instanceof ImageView && hasNoImage((ImageView) delegate))
    {
        return false;
    }
    return true;
}
 
开发者ID:OpenIndex,项目名称:OpenIndex-SHEF,代码行数:9,代码来源:WysiwygHTMLEditorKit.java

示例7: getViewFactory

import javax.swing.text.html.ImageView; //导入依赖的package包/类
public ViewFactory getViewFactory() {
    return new HTMLFactory() {

        public View create(Element elem) {
            View view = super.create(elem);
            if (view instanceof ImageView) {
                ((ImageView)view).setLoadsSynchronously(true);
            }
            return view;
        }
    };
}
 
开发者ID:shevek,项目名称:spring-rich-client,代码行数:13,代码来源:SynchronousHTMLEditorKit.java

示例8: setHTMLEditorKit

import javax.swing.text.html.ImageView; //导入依赖的package包/类
/**
 * <p>setHTMLEditorKit.</p>
 *
 * @param editorPane a {@link javax.swing.JEditorPane} object.
 */
static public void setHTMLEditorKit(JEditorPane editorPane) {
    editorPane.getDocument().putProperty("imageCache", imageCache); // Read internally by ImageView, but never written.
    // Extend all this shit to cache images.
    editorPane.setEditorKit(new HTMLEditorKit() {
        private static final long serialVersionUID = -562969765076450440L;

        public ViewFactory getViewFactory() {
            return new HTMLFactory() {
                public View create(Element elem) {
                    Object o = elem.getAttributes().getAttribute(StyleConstants.NameAttribute);
                    if (o instanceof HTML.Tag) {
                        HTML.Tag kind = (HTML.Tag) o;
                        if (kind == HTML.Tag.IMG) return new ImageView(elem) {
                            public URL getImageURL() {
                                URL url = super.getImageURL();
                                // Put an image into the cache to be read by other ImageView methods.
                                if (url != null && imageCache.get(url) == null)
                                    try {
                                        imageCache.put(url.toURI(), Toolkit.getDefaultToolkit().createImage(url));
                                    } catch (URISyntaxException e) {
                                    }
                                return url;
                            }
                        };
                    }
                    return super.create(elem);
                }
            };
        }
    });
}
 
开发者ID:xitongzou,项目名称:cardforge,代码行数:37,代码来源:UI.java

示例9: hasNoImage

import javax.swing.text.html.ImageView; //导入依赖的package包/类
private boolean hasNoImage(ImageView delegate)
{
  return delegate.getImage() == null;
}
 
开发者ID:OpenIndex,项目名称:OpenIndex-SHEF,代码行数:5,代码来源:WysiwygHTMLEditorKit.java


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