Draw2D v2.0

org.eclipse.draw2d
Class ButtonBorder

java.lang.Object
  |
  +--org.eclipse.draw2d.AbstractBorder
        |
        +--org.eclipse.draw2d.SchemeBorder
              |
              +--org.eclipse.draw2d.ButtonBorder
All Implemented Interfaces:
Border, ColorConstants

public class ButtonBorder
extends SchemeBorder

Creates a border for a clickable type of figure, which works in conjunction with the Figure and its model. This border adjusts itself to the various states the model of the figure could be. This border uses an extended Scheme called ButtonScheme which provides more information required by border to handle the the states of the model.

See Also:
ButtonBorder.ButtonScheme, ButtonBorder.ButtonScheme

Inner Class Summary
static class ButtonBorder.ButtonScheme
          Provides for a scheme to represent the borders of clickable figures like buttons.
static interface ButtonBorder.SCHEMES
          Interface defining commonly used schemes for the ButtonBorder.
 
Inner classes inherited from class org.eclipse.draw2d.SchemeBorder
SchemeBorder.Scheme, SchemeBorder.SCHEMES
 
Fields inherited from class org.eclipse.draw2d.SchemeBorder
DARKER_LIGHTER, DARKEST_DARKER, LIGHTER_DARKER, scheme
 
Fields inherited from class org.eclipse.draw2d.AbstractBorder
tempRect
 
Fields inherited from interface org.eclipse.draw2d.ColorConstants
black, blue, button, buttonDarker, buttonDarkest, buttonLightest, cyan, darkBlue, darkGray, darkGreen, display, gray, green, lightBlue, lightGray, lightGreen, menuBackground, menuBackgroundSelected, menuForeground, menuForegroundSelected, orange, red, titleBackground, titleForeground, titleGradient, titleInactiveBackground, titleInactiveForeground, titleInactiveGradient, tooltipBackground, tooltipForeground, white, yellow
 
Constructor Summary
ButtonBorder()
          Constructs a ButtonBorder with a predefined button scheme set as its default.
ButtonBorder(ButtonBorder.ButtonScheme scheme)
          Constructs a ButtonBorder with the input ButtonScheme set as its Scheme.
 
Method Summary
 void paint(IFigure figure, Graphics graphics, Insets insets)
          paint the Border.
 
Methods inherited from class org.eclipse.draw2d.SchemeBorder
getInsets, getScheme, isOpaque, paint, setScheme
 
Methods inherited from class org.eclipse.draw2d.AbstractBorder
getPaintRectangle, getPreferredSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ButtonBorder

public ButtonBorder()
Constructs a ButtonBorder with a predefined button scheme set as its default.
Since:
2.0

ButtonBorder

public ButtonBorder(ButtonBorder.ButtonScheme scheme)
Constructs a ButtonBorder with the input ButtonScheme set as its Scheme.
Parameters:
scheme - Button Scheme for this ButtonBorder.
Since:
2.0
Method Detail

paint

public void paint(IFigure figure,
                  Graphics graphics,
                  Insets insets)
Description copied from interface: Border
paint the Border. The border should paint inside figure's getBounds(), inset by the parameter insets. The border generally should not paint inside its own insets. More specifically, Border b should paint inside the rectangle: figure.getBounds().getCropped(insets) and outside of the rectangle: figure.getBounds().getCropped(insets).getCropped(getInsets()) where inside is defined as rectangle.contains(x,y);
Overrides:
paint in class SchemeBorder

Draw2D v2.0