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

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

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

Utilities.loadImage介绍

[英]Loads an image from the specified resource ID. The image is loaded using the "system" classloader registered in Lookup.
[中]从指定的资源ID加载图像。使用在查找中注册的“系统”类加载器加载图像。

代码示例

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

private Image getIcon() {
  if (icon == null) {
    icon = Utilities.loadImage("org/codehaus/mevenide/netbeans/Maven2Icon.gif");//NOI18N
  }
  return icon;
}

代码示例来源:origin: org.codehaus.mevenide/lifecycle-build-plan

@Override
  public Image getIcon(int arg0) {
    return Utilities.loadImage("org/codehaus/mevenide/buildplan/nodes/wait.gif");
  }
};

代码示例来源:origin: dcaoyuan/nbscala

public Image getIcon(int iconKind) {
  if ((iconKind == BeanInfo.ICON_COLOR_16x16) || (iconKind == BeanInfo.ICON_MONO_16x16)) {
    return Utilities.loadImage("org/netbeans/modules/scala/stdplatform/resources/platform.gif"); // NOI18N
  } else {
    return null;
  }
}

代码示例来源:origin: dcaoyuan/nbscala

public Image getIcon(int iconKind) {
  if ((iconKind == BeanInfo.ICON_COLOR_16x16) || (iconKind == BeanInfo.ICON_MONO_16x16)) {
    return Utilities.loadImage("org/netbeans/modules/scala/stdplatform/resources/platform.gif"); // NOI18N
  } else {
    return null;
  }
}

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

@Override
public Image getIcon(int arg0) {
  Image badge = Utilities.loadImage("org/codehaus/mevenide/repository/ArtifactBadge.png", true); //NOI18N
  return badge;
}

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

@Override
public Image getIcon(int arg0) {
  Image badge = Utilities.loadImage("org/codehaus/mevenide/netbeans/actions/usages/ArtifactBadge.png", true); //NOI18N
  return badge;
}

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

/** Returns the PrintSettings' icon */
public Image getIcon(int type) {
  if ((type == java.beans.BeanInfo.ICON_COLOR_16x16) || (type == java.beans.BeanInfo.ICON_MONO_16x16))
    return Utilities.loadImage("org/openide/resources/printSettings.gif"); // NOI18N
  else
    return Utilities.loadImage ("org/openide/resources/printSettings32.gif"); // NOI18N
}

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

private static ImageIcon getBlankIcon() {
  if (BLANK_ICON == null) {
    BLANK_ICON = new ImageIcon(Utilities.loadImage("org/openide/resources/actions/empty.gif", true)); // NOI18N
  }
  return BLANK_ICON;
}

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

Image getDefaultIcon () {
  Image i = Utilities.loadImage(DEFAULT_ICON);
  if (i == null) throw new MissingResourceException("No default icon", "", DEFAULT_ICON); // NOI18N
  return i;
}

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

private ImageIcon getProperIcon(boolean descending) {
    if ( descending )
      return new ImageIcon ( org.openide.util.Utilities.loadImage( SORT_DESC_ICON ) );
    else
      return new ImageIcon ( org.openide.util.Utilities.loadImage( SORT_ASC_ICON ) );    
  }
} // End of inner class SortingHeaderRenderer.

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

/** Loads default icon if not loaded. */
private static Icon getDefaultIcon () {
  if (defaultIcon == null) {
    defaultIcon = new ImageIcon(Utilities.loadImage(DEFAULT_ICON));
  }
  return defaultIcon;
}

代码示例来源:origin: dcaoyuan/nbscala

public Object getValue(String key) {
  if (key == Action.NAME) {
    return NbBundle.getMessage (ToggleMethodFieldBreakpointAction.class, "CTL_ToggleMethodFieldBreakpointAction");
  }
  Object value = super.getValue(key);
  if (key == Action.SMALL_ICON) {
    if (value instanceof String) {
      value = new ImageIcon (Utilities.loadImage (value+".gif"));// Utils.getIcon ((String) value);
    }
  }
  return value;
}

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

public ReRunAction(boolean debug) {
  this.debug = debug;
  this.putValue(Action.SMALL_ICON, debug ? new ImageIcon(Utilities.loadImage("org/codehaus/mevenide/netbeans/execute/refreshdebug.png")) : //NOI18N
      new ImageIcon(Utilities.loadImage("org/codehaus/mevenide/netbeans/execute/refresh.png")));//NOI18N
  putValue(Action.NAME, debug ? NbBundle.getMessage(AbstractMavenExecutor.class, "TXT_Rerun_extra") : NbBundle.getMessage(AbstractMavenExecutor.class, "TXT_Rerun"));
  putValue(Action.SHORT_DESCRIPTION, debug ? NbBundle.getMessage(AbstractMavenExecutor.class, "TIP_Rerun_Extra") : NbBundle.getMessage(AbstractMavenExecutor.class, "TIP_Rerun"));
  setEnabled(false);
}

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

BuildPlanAction() {
  putValue(Action.SMALL_ICON, new ImageIcon(Utilities.loadImage("org/codehaus/mevenide/netbeans/execute/buildplangoals.png"))); //NOi18N
  putValue(Action.NAME, NbBundle.getMessage(AbstractMavenExecutor.class, "TXT_Build_Plan"));
  putValue(Action.SHORT_DESCRIPTION, NbBundle.getMessage(AbstractMavenExecutor.class, "TIP_Build_Plan_tip"));
  mbps = Lookup.getDefault().lookup(MavenBuildPlanSupport.class);
  setEnabled(false);
}

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

@Override
public Image getIconImpl(int param) {
  //HACK - 1. getImage call
  // 2. assume project root folder, should be Generic Sources root (but is the same)
  Image img = ((ImageIcon)info.getIcon()).getImage();
  if (reporter.getReports().size() > 0) {
    img = Utilities.mergeImages(img, Utilities.loadImage("org/codehaus/mevenide/netbeans/brokenProjectBadge.png"), 8, 0);//NOI18N
  }
  return img;
}

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

@Override
public Image getOpenedIcon(int param) {
  Image retValue = Utilities.mergeImages(getTreeFolderIcon(true),
      Utilities.loadImage("org/codehaus/mevenide/netbeans/libraries-badge.png"), //NOI18N
      8, 8);
  return retValue;
}

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

@Override
public java.awt.Image getOpenedIcon(int param) {
  java.awt.Image retValue = super.getOpenedIcon(param);
  if (isTopLevelNode) {
    retValue = Utilities.mergeImages(retValue, 
                     Utilities.loadImage("org/codehaus/mevenide/netbeans/projectsite-badge.png"), //NOI18N
                     8, 8);
  } 
  return retValue;
}

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

@Override
public Image getOpenedIconImpl(int param) {
  //HACK - 1. getImage call
  // 2. assume project root folder, should be Generic Sources root (but is the same)
  Image img = ((ImageIcon)info.getIcon()).getImage();
  if (reporter.getReports().size() > 0) {
    img = Utilities.mergeImages(img, Utilities.loadImage("org/codehaus/mevenide/netbeans/brokenProjectBadge.png"), 8, 0);//NOI18N
  }
  return img;
}

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

@Override
public Image getIcon(int param) {
  Image retValue = Utilities.mergeImages(getTreeFolderIcon(false),
      Utilities.loadImage("org/codehaus/mevenide/netbeans/libraries-badge.png"), //NOI18N
      8, 8);
  return retValue;
}

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

StopAction() {
  putValue(Action.SMALL_ICON, new ImageIcon(Utilities.loadImage("org/codehaus/mevenide/netbeans/execute/stop.gif"))); //NOi18N
  putValue(Action.NAME, NbBundle.getMessage(AbstractMavenExecutor.class, "TXT_Stop_execution"));
  putValue(Action.SHORT_DESCRIPTION, NbBundle.getMessage(AbstractMavenExecutor.class, "TIP_Stop_Execution"));
  setEnabled(false);
}

相关文章

微信公众号

最新文章

更多