public void paintIcon(Component c, Graphics g, int x, int y) { super.paintIcon(c, g, x, y); Dimension d = new Dimension(getIconWidth(), getIconHeight()); for (Icon icon : iconSet) { Dimension id = new Dimension(icon.getIconWidth(), icon.getIconHeight()); int dx = (d.width - id.width)/2; int dy = (d.height - id.height)/2; icon.paintIcon(c, g, x+dx, y+dy); } }
LayeredIcon iconImg = new LayeredIcon(imageIcon.getImage()); for (int i=1;i<iconNames.length;i++) { final URL resource1 = TopologyManagerFrame.class.getResource(iconNames[i].trim()); logger.debug("Load icon: "+iconNames[0].trim() + " for node "+vertice); iconImg.add(new ImageIcon(resource1));
try { Icon icon = new LayeredIcon(new ImageIcon(VertexImageShaperDemo.class.getResource(name)).getImage()); iconMap.put(i, icon); } catch(Exception ex) {
try { Icon icon = new LayeredIcon(new ImageIcon(DemoLensVertexImageShaperDemo.class.getResource(name)).getImage()); iconMap.put(vertices[i], icon); } catch(Exception ex) {
public void itemStateChanged(ItemEvent e) { @SuppressWarnings("unchecked") Icon icon = imager.apply((N) e.getItem()); if (icon != null && icon instanceof LayeredIcon) { if (e.getStateChange() == ItemEvent.SELECTED) { ((LayeredIcon) icon).add(checked); } else { ((LayeredIcon) icon).remove(checked); } } } }
try { Icon icon = new LayeredIcon(new ImageIcon(LensVertexImageShaperDemo.class.getResource(name)).getImage()); iconMap.put(vertices[i], icon); } catch(Exception ex) {
public void paintIcon(Component c, Graphics g, int x, int y) { super.paintIcon(c, g, x, y); Dimension d = new Dimension(getIconWidth(), getIconHeight()); for (Icon icon : iconSet) { Dimension id = new Dimension(icon.getIconWidth(), icon.getIconHeight()); int dx = (d.width - id.width) / 2; int dy = (d.height - id.height) / 2; icon.paintIcon(c, g, x + dx, y + dy); } }
public void itemStateChanged(ItemEvent e) { @SuppressWarnings("unchecked") Icon icon = imager.apply((V)e.getItem()); if(icon != null && icon instanceof LayeredIcon) { if(e.getStateChange() == ItemEvent.SELECTED) { ((LayeredIcon)icon).add(checked); } else { ((LayeredIcon)icon).remove(checked); } } } }
try { Icon icon = new LayeredIcon(new ImageIcon(NodeImageShaperDemo.class.getResource(name)).getImage()); iconMap.put(node, icon); } catch (Exception ex) {
try { Icon icon = new LayeredIcon( new ImageIcon(LensNodeImageShaperDemo.class.getResource(name)).getImage()); iconMap.put(node, icon);