//==============================================================================
// 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 resources.InsurancePlan;
import repast.simphony.visualizationOGL2D.StyleOGL2D;
import saf.v3d.ShapeFactory2D;
import saf.v3d.scene.Position;
import saf.v3d.scene.VSpatial;


public class InsurancePlanStyle implements StyleOGL2D<InsurancePlan>
{
    private ShapeFactory2D shapeFactory;

//==============================================================================
// Method: These first methods implement the label methods of StyleOGL2D.
//------------------------------------------------------------------------------
    @Override
    public String getLabel(InsurancePlan insurancePlan)
    {

        return (insurancePlan.getAgentName());

    }

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

    @Override
    public float getLabelXOffset(InsurancePlan insurancePlan)
    {
        return 0;
    }

    @Override
    public float getLabelYOffset(InsurancePlan insurancePlan)
    {
        return 0;
    }

    @Override
    public Position getLabelPosition(InsurancePlan insurancePlan)
    {
        return Position.SOUTH;
    }

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


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

//==============================================================================
// This method sets the color of the disk representing the InsurancePlan.
// 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(InsurancePlan insurancePlan)
    {
    	if (insurancePlan.getInsurancePlanIDString().equals("InsurancePlan0"))
    		return new Color (58, 102, 156); //Dark blue;
    	else if (insurancePlan.getInsurancePlanIDString().equals("InsurancePlan1"))
    		return new Color (140, 173, 212); //Light blue;
    	else if (insurancePlan.getInsurancePlanIDString().equals("InsurancePlan2"))
    		return new Color (184, 88, 88); //Dark orange;
    	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(InsurancePlan insurancePlan)
    {
     	return (float) 1.00;
    }


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

    }

    @Override
    public Color getBorderColor(InsurancePlan insurancePlan)
    {

            return new Color (0, 0, 255); //Blue

    }

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

    @Override
    public float getRotation(InsurancePlan insurancePlan)
    {
        return 0;
    }
    
}//end InsurancePlanStyle class