com.arsdigita.toolbox.rebop
Class BevelBox

java.lang.Object
  extended bycom.arsdigita.toolbox.rebop.AbstractDrawable
      extended bycom.arsdigita.toolbox.rebop.BevelBox
All Implemented Interfaces:
GenericDrawable

public class BevelBox
extends AbstractDrawable
implements GenericDrawable

Used to draw 3D boxes and edges around components. Can be used to draw solid flat rectangles, buttons, and edges around other controls. Implements the GenericDrawable interface so it can be used as a drawable for any GenericComponent.

Author:
Gavin Doughtie

Field Summary
static int STANDARD_BEVEL
           
static String versionId
           
 
Constructor Summary
BevelBox()
          Construct a new BevelBox.
BevelBox(Color fillColor)
          Construct a new BevelBox with the specified fillColor and the "raised button" appearance.
BevelBox(Color fillColor, Color lightEdge, Color darkEdge, int bevelWidth, boolean in)
          Construct a new BevelBox with the specified appearance.
BevelBox(Color fillColor, int bevelWidth, boolean in)
          Construct a new BevelBox with the specified appearance.
 
Method Summary
 void draw(Graphics g, int x, int y, int width, int height)
          Implementation of the GenericDrawable interface
 boolean getIn()
           
 void setIn(boolean in)
           
 void toggleIn()
           
 
Methods inherited from class com.arsdigita.toolbox.rebop.AbstractDrawable
getXOffset, getYOffset, setXOffset, setYOffset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.arsdigita.toolbox.rebop.GenericDrawable
getXOffset, getYOffset, setXOffset, setYOffset
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values

STANDARD_BEVEL

public static final int STANDARD_BEVEL
See Also:
Constant Field Values
Constructor Detail

BevelBox

public BevelBox()
Construct a new BevelBox. Will draw as a standard-looking gray button.


BevelBox

public BevelBox(Color fillColor)
Construct a new BevelBox with the specified fillColor and the "raised button" appearance.

Parameters:
fillColor - box will be drawn with this as its fill color. fillColor shouldn't be null, because then there's nothing to draw!

BevelBox

public BevelBox(Color fillColor,
                int bevelWidth,
                boolean in)
Construct a new BevelBox with the specified appearance.

Parameters:
fillColor - box will be drawn with this as its fill color. fillColor shouldn't be null, because then there's nothing to draw!
bevelWidth - number of pixels to use for bevelled edges
in - if true, then the lightEdge will be the lower-right edges of the box, otherwise the lightEdge will be the upper-left edges.

BevelBox

public BevelBox(Color fillColor,
                Color lightEdge,
                Color darkEdge,
                int bevelWidth,
                boolean in)
Construct a new BevelBox with the specified appearance.

Parameters:
fillColor - box will be drawn with this as its fill color. if null, then no center will be drawn.
lightEdge - color to draw the light edge in. If null, no light edge will be drawn.
darkEdge - color to draw the light edge in. If null, no dark edge will be drawn.
bevelWidth - number of pixels to use for bevelled edges
in - if true, then the lightEdge will be the lower-right edges of the box, otherwise the lightEdge will be the upper-left edges.
Method Detail

setIn

public void setIn(boolean in)

toggleIn

public void toggleIn()

getIn

public boolean getIn()

draw

public void draw(Graphics g,
                 int x,
                 int y,
                 int width,
                 int height)
Implementation of the GenericDrawable interface

Specified by:
draw in interface GenericDrawable
Parameters:
g - Graphics to draw on
x - horizontal location to begin drawing
y - vertical location to begin drawing
width - width of area to draw in
height - height of area to draw in


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2337 UTC