This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.swing.border
class MatteBorder

java.lang.Object extended by javax.swing.border.AbstractBorder extended by javax.swing.border.EmptyBorder extended by javax.swing.border.MatteBorder
All Implemented Interfaces:
Serializable, Border
Direct Known Subclasses:
BorderUIResource.MatteBorderUIResource

public class MatteBorder
extends EmptyBorder

A class which provides a matte-like border of either a solid color or a tiled icon.

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 applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see {@link java.beans.XMLEncoder}.


Field Summary
protected Color color
          
protected Icon tileIcon
          
 
Fields inherited from class javax.swing.border.EmptyBorder
bottom, left, right, top
 
Constructor Summary
MatteBorder(Icon tileIcon)

          Creates a matte border with the specified tile icon.
MatteBorder(Insets borderInsets, Color matteColor)

          Creates a matte border with the specified insets and color.
MatteBorder(Insets borderInsets, Icon tileIcon)

          Creates a matte border with the specified insets and tile icon.
MatteBorder(int top, int left, int bottom, int right, Color matteColor)

          Creates a matte border with the specified insets and color.
MatteBorder(int top, int left, int bottom, int right, Icon tileIcon)

          Creates a matte border with the specified insets and tile icon.
 
Method Summary
 Insets

          Returns the insets of the border.
 Insets

          Returns the insets of the border.
 Insets

          Reinitialize the insets parameter with this Border's current Insets.
 Color

          Returns the color used for tiling the border or null if a tile icon is being used.
 Icon

          Returns the icon used for tiling the border or null if a solid color is being used.
 boolean

          Returns whether or not the border is opaque.
 void
paintBorder(Component c, Graphics g, int x, int y, int width, int height)

          Paints the matte border.
 
Methods inherited from class javax.swing.border.EmptyBorder
getBorderInsets, getBorderInsets, getBorderInsets, isBorderOpaque, paintBorder
 
Methods inherited from class javax.swing.border.AbstractBorder
getBaseline, getBaselineResizeBehavior, getBorderInsets, getBorderInsets, getInteriorRectangle, getInteriorRectangle, isBorderOpaque, paintBorder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

color

protected Color color

tileIcon

protected Icon tileIcon
Constructor Detail

MatteBorder

public MatteBorder(Icon tileIcon)
Creates a matte border with the specified tile icon. The insets will be calculated dynamically based on the size of the tile icon, where the top and bottom will be equal to the tile icon's height, and the left and right will be equal to the tile icon's width.

Parameters:
tileIcon - the icon to be used for tiling the border

MatteBorder

public MatteBorder(Insets borderInsets,
                   Color matteColor)
Creates a matte border with the specified insets and color.

Parameters:
borderInsets - the insets of the border
matteColor - the color rendered for the border

MatteBorder

public MatteBorder(Insets borderInsets,
                   Icon tileIcon)
Creates a matte border with the specified insets and tile icon.

Parameters:
borderInsets - the insets of the border
tileIcon - the icon to be used for tiling the border

MatteBorder

public MatteBorder(int top,
                   int left,
                   int bottom,
                   int right,
                   Color matteColor)
Creates a matte border with the specified insets and color.

Parameters:
top - the top inset of the border
left - the left inset of the border
bottom - the bottom inset of the border
right - the right inset of the border
matteColor - the color rendered for the border

MatteBorder

public MatteBorder(int top,
                   int left,
                   int bottom,
                   int right,
                   Icon tileIcon)
Creates a matte border with the specified insets and tile icon.

Parameters:
top - the top inset of the border
left - the left inset of the border
bottom - the bottom inset of the border
right - the right inset of the border
tileIcon - the icon to be used for tiling the border
Method Detail

getBorderInsets

public Insets getBorderInsets()
Returns the insets of the border.

Overrides:
getBorderInsets in class EmptyBorder

getBorderInsets

public Insets getBorderInsets(Component c)
Returns the insets of the border.

Overrides:
getBorderInsets in class EmptyBorder
Parameters:
c - the component for which this border insets value applies

getBorderInsets

public Insets getBorderInsets(Component c,
                              Insets insets)
Reinitialize the insets parameter with this Border's current Insets.

Overrides:
getBorderInsets in class EmptyBorder
Parameters:
c - the component for which this border insets value applies
insets - the object to be reinitialized

getMatteColor

public Color getMatteColor()
Returns the color used for tiling the border or null if a tile icon is being used.


getTileIcon

public Icon getTileIcon()
Returns the icon used for tiling the border or null if a solid color is being used.


isBorderOpaque

public boolean isBorderOpaque()
Returns whether or not the border is opaque.

Overrides:
isBorderOpaque in class EmptyBorder

paintBorder

public void paintBorder(Component c,
                        Graphics g,
                        int x,
                        int y,
                        int width,
                        int height)
Paints the matte border.

Overrides:
paintBorder in class EmptyBorder
Parameters:
c
g
x
y
width
height


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.