Class BezelBorder
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class BezelBorder

public class netscape.application.BezelBorder
    extends netscape.application.Border
{
    /* Fields
     */
    public final static int GROOVED;
    public final static int LOWERED;
    public final static int LOWERED_BUTTON;
    public final static int RAISED;
    public final static int RAISED_BUTTON;

    /* Constructors
     */
    public BezelBorder();
    public BezelBorder(int);
    public BezelBorder(int, Color);
    public BezelBorder(int, Color, Color, Color);

    /* Methods
     */
    public static void drawBezel(Graphics, int, int, int, int, Color, Color, Color, Color, boolean);
    public static void drawGroovedBezel(Graphics, int, int, int, int, Color, Color);
    public static void drawLoweredButtonBezel(Graphics, int, int, int, int);
    public static void drawRaisedButtonBezel(Graphics, int, int, int, int);
    public static Border groovedBezel();
    public static Border loweredBezel();
    public static Border loweredButtonBezel();
    public static Border raisedBezel();
    public static Border raisedButtonBezel();

    public int bottomMargin();
    public void decode(Decoder);
    public void describeClassInfo(ClassInfo);
    public void drawInRect(Graphics, int, int, int, int);
    public void encode(Encoder);
    public void finishDecoding();
    public int leftMargin();
    public int rightMargin();
    public int topMargin();
    public int type();
}
Border subclass capable of drawing five different kinds of 3D bezels: raised, lowered, grooved, raised button, and lowered button. For the raised, lowered, and grooved bezels, the 3D effect is created by generating lighter and darker versions of a given base color. The base color is typically the background color on which the bezel appears (Color.lightGray). The button bezel colors are hardcoded, and draw a more complicated bezel.

Fields

RAISED

  public final static int RAISED
Raised bezel type.

LOWERED

  public final static int LOWERED
Lowered bezel type.

GROOVED

  public final static int GROOVED
Grooved bezel type.

RAISED_BUTTON

  public final static int RAISED_BUTTON
"Raised" button bezel type.

LOWERED_BUTTON

  public final static int LOWERED_BUTTON
"Lowered" button bezel type.

Constructors

BezelBorder

  public BezelBorder()
Constructs a BezelBorder. This constructor is only useful during decoding.

BezelBorder

  public BezelBorder(int type)
Constructs a BezelBorder of type type. Use this method when creating Button borders, not the generic bezeled or grooved Border.

BezelBorder

  public BezelBorder(int type,
                     Color baseColor)
Constructs a BezelBorder of the given type and base color. Computes the highlight colors (lighter and darker) by calling lighterColor() and darkerColor() on baseColor.

BezelBorder

  public BezelBorder(int type,
                     Color baseColor,
                     Color lighterColor,
                     Color darkerColor)
Constructs a BezelBorder of the given type, base color, and lighter and darker colors (for creating highlights).

Methods

raisedBezel

  public static Border raisedBezel()
Convenience method for creating a raised bezel on the standard background color.

loweredBezel

  public static Border loweredBezel()
Convenience method for creating a lowered bezel on the standard background color.

groovedBezel

  public static Border groovedBezel()
Convenience method for creating a grooved bezel on the standard background color.

raisedButtonBezel

  public static Border raisedButtonBezel()
A convenience for creating a raised bezel on the standard Button.

loweredButtonBezel

  public static Border loweredButtonBezel()
A convenience for creating a lowered bezel on the standard Button.

leftMargin

  public int leftMargin()
Returns the BezelBorder's left margin of 2 pixels.
Overrides:
leftMargin in class Border

rightMargin

  public int rightMargin()
Returns the BezelBorder's right margin of 2 pixels.
Overrides:
rightMargin in class Border

topMargin

  public int topMargin()
Returns the BezelBorder's top margin of 2 pixels.
Overrides:
topMargin in class Border

bottomMargin

  public int bottomMargin()
Returns the BezelBorder's bottom margin of 2 pixels.
Overrides:
bottomMargin in class Border

type

  public int type()
Returns the Bezel's type.

drawInRect

  public void drawInRect(Graphics g,
                         int x,
                         int y,
                         int width,
                         int height)
Draws the BezelBorder in the given rectable.
Overrides:
drawInRect in class Border

describeClassInfo

  public void describeClassInfo(ClassInfo info)
Describes the BezelBorder class' information.
Overrides:
describeClassInfo in class Border
See Also:
describeClassInfo

encode

  public void encode(Encoder encoder) throws CodingException
Encodes the BezelBorder instance.
Overrides:
encode in class Border
See Also:
encode

decode

  public void decode(Decoder decoder) throws CodingException
Decodes the BezelBorder instance.
Overrides:
decode in class Border
See Also:
decode

finishDecoding

  public void finishDecoding() throws CodingException
Finishes the BezelBorder decoding.
Overrides:
finishDecoding in class Border
See Also:
finishDecoding

drawBezel

  public static void drawBezel(Graphics g,
                               int x,
                               int y,
                               int width,
                               int height,
                               Color baseColor,
                               Color lighterColor,
                               Color darkerColor,
                               Color blackColor,
                               boolean raised)
Convenience method for drawing a bezel with the four specified colors.

drawGroovedBezel

  public static void drawGroovedBezel(Graphics g,
                                      int x,
                                      int y,
                                      int width,
                                      int height,
                                      Color lighterColor,
                                      Color darkerColor)
Convenience method for drawing a grooved bezel with the two specified colors.

drawRaisedButtonBezel

  public static void drawRaisedButtonBezel(Graphics g,
                                           int x,
                                           int y,
                                           int width,
                                           int height)
Convenience method for drawing a raised Button bezel.

drawLoweredButtonBezel

  public static void drawLoweredButtonBezel(Graphics g,
                                            int x,
                                            int y,
                                            int width,
                                            int height)
Convenience method for drawing a lowered Button bezel.

All Packages  Class Hierarchy  This Package  Previous  Next  Index