本文整理汇总了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;
}
}
示例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
}
}
}
示例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
}
}