com.dlsc.flexgantt.swing.util
Class Simple3DBorder

java.lang.Object
  extended by com.dlsc.flexgantt.swing.util.Simple3DBorder
All Implemented Interfaces:
javax.swing.border.Border

public class Simple3DBorder
extends java.lang.Object
implements javax.swing.border.Border

A simple 3D border with a line thickness of 1 pixel.

Since:
1.0
Author:
Dirk Lemmermann

Constructor Summary
Simple3DBorder()
          Constructs a new (raised) border.
Simple3DBorder(boolean raised)
          Constructs a new border.
 
Method Summary
 java.awt.Insets getBorderInsets(java.awt.Component comp)
          Returns insets;
 boolean isBorderOpaque()
          Always returns TRUE.
 boolean isRaised()
          Returns TRUE if the border is drawn raised.
 void paintBorder(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)
          Paints the 3D rectangle around the given component.
 void setBorderInsets(java.awt.Insets insets)
          Changes the insets of the border.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Simple3DBorder

public Simple3DBorder(boolean raised)
Constructs a new border.

Parameters:
raised - if TRUE the 3D border will be drawn raised instead of sunken.
Since:
1.0

Simple3DBorder

public Simple3DBorder()
Constructs a new (raised) border.

Since:
1.0
Method Detail

isRaised

public boolean isRaised()
Returns TRUE if the border is drawn raised.

Returns:
TRUE if the border gets drawn raised.
Since:
1.0

isBorderOpaque

public boolean isBorderOpaque()
Always returns TRUE. This method is part of the Swing Border interface and indicates whether or not the border will be opaque or not. In this case the border is always opaque.

Specified by:
isBorderOpaque in interface javax.swing.border.Border
Returns:
always TRUE
Since:
1.0
See Also:
Border.isBorderOpaque()

getBorderInsets

public java.awt.Insets getBorderInsets(java.awt.Component comp)
Returns insets;

Specified by:
getBorderInsets in interface javax.swing.border.Border
Parameters:
comp - the component for which to draw the border
Returns:
the border's insets
Since:
1.0
See Also:
Border.getBorderInsets(Component)

setBorderInsets

public void setBorderInsets(java.awt.Insets insets)
Changes the insets of the border.

Parameters:
insets - the border's insets
Since:
1.0

paintBorder

public void paintBorder(java.awt.Component c,
                        java.awt.Graphics g,
                        int x,
                        int y,
                        int width,
                        int height)
Paints the 3D rectangle around the given component.

Specified by:
paintBorder in interface javax.swing.border.Border
Parameters:
c - the component for which to draw a border
g - the graphics context to use for rendering operations
x - the x-coordinate for the border
y - the y-coordinate for the border
width - the width of the border
height - the height of the border
Since:
1.0
See Also:
Border.paintBorder(Component, Graphics, int, int, int, int)