overlayIcon = new PImage(((ImageIcon) icon).getImage()); overlayIcon.setPickable(false); addChild(overlayIcon); overlayIconMap.put(icon, overlayIcon);
public void setIcon(Icon icon) { if (pImage != null) { pImage.removeAllChildren(); pImage.removeFromParent(); pImage.getImage().flush(); } if ((icon != null) && (icon instanceof ImageIcon)) { iconWidth = icon.getIconWidth(); iconHeight = icon.getIconHeight(); pImage = new PImage(((ImageIcon) icon).getImage()); pImage.setPickable(false); addChild(pImage); updateBounds(); } }
public DefaultGraphNode(Object userObject, String text, Icon icon, Object type) { super(); this.userObject = userObject; this.changeListeners = new ArrayList<ChangeListener>(); this.style = new DefaultGraphNodeStyle(); this.selected = false; this.highlighted = false; this.matching = false; this.arcs = new ArrayList<GraphArc>(); this.setPickable(true); this.setChildrenPickable(false); textNode = new GraphTextNode(); // make this node match the text size textNode.setConstrainWidthToTextWidth(true); textNode.setConstrainHeightToTextHeight(true); textNode.setPickable(false); addChild(textNode); setText(text); setIcon(icon); setType(type); }