org.openide.nodes.AbstractNode.findIcon()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(74)

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

AbstractNode.findIcon介绍

[英]Tries to find the right icon for the iconbase.
[中]尝试查找iconbase的正确图标。

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-nodes

/** Find an icon for this node. Uses an {@link #setIconBase icon set}.
*
* @param type constants from {@link java.beans.BeanInfo}
*
* @return icon to use to represent the bean
*/
public Image getIcon(int type) {
  return findIcon(type, ICON_BASE);
}

代码示例来源:origin: org.netbeans.api/org-openide-nodes

/** Finds an icon for this node when opened. This icon should represent the node
* only when it is opened (when it can have children).
*
* @param type as in {@link #getIcon}
* @return icon to use to represent the bean when opened
*/
public Image getOpenedIcon(int type) {
  return findIcon(type, OPENED_ICON_BASE);
}

代码示例来源:origin: org.netbeans.api/org-openide-nodes

/** Tries to find the right icon for the iconbase.
* @param type type of icon (from BeanInfo constants)
* @param ib base where to scan in the array
*/
private Image findIcon(int type, int ib) {
  String res = iconBase + icons[type + ib] + iconExtension;
  Image im = ImageUtilities.loadImage(res, true);
  if (im != null) {
    return im;
  }
  // try the first icon
  res = iconBase + icons[java.beans.BeanInfo.ICON_COLOR_16x16 + ib] + iconExtension;
  im = ImageUtilities.loadImage(res, true);
  if (im != null) {
    return im;
  }
  if (ib == OPENED_ICON_BASE) {
    // try closed icon also
    return findIcon(type, ICON_BASE);
  }
  // if still not found return default icon
  return getDefaultIcon();
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

/** Finds an icon for this node when opened. This icon should represent the node
* only when it is opened (when it can have children).
*
* @param type as in {@link #getIcon}
* @return icon to use to represent the bean when opened
*/
public Image getOpenedIcon (int type) {
  return findIcon (type, OPENED_ICON_BASE);
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

/** Find an icon for this node. Uses an {@link #setIconBase icon set}.
*
* @param type constants from {@link java.beans.BeanInfo}
*
* @return icon to use to represent the bean
*/
public Image getIcon (int type) {
  return findIcon (type, ICON_BASE);
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

/** Finds an icon for this node when opened. This icon should represent the node
* only when it is opened (when it can have children).
*
* @param type as in {@link #getIcon}
* @return icon to use to represent the bean when opened
*/
public Image getOpenedIcon (int type) {
  return findIcon (type, OPENED_ICON_BASE);
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

/** Find an icon for this node. Uses an {@link #setIconBase icon set}.
*
* @param type constants from {@link java.beans.BeanInfo}
*
* @return icon to use to represent the bean
*/
public Image getIcon (int type) {
  return findIcon (type, ICON_BASE);
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

/** Tries to find the right icon for the iconbase.
* @param type type of icon (from BeanInfo constants)
* @param ib base where to scan in the array
*/
private Image findIcon (int type, int ib) {
  String res = iconBase + icons[type + ib];
  Image im = Utilities.loadImage (res);
  if (im != null) return im;
  // try the first icon
  res = iconBase + icons[java.beans.BeanInfo.ICON_COLOR_16x16 + ib];
  im = Utilities.loadImage (res);
  if (im != null) return im;
  if (ib == OPENED_ICON_BASE) {
    // try closed icon also
    return findIcon (type, ICON_BASE);
  }
  // if still not found return default icon
  return getDefaultIcon ();
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

/** Tries to find the right icon for the iconbase.
* @param type type of icon (from BeanInfo constants)
* @param ib base where to scan in the array
*/
private Image findIcon (int type, int ib) {
  String res = iconBase + icons[type + ib];
  Image im = Utilities.loadImage (res);
  if (im != null) return im;
  // try the first icon
  res = iconBase + icons[java.beans.BeanInfo.ICON_COLOR_16x16 + ib];
  im = Utilities.loadImage (res);
  if (im != null) return im;
  if (ib == OPENED_ICON_BASE) {
    // try closed icon also
    return findIcon (type, ICON_BASE);
  }
  // if still not found return default icon
  return getDefaultIcon ();
}

相关文章

微信公众号

最新文章

更多