413cecd6bc4b0b4282a5429e0cbdd2e78ebc8455
1 /**********************************************************************
2 * Copyright (c) 2005, 2013 IBM Corporation, Ericsson
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
9 * IBM - Initial API and implementation
10 * Bernd Hufmann - Updated for TMF
11 **********************************************************************/
13 package org
.eclipse
.linuxtools
.tmf
.ui
.views
.uml2sd
.drawings
.impl
;
15 import org
.eclipse
.linuxtools
.tmf
.ui
.views
.uml2sd
.drawings
.IColor
;
16 import org
.eclipse
.swt
.graphics
.Color
;
17 import org
.eclipse
.swt
.widgets
.Display
;
20 * Default implementation of the IColor interface.
26 public class ColorImpl
implements IColor
{
28 // ------------------------------------------------------------------------
30 // ------------------------------------------------------------------------
34 protected Color fColor
= null;
36 * Flag to indicate that this object is managing the resource.
38 protected boolean fManageColor
= true;
40 // ------------------------------------------------------------------------
42 // ------------------------------------------------------------------------
46 * @param display The display to use
47 * @param r A value for red
48 * @param g A value for green
49 * @param b A value for blue
51 public ColorImpl(Display display
, int r
, int g
, int b
) {
52 fColor
= new Color(display
, r
, g
, b
);
61 protected ColorImpl(Color color
) {
66 // ------------------------------------------------------------------------
68 // ------------------------------------------------------------------------
71 * Returns a system color.
73 * @param color The color ID
74 * @return a system color
76 public static ColorImpl
getSystemColor(int color
) {
77 return new ColorImpl(Display
.getDefault().getSystemColor(color
));
81 public Object
getColor() {
86 public void dispose() {
87 if ((fColor
!= null) && (fManageColor
)) {
This page took 0.031505 seconds and 5 git commands to generate.