/*
* 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.EnuEvtDspRndWwdEarthShpDimOne;
import org.geoforge.mdldsp.event.render.wwd.EnuEvtDspRndWwdEarthShpDimOneSegmentWise;
import org.geoforge.mdldsp.event.render.wwd.GfrEvtMdlIdDspRndWwdEarthShpDimOneSegWise;
import org.geoforge.mdldsp.render.wwd.GfrMdlDspRndWwdEarthShpDimOneSegWiseAbs;
import org.geoforge.wrpbasprsdsp.render.wwd.GfrWrpBasPrsDspPrjRndWwdEarthShpDimOneSegmentWiseYes;
import org.geoforge.wrpbasprsdspecl.render.wwd.GfrWrpRndDftWwdEarthShpDimOneLineSegWiseYesEcl;
import org.geoforge.wrpbasprssynecl.GfrWrpBasTopSynEclSegsWiseYes;
/**
*
* @author Amadeus.Sowerby
*
* email: Amadeus.Sowerby_AT_gmail.com ... please remove "_AT_" from the above
* string to get the right email address
*/
public class GfrMdlDspRndWwdEarthShpDimOneSegWiseYesEcl extends GfrMdlDspRndWwdEarthShpDimOneSegWiseAbs
{
static private GfrMdlDspRndWwdEarthShpDimOneSegWiseYesEcl _INSTANCE_;
static public GfrMdlDspRndWwdEarthShpDimOneSegWiseYesEcl getInstance()
{
if (_INSTANCE_ == null)
{
_INSTANCE_ = new GfrMdlDspRndWwdEarthShpDimOneSegWiseYesEcl();
}
return _INSTANCE_;
}
// beg public
@Override
public void setThickness(String strId, int intValue,
boolean blnApplyToAll, boolean blnSetAsDefault) throws Exception
{
if (blnSetAsDefault)
GfrWrpRndDftWwdEarthShpDimOneLineSegWiseYesEcl.getInstance().setThickness(intValue);
Integer itgValue = new Integer(intValue);
if (blnApplyToAll)
{
String[] strs = GfrWrpBasTopSynEclSegsWiseYes.getInstance().getIdsTlo();
GfrWrpBasPrsDspPrjRndWwdEarthShpDimOneSegmentWiseYes.getInstance().setThickness(strs, intValue);
for (int i=0; i<strs.length; i++)
{
super.setChanged();
Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimOneSegWise(strs[i], EnuEvtDspRndWwdEarthShpDimOneSegmentWise.THICKNESS, itgValue);
super.notifyObservers(objEvt);
}
}
else
{
GfrWrpBasPrsDspPrjRndWwdEarthShpDimOneSegmentWiseYes.getInstance().setThickness(strId, intValue);
super.setChanged();
Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimOneSegWise(strId, EnuEvtDspRndWwdEarthShpDimOneSegmentWise.THICKNESS, itgValue);
super.notifyObservers(objEvt);
}
}
@Override
public void setColor(String strId, Color colValue,
boolean blnApplyToAll, boolean blnSetAsDefault) throws Exception
{
if (colValue == null)
throw new Exception("colValue == null");
if (blnSetAsDefault)
GfrWrpRndDftWwdEarthShpDimOneLineSegWiseYesEcl.getInstance().setColor(colValue);
if (blnApplyToAll)
{
String[] strs = GfrWrpBasTopSynEclSegsWiseYes.getInstance().getIdsTlo();
GfrWrpBasPrsDspPrjRndWwdEarthShpDimOneSegmentWiseYes.getInstance().setColor(strs, colValue);
for (int i=0; i<strs.length; i++)
{
super.setChanged();
Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimOneSegWise(strs[i], EnuEvtDspRndWwdEarthShpDimOne.COLOR, colValue);
super.notifyObservers(objEvt);
}
}
else
{
GfrWrpBasPrsDspPrjRndWwdEarthShpDimOneSegmentWiseYes.getInstance().setColor(strId, colValue);
super.setChanged();
Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimOneSegWise(strId, EnuEvtDspRndWwdEarthShpDimOne.COLOR, colValue);
super.notifyObservers(objEvt);
}
}
@Override
public void setTransparency(String strId, float fltValue,
boolean blnApplyToAll, boolean blnSetAsDefault) throws Exception
{
if (blnSetAsDefault)
GfrWrpRndDftWwdEarthShpDimOneLineSegWiseYesEcl.getInstance().setTransparency(fltValue);
Float flo = new Float(fltValue);
if (blnApplyToAll)
{
String[] strs = GfrWrpBasTopSynEclSegsWiseYes.getInstance().getIdsTlo();
GfrWrpBasPrsDspPrjRndWwdEarthShpDimOneSegmentWiseYes.getInstance().setTransparency(strs, fltValue);
for (int i=0; i<strs.length; i++)
{
super.setChanged();
Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimOneSegWise(strs[i], EnuEvtDspRndWwdEarthShpDimOne.TRANSPARENCY, flo);
super.notifyObservers(objEvt);
}
}
else
{
GfrWrpBasPrsDspPrjRndWwdEarthShpDimOneSegmentWiseYes.getInstance().setTransparency(strId, fltValue);
super.setChanged();
Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimOneSegWise(strId, EnuEvtDspRndWwdEarthShpDimOne.TRANSPARENCY, flo);
super.notifyObservers(objEvt);
}
}
@Override
public void setKindAnnotation(String strId, String strValue,
boolean blnApplyToAll, boolean blnSetAsDefault) throws Exception
{
if (blnSetAsDefault)
GfrWrpRndDftWwdEarthShpDimOneLineSegWiseYesEcl.getInstance().setKindAnnotation(strValue);
if (blnApplyToAll)
{
String[] strs = GfrWrpBasTopSynEclSegsWiseYes.getInstance().getIdsTlo();
GfrWrpBasPrsDspPrjRndWwdEarthShpDimOneSegmentWiseYes.getInstance().setKindAnnotation(strs, strValue);
for (int i=0; i<strs.length; i++)
{
super.setChanged();
Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimOneSegWise(strs[i], EnuEvtDspRndWwdEarthShp.ANNOTATION, strValue);
super.notifyObservers(objEvt);
}
}
else
{
GfrWrpBasPrsDspPrjRndWwdEarthShpDimOneSegmentWiseYes.getInstance().setKindAnnotation(strId, strValue);
super.setChanged();
Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimOneSegWise(strId, EnuEvtDspRndWwdEarthShp.ANNOTATION, strValue);
super.notifyObservers(objEvt);
}
}
@Override
public void setTooltip(String strId, boolean blnValue,
boolean blnApplyToAll, boolean blnSetAsDefault) throws Exception
{
if (blnSetAsDefault)
GfrWrpRndDftWwdEarthShpDimOneLineSegWiseYesEcl.getInstance().setTooltip(blnValue);
Boolean boo = Boolean.valueOf(blnValue);
if (blnApplyToAll)
{
String[] strs = GfrWrpBasTopSynEclSegsWiseYes.getInstance().getIdsTlo();
GfrWrpBasPrsDspPrjRndWwdEarthShpDimOneSegmentWiseYes.getInstance().setTooltip(strs, blnValue);
for (int i=0; i<strs.length; i++)
{
super.setChanged();
Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimOneSegWise(strs[i], EnuEvtDspRndWwdEarthShp.TOOLTIP, boo);
super.notifyObservers(objEvt);
}
}
else
{
GfrWrpBasPrsDspPrjRndWwdEarthShpDimOneSegmentWiseYes.getInstance().setTooltip(strId, blnValue);
super.setChanged();
Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimOneSegWise(strId, EnuEvtDspRndWwdEarthShp.TOOLTIP, boo);
super.notifyObservers(objEvt);
}
}
// default
@Override
public void setThicknessDefault(int intValue, boolean blnApplyToAll) throws Exception
{
GfrWrpRndDftWwdEarthShpDimOneLineSegWiseYesEcl.getInstance().setThickness(intValue);
if (! blnApplyToAll)
return;
String[] strs = GfrWrpBasTopSynEclSegsWiseYes.getInstance().getIdsTlo();
GfrWrpBasPrsDspPrjRndWwdEarthShpDimOneSegmentWiseYes.getInstance().setThickness(strs, intValue);
Integer itgValue = new Integer(intValue);
for (int i=0; i<strs.length; i++)
{
super.setChanged();
Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimOneSegWise(strs[i], EnuEvtDspRndWwdEarthShpDimOneSegmentWise.THICKNESS, itgValue);
super.notifyObservers(objEvt);
}
}
@Override
public void setColorDefault(Color colValue, boolean blnApplyToAll) throws Exception
{
GfrWrpRndDftWwdEarthShpDimOneLineSegWiseYesEcl.getInstance().setColor(colValue);
if (! blnApplyToAll)
return;
String[] strs = GfrWrpBasTopSynEclSegsWiseYes.getInstance().getIdsTlo();
if (colValue != null)
{
GfrWrpBasPrsDspPrjRndWwdEarthShpDimOneSegmentWiseYes.getInstance().setColor(strs, colValue);
for (int i=0; i<strs.length; i++)
{
super.setChanged();
Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimOneSegWise(strs[i], EnuEvtDspRndWwdEarthShpDimOne.COLOR, colValue);
super.notifyObservers(objEvt);
}
return;
}
// random color
for (int i=0; i<strs.length; i++)
{
Color colCur = GfrColorFactory.s_getRandom();
GfrWrpBasPrsDspPrjRndWwdEarthShpDimOneSegmentWiseYes.getInstance().setColor(strs[i], colCur);
super.setChanged();
Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimOneSegWise(strs[i], EnuEvtDspRndWwdEarthShpDimOne.COLOR, colCur);
super.notifyObservers(objEvt);
}
}
@Override
public void setTransparencyDefault(float fltValue, boolean blnApplyToAll) throws Exception
{
GfrWrpRndDftWwdEarthShpDimOneLineSegWiseYesEcl.getInstance().setTransparency(fltValue);
if (! blnApplyToAll)
return;
Float flo = new Float(fltValue);
String[] strs = GfrWrpBasTopSynEclSegsWiseYes.getInstance().getIdsTlo();
GfrWrpBasPrsDspPrjRndWwdEarthShpDimOneSegmentWiseYes.getInstance().setTransparency(strs, fltValue);
for (int i=0; i<strs.length; i++)
{
super.setChanged();
Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimOneSegWise(strs[i], EnuEvtDspRndWwdEarthShpDimOne.TRANSPARENCY, flo);
super.notifyObservers(objEvt);
}
}
@Override
public void setKindAnnotationDefault(String strValue, boolean blnApplyToAll) throws Exception
{
GfrWrpRndDftWwdEarthShpDimOneLineSegWiseYesEcl.getInstance().setKindAnnotation(strValue);
if (! blnApplyToAll)
return;
String[] strs = GfrWrpBasTopSynEclSegsWiseYes.getInstance().getIdsTlo();
GfrWrpBasPrsDspPrjRndWwdEarthShpDimOneSegmentWiseYes.getInstance().setKindAnnotation(strs, strValue);
for (int i=0; i<strs.length; i++)
{
super.setChanged();
Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimOneSegWise(strs[i], EnuEvtDspRndWwdEarthShp.ANNOTATION, strValue);
super.notifyObservers(objEvt);
}
}
@Override
public void setTooltipDefault(boolean blnValue, boolean blnApplyToAll) throws Exception
{
GfrWrpRndDftWwdEarthShpDimOneLineSegWiseYesEcl.getInstance().setTooltip(blnValue);
if (! blnApplyToAll)
return;
Boolean boo = Boolean.valueOf(blnValue);
String[] strs = GfrWrpBasTopSynEclSegsWiseYes.getInstance().getIdsTlo();
GfrWrpBasPrsDspPrjRndWwdEarthShpDimOneSegmentWiseYes.getInstance().setTooltip(strs, blnValue);
for (int i=0; i<strs.length; i++)
{
super.setChanged();
Object objEvt = new GfrEvtMdlIdDspRndWwdEarthShpDimOneSegWise(strs[i], EnuEvtDspRndWwdEarthShp.TOOLTIP, boo);
super.notifyObservers(objEvt);
}
}
// beg private
private GfrMdlDspRndWwdEarthShpDimOneSegWiseYesEcl()
{
super();
}
}