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


public class ExchangeStyle implements StyleOGL2D<Exchange>
{
    private ShapeFactory2D shapeFactory;

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

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

    @Override
    public float getLabelXOffset(Exchange exchange)
    {
        return 0;
    }

    @Override
    public float getLabelYOffset(Exchange exchange)
    {
        return (float) 0.0;
    }

    @Override
    public Position getLabelPosition(Exchange exchange)
    {
        return Position.SOUTH;
    }

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


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

//==============================================================================
// This method sets the color of the disk representing the Exchange.
// 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(Exchange exchange)
    {
    	return new Color (230, 230, 230); //Light gray;
    }

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


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

    }

    @Override
    public Color getBorderColor(Exchange exchange)
    {

            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(Exchange exchange)
    {
        return 0;
    }
    
}//end ExchangeStyle class