author | dadubrow |
Wed, 11 Aug 2010 15:25:32 -0500 | |
changeset 1810 | 2ccd3660a736 |
parent 1618 | 712d047abd8b |
child 1831 | 3319dd953212 |
permissions | -rw-r--r-- |
1609 | 1 |
/* |
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: |
|
15 |
* |
|
16 |
*/ |
|
17 |
package com.nokia.carbide.internal.discovery.ui.editor; |
|
18 |
||
19 |
import org.eclipse.swt.graphics.Color; |
|
20 |
import org.eclipse.swt.graphics.GC; |
|
21 |
import org.eclipse.swt.widgets.Composite; |
|
22 |
||
23 |
class RoundedCornerComposite extends SharedBackgroundComposite { |
|
24 |
||
25 |
private final Color background; |
|
26 |
private final Color outline; |
|
27 |
||
28 |
public RoundedCornerComposite(Composite parent, Composite backgroundParent, Color outline, Color background) { |
|
29 |
super(parent, backgroundParent); |
|
30 |
this.background = background; |
|
31 |
this.outline = outline; |
|
32 |
} |
|
33 |
||
34 |
@Override |
|
35 |
public void drawBackground(GC gc, int x, int y, int width, int height) { |
|
36 |
super.drawBackground(gc, x, y, width, height); |
|
37 |
if (background != null) { |
|
38 |
gc.setBackground(background); |
|
1618 | 39 |
gc.fillRoundRectangle(0, 0, width, height, 6, 6); |
1609 | 40 |
} |
41 |
if (outline != null) { |
|
42 |
gc.setForeground(outline); |
|
1810
2ccd3660a736
feature config exporter + non-functional importer
dadubrow
parents:
1618
diff
changeset
|
43 |
gc.drawRoundRectangle(0, 0, width - 1, height - 1, 6, 6); |
1609 | 44 |
} |
45 |
} |
|
46 |
} |