javax.swing.border
Class MatteBorder

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

public class MatteBorder
extends EmptyBorder sample code for javax.swing.border.EmptyBorder definition code for javax.swing.border.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 XMLEncoder sample code for java.beans.XMLEncoder definition code for java.beans.XMLEncoder .

See Also:
Serialized Form

Field Summary
protected  Color sample code for java.awt.Color definition code for java.awt.Color color sample code for javax.swing.border.MatteBorder.color definition code for javax.swing.border.MatteBorder.color
           
protected  Icon sample code for javax.swing.Icon definition code for javax.swing.Icon tileIcon sample code for javax.swing.border.MatteBorder.tileIcon definition code for javax.swing.border.MatteBorder.tileIcon
           
 
Fields inherited from class javax.swing.border.EmptyBorder sample code for javax.swing.border.EmptyBorder definition code for javax.swing.border.EmptyBorder
bottom sample code for javax.swing.border.EmptyBorder.bottom definition code for javax.swing.border.EmptyBorder.bottom , left sample code for javax.swing.border.EmptyBorder.left definition code for javax.swing.border.EmptyBorder.left , right sample code for javax.swing.border.EmptyBorder.right definition code for javax.swing.border.EmptyBorder.right , top sample code for javax.swing.border.EmptyBorder.top definition code for javax.swing.border.EmptyBorder.top
 
Constructor Summary
MatteBorder sample code for javax.swing.border.MatteBorder.MatteBorder(javax.swing.Icon) definition code for javax.swing.border.MatteBorder.MatteBorder(javax.swing.Icon) (Icon sample code for javax.swing.Icon definition code for javax.swing.Icon  tileIcon)
          Creates a matte border with the specified tile icon.
MatteBorder sample code for javax.swing.border.MatteBorder.MatteBorder(java.awt.Insets, java.awt.Color) definition code for javax.swing.border.MatteBorder.MatteBorder(java.awt.Insets, java.awt.Color) (Insets sample code for java.awt.Insets definition code for java.awt.Insets  borderInsets, Color sample code for java.awt.Color definition code for java.awt.Color  matteColor)
          Creates a matte border with the specified insets and color.
MatteBorder sample code for javax.swing.border.MatteBorder.MatteBorder(java.awt.Insets, javax.swing.Icon) definition code for javax.swing.border.MatteBorder.MatteBorder(java.awt.Insets, javax.swing.Icon) (Insets sample code for java.awt.Insets definition code for java.awt.Insets  borderInsets, Icon sample code for javax.swing.Icon definition code for javax.swing.Icon  tileIcon)
          Creates a matte border with the specified insets and tile icon.
MatteBorder sample code for javax.swing.border.MatteBorder.MatteBorder(int, int, int, int, java.awt.Color) definition code for javax.swing.border.MatteBorder.MatteBorder(int, int, int, int, java.awt.Color) (int top, int left, int bottom, int right, Color sample code for java.awt.Color definition code for java.awt.Color  matteColor)
          Creates a matte border with the specified insets and color.
MatteBorder sample code for javax.swing.border.MatteBorder.MatteBorder(int, int, int, int, javax.swing.Icon) definition code for javax.swing.border.MatteBorder.MatteBorder(int, int, int, int, javax.swing.Icon) (int top, int left, int bottom, int right, Icon sample code for javax.swing.Icon definition code for javax.swing.Icon  tileIcon)
          Creates a matte border with the specified insets and tile icon.
 
Method Summary
 Insets sample code for java.awt.Insets definition code for java.awt.Insets getBorderInsets sample code for javax.swing.border.MatteBorder.getBorderInsets() definition code for javax.swing.border.MatteBorder.getBorderInsets() ()
          Returns the insets of the border.
 Insets sample code for java.awt.Insets definition code for java.awt.Insets getBorderInsets sample code for javax.swing.border.MatteBorder.getBorderInsets(java.awt.Component) definition code for javax.swing.border.MatteBorder.getBorderInsets(java.awt.Component) (Component sample code for java.awt.Component definition code for java.awt.Component  c)
          Returns the insets of the border.
 Insets sample code for java.awt.Insets definition code for java.awt.Insets getBorderInsets sample code for javax.swing.border.MatteBorder.getBorderInsets(java.awt.Component, java.awt.Insets) definition code for javax.swing.border.MatteBorder.getBorderInsets(java.awt.Component, java.awt.Insets) (Component sample code for java.awt.Component definition code for java.awt.Component  c, Insets sample code for java.awt.Insets definition code for java.awt.Insets  insets)
          Reinitialize the insets parameter with this Border's current Insets.
 Color sample code for java.awt.Color definition code for java.awt.Color getMatteColor sample code for javax.swing.border.MatteBorder.getMatteColor() definition code for javax.swing.border.MatteBorder.getMatteColor() ()
          Returns the color used for tiling the border or null if a tile icon is being used.
 Icon sample code for javax.swing.Icon definition code for javax.swing.Icon getTileIcon sample code for javax.swing.border.MatteBorder.getTileIcon() definition code for javax.swing.border.MatteBorder.getTileIcon() ()
          Returns the icon used for tiling the border or null if a solid color is being used.
 boolean isBorderOpaque sample code for javax.swing.border.MatteBorder.isBorderOpaque() definition code for javax.swing.border.MatteBorder.isBorderOpaque() ()
          Returns whether or not the border is opaque.
 void paintBorder sample code for javax.swing.border.MatteBorder.paintBorder(java.awt.Component, java.awt.Graphics, int, int, int, int) definition code for javax.swing.border.MatteBorder.paintBorder(java.awt.Component, java.awt.Graphics, int, int, int, int) (Component sample code for java.awt.Component definition code for java.awt.Component  c, Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g, int x, int y, int width, int height)
          Paints the matte border.
 
Methods inherited from class javax.swing.border.AbstractBorder sample code for javax.swing.border.AbstractBorder definition code for javax.swing.border.AbstractBorder
getInteriorRectangle sample code for javax.swing.border.AbstractBorder.getInteriorRectangle(java.awt.Component, javax.swing.border.Border, int, int, int, int) definition code for javax.swing.border.AbstractBorder.getInteriorRectangle(java.awt.Component, javax.swing.border.Border, int, int, int, int) , getInteriorRectangle sample code for javax.swing.border.AbstractBorder.getInteriorRectangle(java.awt.Component, int, int, int, int) definition code for javax.swing.border.AbstractBorder.getInteriorRectangle(java.awt.Component, int, int, int, int)
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

color sample code for javax.swing.border.MatteBorder.color

protected Color sample code for java.awt.Color definition code for java.awt.Color  color

tileIcon sample code for javax.swing.border.MatteBorder.tileIcon

protected Icon sample code for javax.swing.Icon definition code for javax.swing.Icon  tileIcon
Constructor Detail

MatteBorder sample code for javax.swing.border.MatteBorder(int, int, int, int, java.awt.Color) definition code for javax.swing.border.MatteBorder(int, int, int, int, java.awt.Color)

public MatteBorder(int top,
                   int left,
                   int bottom,
                   int right,
                   Color sample code for java.awt.Color definition code for java.awt.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 sample code for javax.swing.border.MatteBorder(java.awt.Insets, java.awt.Color) definition code for javax.swing.border.MatteBorder(java.awt.Insets, java.awt.Color)

public MatteBorder(Insets sample code for java.awt.Insets definition code for java.awt.Insets  borderInsets,
                   Color sample code for java.awt.Color definition code for java.awt.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 sample code for javax.swing.border.MatteBorder(int, int, int, int, javax.swing.Icon) definition code for javax.swing.border.MatteBorder(int, int, int, int, javax.swing.Icon)

public MatteBorder(int top,
                   int left,
                   int bottom,
                   int right,
                   Icon sample code for javax.swing.Icon definition code for javax.swing.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

MatteBorder sample code for javax.swing.border.MatteBorder(java.awt.Insets, javax.swing.Icon) definition code for javax.swing.border.MatteBorder(java.awt.Insets, javax.swing.Icon)

public MatteBorder(Insets sample code for java.awt.Insets definition code for java.awt.Insets  borderInsets,
                   Icon sample code for javax.swing.Icon definition code for javax.swing.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 sample code for javax.swing.border.MatteBorder(javax.swing.Icon) definition code for javax.swing.border.MatteBorder(javax.swing.Icon)

public MatteBorder(Icon sample code for javax.swing.Icon definition code for javax.swing.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
Method Detail

paintBorder sample code for javax.swing.border.MatteBorder.paintBorder(java.awt.Component, java.awt.Graphics, int, int, int, int) definition code for javax.swing.border.MatteBorder.paintBorder(java.awt.Component, java.awt.Graphics, int, int, int, int)

public void paintBorder(Component sample code for java.awt.Component definition code for java.awt.Component  c,
                        Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g,
                        int x,
                        int y,
                        int width,
                        int height)
Paints the matte border.

Specified by:
paintBorder sample code for javax.swing.border.Border.paintBorder(java.awt.Component, java.awt.Graphics, int, int, int, int) definition code for javax.swing.border.Border.paintBorder(java.awt.Component, java.awt.Graphics, int, int, int, int) in interface Border sample code for javax.swing.border.Border definition code for javax.swing.border.Border
Overrides:
paintBorder sample code for javax.swing.border.EmptyBorder.paintBorder(java.awt.Component, java.awt.Graphics, int, int, int, int) definition code for javax.swing.border.EmptyBorder.paintBorder(java.awt.Component, java.awt.Graphics, int, int, int, int) in class EmptyBorder sample code for javax.swing.border.EmptyBorder definition code for javax.swing.border.EmptyBorder
Parameters:
c - the component for which this border is being painted
g - the paint graphics
x - the x position of the painted border
y - the y position of the painted border
width - the width of the painted border
height - the height of the painted border

getBorderInsets sample code for javax.swing.border.MatteBorder.getBorderInsets(java.awt.Component) definition code for javax.swing.border.MatteBorder.getBorderInsets(java.awt.Component)

public Insets sample code for java.awt.Insets definition code for java.awt.Insets  getBorderInsets(Component sample code for java.awt.Component definition code for java.awt.Component  c)
Returns the insets of the border.

Specified by:
getBorderInsets sample code for javax.swing.border.Border.getBorderInsets(java.awt.Component) definition code for javax.swing.border.Border.getBorderInsets(java.awt.Component) in interface Border sample code for javax.swing.border.Border definition code for javax.swing.border.Border
Overrides:
getBorderInsets sample code for javax.swing.border.EmptyBorder.getBorderInsets(java.awt.Component) definition code for javax.swing.border.EmptyBorder.getBorderInsets(java.awt.Component) in class EmptyBorder sample code for javax.swing.border.EmptyBorder definition code for javax.swing.border.EmptyBorder
Parameters:
c - the component for which this border insets value applies
Returns:
the new Insets object initialized to 0

getBorderInsets sample code for javax.swing.border.MatteBorder.getBorderInsets(java.awt.Component, java.awt.Insets) definition code for javax.swing.border.MatteBorder.getBorderInsets(java.awt.Component, java.awt.Insets)

public Insets sample code for java.awt.Insets definition code for java.awt.Insets  getBorderInsets(Component sample code for java.awt.Component definition code for java.awt.Component  c,
                              Insets sample code for java.awt.Insets definition code for java.awt.Insets  insets)
Reinitialize the insets parameter with this Border's current Insets.

Overrides:
getBorderInsets sample code for javax.swing.border.EmptyBorder.getBorderInsets(java.awt.Component, java.awt.Insets) definition code for javax.swing.border.EmptyBorder.getBorderInsets(java.awt.Component, java.awt.Insets) in class EmptyBorder sample code for javax.swing.border.EmptyBorder definition code for javax.swing.border.EmptyBorder
Parameters:
c - the component for which this border insets value applies
insets - the object to be reinitialized
Returns:
the insets object

getBorderInsets sample code for javax.swing.border.MatteBorder.getBorderInsets() definition code for javax.swing.border.MatteBorder.getBorderInsets()

public Insets sample code for java.awt.Insets definition code for java.awt.Insets  getBorderInsets()
Returns the insets of the border.

Overrides:
getBorderInsets sample code for javax.swing.border.EmptyBorder.getBorderInsets() definition code for javax.swing.border.EmptyBorder.getBorderInsets() in class EmptyBorder sample code for javax.swing.border.EmptyBorder definition code for javax.swing.border.EmptyBorder

getMatteColor sample code for javax.swing.border.MatteBorder.getMatteColor() definition code for javax.swing.border.MatteBorder.getMatteColor()

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


getTileIcon sample code for javax.swing.border.MatteBorder.getTileIcon() definition code for javax.swing.border.MatteBorder.getTileIcon()

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


isBorderOpaque sample code for javax.swing.border.MatteBorder.isBorderOpaque() definition code for javax.swing.border.MatteBorder.isBorderOpaque()

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

Specified by:
isBorderOpaque sample code for javax.swing.border.Border.isBorderOpaque() definition code for javax.swing.border.Border.isBorderOpaque() in interface Border sample code for javax.swing.border.Border definition code for javax.swing.border.Border
Overrides:
isBorderOpaque sample code for javax.swing.border.EmptyBorder.isBorderOpaque() definition code for javax.swing.border.EmptyBorder.isBorderOpaque() in class EmptyBorder sample code for javax.swing.border.EmptyBorder definition code for javax.swing.border.EmptyBorder
Returns:
false