/*
* 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.Dimension;
import javax.swing.JScrollPane;
import javax.swing.ScrollPaneConstants;
import javax.swing.border.BevelBorder;
import javax.swing.border.SoftBevelBorder;
import org.geoforge.guillc.scrollpane.GfrScr;
import org.geoforge.guillc.textarea.GfrTaa;
/**
*
* @author bantchao
*/
public class GfrPnlKeyValueTaaLarge extends GfrPnlKeyValueAbs
{
final static public int INT_WIDTH = 340;
final static public int INT_HEIGHT = 80;
private GfrTaa _taaText_ = null;
public GfrPnlKeyValueTaaLarge(String strKey, String strValue)
{
super(strKey);
this._taaText_ = new GfrTaa();
super._objText = new GfrScr(this._taaText_);
((JScrollPane) super._objText).setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
this._taaText_.setText(strValue);
this._taaText_.setEditable(false);
if (strValue != null && strValue.length()>0)
this._taaText_.setCaretPosition(0);
}
@Override
public boolean init()
{
if (! super.init())
return false;
if (! this._taaText_.init())
return false;
Dimension dim = new Dimension(GfrPnlKeyValueTaaLarge.INT_WIDTH, GfrPnlKeyValueTaaLarge.INT_HEIGHT);
((JScrollPane) super._objText).setPreferredSize(dim);
((JScrollPane) super._objText).setMaximumSize(dim);
((JScrollPane) super._objText).setMinimumSize(dim);
this._taaText_.setBorder(new SoftBevelBorder(BevelBorder.LOWERED));
return true;
}
@Override
public void destroy()
{
super.destroy();
if (this._taaText_ != null)
{
this._taaText_.destroy();
this._taaText_ = null;
}
}
}