/*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
package org.geoforge.guillc.panel;
import java.awt.Dimension;
import java.awt.event.ActionListener;
import javax.swing.Box;
import javax.swing.BoxLayout;
import org.geoforge.guillc.combobox.GfrCmb;
import org.geoforge.lang.util.geography.GfrUtilUtm;
/**
*
* @author Amadeus.Sowerby
*
* email: Amadeus.Sowerby_AT_gmail.com
* ... please remove "_AT_" from the above string to get the right email address
*
*
* !!! NOTION OF COMBOBOX AND DOES NOT T DERIVE FROM GfrPnlGrpSngCmbAbs !!!!!!!!!!!!!!!!!!!!!!!!
*/
public class GfrPnlGrpChoiceUtmZoneHemisphere extends GfrPnlGrpAbs
{
//beg static private
static private String[] _STRS_CHOICE_ZONE_ = new String[60];
static
{
for (int i = 0; i < 60; i++)
{
_STRS_CHOICE_ZONE_[i] = Integer.toString(i + 1);
}
}
//--end static private
//--
//
//--
//--beg private fields
private GfrCmb _cmbChoiceZone_;
private GfrCmb _cmbChoiceHemisphere;
private GfrPnl _pnlContent_;
//--end private fields
//--
//--
//--beg public methods
public String getHemisphere()
{
return this._cmbChoiceHemisphere.getSelectedItem().toString();
}
public int getZone()
{
return Integer.parseInt(this._cmbChoiceZone_.getSelectedItem().toString());
}
public GfrPnlGrpChoiceUtmZoneHemisphere(String strWhat)
{
super(strWhat,
GfrCmb.INT_HEIGHT);
this._cmbChoiceZone_ = new GfrCmb(
GfrPnlGrpChoiceUtmZoneHemisphere._STRS_CHOICE_ZONE_);
this._cmbChoiceZone_.addActionListener((ActionListener) this);
this._cmbChoiceHemisphere = new GfrCmb(GfrUtilUtm.STRS_HEMISPHERE);
this._cmbChoiceHemisphere.addActionListener((ActionListener) this);
this._pnlContent_ = new GfrPnl();
}
@Override
public boolean init()
{
if (!super.init())
return false;
if (!this._pnlContent_.init())
return false;
if (!this._cmbChoiceZone_.init())
return false;
if (!this._cmbChoiceHemisphere.init())
return false;
this._pnlContent_.setLayout(new BoxLayout(this._pnlContent_, BoxLayout.LINE_AXIS));
this._pnlContent_.add(this._cmbChoiceZone_);
this._pnlContent_.add(Box.createRigidArea(new Dimension(5, 0)));
this._pnlContent_.add(this._cmbChoiceHemisphere);
super.add(this._pnlContent_);
return true;
}
//end public methods
@Override
public void destroy()
{
if (this._pnlContent_ != null)
{
this._pnlContent_.destroy();
this._pnlContent_ = null;
}
if (this._cmbChoiceZone_ != null)
{
this._cmbChoiceZone_.destroy();
this._cmbChoiceZone_ = null;
}
if (this._cmbChoiceHemisphere != null)
{
this._cmbChoiceHemisphere.destroy();
this._cmbChoiceHemisphere = null;
}
super.destroy();
}
}