/*
* 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.GfrWrpRndDftWwdEarthShpDimTwoAre;
import org.geoforge.wrpbasprssynecl.GfrWrpBasTopSynEclAres;
/**
*
* @author bgwilliams71
*
* email: bgwilliams71_AT_gmail.com
* ... please remove "_AT_" from the above string to get the right email address
*/
public class GfrMdlDspRndWwdEarthShpDimTwoAre extends GfrMdlDspRndWwdEarthShpDimTwoAbs
{
static private GfrMdlDspRndWwdEarthShpDimTwoAre _INSTANCE_;
static public GfrMdlDspRndWwdEarthShpDimTwoAre getInstance()
{
if (_INSTANCE_ == null)
{
_INSTANCE_ = new GfrMdlDspRndWwdEarthShpDimTwoAre();
}
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)
GfrWrpRndDftWwdEarthShpDimTwoAre.getInstance().setColorIn(colValue);
if (blnApplyToAll)
{
String[] strs = GfrWrpBasTopSynEclAres.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)
GfrWrpRndDftWwdEarthShpDimTwoAre.getInstance().setTransparencyIn(fltValue);
Float flo = new Float(fltValue);
if (blnApplyToAll)
{
String[] strs = GfrWrpBasTopSynEclAres.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)
GfrWrpRndDftWwdEarthShpDimTwoAre.getInstance().setColorOut(colValue);
if (blnApplyToAll)
{
String[] strs = GfrWrpBasTopSynEclAres.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)
GfrWrpRndDftWwdEarthShpDimTwoAre.getInstance().setTransparencyOut(fltValue);
Float flo = new Float(fltValue);
if (blnApplyToAll)
{
String[] strs = GfrWrpBasTopSynEclAres.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)
GfrWrpRndDftWwdEarthShpDimTwoAre.getInstance().setKindAnnotation(strValue);
if (blnApplyToAll)
{
String[] strs = GfrWrpBasTopSynEclAres.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)
GfrWrpRndDftWwdEarthShpDimTwoAre.getInstance().setTooltip(blnValue);
Boolean boo = Boolean.valueOf(blnValue);
if (blnApplyToAll)
{
String[] strs = GfrWrpBasTopSynEclAres.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
{
GfrWrpRndDftWwdEarthShpDimTwoAre.getInstance().setColorIn(colValue);
if (! blnApplyToAll)
return;
String[] strs = GfrWrpBasTopSynEclAres.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
{
GfrWrpRndDftWwdEarthShpDimTwoAre.getInstance().setTransparencyIn(fltValue);
if (! blnApplyToAll)
return;
Float flo = new Float(fltValue);
String[] strs = GfrWrpBasTopSynEclAres.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
{
GfrWrpRndDftWwdEarthShpDimTwoAre.getInstance().setColorOut(colValue);
if (! blnApplyToAll)
return;
String[] strs = GfrWrpBasTopSynEclAres.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
{
GfrWrpRndDftWwdEarthShpDimTwoAre.getInstance().setTransparencyOut(fltValue);
if (! blnApplyToAll)
return;
Float flo = new Float(fltValue);
String[] strs = GfrWrpBasTopSynEclAres.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
{
GfrWrpRndDftWwdEarthShpDimTwoAre.getInstance().setKindAnnotation(strValue);
if (! blnApplyToAll)
return;
String[] strs = GfrWrpBasTopSynEclAres.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
{
GfrWrpRndDftWwdEarthShpDimTwoAre.getInstance().setTooltip(blnValue);
if (! blnApplyToAll)
return;
Boolean boo = Boolean.valueOf(blnValue);
String[] strs = GfrWrpBasTopSynEclAres.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 GfrMdlDspRndWwdEarthShpDimTwoAre()
{
super();
}
}