public class SchemeBorder extends AbstractBorder implements ColorConstants
Schemes
. A Scheme is a class whose only
purpose is to carry border specific information. SchemeBorder renders the
border based on the information given by the Scheme set to it.Modifier and Type | Class and Description |
---|---|
static class |
SchemeBorder.Scheme
Holds a set of information about a border, which can be changed to create
a wide range of schemes.
|
static interface |
SchemeBorder.SCHEMES
Interface which defines some commonly used schemes for the border.
|
ColorConstants.SystemColorFactory
Modifier and Type | Field and Description |
---|---|
protected static Color[] |
DARKER_LIGHTER
Arrays of Colors, used for shadow or highlight effects
|
protected static Color[] |
DARKEST_DARKER
Arrays of Colors, used for shadow or highlight effects
|
protected static Color[] |
LIGHTER_DARKER
Arrays of Colors, used for shadow or highlight effects
|
protected SchemeBorder.Scheme |
scheme
The
SchemeBorder.Scheme associated with this SchemeBorder |
tempRect
black, blue, button, buttonDarker, buttonDarkest, buttonLightest, cyan, darkBlue, darkGray, darkGreen, gray, green, lightBlue, lightGray, lightGreen, listBackground, listForeground, menuBackground, menuBackgroundSelected, menuForeground, menuForegroundSelected, orange, red, titleBackground, titleForeground, titleGradient, titleInactiveBackground, titleInactiveForeground, titleInactiveGradient, tooltipBackground, tooltipForeground, white, yellow
Modifier | Constructor and Description |
---|---|
protected |
SchemeBorder()
Constructs a default SchemeBorder with no scheme defined.
|
|
SchemeBorder(SchemeBorder.Scheme scheme)
Constructs a SchemeBorder with the Scheme given as input.
|
Modifier and Type | Method and Description |
---|---|
Insets |
getInsets(IFigure figure)
Returns the Insets for this Border for the given Figure.
|
protected SchemeBorder.Scheme |
getScheme()
Returns the scheme used by this border.
|
boolean |
isOpaque()
Returns the opaque state of this border.
|
protected void |
paint(Graphics graphics,
IFigure fig,
Insets insets,
Color[] tl,
Color[] br)
Paints the border using the information in the set Scheme and the inputs
given.
|
void |
paint(IFigure figure,
Graphics g,
Insets insets)
Paints the border.
|
protected void |
setScheme(SchemeBorder.Scheme scheme)
Sets the Scheme for this border to the Scheme given as input.
|
getPaintRectangle, getPreferredSize
protected SchemeBorder.Scheme scheme
SchemeBorder.Scheme
associated with this SchemeBorderprotected static final Color[] DARKEST_DARKER
protected static final Color[] LIGHTER_DARKER
protected static final Color[] DARKER_LIGHTER
protected SchemeBorder()
public SchemeBorder(SchemeBorder.Scheme scheme)
scheme
- the Scheme to be used by this borderpublic Insets getInsets(IFigure figure)
Border
getInsets
in interface Border
figure
- The figure this border belongs toBorder.getInsets(IFigure)
protected SchemeBorder.Scheme getScheme()
public boolean isOpaque()
true
indicating that this will fill in the area enclosed by the border.isOpaque
in interface Border
isOpaque
in class AbstractBorder
true
if this border is opaqueBorder.isOpaque()
protected void setScheme(SchemeBorder.Scheme scheme)
scheme
- the Scheme for this borderpublic void paint(IFigure figure, Graphics g, Insets insets)
Border
IFigure.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(int, int)
.paint
in interface Border
figure
- The figure this border belongs tog
- The graphics object used for paintinginsets
- The insetsBorder.paint(IFigure, Graphics, Insets)
protected void paint(Graphics graphics, IFigure fig, Insets insets, Color[] tl, Color[] br)
graphics
- the graphics objectfig
- the figure this border belongs toinsets
- the insetstl
- the highlight (top/left) colorsbr
- the shadow (bottom/right) colorsCopyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.