Package org.geoforge.mdldspecl.render.wwd

Source Code of org.geoforge.mdldspecl.render.wwd.GfrMdlDspRndWwdEarthShpDimTwoSct

/*
*  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 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.mdldspecl.render.wwd;


import java.awt.Color;
import org.geoforge.awt.color.GfrColorFactory;
import org.geoforge.mdldsp.event.render.wwd.EnuEvtDspRndWwdEarthShp;
import org.geoforge.mdldsp.event.render.wwd.EnuEvtDspRndWwdEarthDimTwo;
import org.geoforge.mdldsp.event.render.wwd.GfrEvtMdlIdDspRndWwdEarthShpDimTwo;
import org.geoforge.mdldsp.render.wwd.GfrMdlDspRndWwdEarthShpDimTwoAbs;
import org.geoforge.wrpbasprsdsp.render.wwd.GfrWrpBasPrsDspPrjRndWwdEarthShpDimTwo;
import org.geoforge.wrpbasprsdspecl.render.wwd.GfrWrpRndDftWwdEarthShpDimTwoSct;
import org.geoforge.wrpbasprssynecl.GfrWrpBasTopSynEclScts;


/**
*
* @author bgwilliams71
*
* email: bgwilliams71_AT_gmail.com
* ... please remove "_AT_" from the above string to get the right email address
*/
public class GfrMdlDspRndWwdEarthShpDimTwoSct extends GfrMdlDspRndWwdEarthShpDimTwoAbs
{
   static private GfrMdlDspRndWwdEarthShpDimTwoSct _INSTANCE_;
  
   static public GfrMdlDspRndWwdEarthShpDimTwoSct getInstance()
   {
      if (_INSTANCE_ == null)
      {
         _INSTANCE_ = new GfrMdlDspRndWwdEarthShpDimTwoSct();
      }
     
      return _INSTANCE_;
   }
  
   // beg public
  
   @Override
   public void setColorIn(String strId, Color colValue,
           boolean blnApplyToAll, boolean blnSetAsDefault) throws Exception
   {
      if (colValue == null)
         throw new Exception("colValue == null");
     
      if (blnSetAsDefault)
         GfrWrpRndDftWwdEarthShpDimTwoSct.getInstance().setColorIn(colValue);
     
      if (blnApplyToAll)
      {
         String[] strs = GfrWrpBasTopSynEclScts.getInstance().getIdsTlo();
         GfrWrpBasPrsDspPrjRndWwdEarthShpDimTwo.getInstance().setColorIn(strs, colValue);

        for (int i=0; i<strs.length; i++)
        {
           super.setChanged();
           Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimTwo(strs[i], EnuEvtDspRndWwdEarthDimTwo.COLOR_IN, colValue);
           super.notifyObservers(objEvt);
        }
      }

      else
      {
         GfrWrpBasPrsDspPrjRndWwdEarthShpDimTwo.getInstance().setColorIn(strId, colValue);

         super.setChanged();
         Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimTwo(strId, EnuEvtDspRndWwdEarthDimTwo.COLOR_IN, colValue);
         super.notifyObservers(objEvt);
      }
   }
  
   @Override
   public void setTransparencyIn(String strId, float fltValue,
           boolean blnApplyToAll, boolean blnSetAsDefault) throws Exception
   {
      if (blnSetAsDefault)
         GfrWrpRndDftWwdEarthShpDimTwoSct.getInstance().setTransparencyIn(fltValue);
     
      Float flo = new Float(fltValue);
     
      if (blnApplyToAll)
      {
         String[] strs = GfrWrpBasTopSynEclScts.getInstance().getIdsTlo();
         GfrWrpBasPrsDspPrjRndWwdEarthShpDimTwo.getInstance().setTransparencyIn(strs, fltValue);
        
         for (int i=0; i<strs.length; i++)
        {
           super.setChanged();
           Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimTwo(strs[i], EnuEvtDspRndWwdEarthDimTwo.TRANSPARENCY_IN, flo);
           super.notifyObservers(objEvt);
        }
      }
     
      else
      {
         GfrWrpBasPrsDspPrjRndWwdEarthShpDimTwo.getInstance().setTransparencyIn(strId, fltValue);
        
         super.setChanged();
         Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimTwo(strId, EnuEvtDspRndWwdEarthDimTwo.TRANSPARENCY_IN, flo);
         super.notifyObservers(objEvt);
      }
   }
  
   // ----
  
   @Override
   public void setColorOut(String strId, Color colValue,
           boolean blnApplyToAll, boolean blnSetAsDefault) throws Exception
   {
      if (colValue == null)
         throw new Exception("colValue == null");
     
      if (blnSetAsDefault)
         GfrWrpRndDftWwdEarthShpDimTwoSct.getInstance().setColorOut(colValue);
     
      if (blnApplyToAll)
      {
         String[] strs = GfrWrpBasTopSynEclScts.getInstance().getIdsTlo();
         GfrWrpBasPrsDspPrjRndWwdEarthShpDimTwo.getInstance().setColorOut(strs, colValue);

        for (int i=0; i<strs.length; i++)
        {
           super.setChanged();
           Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimTwo(strs[i], EnuEvtDspRndWwdEarthDimTwo.COLOR_OUT, colValue);
           super.notifyObservers(objEvt);
        }
      }

      else
      {
         GfrWrpBasPrsDspPrjRndWwdEarthShpDimTwo.getInstance().setColorOut(strId, colValue);

         super.setChanged();
         Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimTwo(strId, EnuEvtDspRndWwdEarthDimTwo.COLOR_OUT, colValue);
         super.notifyObservers(objEvt);
      }
   }
  
   @Override
   public void setTransparencyOut(String strId, float fltValue,
           boolean blnApplyToAll, boolean blnSetAsDefault) throws Exception
   {
      if (blnSetAsDefault)
         GfrWrpRndDftWwdEarthShpDimTwoSct.getInstance().setTransparencyOut(fltValue);
     
      Float flo = new Float(fltValue);
     
      if (blnApplyToAll)
      {
         String[] strs = GfrWrpBasTopSynEclScts.getInstance().getIdsTlo();
         GfrWrpBasPrsDspPrjRndWwdEarthShpDimTwo.getInstance().setTransparencyOut(strs, fltValue);
        
         for (int i=0; i<strs.length; i++)
        {
           super.setChanged();
           Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimTwo(strs[i], EnuEvtDspRndWwdEarthDimTwo.TRANSPARENCY_OUT, flo);
           super.notifyObservers(objEvt);
        }
      }
     
      else
      {
         GfrWrpBasPrsDspPrjRndWwdEarthShpDimTwo.getInstance().setTransparencyOut(strId, fltValue);
        
         super.setChanged();
         Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimTwo(strId, EnuEvtDspRndWwdEarthDimTwo.TRANSPARENCY_OUT, flo);
         super.notifyObservers(objEvt);
      }
   }
  
   @Override
   public void setKindAnnotation(String strId, String strValue,
           boolean blnApplyToAll, boolean blnSetAsDefault) throws Exception
   {
      if (blnSetAsDefault)
         GfrWrpRndDftWwdEarthShpDimTwoSct.getInstance().setKindAnnotation(strValue);
     
      if (blnApplyToAll)
      {
         String[] strs = GfrWrpBasTopSynEclScts.getInstance().getIdsTlo();
         GfrWrpBasPrsDspPrjRndWwdEarthShpDimTwo.getInstance().setKindAnnotation(strs, strValue);
        
         for (int i=0; i<strs.length; i++)
        {
           super.setChanged();
           Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimTwo(strs[i], EnuEvtDspRndWwdEarthShp.ANNOTATION, strValue);
           super.notifyObservers(objEvt);
        }
      }
     
      else
      {
         GfrWrpBasPrsDspPrjRndWwdEarthShpDimTwo.getInstance().setKindAnnotation(strId, strValue);
        
         super.setChanged();
         Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimTwo(strId, EnuEvtDspRndWwdEarthShp.ANNOTATION, strValue);
         super.notifyObservers(objEvt);
      }
   }
  
   @Override
   public void setTooltip(String strId, boolean blnValue,
           boolean blnApplyToAll, boolean blnSetAsDefault) throws Exception
   {
      if (blnSetAsDefault)
         GfrWrpRndDftWwdEarthShpDimTwoSct.getInstance().setTooltip(blnValue);
     
      Boolean boo = Boolean.valueOf(blnValue);
     
      if (blnApplyToAll)
      {
         String[] strs = GfrWrpBasTopSynEclScts.getInstance().getIdsTlo();
         GfrWrpBasPrsDspPrjRndWwdEarthShpDimTwo.getInstance().setTooltip(strs, blnValue);
        
         for (int i=0; i<strs.length; i++)
        {
           super.setChanged();
           Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimTwo(strs[i], EnuEvtDspRndWwdEarthShp.TOOLTIP, boo);
           super.notifyObservers(objEvt);
        }
      }
     
      else
      {
         GfrWrpBasPrsDspPrjRndWwdEarthShpDimTwo.getInstance().setTooltip(strId, blnValue);
        
         super.setChanged();
         Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimTwo(strId, EnuEvtDspRndWwdEarthShp.TOOLTIP, boo);
         super.notifyObservers(objEvt);
      }
   }
  
   @Override
   public void setColorDefaultIn(Color colValue, boolean blnApplyToAll) throws Exception
   {
      GfrWrpRndDftWwdEarthShpDimTwoSct.getInstance().setColorIn(colValue);
     
      if (! blnApplyToAll)
         return;
     
      String[] strs = GfrWrpBasTopSynEclScts.getInstance().getIdsTlo();
      if (colValue != null)
      {
         GfrWrpBasPrsDspPrjRndWwdEarthShpDimTwo.getInstance().setColorIn(strs, colValue);

         for (int i = 0; i < strs.length; i++)
         {
            super.setChanged();
            Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimTwo(strs[i], EnuEvtDspRndWwdEarthDimTwo.COLOR_IN, colValue);
            super.notifyObservers(objEvt);
         }

         return;
      }

      // random color

      for (int i = 0; i < strs.length; i++)
      {
         Color colCur = GfrColorFactory.s_getRandom();
         GfrWrpBasPrsDspPrjRndWwdEarthShpDimTwo.getInstance().setColorIn(strs[i], colCur);

         super.setChanged();
         Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimTwo(strs[i], EnuEvtDspRndWwdEarthDimTwo.COLOR_IN, colCur);
         super.notifyObservers(objEvt);
      }
     
   }
  
   @Override
   public void setTransparencyDefaultIn(float fltValue, boolean blnApplyToAll) throws Exception
   {
      GfrWrpRndDftWwdEarthShpDimTwoSct.getInstance().setTransparencyIn(fltValue);
     
      if (! blnApplyToAll)
         return;
     
      Float flo = new Float(fltValue);
     
      String[] strs = GfrWrpBasTopSynEclScts.getInstance().getIdsTlo();
      GfrWrpBasPrsDspPrjRndWwdEarthShpDimTwo.getInstance().setTransparencyIn(strs, fltValue);
     
      for (int i=0; i<strs.length; i++)
      {
        super.setChanged();
        Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimTwo(strs[i], EnuEvtDspRndWwdEarthDimTwo.TRANSPARENCY_IN, flo);
        super.notifyObservers(objEvt);
      }
   }
  
   @Override
   public void setColorDefaultOut(Color colValue, boolean blnApplyToAll) throws Exception
   {
      GfrWrpRndDftWwdEarthShpDimTwoSct.getInstance().setColorOut(colValue);
     
      if (! blnApplyToAll)
         return;
     
      String[] strs = GfrWrpBasTopSynEclScts.getInstance().getIdsTlo();
     
      if (colValue != null)
      {
         GfrWrpBasPrsDspPrjRndWwdEarthShpDimTwo.getInstance().setColorOut(strs, colValue);

         for (int i = 0; i < strs.length; i++)
         {
            super.setChanged();
            Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimTwo(strs[i], EnuEvtDspRndWwdEarthDimTwo.COLOR_OUT, colValue);
            super.notifyObservers(objEvt);
         }

         return;
      }

      // random color

      for (int i = 0; i < strs.length; i++)
      {
         Color colCur = GfrColorFactory.s_getRandom();
         GfrWrpBasPrsDspPrjRndWwdEarthShpDimTwo.getInstance().setColorOut(strs[i], colCur);

         super.setChanged();
         Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimTwo(strs[i], EnuEvtDspRndWwdEarthDimTwo.COLOR_OUT, colCur);
         super.notifyObservers(objEvt);
      }

     
   }
  
   @Override
   public void setTransparencyDefaultOut(float fltValue, boolean blnApplyToAll) throws Exception
   {
       GfrWrpRndDftWwdEarthShpDimTwoSct.getInstance().setTransparencyOut(fltValue);
     
      if (! blnApplyToAll)
         return;
     
      Float flo = new Float(fltValue);
     
      String[] strs = GfrWrpBasTopSynEclScts.getInstance().getIdsTlo();
      GfrWrpBasPrsDspPrjRndWwdEarthShpDimTwo.getInstance().setTransparencyOut(strs, fltValue);
     
      for (int i=0; i<strs.length; i++)
      {
        super.setChanged();
        Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimTwo(strs[i], EnuEvtDspRndWwdEarthDimTwo.TRANSPARENCY_OUT, flo);
        super.notifyObservers(objEvt);
      }
   }
  
   @Override
   public void setKindAnnotationDefault(String strValue, boolean blnApplyToAll) throws Exception
   {
      GfrWrpRndDftWwdEarthShpDimTwoSct.getInstance().setKindAnnotation(strValue);
     
      if (! blnApplyToAll)
         return;
     
      String[] strs = GfrWrpBasTopSynEclScts.getInstance().getIdsTlo();
      GfrWrpBasPrsDspPrjRndWwdEarthShpDimTwo.getInstance().setKindAnnotation(strs, strValue);
     
      for (int i=0; i<strs.length; i++)
      {
        super.setChanged();
        Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimTwo(strs[i], EnuEvtDspRndWwdEarthShp.ANNOTATION, strValue);
        super.notifyObservers(objEvt);
      }
   }

   @Override
   public void setTooltipDefault(boolean blnValue, boolean blnApplyToAll) throws Exception
   {
      GfrWrpRndDftWwdEarthShpDimTwoSct.getInstance().setTooltip(blnValue);
     
      if (! blnApplyToAll)
         return;
     
      Boolean boo = Boolean.valueOf(blnValue);
     
      String[] strs = GfrWrpBasTopSynEclScts.getInstance().getIdsTlo();
      GfrWrpBasPrsDspPrjRndWwdEarthShpDimTwo.getInstance().setTooltip(strs, blnValue);
     
      for (int i=0; i<strs.length; i++)
      {
        super.setChanged();
        Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimTwo(strs[i], EnuEvtDspRndWwdEarthShp.TOOLTIP, boo);
        super.notifyObservers(objEvt);
      }
   }
  
   // beg private
  
   private GfrMdlDspRndWwdEarthShpDimTwoSct()
   {
      super();
   }

  
}
TOP

Related Classes of org.geoforge.mdldspecl.render.wwd.GfrMdlDspRndWwdEarthShpDimTwoSct

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.