Eclipse Draw2d
2.1

org.eclipse.draw2d
Class ButtonBorder.ButtonScheme

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

public static class ButtonBorder.ButtonScheme
extends SchemeBorder.Scheme

Provides for a scheme to represent the borders of clickable figures like buttons. Though similar to the Scheme it supports an extra set of borders for the pressed states.


Field Summary
 
Fields inherited from class org.eclipse.draw2d.SchemeBorder.Scheme
highlight, shadow
 
Constructor Summary
ButtonBorder.ButtonScheme(Color[] highlight, Color[] shadow)
          Constructs a new button scheme where the input colors are the colors for the top-left and bottom-right sides of the border.
ButtonBorder.ButtonScheme(Color[] hl, Color[] sh, Color[] hlp, Color[] shp)
          Constructs a new button scheme where the input colors are the colors for the top-left and bottom-right sides of the border, for the normal and pressed states.
 
Method Summary
protected  Insets calculateInsets()
          Calculates and returns the Insets for this border.
protected  boolean calculateOpaque()
          Calculates and returns the opaque state of this border.
protected  Color[] getHighlightPressed()
          Returns the pressed highlight colors of this border.
protected  Color[] getShadowPressed()
          Returns the pressed shadow colors of this border.
 
Methods inherited from class org.eclipse.draw2d.SchemeBorder.Scheme
getHighlight, getInsets, getShadow, init, isOpaque
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ButtonBorder.ButtonScheme

public ButtonBorder.ButtonScheme(Color[] highlight,
                                 Color[] shadow)
Constructs a new button scheme where the input colors are the colors for the top-left and bottom-right sides of the border. These colors serve as the colors when the border is in a pressed state too. The width of each side is determined by the number of colors passed in as input.

Parameters:
highlight - Colors for the top-left sides of the border
shadow - Colors for the bottom-right sides of the border
Since:
2.0

ButtonBorder.ButtonScheme

public ButtonBorder.ButtonScheme(Color[] hl,
                                 Color[] sh,
                                 Color[] hlp,
                                 Color[] shp)
Constructs a new button scheme where the input colors are the colors for the top-left and bottom-right sides of the border, for the normal and pressed states. The width of each side is determined by the number of colors passed in as input.

Parameters:
hl - Colors for the top-left sides of the border
sh - Colors for the bottom-right sides of the border
hlp - Colors for the top-left sides of the border when figure is pressed
shp - Colors for the bottom-right sides of the border when figure is pressed
Since:
2.0
Method Detail

calculateInsets

protected Insets calculateInsets()
Calculates and returns the Insets for this border. The calculations are based on the number of normal and pressed, highlight and shadow colors.

Overrides:
calculateInsets in class SchemeBorder.Scheme
Returns:
The insets for this border
Since:
2.0

calculateOpaque

protected boolean calculateOpaque()
Calculates and returns the opaque state of this border.

Returns false in the following conditions:

This is done so that the entire region under the figure is properly covered.

Overrides:
calculateOpaque in class SchemeBorder.Scheme
Returns:
The opaque state of this border
Since:
2.0

getHighlightPressed

protected Color[] getHighlightPressed()
Returns the pressed highlight colors of this border.

Returns:
Colors as an array of Colors
Since:
2.0

getShadowPressed

protected Color[] getShadowPressed()
Returns the pressed shadow colors of this border.

Returns:
Colors as an array of Colors
Since:
2.0

Eclipse Draw2d
2.1

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