/** * QuiltPlayer v1.0 Copyright (C) 2008-2009 Vlado Palczynski * vlado.palczynski@quiltplayer.com http://www.quiltplayer.com This program is * free software; you can redistribute it and/or modify it under the terms of * the GNU General Public License as published by the Free Software Foundation; * either version 2 of the License, or (at your option) any later version. This * program is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ package com.quiltplayer.view.swing.labels; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.RenderingHints; import javax.swing.JLabel; import com.quiltplayer.properties.Configuration; import com.quiltplayer.view.swing.FontFactory; /** * @author Vlado Palczynski */ public class QLabel extends JLabel { private static final long serialVersionUID = 1L; public QLabel() { super(); setOpaque(false); setDefaults(); } public QLabel(String text) { super(text); setOpaque(false); setDefaults(); } private void setDefaults() { setFont(FontFactory.getFont(14)); setMaximumSize(new Dimension(200, 30)); setForeground(Configuration.getInstance().getColorConstants().getQLabelForegroundColor()); } /* * (non-Javadoc) * * @see javax.swing.JComponent#paintComponent(java.awt.Graphics) */ @Override protected void paintComponent(Graphics g) { Graphics2D g2d = (Graphics2D) g; g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); super.paintComponent(g2d); } }