Package org.eclipse.draw2d
Class AbstractBackground
java.lang.Object
org.eclipse.draw2d.AbstractBorder
org.eclipse.draw2d.AbstractBackground
- All Implemented Interfaces:
Border
A special border which can paint both underneath and on top of a Figure.
Normal borders only paint on top of a figure and its children. A background
has the opportunity to paint both first, and optionally last.
WARNING: Experimental for 3.3. Clients should help validate the use cases of this new function.
- Since:
- 3.3
-
Field Summary
Fields inherited from class org.eclipse.draw2d.AbstractBorder
tempRect
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the Insets for this Border for the given Figure.void
Paints the border.void
paintBackground
(IFigure figure, Graphics graphics, Insets insets) Called when this Background should paint.Methods inherited from class org.eclipse.draw2d.AbstractBorder
getPaintRectangle, getPreferredSize, isOpaque
-
Constructor Details
-
AbstractBackground
public AbstractBackground()
-
-
Method Details
-
getInsets
Returns the Insets for this Border for the given Figure.- Parameters:
figure
- The figure this border belongs to- Returns:
- The insets
-
paint
Paints the border. The border should paint inside figure'sIFigure.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 asRectangle.contains(int, int)
. By default, this method is stubbed out for backgrounds which only paint underneath a figure.- Parameters:
figure
- The figure this border belongs tographics
- The graphics object used for paintinginsets
- The insets
-
paintBackground
Called when this Background should paint. If the background is being painted inside another border or background, the insets indicate how far inside the target figure the background should be painted. In most cases, the insets will be all zero.- Parameters:
figure
- The figure on which the background is being paintedgraphics
- The graphicsinsets
- Amount to inset from the figure's bounds- Since:
- 3.2
-