org.openide.util.Utilities.icon2Image()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(95)

本文整理了Java中org.openide.util.Utilities.icon2Image()方法的一些代码示例,展示了Utilities.icon2Image()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utilities.icon2Image()方法的具体详情如下:
包路径:org.openide.util.Utilities
类名称:Utilities
方法名:icon2Image

Utilities.icon2Image介绍

[英]Converts given icon to a java.awt.Image.
[中]将给定图标转换为java。awt。形象

代码示例

代码示例来源:origin: org.codehaus.mevenide/nb-repo-browser

@Override
public Image getIcon(int arg0) {
  return Utilities.icon2Image(pi.getIcon());
}

代码示例来源:origin: org.codehaus.mevenide/nb-project

@Override
public Image getIcon(int arg0) {
  return Utilities.icon2Image(pi.getIcon());
}

代码示例来源:origin: org.codehaus.mevenide/nb-project

/**
 * Returns default folder icon as {@link java.awt.Image}. Never returns
 * <code>null</code>.
 *
 * @param opened wheter closed or opened icon should be returned.
 * 
 * copied from apisupport/project
 */
public static Image getTreeFolderIcon(boolean opened) {
  Image base = null;
  Icon baseIcon = UIManager.getIcon(opened ? OPENED_ICON_KEY_UIMANAGER : ICON_KEY_UIMANAGER); // #70263
  if (baseIcon != null) {
    base = Utilities.icon2Image(baseIcon);
  } else {
    base = (Image) UIManager.get(opened ? OPENED_ICON_KEY_UIMANAGER_NB : ICON_KEY_UIMANAGER_NB); // #70263
    if (base == null) { // fallback to our owns
      base = Utilities.loadImage(opened ? OPENED_ICON_PATH : ICON_PATH, true);
    }
  }
  assert base != null;
  return base;
}

代码示例来源:origin: org.codehaus.mevenide/nb-project

/**
 * Returns default folder icon as {@link java.awt.Image}. Never returns
 * <code>null</code>.
 *
 * @param opened wheter closed or opened icon should be returned.
 */
public static Image getTreeFolderIcon(boolean opened) {
  Image base = null;
  Icon baseIcon = UIManager.getIcon(opened ? OPENED_ICON_KEY_UIMANAGER : ICON_KEY_UIMANAGER); // #70263
  if (baseIcon != null) {
    base = Utilities.icon2Image(baseIcon);
  } else {
    base = (Image) UIManager.get(opened ? OPENED_ICON_KEY_UIMANAGER_NB : ICON_KEY_UIMANAGER_NB); // #70263
    if (base == null) { // fallback to our owns
      base = Utilities.loadImage(opened ? OPENED_ICON_PATH : ICON_PATH, true);
    }
  }
  assert base != null;
  return base;
}

代码示例来源:origin: org.codehaus.mevenide/nb-repo-browser

/**
 * Returns default folder icon as {@link java.awt.Image}. Never returns
 * <code>null</code>.
 *
 * @param opened wheter closed or opened icon should be returned.
 */
public static Image getTreeFolderIcon(boolean opened) {
  Image base = null;
  Icon baseIcon = UIManager.getIcon(opened ? OPENED_ICON_KEY_UIMANAGER : ICON_KEY_UIMANAGER); // #70263
  if (baseIcon != null) {
    base = Utilities.icon2Image(baseIcon);
  } else {
    base = (Image) UIManager.get(opened ? OPENED_ICON_KEY_UIMANAGER_NB : ICON_KEY_UIMANAGER_NB); // #70263
    if (base == null) { // fallback to our owns
      base = Utilities.loadImage(opened ? OPENED_ICON_PATH : ICON_PATH, true);
    }
  }
  assert base != null;
  return base;
}

相关文章