/*---------------------------------------------------------------------------
File:         			Separator.java
Package:                        JFLAP Version 3.0
Author:			        Eric Gramond 
                                
Description of Contents:	Contains class Separator.
				
--------------------------------------------------------------------------*/

/* 
 * Susan H. Rodger, Magda Procopiuc, Octavian Procopiuc, Eric Gramond
 * Computer Science Department
 * Duke University
 * June 1998
 * Supported by National Science Foundation DUE-9596002 and DUE-9555084.
 *
 * Copyright (c) 1998
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms are permitted
 * provided that the above copyright notice and this paragraph are
 * duplicated in all such forms and that any documentation,
 * advertising materials, and other materials related to such
 * distribution and use acknowledge that the software was developed
 * by the author.  The name of the author may not be used to
 * endorse or promote products derived from this software without
 * specific prior written permission.
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */
package flap;

import java.awt.*;
import java.awt.image.*;
import java.awt.event.*;
import java.io.*;
import java.net.URL;
import java.util.*;

/**
 * this class is one of these cute little lines that can be used as a separator
 * between two parts of a window. The line is horizontal.
 */

public class Separator extends Canvas {


    /** 
     * the constructor. nothing to do.
     */
    public Separator() {}


    /**
     * paint the little indented line on my graphics
     */
    public void paint(Graphics g) {
	
	Dimension d = this.getSize();
	int x = d.width;
	int startx = x/40;
	int endx = startx*39;
	if(x > endx  || x < startx)
	    x = startx;
	
	g.setColor(Color.black);
	g.drawLine(startx,0,endx,0);
	g.setColor(Color.white);
	g.drawLine(startx,1,endx,1);
	g.setColor(Color.gray.darker());
	g.drawLine(startx,1, startx,1);
    }
}
