/*
* 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.guillcogcecl.dialog;
import java.util.ArrayList;
import java.util.logging.Logger;
import javax.swing.JFrame;
import org.geoforge.awt.geoshape.ShapeAbs;
import org.geoforge.guillc.dialog.GfrDlgPgsBldObjsShapeAbs;
import org.geoforge.guillcogcecl.thread.GfrPgsThrIdsBldShpTloPths;
import org.geoforge.lang.handler.IGfrHandlerEventListenerThreadJobProgress;
import org.geoforge.java.util.logging.filehandler.FileHandlerLogger;
/**
*
* @author bantchao
*/
public class GfrDlgPgsBldObjectsShapePths extends GfrDlgPgsBldObjsShapeAbs
{
// ----
// begin: instantiate logger for this class
final private static Logger _LOGGER_ = Logger.getLogger(GfrDlgPgsBldObjectsShapePths.class.getName());
static
{
GfrDlgPgsBldObjectsShapePths._LOGGER_.addHandler(FileHandlerLogger.s_getInstance());
}
// end: instantiate logger for this class
// ----
public GfrDlgPgsBldObjectsShapePths(
JFrame frmOwner,
String strPathAbsSource,
ArrayList<ShapeAbs> alt)
{
super(frmOwner,
"Saving paths in project",
strPathAbsSource,
alt);
}
@Override
public boolean init()
{
if (! super.init())
return false;
try
{
if (! super._blnCancelled)
{
super.pack();
super.setVisible(true);
super._thr = new GfrPgsThrIdsBldShpTloPths(
(IGfrHandlerEventListenerThreadJobProgress) this,
super._pbr,
super._lbl,
super._alt
);
}
}
catch (Exception exc)
{
if (super._frmOwner != null)
super._frmOwner.setEnabled(true);
if (super._blnCancelled)
{
GfrDlgPgsBldObjectsShapePths._LOGGER_.info("super._blnCancelled_");
return true;
}
exc.printStackTrace();
String str = exc.getMessage();
GfrDlgPgsBldObjectsShapePths._LOGGER_.severe(str);
return false;
}
return true;
}
}