X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.utils.ui%2Fsrc%2Forg%2Fsimantics%2Futils%2Fui%2Fcolor%2FColorIconCreator.java;h=15d6fddeba14c165b2a24f760a17352d63461db9;hb=060e9e392bf9fd35da738061077b285ba07fce81;hp=63bc150fd786606a280d8d286a062a6523279f3c;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git
diff --git a/bundles/org.simantics.utils.ui/src/org/simantics/utils/ui/color/ColorIconCreator.java b/bundles/org.simantics.utils.ui/src/org/simantics/utils/ui/color/ColorIconCreator.java
index 63bc150fd..15d6fddeb 100644
--- a/bundles/org.simantics.utils.ui/src/org/simantics/utils/ui/color/ColorIconCreator.java
+++ b/bundles/org.simantics.utils.ui/src/org/simantics/utils/ui/color/ColorIconCreator.java
@@ -1,63 +1,63 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Association for Decentralized Information Management
- * in Industry THTH ry.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * VTT Technical Research Centre of Finland - initial API and implementation
- *******************************************************************************/
-package org.simantics.utils.ui.color;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-
-
-
-/**
- *
- * @author Marko Luukkainen
- *
- */
-public class ColorIconCreator {
-
- /**
- * Creates square image with defined color
- * Images created this way must be disposed
- * @param color
- * @param size
- * @return
- */
- public static Image createImage(Color color, int size, int style) {
- return createImage(color,size,size,style);
- }
- /**
- * Creates rectangle image with defined color
- * Images created this way must be disposed
- * @param color
- * @param width
- * @param height
- * @return
- */
- public static Image createImage(Color color, int width, int height, int style) {
- Display display = Display.getCurrent();
- Image image = new Image(display, width, height);
- GC gc = new GC(image);
- org.eclipse.swt.graphics.Color swtColor = new org.eclipse.swt.graphics.Color(display, color.getR(), color.getG(), color.getB());
- gc.setBackground(swtColor);
- gc.setForeground(swtColor);
- gc.fillRectangle(0, 0, width, height);
- if ((style & SWT.BORDER) > 0) {
- gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
- gc.drawRectangle(0, 0, width-1, height-1);
- }
- swtColor.dispose();
- gc.dispose();
- return image;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management
+ * in Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
+package org.simantics.utils.ui.color;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+
+
+
+/**
+ *
+ * @author Marko Luukkainen
+ *
+ */
+public class ColorIconCreator {
+
+ /**
+ * Creates square image with defined color
+ * Images created this way must be disposed
+ * @param color
+ * @param size
+ * @return
+ */
+ public static Image createImage(Color color, int size, int style) {
+ return createImage(color,size,size,style);
+ }
+ /**
+ * Creates rectangle image with defined color
+ * Images created this way must be disposed
+ * @param color
+ * @param width
+ * @param height
+ * @return
+ */
+ public static Image createImage(Color color, int width, int height, int style) {
+ Display display = Display.getCurrent();
+ Image image = new Image(display, width, height);
+ GC gc = new GC(image);
+ org.eclipse.swt.graphics.Color swtColor = new org.eclipse.swt.graphics.Color(display, color.getR(), color.getG(), color.getB());
+ gc.setBackground(swtColor);
+ gc.setForeground(swtColor);
+ gc.fillRectangle(0, 0, width, height);
+ if ((style & SWT.BORDER) > 0) {
+ gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
+ gc.drawRectangle(0, 0, width-1, height-1);
+ }
+ swtColor.dispose();
+ gc.dispose();
+ return image;
+ }
+
+}