1
|
/*******************************************************************************
|
2
|
* Copyright (c) 2007, 2010 IBM Corporation and others.
|
3
|
* All rights reserved. This program and the accompanying materials
|
4
|
* are made available under the terms of the Eclipse Public License v1.0
|
5
|
* which accompanies this distribution, and is available at
|
6
|
* http://www.eclipse.org/legal/epl-v10.html
|
7
|
*
|
8
|
* Contributors:
|
9
|
* IBM Corporation - initial API and implementation
|
10
|
*******************************************************************************/
|
11
|
|
12
|
package org.eclipse.draw2d;
|
13
|
|
14
|
import org.eclipse.draw2d.geometry.Insets;
|
15
|
|
16
|
/**
|
17
|
* A special border which can paint both underneath and on top of a Figure.
|
18
|
* Normal borders only paint on top of a figure and its children. A background
|
19
|
* has the opportunity to paint both first, and optionally last.
|
20
|
* <P>
|
21
|
* WARNING: Experimental for 3.3. Clients should help validate the use cases of
|
22
|
* this new function.
|
23
|
*
|
24
|
* @since 3.3
|
25
|
*/
|
26
|
public class AbstractBackground extends AbstractBorder {
|
27
|
|
28
|
/**
|
29
|
* {@inheritDoc}
|
30
|
*/
|
31
|
public Insets getInsets(IFigure figure) {
|
32
|
return IFigure.NO_INSETS;
|
33
|
}
|
34
|
|
35
|
/**
|
36
|
* {@inheritDoc} By default, this method is stubbed out for backgrounds
|
37
|
* which only paint underneath a figure.
|
38
|
*/
|
39
|
public void paint(IFigure figure, Graphics graphics, Insets insets) {
|
40
|
}
|
41
|
|
42
|
/**
|
43
|
* Called when this Background should paint. If the background is being
|
44
|
* painted inside another border or background, the insets indicate how far
|
45
|
* inside the target figure the background should be painted. In most cases,
|
46
|
* the insets will be all zero.
|
47
|
*
|
48
|
* @param figure
|
49
|
* The figure on which the background is being painted
|
50
|
* @param graphics
|
51
|
* The graphics
|
52
|
* @param insets
|
53
|
* Amount to inset from the figure's bounds
|
54
|
* @since 3.2
|
55
|
*/
|
56
|
public void paintBackground(IFigure figure, Graphics graphics, Insets insets) {
|
57
|
}
|
58
|
|
59
|
}
|