
package jp.riken.brain.ni.samuraigraph.figure.java2d;

import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D;

import jp.riken.brain.ni.samuraigraph.figure.SGDrawingElementArrow;
import jp.riken.brain.ni.samuraigraph.figure.SGDrawingElementErrorBar;
import jp.riken.brain.ni.samuraigraph.figure.SGILineConstants;

/**
 * 
 *
 */
public class SGDrawingElementErrorBar2D extends SGDrawingElementErrorBar
	implements SGIDrawingElementJava2D
{

	/**
	 * 
	 */
	public SGDrawingElementErrorBar2D()
	{
		super();
	}


	/**
	 * 
	 */
	public boolean contains(int x, int y)
	{
		return this.getArrow().contains(x,y);
	}


	/**
	 * 
	 */
	public void paintElement( Graphics2D g2d )
	{
		((SGDrawingElementArrow2D)this.getArrow()).paintElement(g2d);
	}


	/**
	 * 
	 * @param g2d
	 * @param rect
	 */
	public void paint( Graphics2D g2d, Rectangle2D rect )
	{
		((SGDrawingElementArrow2D)this.getArrow()).paint(g2d,rect);
	}


	/**
	 * 
	 */
	public Rectangle2D getElementBounds()
	{
		return ((SGDrawingElementArrow2D)this.getArrow()).getElementBounds();
	}

	/**
	 * 
	 */
	protected SGDrawingElementArrow createArrowInstance()
	{
		SGDrawingElementArrow arrow =  new SGDrawingElementArrow2D();
		arrow.setLineType( SGILineConstants.LINE_TYPE_SOLID );
		return arrow;
	}
}

