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

    Fields
    Modifier and Type
    Field
    Description
    protected Color[]
    Arrays of Colors, used for highlight and shadow effects
    protected Color[]
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructs a default border Scheme with no border sides.
     
    Scheme(Color[] colors)
    Constructs a border scheme with the specified colors.
     
    Scheme(Color[] highlight, Color[] shadow)
    Constructs a border Scheme with the specified highlight and shadow colors.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected 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
    Calculates and initializes the properties of this border scheme.
    protected boolean
    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 Details

    • highlight

      protected Color[] highlight
      Arrays of Colors, used for highlight and shadow effects
    • shadow

      protected Color[] shadow
  • Constructor Details

    • Scheme

      protected Scheme()
      Constructs a default border Scheme with no border sides.
      Since:
      2.0
    • Scheme

      public 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 - the hightlight colors
      shadow - the shadow colors
      Since:
      2.0
    • Scheme

      public 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.
      Parameters:
      colors - the colors to be used for the border
      Since:
      2.0
  • Method Details

    • 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:
      the Insets used by this border
      Since:
      2.0
    • calculateOpaque

      protected boolean calculateOpaque()
      Calculates and retuns the opaque state of this border scheme. Returns false if any of the border colors are null. This is done to prevent the appearance of underlying pixels since the border color is null.
      Returns:
      true if this border is opaque
      Since:
      2.0
    • getHighlight

      protected Color[] getHighlight()
      Returns the highlight colors of this border scheme as an array of Colors.
      Returns:
      the highlight colors
      Since:
      2.0
    • getInsets

      protected Insets getInsets()
      Returns the Insets required by this Scheme.
      Returns:
      the Insets
      Since:
      2.0
    • getShadow

      protected Color[] 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