public class AbstractBackground extends AbstractBorder
WARNING: Experimental for 3.3. Clients should help validate the use cases of this new function.
tempRect
Constructor and Description |
---|
AbstractBackground() |
Modifier and Type | Method and Description |
---|---|
Insets |
getInsets(IFigure figure)
Returns the Insets for this Border for the given Figure.
|
void |
paint(IFigure figure,
Graphics graphics,
Insets insets)
Paints the border.
|
void |
paintBackground(IFigure figure,
Graphics graphics,
Insets insets)
Called when this Background should paint.
|
getPaintRectangle, getPreferredSize, isOpaque
public Insets getInsets(IFigure figure)
figure
- The figure this border belongs topublic void paint(IFigure figure, Graphics graphics, Insets insets)
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)
. By default, this method is stubbed out for backgrounds
which only paint underneath a figure.figure
- The figure this border belongs tographics
- The graphics object used for paintinginsets
- The insetspublic void paintBackground(IFigure figure, Graphics graphics, Insets insets)
figure
- The figure on which the background is being paintedgraphics
- The graphicsinsets
- Amount to inset from the figure's boundsCopyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.