net.jbeans.ui.border
Class TiledMatteBorder

java.lang.Object
  extended byjavax.swing.border.AbstractBorder
      extended byjavax.swing.border.EmptyBorder
          extended byjavax.swing.border.MatteBorder
              extended bynet.jbeans.ui.border.TiledMatteBorder
All Implemented Interfaces:
javax.swing.border.Border, java.io.Serializable

public class TiledMatteBorder
extends javax.swing.border.MatteBorder
implements java.io.Serializable

A class which is similar to the javax.swing.border.MatteBorder. This border, however, can alternate two tiled icons to create border.

Version:
$Revision: 1.1.1.1 $
Author:
Masahiro Takatsuka (masa@jbeans.net)
See Also:
MatteBorder, Serialized Form

Field Summary
protected  javax.swing.Icon tileIconAlt
           
 
Fields inherited from class javax.swing.border.MatteBorder
color, tileIcon
 
Fields inherited from class javax.swing.border.EmptyBorder
bottom, left, right, top
 
Constructor Summary
TiledMatteBorder(javax.swing.Icon tileIcon, javax.swing.Icon tileIconAlt)
          Creates a matte border with the specified tile icon.
TiledMatteBorder(int top, int left, int bottom, int right, javax.swing.Icon tileIcon, javax.swing.Icon tileIconAlt)
          Creates a matte border with the specified insets and tile icon.
 
Method Summary
 void paintBorder(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)
          Paints the matte border.
 
Methods inherited from class javax.swing.border.MatteBorder
getBorderInsets, getBorderInsets, getBorderInsets, getMatteColor, getTileIcon, isBorderOpaque
 
Methods inherited from class javax.swing.border.AbstractBorder
getInteriorRectangle, getInteriorRectangle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tileIconAlt

protected javax.swing.Icon tileIconAlt
Constructor Detail

TiledMatteBorder

public TiledMatteBorder(int top,
                        int left,
                        int bottom,
                        int right,
                        javax.swing.Icon tileIcon,
                        javax.swing.Icon tileIconAlt)
Creates a matte border with the specified insets and tile icon. The two tile icons have to be the same size.

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
tileIconAlt - the alternate icon to be used for tiling the border

TiledMatteBorder

public TiledMatteBorder(javax.swing.Icon tileIcon,
                        javax.swing.Icon tileIconAlt)
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
tileIconAlt - the alternate icon to be used for tiling the border
Method Detail

paintBorder

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

Specified by:
paintBorder in interface javax.swing.border.Border


Copyright © 2003 JBean project. All Rights Reserved.