javax.swing.border
Class AbstractBorder
- Border, Serializable
An invisible zero-width border, serving as a base class for
implementing more interesting borders.
Insets | getBorderInsets(Component c) - Measures the width of this border.
|
Insets | getBorderInsets(Component c, Insets insets) - Determines the insets of this border.
|
Rectangle | getInteriorRectangle(Component c, int x, int y, int width, int height) - Returns a rectangle that covers the specified area minus this
border.
|
static Rectangle | getInteriorRectangle(Component c, Border b, int x, int y, int width, int height) - Returns a rectangle that covers the specified area minus a
border.
|
boolean | isBorderOpaque() - Determines whether or not this border is opaque.
|
void | paintBorder(Component c, Graphics g, int x, int y, int width, int height) - Performs nothing, because the default implementation provided by
this class is an invisible, zero-width border.
|
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
AbstractBorder
public AbstractBorder()
Constructs a new AbstractBorder.
getBorderInsets
public Insets getBorderInsets(Component c)
Measures the width of this border.
- getBorderInsets in interface Border
c
- the component whose border is to be measured.
- an Insets object whose
left
, right
,
top
and bottom
fields indicate the
width of the border at the respective edge, which is zero
for the default implementation provided by AbstractButton.
getBorderInsets
public Insets getBorderInsets(Component c,
Insets insets)
Determines the insets of this border. The implementation provided
by AbstractButton sets the left
, right
,
top
and bottom
fields of the passed
insets
parameter to zero.
c
- the component whose border is to be measured
- the same object that was passed for
insets
getInteriorRectangle
public Rectangle getInteriorRectangle(Component c,
int x,
int y,
int width,
int height)
Returns a rectangle that covers the specified area minus this
border. Components that wish to determine an area into which
they can safely draw without intersecting with a border might
want to use this helper method.
c
- the component in the center of this border.x
- the horizontal position of the border.y
- the vertical position of the border.width
- the width of the available area for the border.height
- the height of the available area for the border.
getInteriorRectangle
public static Rectangle getInteriorRectangle(Component c,
Border b,
int x,
int y,
int width,
int height)
Returns a rectangle that covers the specified area minus a
border. Components that wish to determine an area into which
they can safely draw without intersecting with a border might
want to use this helper method.
c
- the component in the center of this border.x
- the horizontal position of the border.y
- the vertical position of the border.width
- the width of the available area for the border.height
- the height of the available area for the border.
isBorderOpaque
public boolean isBorderOpaque()
Determines whether or not this border is opaque. An opaque border
fills every pixel in its area when painting. Partially
translucent borders must return false
, or ugly
artifacts can appear on screen. The default implementation
provided by AbstractBorder always returns false
.
- isBorderOpaque in interface Border
paintBorder
public void paintBorder(Component c,
Graphics g,
int x,
int y,
int width,
int height)
Performs nothing, because the default implementation provided by
this class is an invisible, zero-width border. Subclasses will
likely want to override this method, but they are not required
for doing so.
- paintBorder in interface Border
c
- the component whose border is to be painted.g
- the graphics for painting.x
- the horizontal position for painting the border.y
- the vertical position for painting the border.width
- the width of the available area for painting the border.height
- the height of the available area for painting the border.
AbstractBorder.java --
Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.