//==============================================================================
// The Society of Actuaries (SOA) makes this computer model and its computer
// code available to its members for educational purposes. The model and its
// code may be modified and redistributed without prior authorization from the
// SOA. The SOA distributes this computer model and its computer code 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.
//==============================================================================

package styles;

//==============================================================================
//Import statements
//------------------------------------------------------------------------------
import java.awt.Color;
import java.awt.Font;
import agents.HealthInsuranceCompany;
import repast.simphony.visualizationOGL2D.StyleOGL2D;
import resources.Constants;
import saf.v3d.ShapeFactory2D;
import saf.v3d.scene.Position;
import saf.v3d.scene.VSpatial;

public class HealthInsuranceCompanyStyle implements StyleOGL2D<HealthInsuranceCompany>
{
    private ShapeFactory2D shapeFactory;

//==============================================================================
// Method: These first methods implement the label methods of StyleOGL2D.
//------------------------------------------------------------------------------
    @Override
    public String getLabel(HealthInsuranceCompany healthInsuranceCompany)
    {
        return healthInsuranceCompany.getAgentName();
    }

    @Override
    public Font getLabelFont(HealthInsuranceCompany healthInsuranceCompany)
    {
        return new Font("sansserif", Font.BOLD, 30);
    }

    @Override
    public float getLabelXOffset(HealthInsuranceCompany healthInsuranceCompany)
    {
        return (float) 0.0;
    }

    @Override
    public float getLabelYOffset(HealthInsuranceCompany healthInsuranceCompany)
    {
        return (float) 0.0;
    }

    @Override
    public Position getLabelPosition(HealthInsuranceCompany healthInsuranceCompany)
    {
        return Position.SOUTH;
    }

    @Override
    public Color getLabelColor(HealthInsuranceCompany healthInsuranceCompany)
    {
        return new Color (0, 0, 0); //Black
    }
//==============================================================================


//==============================================================================
// This method sets the shape of the icon representing the HealthInsuranceCompany to a circle.
//------------------------------------------------------------------------------
    @Override
    public VSpatial getVSpatial(HealthInsuranceCompany healthInsuranceCompany, VSpatial spatial)
    {
        
         return shapeFactory.createRectangle(75, 75);
    }

//==============================================================================
// This method sets the color of the disk representing the HealthInsuranceCompany.
// The color is given by the triplet (Red, Green, Blue),
// where Red, Green, and Blue are integers between 0 and 255.
// Colors for Repast are represented in the standard Red/Green/Blue format.
//------------------------------------------------------------------------------
    @Override
    public Color getColor(HealthInsuranceCompany healthInsuranceCompany)
    {
        if (healthInsuranceCompany.getAgentID().getAgentNumber() == Constants.HEALTH_INSURANCE_COMPANY_A)
            return new Color (140, 173, 212); //Light blue;
        else return new Color (249, 184, 131); //Light orange;
    }

//==============================================================================
// This method sets the scale parameter for the rectangle representing the
// insurance plan.
//------------------------------------------------------------------------------
    @Override
    public float getScale(HealthInsuranceCompany healthInsuranceCompany)
    {
        return (float) 1.00;
    }


//==============================================================================
// These methods set the disk border representing the HealthInsuranceCompany.
// If the healthInsuranceCompany is participating in the HealthInsuranceCompany, the border is blue.
//------------------------------------------------------------------------------
    @Override
    public int getBorderSize(HealthInsuranceCompany healthInsuranceCompany)
    {
            return 0;

    }

    @Override
    public Color getBorderColor(HealthInsuranceCompany healthInsuranceCompany)
    {

            return new Color (150, 150, 150); //Dark gray

    }

//==============================================================================
// Method: These are general methods implementing StyleOGL2D.
//------------------------------------------------------------------------------
    @Override
    public void init(ShapeFactory2D shapeFactory)
    {
        this.shapeFactory = shapeFactory;
    }

    @Override
    public float getRotation(HealthInsuranceCompany healthInsuranceCompany)
    {
        return 0;
    }
    
}//end HealthInsuranceCompanyStyle class