1 /**********************************************************************
2 * Copyright (c) 2005, 2008 IBM Corporation and others.
3 * Copyright (c) 2011, 2012 Ericsson.
5 * All rights reserved. This program and the accompanying materials
6 * are made available under the terms of the Eclipse Public License v1.0
7 * which accompanies this distribution, and is available at
8 * http://www.eclipse.org/legal/epl-v10.html
11 * IBM - Initial API and implementation
12 * Bernd Hufmann - Updated for TMF
13 **********************************************************************/
14 package org
.eclipse
.linuxtools
.tmf
.ui
.views
.uml2sd
.drawings
.impl
;
16 import org
.eclipse
.linuxtools
.tmf
.ui
.views
.uml2sd
.drawings
.IColor
;
17 import org
.eclipse
.swt
.graphics
.Color
;
18 import org
.eclipse
.swt
.widgets
.Display
;
21 * Default implementation of the IColor interface.
27 public class ColorImpl
implements IColor
{
29 // ------------------------------------------------------------------------
31 // ------------------------------------------------------------------------
35 protected Color fColor
= null;
37 * Flag to indicate that this object is managing the resource.
39 protected boolean fManageColor
= true;
41 // ------------------------------------------------------------------------
43 // ------------------------------------------------------------------------
47 * @param display The display to use
48 * @param r A value for red
49 * @param g A value for green
50 * @param b A value for blue
52 public ColorImpl(Display display
, int r
, int g
, int b
) {
53 fColor
= new Color(display
, r
, g
, b
);
59 * @param A color to copy
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
));
82 * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IColor#getColor()
85 public Object
getColor() {
91 * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IColor#dispose()
94 public void dispose() {
95 if ((fColor
!= null) && (fManageColor
)) {
This page took 0.033055 seconds and 5 git commands to generate.