-/*******************************************************************************\r
- * Copyright (c) 2007, 2011 Association for Decentralized Information Management in\r
- * Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- * VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.charts.ui;\r
-\r
-import java.awt.Color;\r
-\r
-import org.eclipse.jface.resource.ImageDescriptor;\r
-import org.osgi.framework.Bundle;\r
-import org.simantics.charts.Activator;\r
-import org.simantics.utils.ui.gfx.CompositionImageDescriptor;\r
-import org.simantics.utils.ui.gfx.RGBAdjustmentImageDescriptor;\r
-\r
-public class ChartItemIcon {\r
-\r
- public ImageDescriptor tagEmpty, tagLabel, binaryEmpty, binaryLabel;\r
- \r
- public ChartItemIcon() {\r
- Bundle bundle = Activator.getDefault().getBundle();\r
- tagEmpty = ImageDescriptor.createFromURL(bundle.getResource("icons/tag_empty.png"));\r
- tagLabel = ImageDescriptor.createFromURL(bundle.getResource("icons/tag_label.png"));\r
- binaryEmpty = ImageDescriptor.createFromURL(bundle.getResource("icons/binary_empty.png"));\r
- binaryLabel = ImageDescriptor.createFromURL(bundle.getResource("icons/binary_label.png")); \r
- }\r
- \r
- public ImageDescriptor createIcon( boolean analog, Color color, boolean selected )\r
- {\r
- ImageDescriptor _base = analog ? tagEmpty : binaryEmpty;\r
- ImageDescriptor _label = analog ? tagLabel : binaryLabel;\r
- \r
- if ( selected ) _base = new RGBAdjustmentImageDescriptor(_base, 200, 200, 300);\r
- \r
- ImageDescriptor label = new RGBAdjustmentImageDescriptor(_label, color.getRed(), color.getGreen(), color.getBlue());\r
- ImageDescriptor icon = CompositionImageDescriptor.compose(_base, label);\r
- \r
- return icon;\r
- }\r
- \r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2007, 2011 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.charts.ui;
+
+import java.awt.Color;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.osgi.framework.Bundle;
+import org.simantics.charts.Activator;
+import org.simantics.utils.ui.gfx.CompositionImageDescriptor;
+import org.simantics.utils.ui.gfx.RGBAdjustmentImageDescriptor;
+
+public class ChartItemIcon {
+
+ public ImageDescriptor tagEmpty, tagLabel, binaryEmpty, binaryLabel;
+
+ public ChartItemIcon() {
+ Bundle bundle = Activator.getDefault().getBundle();
+ tagEmpty = ImageDescriptor.createFromURL(bundle.getResource("icons/tag_empty.png"));
+ tagLabel = ImageDescriptor.createFromURL(bundle.getResource("icons/tag_label.png"));
+ binaryEmpty = ImageDescriptor.createFromURL(bundle.getResource("icons/binary_empty.png"));
+ binaryLabel = ImageDescriptor.createFromURL(bundle.getResource("icons/binary_label.png"));
+ }
+
+ public ImageDescriptor createIcon( boolean analog, Color color, boolean selected )
+ {
+ ImageDescriptor _base = analog ? tagEmpty : binaryEmpty;
+ ImageDescriptor _label = analog ? tagLabel : binaryLabel;
+
+ if ( selected ) _base = new RGBAdjustmentImageDescriptor(_base, 200, 200, 300);
+
+ ImageDescriptor label = new RGBAdjustmentImageDescriptor(_label, color.getRed(), color.getGreen(), color.getBlue());
+ ImageDescriptor icon = CompositionImageDescriptor.compose(_base, label);
+
+ return icon;
+ }
+
+}