Eclipse Draw2d
2.1

org.eclipse.draw2d
Class SchemeBorder.Scheme

java.lang.Object
  |
  +--org.eclipse.draw2d.SchemeBorder.Scheme
Direct Known Subclasses:
ButtonBorder.ButtonScheme
Enclosing class:
SchemeBorder

public static class SchemeBorder.Scheme
extends Object

Holds a set of information about a border, which can be changed to create a wide range of schemes. Provides support for border opacity, size, highlight side and shadow side colors.


Field Summary
protected  Color[] highlight
           
protected  Color[] shadow
           
 
Constructor Summary
protected SchemeBorder.Scheme()
          Constructs a default border Scheme with no border sides.
  SchemeBorder.Scheme(Color[] colors)
          Constructs a border scheme with the specified colors.
  SchemeBorder.Scheme(Color[] highlight, Color[] shadow)
          Constructs a border Scheme with the specified highlight and shadow colors.
 
Method Summary
protected  Insets calculateInsets()
          Calculates and returns the Insets for this border Scheme.
protected  boolean calculateOpaque()
          Retuns the opaque state of this border scheme.
protected  Color[] getHighlight()
          Returns the highlight colors being used.
protected  Insets getInsets()
          Returns the Insets required by this Scheme.
protected  Color[] getShadow()
          Returns the shadow colors being used.
protected  void init()
          Calculates and initializes the properties of this border scheme.
protected  boolean isOpaque()
          Returns whether this border should be opaque or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

highlight

protected Color[] highlight

shadow

protected Color[] shadow
Constructor Detail

SchemeBorder.Scheme

protected SchemeBorder.Scheme()
Constructs a default border Scheme with no border sides.

Since:
2.0

SchemeBorder.Scheme

public SchemeBorder.Scheme(Color[] highlight,
                           Color[] shadow)
Constructs a border Scheme with the specified highlight and shadow colors. The size of the border depends on the number of colors passed in for each parameter. Hightlight colors are used in the top and left sides of the border, and Shadow colors are used in the bottom and right sides of the border.

Parameters:
highlight - Hightlight colors to be used.
shadow - Shadow colors to be used.
Since:
2.0

SchemeBorder.Scheme

public SchemeBorder.Scheme(Color[] colors)
Constructs a border scheme with the specified colors. The input colors serve as both highlight and shadow colors. The size of the border is the number of colors passed in as input. Hightlight colors are used in the top and left sides of the border, and Shadow colors are used in the bottom and right sides of the border.

Since:
2.0
Method Detail

calculateInsets

protected Insets calculateInsets()
Calculates and returns the Insets for this border Scheme. The calculations depend on the number of colors passed in as input.

Returns:
Insets used by this border.
Since:
2.0

calculateOpaque

protected boolean calculateOpaque()
Retuns the opaque state of this border scheme. Returns null if any of the border colors is null. This is done to prevent the appearance of underlying pixels since the border color is null.

Since:
2.0

getHighlight

protected Color[] getHighlight()
Returns the highlight colors being used.

Returns:
Highlight colors of this border scheme as an array of Colors.
Since:
2.0

getInsets

protected Insets getInsets()
Returns the Insets required by this Scheme.

Returns:
Insets required by this Scheme.
Since:
2.0

getShadow

protected Color[] getShadow()
Returns the shadow colors being used.

Returns:
Shadow colors used by this border scheme as an array of Colors.
Since:
2.0

init

protected void init()
Calculates and initializes the properties of this border scheme.

Since:
2.0

isOpaque

protected boolean isOpaque()
Returns whether this border should be opaque or not.

Returns:
The opaque nature of this border scheme.
Since:
2.0

Eclipse Draw2d
2.1

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.