本文整理匯總了Java中org.openide.util.ImageUtilities.mergeImages方法的典型用法代碼示例。如果您正苦於以下問題:Java ImageUtilities.mergeImages方法的具體用法?Java ImageUtilities.mergeImages怎麽用?Java ImageUtilities.mergeImages使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.openide.util.ImageUtilities
的用法示例。
在下文中一共展示了ImageUtilities.mergeImages方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: annotateIcon
import org.openide.util.ImageUtilities; //導入方法依賴的package包/類
@Override
@NonNull
public Image annotateIcon(
@NonNull final Project p,
@NonNull Image original,
final boolean openedNode) {
Boolean type = projectType.get(p);
if (type != null) {
if(type.booleanValue() == true) {
final Image badge = getJFXBadge();
if (badge != null) {
original = ImageUtilities.mergeImages(original, badge, 8, 8);
}
}
} else {
evaluateProjectType(p);
}
return original;
}
示例2: getNotificationsIcon
import org.openide.util.ImageUtilities; //導入方法依賴的package包/類
private Icon getNotificationsIcon(int unread, boolean isError) {
ImageIcon icon;
if (isError) {
icon = ImageUtilities.loadImageIcon("org/netbeans/modules/notifications/resources/notificationsError.png", true);
} else {
icon = ImageUtilities.loadImageIcon("org/netbeans/modules/notifications/resources/notifications.png", true);
}
BufferedImage countIcon = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = countIcon.createGraphics();
g.setFont(getFont().deriveFont(10f));
Color color;
if ("Nimbus".equals(UIManager.getLookAndFeel().getID())) {
color = isError ? Color.RED : Color.BLACK;
} else {
color = isError ? UIManager.getColor("nb.errorForeground") : UIManager.getColor("Label.foreground");
}
g.setColor(color);
if (unread < 10) {
g.setFont(g.getFont().deriveFont(Font.BOLD));
g.drawString(Integer.toString(unread), 5, 10);
} else if (unread < 100) {
g.drawString(Integer.toString(unread), 3, 10);
} else {
g.drawString("...", 2, 10);
}
return new ImageIcon(ImageUtilities.mergeImages(icon.getImage(), countIcon, 0, 0));
}
示例3: computeIcon
import org.openide.util.ImageUtilities; //導入方法依賴的package包/類
private Image computeIcon( boolean opened, int type ) {
Image image;
Icon icon = group.getIcon( opened );
if ( icon == null ) {
image = opened ? getDataFolderNodeDelegate().getOpenedIcon( type ) :
getDataFolderNodeDelegate().getIcon( type );
image = ImageUtilities.mergeImages(image, ImageUtilities.loadImage(PACKAGE_BADGE), 7, 7);
}
else {
image = ImageUtilities.icon2Image(icon);
}
return image;
}
示例4: getIcon
import org.openide.util.ImageUtilities; //導入方法依賴的package包/類
@Override
public Image getIcon(int type) {
final Icon icon = info.getIcon();
final Image img = icon == null ?
super.getIcon(type) :
ImageUtilities.icon2Image(icon);
return !broken && compileOnSaveDisabled ?
ImageUtilities.mergeImages(img, compileOnSaveDisabledBadge, 8, 0) :
img;
}
示例5: getIcon
import org.openide.util.ImageUtilities; //導入方法依賴的package包/類
private Image getIcon(boolean opened) {
Image badge = ImageUtilities.loadImage("org/netbeans/modules/apisupport/project/ui/resources/libraries-badge.png", true);
Image img = ImageUtilities.mergeImages(ApisupportAntUIUtils.getTreeFolderIcon(opened), badge, 8, 8);
if (missingJUnit4) {
badge = ImageUtilities.loadImage("org/netbeans/modules/java/api/common/project/ui/resources/brokenProjectBadge.gif", true);
img = ImageUtilities.mergeImages(img, badge, 0, 0);
}
return img;
}
示例6: computeIcon
import org.openide.util.ImageUtilities; //導入方法依賴的package包/類
private Image computeIcon(boolean opened, int type) {
Image image = opened ?
getDataFolderNodeDelegate().getOpenedIcon(type) :
getDataFolderNodeDelegate().getIcon(type);
image = ImageUtilities.mergeImages(
image,
ImageUtilities.loadImage(TEST_BADGE),
4, 5);
return image;
}
示例7: getIcon
import org.openide.util.ImageUtilities; //導入方法依賴的package包/類
@Override
public Image getIcon(int type) {
Object server = getServerDefinition().getServerFlag().getFlag();
Image badge = null;
if (server == null) {
badge = getBadgeIcon("Error");
} else {
badge = getBadgeIcon("Running");
}
return ImageUtilities.mergeImages(getServerIcon(), badge, 4, 4);
}
示例8: badgeIcon
import org.openide.util.ImageUtilities; //導入方法依賴的package包/類
private static Image badgeIcon(Image image, DockerContainer.Status status) {
Image badge = null;
switch (status) {
case PAUSED:
badge = ImageUtilities.loadImage(PAUSED_ICON);
break;
case RUNNING:
badge = ImageUtilities.loadImage(RUNNING_ICON);
break;
default:
break;
}
return badge != null ? ImageUtilities.mergeImages(image, badge, 13, 8) : image;
}
示例9: getIcon
import org.openide.util.ImageUtilities; //導入方法依賴的package包/類
@Override
public java.awt.Image getIcon(int param) {
java.awt.Image retValue = super.getIcon(param);
if (isTopLevelNode) {
retValue = ImageUtilities.mergeImages(retValue,
ImageUtilities.loadImage(PSITE_BADGE), //NOI18N
8, 8);
}
return retValue;
}
示例10: getOpenedIcon
import org.openide.util.ImageUtilities; //導入方法依賴的package包/類
@Override
public java.awt.Image getOpenedIcon(int param) {
java.awt.Image retValue = super.getOpenedIcon(param);
if (isTopLevelNode) {
retValue = ImageUtilities.mergeImages(retValue,
ImageUtilities.loadImage(PSITE_BADGE), //NOI18N
8, 8);
}
return retValue;
}
示例11: computeIcon
import org.openide.util.ImageUtilities; //導入方法依賴的package包/類
private Image computeIcon( boolean opened, int type ) {
if (group.getResource() != null) {
Icon icon = group.getIcon( opened );
Image img = ImageUtilities.icon2Image(icon);
if (group.getResource().isFiltering()) {
Image warn = ImageUtilities.loadImage(FILTERED_RESOURCE);
img = ImageUtilities.mergeImages(img, warn , 0, 8);
}
return img;
} else {
return super.getIcon(type);
}
}
示例12: computeIcon
import org.openide.util.ImageUtilities; //導入方法依賴的package包/類
private Image computeIcon(boolean opened, int type) {
Image image = UiUtils.getTreeFolderIcon(opened);
image = ImageUtilities.mergeImages(image, ICON_BADGE, 7, 7);
return image;
}
示例13: createLoopIcon
import org.openide.util.ImageUtilities; //導入方法依賴的package包/類
public static ImageIcon createLoopIcon(ImageIcon icon) {
return new ImageIcon(ImageUtilities.mergeImages(icon.getImage(), ICON_LOOP.getImage(), 0, 0));
}
示例14: getIcon
import org.openide.util.ImageUtilities; //導入方法依賴的package包/類
private Image getIcon(boolean opened) {
Image badge = ImageUtilities.loadImage(CONFIG_BADGE, true); //NOI18N
return ImageUtilities.mergeImages(NodeUtils.getTreeFolderIcon(opened), badge, 8, 8);
}
示例15: getBadge
import org.openide.util.ImageUtilities; //導入方法依賴的package包/類
private Image getBadge(String badgePath, Image origIcon, String toolTip) {
Image ret = ImageUtilities.assignToolTipToImage(ImageUtilities.loadImage(badgePath, true), toolTip);
ret = ImageUtilities.mergeImages(origIcon, ret, 16, 9);
return ret;
}