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


public class ProviderNetworkStyle implements StyleOGL2D<ProviderNetwork>
{
    private ShapeFactory2D shapeFactory;

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

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

    @Override
    public float getLabelXOffset(ProviderNetwork providerNetwork)
    {
        return 0;
    }

    @Override
    public float getLabelYOffset(ProviderNetwork providerNetwork)
    {
        return (float) 0.0;
    }

    @Override
    public Position getLabelPosition(ProviderNetwork providerNetwork)
    {
        return Position.WEST;
    }

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


//==============================================================================
// This method sets the shape of the icon representing the ProviderNetwork to a circle.
//------------------------------------------------------------------------------
    @Override
    public VSpatial getVSpatial(ProviderNetwork providerNetwork, VSpatial spatial)
    {
        
         return shapeFactory.createCircle(5, 100);
    }

//==============================================================================
// This method sets the color of the disk representing the ProviderNetwork.
// 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(ProviderNetwork providerNetwork)
    {
        if (providerNetwork.getAgentID().getAgentNumber() == Constants.PROVIDER_NETWORK_A)
            return new Color (58, 102, 156); //Dark blue;
        else return new Color (184, 88, 8); //Dark orange;

    }

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


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

    }

    @Override
    public Color getBorderColor(ProviderNetwork providerNetwork)
    {

            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(ProviderNetwork providerNetwork)
    {
        return 0;
    }
    
}//end ProviderNetworkStyle class