Mercurial > projects > dwt-addons
comparison dwtx/draw2d/AbstractBackground.d @ 98:95307ad235d9
Added Draw2d code, still work in progress
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 03 Aug 2008 00:52:14 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
96:b492ba44e44d | 98:95307ad235d9 |
---|---|
1 /******************************************************************************* | |
2 * Copyright (c) 2007 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 * Port to the D programming language: | |
11 * Frank Benoit <benoit@tionex.de> | |
12 *******************************************************************************/ | |
13 | |
14 module dwtx.draw2d.AbstractBackground; | |
15 | |
16 import dwt.dwthelper.utils; | |
17 | |
18 import dwtx.draw2d.geometry.Insets; | |
19 import dwtx.draw2d.AbstractBorder; | |
20 import dwtx.draw2d.IFigure; | |
21 import dwtx.draw2d.Graphics; | |
22 | |
23 /** | |
24 * A special border which can paint both underneath and on top of a Figure. | |
25 * Normal borders only paint on top of a figure and its children. A background | |
26 * has the opportunity to paint both first, and optionally last. | |
27 * <P> | |
28 * WARNING: Experimental for 3.3. Clients should help validate the use cases | |
29 * of this new function. | |
30 * @since 3.3 | |
31 */ | |
32 public class AbstractBackground : AbstractBorder { | |
33 | |
34 /** | |
35 * {@inheritDoc} | |
36 */ | |
37 public Insets getInsets(IFigure figure) { | |
38 return IFigure_NO_INSETS; | |
39 } | |
40 | |
41 /** | |
42 * {@inheritDoc} | |
43 * By default, this method is stubbed out for backgrounds which only paint | |
44 * underneath a figure. | |
45 */ | |
46 public void paint(IFigure figure, Graphics graphics, Insets insets) { | |
47 } | |
48 | |
49 /** | |
50 * Called when this Background should paint. If the background is being painted | |
51 * inside another border or background, the insets indicate how far inside the | |
52 * target figure the background should be painted. In most cases, the insets | |
53 * will be all zero. | |
54 * @param figure The figure on which the background is being painted | |
55 * @param graphics The graphics | |
56 * @param insets Amount to inset from the figure's bounds | |
57 * @since 3.2 | |
58 */ | |
59 public void paintBackground(IFigure figure, Graphics graphics, Insets insets) { | |
60 } | |
61 | |
62 } |