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


Java ImageFigure.getImage方法代码示例

本文整理汇总了Java中org.eclipse.draw2d.ImageFigure.getImage方法的典型用法代码示例。如果您正苦于以下问题:Java ImageFigure.getImage方法的具体用法?Java ImageFigure.getImage怎么用?Java ImageFigure.getImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.draw2d.ImageFigure的用法示例。


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

示例1: updateFigure

import org.eclipse.draw2d.ImageFigure; //导入方法依赖的package包/类
public void updateFigure( ExtendedItemHandle handle, IFigure figure )
{
    switch( extensionType )
    {
    case FIGURE_EXTENSION_TYPE:
        figureExtension.updateFigure(handle, figure);
        break;
    case IMAGE_EXTENSION_TYPE:
        ImageFigure imageFigure = (ImageFigure)figure;
        Image newImage = imageExtension.getImage( handle );
        Image oldImage = imageFigure.getImage();
        if ( newImage != oldImage )
        {
            imageFigure.setImage(newImage);
            imageExtension.disposeImage( handle, oldImage );
        }
        break;
    case LABEL_EXTENSION_TYPE:
        ((Label)figure).setText(labelExtension.getLabel( handle ));
        break;
    }

}
 
开发者ID:eclipse,项目名称:birt,代码行数:24,代码来源:ExtendedUIAdapter.java

示例2: refreshFigureFromModel

import org.eclipse.draw2d.ImageFigure; //导入方法依赖的package包/类
private void refreshFigureFromModel(List<ElementFigure> selectedElementsInternals, BTSWord word) {
	for (ElementFigure element : selectedElementsInternals)
	{
		if (element instanceof WordFigure)
		{
			WordFigure wf = (WordFigure) element;
			Object o = wf.getModelObject();
			if (word == null && o instanceof BTSWord)
			{
				word = (BTSWord) o;
			}
			boolean lset = false;
			boolean fset = false;
			for (Object fig : wf.getChildren()) {
				if (fig instanceof ImageFigure) {
					ImageFigure imf = (ImageFigure) fig;
					String mdc = transformWordToMdCString(word);
					try {
						if (imf.getImage() != null)
							if (!imf.getImage().isDisposed())
								imf.getImage().dispose();
						imf.setImage(transformToSWT(getImageData(mdc)));
					} catch (MDCSyntaxError e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
				}
				else if (fig instanceof TypedLabel) {
					TypedLabel l = (TypedLabel) fig;
					switch (l.getType()) {
						case TypedLabel.LEMMA :
							l.setText(word.getLKey());
							lset = true;
							break;
						case TypedLabel.FLEXION :
							l.setText(word.getFlexCode());
							fset = true;
							break;
						case TypedLabel.TRANSLITATION :
							l.setText(word.getWChar());
							break;
						case TypedLabel.TRANSLATION :
							if (word.getTranslation() != null) {
								String lang = l.getTranslationLang();
								String trans = word.getTranslation().getTranslation(lang);
								l.setText(lang + ":" + (trans != null ? trans : ""));
							}
							break;
					}
				}
				
			}
			if (showLemmaId && !lset && word.getLKey() != null && !"".equals(word.getLKey()))
			{
				addLKeyToWordFigure(word, wf);
			}
			if (showFlexion && !fset && word.getFlexCode() != null && !"".equals(word.getFlexCode()))
			{
				addFCodeToWordFigure(word, wf);
			}
			//FIXME add hieroglyphs
		}
	}
}
 
开发者ID:cplutte,项目名称:bts,代码行数:65,代码来源:TextAnnotationsComposite.java

示例3: refreshFigureFromModel

import org.eclipse.draw2d.ImageFigure; //导入方法依赖的package包/类
private void refreshFigureFromModel(IFigure figure, BTSWord word) {
	if (figure instanceof WordFigure)
	{
		WordFigure wf = (WordFigure) figure;
		Object o = wf.getModelObject();
		if (word == null && o instanceof BTSWord)
		{
			word = (BTSWord) o;
		}
		boolean lset = false;
		boolean fset = false;
		for (Object fig : wf.getChildren()) {
			if (fig instanceof ImageFigure) {
				ImageFigure imf = (ImageFigure) fig;
				String mdc = transformWordToMdCString(word);
				try {
					if (imf.getImage() != null)
						if (!imf.getImage().isDisposed())
							imf.getImage().dispose();
					imf.setImage(transformToSWT(getImageData(mdc)));
				} catch (MDCSyntaxError e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
			else if (fig instanceof TypedLabel) {
				TypedLabel l = (TypedLabel) fig;
				switch (l.getType()) {
					case TypedLabel.LEMMA :
						l.setText(word.getLKey());
						lset = true;
						break;
					case TypedLabel.FLEXION :
						l.setText(word.getFlexCode());
						fset = true;
						break;
					case TypedLabel.TRANSLITATION :
						l.setText(word.getWChar());
						break;
					case TypedLabel.TRANSLATION :
						if (word.getTranslation() != null) {
							String lang = l.getTranslationLang();
							String trans = word.getTranslation().getTranslationStrict(lang);
							l.setText(lang + ":" + (trans != null ? trans : ""));
						}
						break;
				}
			}
			
		}
		if (showLemmaId && !lset && word.getLKey() != null && !"".equals(word.getLKey()))
		{
			addLKeyToWordFigure(word, wf);
		}
		if (showFlexion && !fset && word.getFlexCode() != null && !"".equals(word.getFlexCode()))
		{
			addFCodeToWordFigure(word, wf);
		}
		//FIXME add hieroglyphs
	}
	
}
 
开发者ID:cplutte,项目名称:bts,代码行数:63,代码来源:SignTextComposite.java


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