/*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
package org.geoforge.guillc.table;
import java.util.logging.Logger;
import javax.swing.SwingConstants;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.TableCellRenderer;
import org.geoforge.guillc.table.tablecellrenderer.GfrImplTableCellRendererLblTxt;
import org.geoforge.guillc.tablemodel.GfrAtmManageSpaceAbs;
import org.geoforge.java.util.logging.filehandler.FileHandlerLogger;
/**
*
* @author robert
*/
abstract public class GfrTblPopHeightRowFixManChildrenSpcAppAbs extends GfrTblPopHeightRowFixAbs
{
// ----
// begin: instantiate logger for this class
final static private Logger _LOGGER_ = Logger.getLogger(GfrTblPopHeightRowFixManChildrenSpcAppAbs.class.getName());
static
{
GfrTblPopHeightRowFixManChildrenSpcAppAbs._LOGGER_.addHandler(FileHandlerLogger.s_getInstance());
}
// end: instantiate logger for this class
// ----
private Object[][] _objssData = null;
public int getIdColNumber() { return 0; }
protected GfrTblPopHeightRowFixManChildrenSpcAppAbs(
Object[][] objssData,
AbstractTableModel tml)
{
super();
this._objssData = objssData;
super.setModel(tml);
super.setDefaultRenderer(
(Class)String.class,
(TableCellRenderer)new GfrImplTableCellRendererLblTxt(
SwingConstants.CENTER
));
}
public void fill(Object[][] objssData) throws Exception
{
this._objssData = objssData;
_fill_();
}
private void _fill_() throws Exception
{
GfrAtmManageSpaceAbs tmp = (GfrAtmManageSpaceAbs) this.getModel();
tmp.fill(this._objssData);
}
@Override
public boolean init()
{
if (!super.init())
return false;
try
{
_fill_();
}
catch (Exception exc)
{
exc.printStackTrace();
String str = exc.getMessage();
GfrTblPopHeightRowFixManChildrenSpcAppAbs._LOGGER_.severe(str);
return false;
}
return true;
}
}