/*
* Copyright (C) 2011-2014 GeoForge Project
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.geoforge.guillc.panel;
import java.awt.BorderLayout;
import java.util.Locale;
import javax.swing.JLabel;
import org.geoforge.guillc.label.GfrLbl;
/**
*
* @author bantchao
*/
public class PnlDspLabel extends PnlAbs
{
private GfrLbl _lblWhat_;
public JLabel getLabel()
{
return this._lblWhat_;
}
public PnlDspLabel(
String strPrefix,
String strContent,
String strSufix)
{
super();
if (!(strPrefix == null || strPrefix.length() < 1))
strPrefix = strPrefix.substring(0, 1).toUpperCase(Locale.ENGLISH)
+ strPrefix.substring(1, strPrefix.length());
if (!(strContent == null || strContent.length() < 1))
strContent = strContent.substring(0, 1).toUpperCase(Locale.ENGLISH)
+ strContent.substring(1, strContent.length());
String strWhat;
if (!(strPrefix == null || strPrefix.length() < 1))
{
strPrefix += " ";
strContent = strContent.toLowerCase();
}
if (!(strSufix == null || strSufix.length() < 1))
strContent += " ";
strWhat = strPrefix + strContent + strSufix.toLowerCase();
this._lblWhat_ = new GfrLbl(strWhat + ":");
super.setLayout(new BorderLayout());
}
@Override
public boolean init()
{
if (!super.init())
return false;
super.add(this._lblWhat_, BorderLayout.CENTER);
return true;
}
@Override
public void destroy()
{
if (this._lblWhat_ != null)
{
this._lblWhat_ = null;
}
super.destroy();
}
@Override
public void loadTransient() throws Exception
{
}
@Override
public void releaseTransient() throws Exception
{
}
}