Package org.geoforge.guillcogcecl.panel

Source Code of org.geoforge.guillcogcecl.panel.GfrPnlTabsSettingsDspWwdEarthDimOneLinSegWiseYesObj

/*
*  Copyright (C) 2011-2013 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.guillcogcecl.panel;

import java.awt.Color;
import java.awt.event.ActionListener;
import javax.swing.event.ChangeListener;
import org.geoforge.guillc.panel.GfrPnlTabsSettingsDspWwdEarthDimOneLinAbs;
import org.geoforge.guillc.panel.PnlDspRowButtonColorObj;
import org.geoforge.guillc.panel.PnlDspRowComboAnnotationDft;
import org.geoforge.guillc.panel.PnlDspRowComboAnnotationDftObject;
import org.geoforge.guillc.panel.PnlDspRowSldAbs;
import org.geoforge.guillc.panel.PnlDspRowSldOpacityObject;
import org.geoforge.guillc.panel.PnlDspRowSldThicknessObj;
import org.geoforge.guillc.panel.PnlDspRowChoiceBlnYesNo;
import org.geoforge.guillc.panel.PnlDspRowChoiceBlnYesNoObject;
import org.geoforge.mdldspecl.render.wwd.GfrMdlDspRndWwdEarthShpDimOneSegWiseYesEcl;
import org.geoforge.wrpbasprsdsp.render.wwd.GfrWrpBasPrsDspPrjRndWwdEarthShpDimAbs.KindAnnotation;

import org.geoforge.wrpbasprsdsp.render.wwd.GfrWrpBasPrsDspPrjRndWwdEarthShpDimOneSegmentWiseYes;

/**
*
* @author Amadeus.Sowerby
*
* email: Amadeus.Sowerby_AT_gmail.com ... please remove "_AT_" from the above
* string to get the right email address
*/
public class GfrPnlTabsSettingsDspWwdEarthDimOneLinSegWiseYesObj extends GfrPnlTabsSettingsDspWwdEarthDimOneLinAbs
{
   private String _strId_ = null;

   public GfrPnlTabsSettingsDspWwdEarthDimOneLinSegWiseYesObj(ActionListener alrParent,
           ChangeListener clrParent,
           String strId)
           throws Exception
   {
      super();
     
      this._strId_ = strId;
     
      // begin get value
      int intThickness = GfrWrpBasPrsDspPrjRndWwdEarthShpDimOneSegmentWiseYes.getInstance().getThickness(strId);
      float fltTransparency = GfrWrpBasPrsDspPrjRndWwdEarthShpDimOneSegmentWiseYes.getInstance().getTransparency(strId);
      fltTransparency *= 100;
      int intTransparency = Math.round(fltTransparency);
      Color colCustom = GfrWrpBasPrsDspPrjRndWwdEarthShpDimOneSegmentWiseYes.getInstance().getColor(strId);
      boolean blnHasTootip = GfrWrpBasPrsDspPrjRndWwdEarthShpDimOneSegmentWiseYes.getInstance().isTooltip(strId);
      String strValueInitAnnotation = GfrWrpBasPrsDspPrjRndWwdEarthShpDimOneSegmentWiseYes.getInstance().getKindAnnotationKey(strId);
      // end get values
     
      super._pnlThickness = new PnlDspRowSldThicknessObj(
              clrParent,
              intThickness,
              "Line");
     
      super._pnlColor = new PnlDspRowButtonColorObj(
              alrParent,
              colCustom);
     
      super._pnlOpacity = new PnlDspRowSldOpacityObject(
              clrParent,
              intTransparency);
     
      super._pnlAnnotation = new PnlDspRowComboAnnotationDftObject(
              alrParent,
              strValueInitAnnotation);
     
      super._pnlTooltip = new PnlDspRowChoiceBlnYesNoObject(
              alrParent,
              blnHasTootip,
              "tooltip");
   }


   @Override
   public void doTaskTabDialog() throws Exception
   {
      if (super._pnlThickness.hasChangedValue())
      {
         int intValue = ((PnlDspRowSldAbs) super._pnlThickness).getValue();
         boolean blnApplyToAll = super._pnlThickness.isApplyToAll();
         boolean blnSetAsDefault = ((PnlDspRowSldThicknessObj) super._pnlThickness).isSetDefault();
         GfrMdlDspRndWwdEarthShpDimOneSegWiseYesEcl.getInstance().setThickness(this._strId_, intValue, blnApplyToAll, blnSetAsDefault);
      }
     
      if (super._pnlColor.hasChangedValue())
      {
         Color colValue = ((PnlDspRowButtonColorObj) super._pnlColor).getValue();
         boolean blnApplyToAll = super._pnlColor.isApplyToAll();
         boolean blnSetAsDefault = ((PnlDspRowButtonColorObj) super._pnlColor).isSetDefault();
         GfrMdlDspRndWwdEarthShpDimOneSegWiseYesEcl.getInstance().setColor(this._strId_, colValue, blnApplyToAll, blnSetAsDefault);
      }
     
      if (super._pnlOpacity.hasChangedValue())
      {
         int intValue = ((PnlDspRowSldAbs) super._pnlOpacity).getValue();
         float fltValue = (float) intValue;
         fltValue /= 100f;
         boolean blnApplyToAll = super._pnlOpacity.isApplyToAll();
         boolean blnSetAsDefault = ((PnlDspRowSldOpacityObject) super._pnlOpacity).isSetDefault();
         GfrMdlDspRndWwdEarthShpDimOneSegWiseYesEcl.getInstance().setTransparency(this._strId_, fltValue, blnApplyToAll, blnSetAsDefault);
      }
     
      if (super._pnlAnnotation.hasChangedValue())
      {
         String strKey = ((PnlDspRowComboAnnotationDft) super._pnlAnnotation).getValue();
         boolean blnApplyToAll = super._pnlAnnotation.isApplyToAll();
         boolean blnSetAsDefault = ((PnlDspRowComboAnnotationDftObject) super._pnlAnnotation).isSetDefault();
         String strValue = KindAnnotation.s_getValue(strKey);
         GfrMdlDspRndWwdEarthShpDimOneSegWiseYesEcl.getInstance().setKindAnnotation(this._strId_, strValue, blnApplyToAll, blnSetAsDefault);
      }
     
      if (super._pnlTooltip.hasChangedValue())
      {
         boolean blnValue = ((PnlDspRowChoiceBlnYesNo) super._pnlTooltip).getValue();
         boolean blnApplyToAll = super._pnlTooltip.isApplyToAll();
         boolean blnSetAsDefault = ((PnlDspRowChoiceBlnYesNoObject) super._pnlTooltip).isSetDefault();
         GfrMdlDspRndWwdEarthShpDimOneSegWiseYesEcl.getInstance().setTooltip(this._strId_, blnValue, blnApplyToAll, blnSetAsDefault);
      }
     
      // ending
      super.doTaskTabDialog();
   }
}
TOP

Related Classes of org.geoforge.guillcogcecl.panel.GfrPnlTabsSettingsDspWwdEarthDimOneLinSegWiseYesObj

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.