home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1998 November
/
Chip_1998-11_cd.bin
/
tema
/
Cafe
/
jfc.bin
/
EmptyBorder.java
< prev
next >
Wrap
Text File
|
1998-02-26
|
3KB
|
92 lines
/*
* @(#)EmptyBorder.java 1.15 98/02/02
*
* Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
*
* This software is the confidential and proprietary information of Sun
* Microsystems, Inc. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered into
* with Sun.
*
* SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
* SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
* SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
* THIS SOFTWARE OR ITS DERIVATIVES.
*
*/
package com.sun.java.swing.border;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Rectangle;
import java.awt.Component;
import java.io.Serializable;
/**
* A class which provides an empty, transparent border which
* takes up space but does no drawing.
* <p>
* Warning: serialized objects of this class will not be compatible with
* future swing releases. The current serialization support is appropriate
* for short term storage or RMI between Swing1.0 applications. It will
* not be possible to load serialized Swing1.0 objects with future releases
* of Swing. The JDK1.2 release of Swing will be the compatibility
* baseline for the serialized form of Swing objects.
*
* @version 1.15 02/02/98
* @author David Kloba
*/
public class EmptyBorder extends AbstractBorder implements Serializable
{
protected int left, right, top, bottom;
/**
* Creates an empty border with the specified insets.
* @param top the top inset of the border
* @param left the left inset of the border
* @param bottom the bottom inset of the border
* @param right the right inset of the border
*/
public EmptyBorder(int top, int left, int bottom, int right) {
this.top = top;
this.right = right;
this.bottom = bottom;
this.left = left;
}
/**
* Creates an empty border with the specified insets.
* @param insets the insets of the border
*/
public EmptyBorder(Insets insets) {
this.top = insets.top;
this.right = insets.right;
this.bottom = insets.bottom;
this.left = insets.left;
}
/**
* Does no drawing by default.
*/
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
}
/**
* Returns the insets of the border.
* @param c the component for which this border insets value applies
*/
public Insets getBorderInsets(Component c) {
return new Insets(top, left, bottom, right);
}
/**
* Returns whether or not the border is opaque.
* Returns false by default.
*/
public boolean isBorderOpaque() { return false; }
}