X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.charts%2Fsrc%2Forg%2Fsimantics%2Fcharts%2Fui%2FChartItemIcon.java;fp=bundles%2Forg.simantics.charts%2Fsrc%2Forg%2Fsimantics%2Fcharts%2Fui%2FChartItemIcon.java;h=a05544848eef1831c21bbcae70d034c684018e65;hp=a7b9581f284cf7ce533a78bff6ff1d2ecd998615;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.charts/src/org/simantics/charts/ui/ChartItemIcon.java b/bundles/org.simantics.charts/src/org/simantics/charts/ui/ChartItemIcon.java index a7b9581f2..a05544848 100644 --- a/bundles/org.simantics.charts/src/org/simantics/charts/ui/ChartItemIcon.java +++ b/bundles/org.simantics.charts/src/org/simantics/charts/ui/ChartItemIcon.java @@ -1,47 +1,47 @@ -/******************************************************************************* - * 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; - } - -} +/******************************************************************************* + * 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; + } + +}