/*
* 05/19/2003 - 16:12:28
*
* AnalyseBar.java - Copyright (C) 2003 Dreux Loic dreuxl@free.fr
*
*
* 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 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.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple
* Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package org.analyse.core.gui;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import javax.swing.BorderFactory;
import javax.swing.JLabel;
public class AnalyseBar extends JLabel
{
private String title;
public AnalyseBar(String title)
{
setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
setTitle(title);
}
public void setTitle(String title)
{
this.title = title;
this.setText("<html><b><i><font size=+1 color=#000000>AnalyseSI - "
+ title + "</font></b></i></html>");
}
public String getTitle()
{
return title;
}
public void paintComponent(Graphics g)
{
Graphics2D g2d = (Graphics2D) g;
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
g2d.setColor(Color.WHITE);
g2d.fillRect(0, 0, getWidth(), getHeight());
super.paintComponent(g2d);
}
}