org.fife.ui
Class BevelDividerBorder

java.lang.Object
  extended by org.fife.ui.BevelDividerBorder
All Implemented Interfaces:
javax.swing.border.Border, javax.swing.SwingConstants

public class BevelDividerBorder
extends java.lang.Object
implements javax.swing.border.Border, javax.swing.SwingConstants

A "border" that is actually just a bevel "divider" like those found in many Microsoft Windows applications. The border can be placed on any of the four sides of a component.

Version:
0.8
Author:
Robert Futrell

Field Summary
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Constructor Summary
BevelDividerBorder(int location)
          Creates a bevel divider border on the specified side of the panel.
BevelDividerBorder(int location, int slack)
          Creates a bevel divider border on the specified side of the panel with the specified "slack" on either side.
BevelDividerBorder(int location, int slack, java.awt.Color light, java.awt.Color dark)
          Creates a bevel divider border on the specified side of the panel with the specified "slack" on either side.
 
Method Summary
 java.awt.Insets getBorderInsets(java.awt.Component c)
          Returns the insets of the border.
 boolean isBorderOpaque()
          Returns whether or not the border is opaque.
 void paintBorder(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)
          Paints the border for the specified component with the specified position and size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BevelDividerBorder

public BevelDividerBorder(int location)
Creates a bevel divider border on the specified side of the panel.

Parameters:
location - One of SwingConstants.TOP, LEFT, BOTTOM, or RIGHT.

BevelDividerBorder

public BevelDividerBorder(int location,
                          int slack)
Creates a bevel divider border on the specified side of the panel with the specified "slack" on either side.

Parameters:
location - One of SwingConstants.TOP, LEFT, BOTTOM, or RIGHT.
slack - How much empty space to leave on either side of the divider.

BevelDividerBorder

public BevelDividerBorder(int location,
                          int slack,
                          java.awt.Color light,
                          java.awt.Color dark)
Creates a bevel divider border on the specified side of the panel with the specified "slack" on either side.

Parameters:
location - One of SwingConstants.TOP, LEFT, BOTTOM, or RIGHT.
slack - How much empty space to leave on either side of the divider.
light - The lighter color to use in the bevel.
dark - The darker color to use in the bevel.
Method Detail

getBorderInsets

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

Specified by:
getBorderInsets in interface javax.swing.border.Border
Parameters:
c - Not used.

isBorderOpaque

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

Specified by:
isBorderOpaque in interface javax.swing.border.Border
Returns:
This method always returns true.

paintBorder

public void paintBorder(java.awt.Component c,
                        java.awt.Graphics g,
                        int x,
                        int y,
                        int width,
                        int height)
Paints the border for the specified component with the specified position and size.

Specified by:
paintBorder in interface javax.swing.border.Border
Parameters:
c - The component that has this border.
g - The graphics context with which to paint.
x - The x-coordinate of the border.
y - The y-coordinate of the border.
width - The width of the component.
height - The height of the component.