org.xnap.commons.gui
Class ThinEtchedBorder

java.lang.Object
  extended by javax.swing.border.AbstractBorder
      extended by org.xnap.commons.gui.ThinEtchedBorder
All Implemented Interfaces:
Serializable, Border

public class ThinEtchedBorder
extends AbstractBorder

Provides a simple 2 line bevel border. If the Border is raised it will look like a tiny wall around the component it is used with. If it is lowered it will look like a thin trench.

See Also:
Serialized Form

Field Summary
protected  int etchType
           
static int LOWERED
           
static int RAISED
           
 
Constructor Summary
ThinEtchedBorder()
          Constructs a lowered border.
ThinEtchedBorder(int etchType)
          Constructs a border with the given etchType.
 
Method Summary
 Insets getBorderInsets(Component c)
           
 Insets getBorderInsets(Component c, Insets insets)
           
 int getEtchType()
          Returns the etch type.
 boolean isBorderOpaque()
          Returns true.
 void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
           
 
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

RAISED

public static final int RAISED
See Also:
Constant Field Values

LOWERED

public static final int LOWERED
See Also:
Constant Field Values

etchType

protected int etchType
Constructor Detail

ThinEtchedBorder

public ThinEtchedBorder(int etchType)
Constructs a border with the given etchType.

Parameters:
etchType - either BevelBoder.RAISED or BevelBorder.LOWERED
See Also:
BevelBorder.BevelBorder(int)

ThinEtchedBorder

public ThinEtchedBorder()
Constructs a lowered border.

See Also:
BevelBorder.BevelBorder(int)
Method Detail

paintBorder

public void paintBorder(Component c,
                        Graphics g,
                        int x,
                        int y,
                        int w,
                        int h)
Specified by:
paintBorder in interface Border
Overrides:
paintBorder in class AbstractBorder

getBorderInsets

public Insets getBorderInsets(Component c)
Specified by:
getBorderInsets in interface Border
Overrides:
getBorderInsets in class AbstractBorder

getBorderInsets

public Insets getBorderInsets(Component c,
                              Insets insets)
Overrides:
getBorderInsets in class AbstractBorder

isBorderOpaque

public boolean isBorderOpaque()
Returns true.

Specified by:
isBorderOpaque in interface Border
Overrides:
isBorderOpaque in class AbstractBorder

getEtchType

public int getEtchType()
Returns the etch type.



Copyright © 2004-2007 XNap Commons Team. All Rights Reserved.