Package org.geoforge.guillcogcecl.panel

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

/*
*  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.PnlDspRowComboAnnotationDft;
import org.geoforge.guillc.panel.PnlDspRowRadiosColorDft;
import org.geoforge.guillc.panel.PnlDspRowSldAbs;
import org.geoforge.guillc.panel.PnlDspRowSldOpacityDft;
import org.geoforge.guillc.panel.PnlDspRowSldThicknessDft;
import org.geoforge.guillc.panel.PnlDspRowChoiceBlnYesNo;
import org.geoforge.mdldspecl.render.wwd.GfrMdlDspRndWwdEarthShpDimOneSegWiseYesEcl;
import org.geoforge.wrpbasprsdsp.render.wwd.GfrWrpBasPrsDspPrjRndWwdEarthShpDimAbs.KindAnnotation;
import org.geoforge.wrpbasprsdspecl.render.wwd.GfrWrpRndDftWwdEarthShpDimOneLineSegWiseYesEcl;

/**
*
* @author Amadeus.Sowerby
*
* email: Amadeus.Sowerby_AT_gmail.com ... please remove "_AT_" from the above
* string to get the right email address
*/
public class GfrPnlTabsSettingsDspWwdEarthDimOneLinSegWiseYesTop extends GfrPnlTabsSettingsDspWwdEarthDimOneLinAbs
{
   

    public GfrPnlTabsSettingsDspWwdEarthDimOneLinSegWiseYesTop(
           ActionListener alrParent,
           ChangeListener clrParent)
           throws Exception
   {
      super();
     
      // begin get value
      int intThickness = GfrWrpRndDftWwdEarthShpDimOneLineSegWiseYesEcl.getInstance().getThickness();
     
      float fltTransparency = GfrWrpRndDftWwdEarthShpDimOneLineSegWiseYesEcl.getInstance().getTransparency();
      fltTransparency *= 100;
      int intTransparency = Math.round(fltTransparency);
     
      Color colCustom = null;
     
      if (! GfrWrpRndDftWwdEarthShpDimOneLineSegWiseYesEcl.getInstance().isColorRandom())
         colCustom = GfrWrpRndDftWwdEarthShpDimOneLineSegWiseYesEcl.getInstance().getColor();
     
     
      boolean blnHasTootip = GfrWrpRndDftWwdEarthShpDimOneLineSegWiseYesEcl.getInstance().isTooltip();
      String strValueInitAnnotation = GfrWrpRndDftWwdEarthShpDimOneLineSegWiseYesEcl.getInstance().getKindAnnotationKey();
      // end get values

      super._pnlThickness = new PnlDspRowSldThicknessDft(
              clrParent,
              intThickness,
              "Line");

      super._pnlColor = new PnlDspRowRadiosColorDft(
              alrParent,
              colCustom);
     
      super._pnlOpacity = new PnlDspRowSldOpacityDft(
              clrParent,
              intTransparency);
     
      super._pnlAnnotation = new PnlDspRowComboAnnotationDft(
              alrParent,
              strValueInitAnnotation);
     
      super._pnlTooltip = new PnlDspRowChoiceBlnYesNo(
              alrParent,
              blnHasTootip,
              "tooltip");
   }

   @Override
   public void doTaskTabDialog() throws Exception
   {
      if (super._pnlThickness.hasChangedValue())
      {
         int intValue = ((PnlDspRowSldAbs) super._pnlThickness).getValue();
         boolean bln = super._pnlThickness.isApplyToAll();
         GfrMdlDspRndWwdEarthShpDimOneSegWiseYesEcl.getInstance().setThicknessDefault(intValue, bln);
      }
     
      if (super._pnlColor.hasChangedValue())
      {
         Color colValue = ((PnlDspRowRadiosColorDft) super._pnlColor).getValue();
         boolean bln = super._pnlColor.isApplyToAll();
         GfrMdlDspRndWwdEarthShpDimOneSegWiseYesEcl.getInstance().setColorDefault(colValue, bln);
      }
     
      if (super._pnlOpacity.hasChangedValue())
      {
         int intValue = ((PnlDspRowSldAbs) super._pnlOpacity).getValue();
         float fltValue = (float) intValue;
         fltValue /= 100f;
        
         boolean bln = super._pnlOpacity.isApplyToAll();
         GfrMdlDspRndWwdEarthShpDimOneSegWiseYesEcl.getInstance().setTransparencyDefault(fltValue, bln);
      }
     
      if (super._pnlAnnotation.hasChangedValue())
      {
         String strKey = ((PnlDspRowComboAnnotationDft) super._pnlAnnotation).getValue();
         boolean bln = super._pnlAnnotation.isApplyToAll();
         String strValue = KindAnnotation.s_getValue(strKey);
         GfrMdlDspRndWwdEarthShpDimOneSegWiseYesEcl.getInstance().setKindAnnotationDefault(strValue, bln);
      }
     
      if (super._pnlTooltip.hasChangedValue())
      {
         boolean blnValue = ((PnlDspRowChoiceBlnYesNo) super._pnlTooltip).getValue();
         boolean bln = super._pnlTooltip.isApplyToAll();
         GfrMdlDspRndWwdEarthShpDimOneSegWiseYesEcl.getInstance().setTooltipDefault(blnValue, bln);
      }
     
      // ending
      super.doTaskTabDialog();
   }
  
}
TOP

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

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.