Package org.eclipse.draw2d
Class SchemeBorder.Scheme
java.lang.Object
org.eclipse.draw2d.SchemeBorder.Scheme
- Direct Known Subclasses:
ButtonBorder.ButtonScheme
- Enclosing class:
- SchemeBorder
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
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Scheme()
Constructs a default border Scheme with no border sides.Constructs a border scheme with the specified colors.Constructs a border Scheme with the specified highlight and shadow colors. -
Method Summary
Modifier and TypeMethodDescriptionprotected Insets
Calculates and returns the Insets for this border Scheme.protected boolean
Calculates and retuns the opaque state of this border scheme.protected Color[]
Returns the highlight colors of this border scheme as an array of Colors.protected Insets
Returns the Insets required by this Scheme.protected Color[]
Returns the shadow colors of this border scheme as an array of Colors.protected void
init()
Calculates and initializes the properties of this border scheme.protected boolean
isOpaque()
Returns whether this border should be opaque or not.
-
Field Details
-
highlight
Arrays of Colors, used for highlight and shadow effects -
shadow
-
-
Constructor Details
-
Scheme
protected Scheme()Constructs a default border Scheme with no border sides.- Since:
- 2.0
-
Scheme
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
- the hightlight colorsshadow
- the shadow colors- Since:
- 2.0
-
Scheme
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.- Parameters:
colors
- the colors to be used for the border- Since:
- 2.0
-
-
Method Details
-
calculateInsets
Calculates and returns the Insets for this border Scheme. The calculations depend on the number of colors passed in as input.- Returns:
- the Insets used by this border
- Since:
- 2.0
-
calculateOpaque
protected boolean calculateOpaque()Calculates and retuns the opaque state of this border scheme. Returnsfalse
if any of the border colors arenull
. This is done to prevent the appearance of underlying pixels since the border color isnull
.- Returns:
true
if this border is opaque- Since:
- 2.0
-
getHighlight
Returns the highlight colors of this border scheme as an array of Colors.- Returns:
- the highlight colors
- Since:
- 2.0
-
getInsets
Returns the Insets required by this Scheme.- Returns:
- the Insets
- Since:
- 2.0
-
getShadow
Returns the shadow colors of this border scheme as an array of Colors.- Returns:
- the shadow 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:
true
if this border is opaque- Since:
- 2.0
-