TagLabel( String s, int size, int roundedness, TagPanel tagPanel, boolean global, boolean deletable) { super(); _tagText = s; _size = size; _roundedness = roundedness; _tagPanel = tagPanel; _global = global; _deletable = deletable; _tag = new JLabel(Writer.shortenText(_tagText)); _tag.setBorder(BorderFactory.createEmptyBorder(1, 1, 3, 1)); _tag.setFont(new Font("Sans Serif", Font.PLAIN, _size + 2)); _tag.setForeground(GuiConstants.PRIMARY_FONT_COLOR); if (_deletable) { ImageIcon current = IconFactory.loadIcon(IconType.DELETE, _size, true); _delete = new JLabel(current); _delete.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1)); _delete.addMouseListener(this); add(_delete); } add(_tag); setBackground(global ? GuiConstants.SET_TAG_COLOR : GuiConstants.CARD_TAG_COLOR); setOpaque(false); _tagPanel._tags.add(this); _tagPanel.add(this); }
public Icon getIcon() { return IconFactory.get().getIcon(IconFactory.JAVADOC_ITEM_ICON); }