package com.sap.dbmtk.demo;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;

import javax.swing.JComponent;

public class SapSeparator 
extends JComponent
{
	private static final long serialVersionUID = 1L;
	private static final Color SAP_YELLOW = new java.awt.Color(255, 189, 23);

	private int _thicknes = 5;
	public SapSeparator()
	{
	}

	public SapSeparator(int thicknes)
	{
		_thicknes = thicknes;
	}

	@Override
	public void paint(Graphics g)
	{
		super.paint(g);

		Dimension s = getSize();

		// HORIZONTAL
		int width  = s.width-1;
		int height = s.height-1;

		g.setColor(SAP_YELLOW);
		g.fillRect(0, 0, width, height);
//System.out.println("SapSeparator.paint(): g.fillRect(x=0, y=0, width="+width+", height="+height+");");
	}

	@Override
	public Dimension getPreferredSize()
	{
		return new Dimension(0, _thicknes);
	}

	@Override
	public Dimension getMinimumSize()
	{
		return new Dimension(0, _thicknes);
	}
}

