/* * * FileName: RectButton.java * * * $Author: konki $ * Author(s): konki * * * Objective: extend WBButton to be able to draw a Rectangle in it * * * $Log: RectButton.java,v $ # Revision 1.1 1996/03/11 20:56:22 konki # Initial revision # * Change Log: * Created on Sat Mar 9 14:02:23 EST 1996 * Changes: Date Initials * * Notes: * $Id: RectButton.java,v 1.1 1996/03/11 20:56:22 konki Exp $ * */ package wb; import java.awt.*; /** * RectButton extends WBButton and draw a rectangle in the small canvas * alloted to display the intention of this button */ public class RectButton extends WBButton { /** * Creates an instance of RectButton with its label string used * for display on the status bar * @param name String containing the label of this button * @param above the WBDrawPanel which holds this button and * understands the type "RECTS" and displays the * label in its status line */ public RectButton(String name, WBDrawPanel above) { super( name, above, false); type = RECTS; } /** * Creates an instance of RectButton with its label string used * for display on the status bar * @param name String containing the label of this button * @param above the WBDrawPanel which holds this button and * understands the type "RECTS" and displays the * label in its status line * @param displaytext boolean to show the label */ public RectButton(String name, WBDrawPanel above, boolean displaytext) { super( name, above, displaytext); type = RECTS; } /** * Overides the parents draw method to draw the required in the * rectangular region. In this case it draw a Rectangle * @param g Graphics */ protected void draw( Graphics g ) { g.setColor(Color.blue); g.drawRect( 10, 10, 20, 10); } } /* * End of File: RectButton.java */