ImageIcon giraffe = new ImageIcon(...); giraffe.setDescription("Giraffe Description");
@Override public ImageIcon getIcon() { if ( icon == null ) { icon = iconImgData == null ? new ImageIcon() : new ImageIcon( iconImgData ); // Set a description so that if this icon is used in a table, copying cells will not result in a meaningless // or strange text. icon.setDescription( "I" ); } return icon; }
/** * Returns the lazily initialized icon of the module. * <p> * The icon is created from the icon image data returned by {@link #getIconImgData()}. * </p> * * @return the lazily initialized icon of the module */ public ImageIcon getIcon() { if ( icon == null ) { icon = iconImgData == null ? new ImageIcon() : new ImageIcon( iconImgData ); // Set a description so that if this icon is used in a table, copying cells will not result in a meaningless // or strange text. icon.setDescription( "I" ); } return icon; }
@Override public void setDescription(final String description) { this.model.get().setDescription(description); }
/** * This looks for the requested image in the classpath under * org.apache.jmeter.images.<em><name></em>, and also sets the description * of the image, which is useful if the icon is going to be placed * on the clipboard. * * @param name * the name of the image * @param description * the description of the image * @return The Image value */ public static ImageIcon getImage(String name, String description) { ImageIcon icon = getImage(name); if(icon != null) { icon.setDescription(description); } return icon; }
private void addCardsAndChangeSize() throws Exception { String tempString; ImageIcon tempIcon; allCards.clear(); URL imageURL; for(int i = 0; i < all.length; i++) { for(int x = 0; x < clubs.length; x++) { tempString = all[i][x]; tempString = "/cards/"+cardFolders[i]+"/"+tempString; imageURL = this.getClass().getResource(tempString); System.out.println(tempString); System.out.println(imageURL == null); tempIcon = resizeImage(new ImageIcon(imageURL),70,70,false); tempString = all[i][x]; tempIcon.setDescription(tempString); allCards.add(tempIcon); } } backCard = resizeImage(new ImageIcon(this.getClass().getResource(back)),70,70,false); }
/** * Gets the small flag for a given PlayerId. * * @param player the player to get the flag for * @return ImageIcon small flag */ protected ImageIcon getIcon(final PlayerId player) { ImageIcon icon = mapPlayerImage.get(player); if (icon == null && uiContext != null) { final Image img = uiContext.getFlagImageFactory().getSmallFlag(player); icon = new ImageIcon(img); icon.setDescription(player.getName()); mapPlayerImage.put(player, icon); } return icon; }
hoverIcon = new ImageIcon(hoverImage); normalIcon.setDescription("Help"); hoverIcon.setDescription("Help");
protected ImageIcon getImageIcon(EntityFullJid participantJID) { Resourcepart displayName = participantJID.getResourcepart(); ImageIcon icon = SparkRes.getImageIcon(SparkRes.GREEN_BALL); icon.setDescription(displayName.toString()); return icon; }
private void setImageIcon(ImageIcon newIcon) { boolean sizeChanged = icon.getIconWidth() != newIcon.getIconWidth() || icon.getIconHeight() != newIcon.getIconHeight(); Image oldImage = icon.getImage(); icon.setImage(newIcon.getImage()); icon.setDescription(newIcon.getDescription()); informUsers(oldImage, newIcon.getImage(), sizeChanged); }
/** * Loads all banned users in a ChatRoom. */ public void loadAllBannedUsers() { // Clear all elements from model listModel.clear(); Iterator<Affiliate> bannedUsers = null; try { bannedUsers = chat.getOutcasts().iterator(); } catch (XMPPException | SmackException | InterruptedException e) { Log.error("Error loading all banned users", e); } while (bannedUsers != null && bannedUsers.hasNext()) { Affiliate bannedUser = bannedUsers.next(); ImageIcon icon = SparkRes.getImageIcon(SparkRes.STAR_RED_IMAGE); icon.setDescription(bannedUser.getJid().toString()); listModel.addElement(icon); } }
if (shouldPreferRegular(imageData)) { ImageIcon icon = new ImageIcon(imageData); icon.setDescription("GIF (Exception)"); return icon; icon.setDescription("GIF (Dont fix)"); return icon; icon.setDescription("GIF"); return icon;
@Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { Component rendering = lookAndFeelRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); boolean failedToUseImage = true; if(rendering instanceof JLabel && isKey) { JLabel renderLabel = (JLabel)rendering; Icon defaultIcon = renderLabel.getIcon(); if(defaultIcon == null) { ImageIcon keyIcon = OrbisGISIcon.getIcon("key"); keyIcon.setDescription(DESCR_IMAGE); renderLabel.setIcon(keyIcon); failedToUseImage = false; } else if(defaultIcon instanceof ImageIcon && !DESCR_IMAGE.equals(((ImageIcon) defaultIcon).getDescription())) { ImageIcon defaultImageIcon = (ImageIcon) defaultIcon; ImageIcon resultIcon = concatenateImages(OrbisGISIcon.getIcon("key"), defaultImageIcon); resultIcon.setDescription(DESCR_IMAGE); renderLabel.setIcon(resultIcon); failedToUseImage = false; } else if(defaultIcon instanceof ImageIcon) { failedToUseImage = false; } } // Use Bold instead of Key icon if icon is not accepted by the component if(failedToUseImage && isKey && rendering.getFont() != null) { rendering.setFont(rendering.getFont().deriveFont(Font.BOLD)); } return rendering; }
newIcon.setDescription(statusItem.getText());
warningIcon.setDescription("Warning"); javax.swing.ImageIcon okIcon = new ImageIcon(getClass().getResource("/images/check-mark.gif")); okIcon.setDescription("OK");
if (loadedImage != null) { image.setImage(loadedImage); image.setDescription("ImageIO");
/** * Create the button/panel for this menu item. * @param record The menu record. * @return The component to add to this panel. */ public JComponent makeSearchMenuButton(String strName) { ProductTypeInfo productType = ProductTypeInfo.getProductType(strName); String strDescription = productType.getDescription(); ImageIcon icon = productType.getStartIcon(); icon.setDescription(strName); return this.makeMenuButton(strDescription, icon, SearchConstants.SEARCH_BUTTON); } /**
if (logoURL != null) { ImageIcon icn = new ImageIcon (logoURL); icn.setDescription ("Jhove logo"); setNormalBackground (); JLabel logoLabel = new JLabel (icn);
images[i] = createImageIcon("/res/" + imgStrings[i] + ".png"); if (images[i] != null) { images[i].setDescription(imgStrings[i]);