6f38e0eec928f9b502f7d406765a1e215f8b72b4
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
);
62 protected ColorImpl(Color color
) {
67 // ------------------------------------------------------------------------
69 // ------------------------------------------------------------------------
72 * Returns a system color.
74 * @param color The color ID
75 * @return a system color
77 public static ColorImpl
getSystemColor(int color
) {
78 return new ColorImpl(Display
.getDefault().getSystemColor(color
));
83 * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IColor#getColor()
86 public Object
getColor() {
92 * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IColor#dispose()
95 public void dispose() {
96 if ((fColor
!= null) && (fManageColor
)) {
This page took 0.031769 seconds and 5 git commands to generate.