/*
* 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.appogcecl.actionperformer;
import java.awt.event.ActionEvent;
import java.util.logging.Logger;
import org.geoforge.guillc.menuitem.GfrMimTrsAlrIdAbs;
import org.geoforge.guillc.menuitem.GfrMimTrsAlrIdCopLlo;
import org.geoforge.guillc.menuitem.GfrMimTrsAlrIdCopTlo;
import org.geoforge.guillc.optionpane.GfrOptionPaneAbs;
import org.geoforge.guillcogcecl.enumeration.GfrEnuValuesKindObjectLloVarSpcPrjOgcEcl;
import org.geoforge.guillcogcecl.enumeration.GfrEnuValuesKindObjectTloSpcPrjOgcEcl;
import org.geoforge.lang.enumeration.GfrEnuApplicationPropertiesImmutableKeys;
import org.geoforge.java.util.logging.filehandler.FileHandlerLogger;
import org.geoforge.mdldatecl.*;
import org.geoforge.wrpbasprssynecl.*;
/**
*
* @author robert
*/
abstract public class ActPrfPrjCloneOgcEclAbs extends ActPrfPrjCloneOgcAbs
{
// ----
// begin: instantiate logger for this class
final private static Logger _LOGGER_ = Logger.getLogger(ActPrfPrjCloneOgcEclAbs.class.getName());
static
{
ActPrfPrjCloneOgcEclAbs._LOGGER_.addHandler(FileHandlerLogger.s_getInstance());
}
// end: instantiate logger for this class
// ----
@Override
public boolean doneJob(ActionEvent evt) throws Exception
{
if (super.doneJob(evt))
return true;
Object objEvt = evt.getSource();
// beg copy tlo
if (objEvt instanceof GfrMimTrsAlrIdCopTlo)
{
GfrMimTrsAlrIdAbs mim = (GfrMimTrsAlrIdAbs) objEvt;
String strIdSource = mim.getId();
String strValueKindObject = mim.getPropertyImmutable(
GfrEnuApplicationPropertiesImmutableKeys.KEY_KIND_OBJECT.name());
//--
if (strValueKindObject == null || strValueKindObject.length() < 1)
return false;
//-- beg tlo
if (strValueKindObject.compareTo(GfrEnuValuesKindObjectTloSpcPrjOgcEcl.VALUE_TLO_ECL_SCT.name()) == 0)
{
String strIdTarget = GfrMdlDatSetTlosEclSct.getInstance().clone(strIdSource);
String strNameSource = GfrWrpBasSynObjNameTloEclSct.getInstance().getName(strIdSource);
String strNameTarget = GfrWrpBasSynObjNameTloEclSct.getInstance().getName(strIdTarget);
String strDone = "Successfully copied:";
strDone += "\n. " + "source: " + strNameSource;
strDone += "\n. " + "copy: " + strNameTarget;
GfrOptionPaneAbs.s_showDialogInfo(null, strDone);
// ---
return true;
}
if (strValueKindObject.compareTo(GfrEnuValuesKindObjectTloSpcPrjOgcEcl.VALUE_TLO_ECL_ARE.name()) == 0)
{
String strIdTarget = GfrMdlDatSetTlosEclAre.getInstance().clone(strIdSource);
String strNameSource = GfrWrpBasSynObjNameTloEclAre.getInstance().getName(strIdSource);
String strNameTarget = GfrWrpBasSynObjNameTloEclAre.getInstance().getName(strIdTarget);
String strDone = "Successfully copied:";
strDone += "\n. " + "source: " + strNameSource;
strDone += "\n. " + "copy: " + strNameTarget;
GfrOptionPaneAbs.s_showDialogInfo(null, strDone);
// ---
return true;
}
if (strValueKindObject.compareTo(GfrEnuValuesKindObjectTloSpcPrjOgcEcl.VALUE_TLO_ECL_PTH.name()) == 0)
{
String strIdTarget = GfrMdlDatSetTlosEclPth.getInstance().clone(strIdSource);
String strNameSource = GfrWrpBasSynObjNameTloEclPth.getInstance().getName(strIdSource);
String strNameTarget = GfrWrpBasSynObjNameTloEclPth.getInstance().getName(strIdTarget);
String strDone = "Successfully copied:";
strDone += "\n. " + "source: " + strNameSource;
strDone += "\n. " + "copy: " + strNameTarget;
GfrOptionPaneAbs.s_showDialogInfo(null, strDone);
// ---
return true;
}
if (strValueKindObject.compareTo(GfrEnuValuesKindObjectTloSpcPrjOgcEcl.VALUE_TLO_ECL_SEG_WISE_YES.name()) == 0)
{
String strIdTarget = GfrMdlDatSetTlosEclSegWiseYes.getInstance().clone(strIdSource);
String strNameSource = GfrWrpBasSynObjNameTloEclSegWiseYes.getInstance().getName(strIdSource);
String strNameTarget = GfrWrpBasSynObjNameTloEclSegWiseYes.getInstance().getName(strIdTarget);
String strDone = "Successfully copied:";
strDone += "\n. " + "source: " + strNameSource;
strDone += "\n. " + "copy: " + strNameTarget;
GfrOptionPaneAbs.s_showDialogInfo(null, strDone);
// ---
return true;
}
if (strValueKindObject.compareTo(GfrEnuValuesKindObjectTloSpcPrjOgcEcl.VALUE_TLO_ECL_PNT.name()) == 0)
{
String strIdTarget = GfrMdlDatSetTlosEclPnt.getInstance().clone(strIdSource);
String strNameSource = GfrWrpBasSynObjNameTloEclPnt.getInstance().getName(strIdSource);
String strNameTarget = GfrWrpBasSynObjNameTloEclPnt.getInstance().getName(strIdTarget);
String strDone = "Successfully copied:";
strDone += "\n. " + "source: " + strNameSource;
strDone += "\n. " + "copy: " + strNameTarget;
GfrOptionPaneAbs.s_showDialogInfo(null, strDone);
// ---
return true;
}
if (strValueKindObject.compareTo(GfrEnuValuesKindObjectTloSpcPrjOgcEcl.VALUE_TLO_ECL_PLC.name()) == 0)
{
String strIdTarget = GfrMdlDatSetTlosEclPlc.getInstance().clone(strIdSource);
String strNameSource = GfrWrpBasSynObjNameTloEclPlc.getInstance().getName(strIdSource);
String strNameTarget = GfrWrpBasSynObjNameTloEclPlc.getInstance().getName(strIdTarget);
String strDone = "Successfully copied:";
strDone += "\n. " + "source: " + strNameSource;
strDone += "\n. " + "copy: " + strNameTarget;
GfrOptionPaneAbs.s_showDialogInfo(null, strDone);
// ---
return true;
}
if (strValueKindObject.compareTo(GfrEnuValuesKindObjectTloSpcPrjOgcEcl.VALUE_TLO_ECL_SPN.name()) == 0)
{
String strIdTarget = GfrMdlDatSetTlosEclSpn.getInstance().clone(strIdSource);
String strNameSource = GfrWrpBasSynObjNameTloEclSpn.getInstance().getName(strIdSource);
String strNameTarget = GfrWrpBasSynObjNameTloEclSpn.getInstance().getName(strIdTarget);
String strDone = "Successfully copied:";
strDone += "\n. " + "source: " + strNameSource;
strDone += "\n. " + "copy: " + strNameTarget;
GfrOptionPaneAbs.s_showDialogInfo(null, strDone);
// ---
return true;
}
}
//end copy tlo
//-- beg copy llo
// beg delete llo
if (evt.getSource() instanceof GfrMimTrsAlrIdCopLlo)
{
GfrMimTrsAlrIdAbs mim = (GfrMimTrsAlrIdAbs) evt.getSource();
String strIdChildSource = mim.getId();
String strIdParent = ((GfrMimTrsAlrIdCopLlo) mim).getIdParent();
String strValueKindObject = mim.getPropertyImmutable(
GfrEnuApplicationPropertiesImmutableKeys.KEY_KIND_OBJECT.name());
//--
if (strValueKindObject == null || strValueKindObject.length() < 1)
return false;
//--
if (strValueKindObject.compareTo(
GfrEnuValuesKindObjectLloVarSpcPrjOgcEcl.VALUE_LLO_IMAGE_ECL_PLC.name()) == 0)
{
String strIdChildTarget = GfrMdlDatIdObjTloEclPlc.getInstance().cloneObjectImage(
strIdParent,strIdChildSource);
String strNameSource = GfrWrpBasSynObjNameTloEclPlc.getInstance().getNameImage(strIdChildSource);
String strNameTarget = GfrWrpBasSynObjNameTloEclPlc.getInstance().getNameImage(strIdChildTarget);
String strDone = "Successfully copied:";
strDone += "\n. " + "source: " + strNameSource;
strDone += "\n. " + "copy: " + strNameTarget;
GfrOptionPaneAbs.s_showDialogInfo(null, strDone);
return true;
}
if (strValueKindObject.compareTo(
GfrEnuValuesKindObjectLloVarSpcPrjOgcEcl.VALUE_LLO_IMAGE_ECL_PNT.name()) == 0)
{
String strIdChildTarget = GfrMdlDatIdObjTloEclPnt.getInstance().cloneObjectImage(
strIdParent,strIdChildSource);
String strNameSource = GfrWrpBasSynObjNameTloEclPnt.getInstance().getNameImage(strIdChildSource);
String strNameTarget = GfrWrpBasSynObjNameTloEclPnt.getInstance().getNameImage(strIdChildTarget);
String strDone = "Successfully copied:";
strDone += "\n. " + "source: " + strNameSource;
strDone += "\n. " + "copy: " + strNameTarget;
GfrOptionPaneAbs.s_showDialogInfo(null, strDone);
return true;
}
if (strValueKindObject.compareTo(
GfrEnuValuesKindObjectLloVarSpcPrjOgcEcl.VALUE_LLO_IMAGE_ECL_ARE.name()) == 0)
{
String strIdChildTarget = GfrMdlDatIdObjTloEclAre.getInstance().cloneObjectImage(
strIdParent,strIdChildSource);
String strNameSource = GfrWrpBasSynObjNameTloEclAre.getInstance().getNameImage(strIdChildSource);
String strNameTarget = GfrWrpBasSynObjNameTloEclAre.getInstance().getNameImage(strIdChildTarget);
String strDone = "Successfully copied:";
strDone += "\n. " + "source: " + strNameSource;
strDone += "\n. " + "copy: " + strNameTarget;
GfrOptionPaneAbs.s_showDialogInfo(null, strDone);
return true;
}
if (strValueKindObject.compareTo(
GfrEnuValuesKindObjectLloVarSpcPrjOgcEcl.VALUE_LLO_IMAGE_ECL_SPN.name()) == 0)
{
String strIdChildTarget = GfrMdlDatIdObjTloEclSpn.getInstance().cloneObjectImage(
strIdParent,strIdChildSource);
String strNameSource = GfrWrpBasSynObjNameTloEclSpn.getInstance().getNameImage(strIdChildSource);
String strNameTarget = GfrWrpBasSynObjNameTloEclSpn.getInstance().getNameImage(strIdChildTarget);
String strDone = "Successfully copied:";
strDone += "\n. " + "source: " + strNameSource;
strDone += "\n. " + "copy: " + strNameTarget;
GfrOptionPaneAbs.s_showDialogInfo(null, strDone);
return true;
}
if (strValueKindObject.compareTo(
GfrEnuValuesKindObjectLloVarSpcPrjOgcEcl.VALUE_LLO_IMAGE_ECL_PTH.name()) == 0)
{
String strIdChildTarget = GfrMdlDatIdObjTloEclPth.getInstance().cloneObjectImage(
strIdParent,strIdChildSource);
String strNameSource = GfrWrpBasSynObjNameTloEclPth.getInstance().getNameImage(strIdChildSource);
String strNameTarget = GfrWrpBasSynObjNameTloEclPth.getInstance().getNameImage(strIdChildTarget);
String strDone = "Successfully copied:";
strDone += "\n. " + "source: " + strNameSource;
strDone += "\n. " + "copy: " + strNameTarget;
GfrOptionPaneAbs.s_showDialogInfo(null, strDone);
return true;
}
if (strValueKindObject.compareTo(
GfrEnuValuesKindObjectLloVarSpcPrjOgcEcl.VALUE_LLO_IMAGE_ECL_SCT.name()) == 0)
{
String strIdChildTarget = GfrMdlDatIdObjTloEclSct.getInstance().cloneObjectImage(
strIdParent,strIdChildSource);
String strNameSource = GfrWrpBasSynObjNameTloEclSct.getInstance().getNameImage(strIdChildSource);
String strNameTarget = GfrWrpBasSynObjNameTloEclSct.getInstance().getNameImage(strIdChildTarget);
String strDone = "Successfully copied:";
strDone += "\n. " + "source: " + strNameSource;
strDone += "\n. " + "copy: " + strNameTarget;
GfrOptionPaneAbs.s_showDialogInfo(null, strDone);
return true;
}
if (strValueKindObject.compareTo(
GfrEnuValuesKindObjectLloVarSpcPrjOgcEcl.VALUE_LLO_IMAGE_ECL_SEG_WISE_YES.name()) == 0)
{
String strIdChildTarget = GfrMdlDatIdObjTloEclSegWiseYes.getInstance().cloneObjectImage(
strIdParent,strIdChildSource);
String strNameSource = GfrWrpBasSynObjNameTloEclSegWiseYes.getInstance().getNameImage(strIdChildSource);
String strNameTarget = GfrWrpBasSynObjNameTloEclSegWiseYes.getInstance().getNameImage(strIdChildTarget);
String strDone = "Successfully copied:";
strDone += "\n. " + "source: " + strNameSource;
strDone += "\n. " + "copy: " + strNameTarget;
GfrOptionPaneAbs.s_showDialogInfo(null, strDone);
return true;
}
}
//-- end copy llo
// ending
return false;
}
// ---
protected ActPrfPrjCloneOgcEclAbs()
{
super();
}
// ---
}