/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.geoforge.appogcecl.actionperformer;
import java.awt.event.ActionEvent;
import java.util.logging.Logger;
import javax.swing.JFrame;
import org.geoforge.guillc.dialog.DlgAbs;
import org.geoforge.guillc.enumeration.GfrEnuValuesKindTargetWindow;
import org.geoforge.guillc.frame.GfrFrmAbs;
import org.geoforge.guillc.menuitem.GfrMimTrsAlrIdAbs;
import org.geoforge.guillc.menuitem.GfrMimTrsAlrIdSetLloVar;
import org.geoforge.guillc.menuitem.GfrMimTrsAlrIdSetTlo;
import org.geoforge.guillc.menuitem.GfrMimTrsAlrSetTop;
import org.geoforge.guillcogc.dialog.*;
import org.geoforge.guillcogc.enumeration.GfrEnuValuesKindObjectOgc;
import org.geoforge.guillcogc.enumeration.GfrEnuValuesKindObjectTloSpcPrjOgc;
import org.geoforge.lang.enumeration.GfrEnuApplicationPropertiesImmutableKeys;
import org.geoforge.java.util.logging.filehandler.FileHandlerLogger;
/**
*
* @author robert
*/
public class ActPrfPrjSettingsOgcAbs extends ActPrfAbs
{
// ----
// begin: instantiate logger for this class
final private static Logger _LOGGER_ = Logger.getLogger(ActPrfPrjSettingsOgcAbs.class.getName());
static
{
ActPrfPrjSettingsOgcAbs._LOGGER_.addHandler(FileHandlerLogger.s_getInstance());
}
// end: instantiate logger for this class
// ----
@Override
public boolean doneJob(ActionEvent evt) throws Exception
{
// beg settings llo
if (evt.getSource() instanceof GfrMimTrsAlrIdSetLloVar)
{
GfrMimTrsAlrIdSetLloVar mim = (GfrMimTrsAlrIdSetLloVar) evt.getSource();
//memo: frmOwner not used due to a persistency bug
JFrame frmOwner = GfrFrmAbs.s_getFrameOwnerTrickForActionController(mim);
String strId = mim.getId();
String strValueKindObject = mim.getPropertyImmutable(
GfrEnuApplicationPropertiesImmutableKeys.KEY_KIND_OBJECT.name());
String strValueKindTargetWindow = mim.getPropertyImmutable(
GfrEnuApplicationPropertiesImmutableKeys.KEY_KIND_TARGET_WINDOW.name());
//--
if (strValueKindObject == null || strValueKindObject.length() < 1)
return false;
if (strValueKindTargetWindow == null || strValueKindTargetWindow.length() < 1)
return false;
// not used
if (strValueKindObject.compareTo(
GfrEnuValuesKindObjectOgc.VALUE_LLO_WMS_LYR_LEAF.name()) == 0)
{
DlgAbs dlg = new GfrDlgTabsSettingsDspActionWwdObjLyrLeaf(
frmOwner, strId);
if (!dlg.init())
{
String str = "! dlg.init()";
ActPrfPrjSettingsOgcAbs._LOGGER_.severe(str);
throw new Exception(str);
}
dlg.setVisible(true);
return true;
}
if (strValueKindObject.compareTo(
GfrEnuValuesKindObjectOgc.VALUE_LLO_WMS_LYR_FOLDER.name()) == 0)
{
DlgAbs dlg = new GfrDlgTabsSettingsDspInfoWwdEarthOgcLyrWmsFolder(
frmOwner, strId);
if (!dlg.init())
{
String str = "! dlg.init()";
ActPrfPrjSettingsOgcAbs._LOGGER_.severe(str);
throw new Exception(str);
}
dlg.setVisible(true);
return true;
}
}
// end settings llo
// beg settings top
if (evt.getSource() instanceof GfrMimTrsAlrSetTop)
{
GfrMimTrsAlrSetTop mim = (GfrMimTrsAlrSetTop) evt.getSource();
JFrame frmOwner = GfrFrmAbs.s_getFrameOwnerTrickForActionController(mim);
String strValueKindObject = mim.getPropertyImmutable(
GfrEnuApplicationPropertiesImmutableKeys.KEY_KIND_OBJECT.name());
String strValueKindTargetWindow = mim.getPropertyImmutable(
GfrEnuApplicationPropertiesImmutableKeys.KEY_KIND_TARGET_WINDOW.name());
//--
if (strValueKindObject == null || strValueKindObject.length() < 1)
return false;
if (strValueKindTargetWindow == null || strValueKindTargetWindow.length() < 1)
return false;
//--
if (strValueKindObject.compareTo(
GfrEnuValuesKindObjectTloSpcPrjOgc.VALUE_TLO_WMS.name()) == 0)
{
if (strValueKindTargetWindow.compareTo(
GfrEnuValuesKindTargetWindow.PERSPECTIVE_MANAGE.name()) == 0
|| strValueKindTargetWindow.compareTo(
GfrEnuValuesKindTargetWindow.PERSPECTIVE_SELECT.name()) == 0
|| strValueKindTargetWindow.compareTo(
GfrEnuValuesKindTargetWindow.PERSPECTIVE_RUN.name()) == 0
|| strValueKindTargetWindow.compareTo(
GfrEnuValuesKindTargetWindow.VIEWER_TOP_WORLDWIND.name()) == 0
|| strValueKindTargetWindow.compareTo(
GfrEnuValuesKindTargetWindow.VIEWER_TOP_LEGENDS_OGC.name()) == 0)
{
DlgAbs dlg = new GfrDlgTabsSettingsDspInfoWwdEarthOgcWmss(
frmOwner);
if (!dlg.init())
{
String str = "! dlg.init()";
ActPrfPrjSettingsOgcAbs._LOGGER_.severe(str);
throw new Exception(str);
}
dlg.setVisible(true);
return true;
}
}
}
// end settings top
// beg settings tlo
if (evt.getSource() instanceof GfrMimTrsAlrIdSetTlo)
{
GfrMimTrsAlrIdAbs mim = (GfrMimTrsAlrIdAbs) evt.getSource();
JFrame frmOwner = GfrFrmAbs.s_getFrameOwnerTrickForActionController(mim);
String strId = mim.getId();
String strValueKindObject = mim.getPropertyImmutable(
GfrEnuApplicationPropertiesImmutableKeys.KEY_KIND_OBJECT.name());
String strValueKindTargetWindow = mim.getPropertyImmutable(
GfrEnuApplicationPropertiesImmutableKeys.KEY_KIND_TARGET_WINDOW.name());
//--
if (strValueKindObject == null || strValueKindObject.length() < 1)
return false;
if (strValueKindTargetWindow == null || strValueKindTargetWindow.length() < 1)
return false;
if (strValueKindObject.compareTo(
GfrEnuValuesKindObjectTloSpcPrjOgc.VALUE_TLO_WMS.name()) == 0)
{
if (strValueKindTargetWindow.compareTo(
GfrEnuValuesKindTargetWindow.PERSPECTIVE_MANAGE.name()) == 0
|| strValueKindTargetWindow.compareTo(
GfrEnuValuesKindTargetWindow.PERSPECTIVE_SELECT.name()) == 0
|| strValueKindTargetWindow.compareTo(
GfrEnuValuesKindTargetWindow.PERSPECTIVE_RUN.name()) == 0
|| strValueKindTargetWindow.compareTo(
GfrEnuValuesKindTargetWindow.VIEWER_TOP_WORLDWIND.name()) == 0)
{
DlgAbs dlg = new GfrDlgTabsSettingsDspInfoWwdEarthOgcWms(
frmOwner, strId);
if (!dlg.init())
{
String str = "! dlg.init()";
ActPrfPrjSettingsOgcAbs._LOGGER_.severe(str);
throw new Exception(str);
}
dlg.setVisible(true);
return true;
}
}
}
// end settings tlo
return false;
}
// ---
protected ActPrfPrjSettingsOgcAbs()
{
super();
}
}