home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / VCafe / prosrc.bin / Spacer.java < prev    next >
Encoding:
Java Source  |  1998-03-18  |  2.8 KB  |  70 lines

  1. /*
  2.  * Copyright (c) 1996 Krumel & Associates, Inc. All Rights Reserved.
  3.  *
  4.  * www.krumel.com - controls@krumel.com
  5.  *
  6.  * Permission is given to the buyer of this package for one software
  7.  * developer to use this software on one CPU (one workstation) and to make
  8.  * one backup copy.  You may uitilize and/or midfy this class for use in your
  9.  * projects.  You may distribute or sell any executable which results from
  10.  * using this code in yur application, except a utility or class of similar
  11.  * nature to this product.  You may distribute this this product in compiled
  12.  * form only, but soley to be used with your cmpiled executable product
  13.  * for the puposes of dynamic loading. You may NOT redistribute the source
  14.  * code in any form or make it accessible through a network or other
  15.  * distribution media to others. Please refer to the file "copyright.html"
  16.  * for further important copyright and licensing information.
  17.  *
  18.  * The source code is the confidential and proprietary information
  19.  * of Krumel & Associates, Inc. ("Confidential Information").  You shall
  20.  * not disclose such Confidential Information and shall use it only in
  21.  * accordance with the terms of the license agreement you entered into
  22.  * with Krumel & Associates, Inc..
  23.  
  24.  * KRUMEL & ASSOCIATES MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
  25.  * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT
  26.  * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  27.  * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. KRUMEL & ASSOCIATES SHALL NOT
  28.  * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING,
  29.  * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
  30.  */
  31.  
  32. package symantec.itools.db.awt.awt;
  33.  
  34. import java.awt.*;
  35.  
  36. /**
  37.  * Class provides the spacer at the bottom corner of controls.
  38.  *
  39.  * @version 1.0   March 15, 1997
  40.  * @author  Andy Krumel
  41.  */
  42. public class Spacer extends Canvas {
  43.     public Spacer() { setBackground(Color.lightGray); }
  44.  
  45.     public void paint(Graphics g) {
  46.         Dimension size = getSize();
  47.  
  48.         g.setColor(getBackground());
  49.         g.fillRect(0, 0, size.width-1, size.height-1);
  50.         g.setColor(getForeground());
  51.         g.drawLine(0, size.height-1, size.width-1, size.height-1);
  52.         g.drawLine(size.width-1, 0, size.width-1, size.height-1);
  53.     }
  54.  
  55.     public void print(Graphics g) {
  56.         if (g instanceof PrintGraphics) {
  57.             Dimension size = getSize();
  58.  
  59.             g.setColor(getBackground());
  60.             g.fillRect(0, 0, size.width-1, size.height-1);
  61.             g.setColor(getForeground());
  62.             g.drawLine(0, size.height-1, size.width-1, size.height-1);
  63.             g.drawLine(size.width-1, 0, size.width-1, size.height-1);
  64.         } else {
  65.             paint(g);
  66.         }
  67.     }
  68. }
  69.  
  70.