Пример #1
0
 @Override
 public void paintIcon(Component c, Graphics g, int x, int y) {
   if (g instanceof Graphics2D) {
     ((Graphics2D) g)
         .setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
   }
   g.setColor(tagSet.equals(highlighted) ? color.brighter() : color);
   g.fillRoundRect(x, y, ICON_WIDTH - 1, ICON_HEIGHT - 1, ICON_WIDTH / 2, ICON_WIDTH / 2);
   g.setColor(color.darker());
   g.drawRoundRect(x, y, ICON_WIDTH - 1, ICON_HEIGHT - 1, ICON_WIDTH / 2, ICON_WIDTH / 2);
 }
Пример #2
0
 @Override
 public void mouseExited(MouseEvent e) {
   if (tagSet.equals(highlighted)) {
     highlighted = null;
   }
   Object source = e.getSource();
   if (source instanceof JComponent) {
     ((JComponent) source).repaint();
   }
   chart.repaint();
 }