/** * This file is protected by Copyright. * Please refer to the COPYRIGHT file distributed with this source distribution. * * This file is part of REDHAWK IDE. * * 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. */ package gov.redhawk.core.graphiti.ui.internal.style; import org.eclipse.emf.common.util.EList; import org.eclipse.graphiti.mm.algorithms.styles.AdaptedGradientColoredAreas; import org.eclipse.graphiti.mm.algorithms.styles.GradientColoredArea; import org.eclipse.graphiti.mm.algorithms.styles.GradientColoredAreas; import org.eclipse.graphiti.mm.algorithms.styles.LocationType; import org.eclipse.graphiti.mm.algorithms.styles.StylesFactory; import org.eclipse.graphiti.util.IGradientType; import org.eclipse.graphiti.util.IPredefinedRenderingStyle; import org.eclipse.graphiti.util.PredefinedColoredAreas; public class FindByColoredAreas extends PredefinedColoredAreas { public static final String COPPER_WHITE_ID = "copper_white"; private static GradientColoredAreas getCopperWhiteDefaultAreas() { final GradientColoredAreas gradientColoredAreas = StylesFactory.eINSTANCE.createGradientColoredAreas(); final EList<GradientColoredArea> gcas = gradientColoredAreas.getGradientColor(); addGradientColoredArea(gcas, "EDE0D8", 0, LocationType.LOCATION_TYPE_ABSOLUTE_START, "EDE0D8", 1, LocationType.LOCATION_TYPE_ABSOLUTE_START); addGradientColoredArea(gcas, "E4D0C4", 1, LocationType.LOCATION_TYPE_ABSOLUTE_START, "F5F0E8", 1, LocationType.LOCATION_TYPE_ABSOLUTE_END); addGradientColoredArea(gcas, "E6DDD0", 2, LocationType.LOCATION_TYPE_ABSOLUTE_END, "E6DDD0", 0, LocationType.LOCATION_TYPE_ABSOLUTE_END); gradientColoredAreas.setStyleAdaption(IPredefinedRenderingStyle.STYLE_ADAPTATION_DEFAULT); return gradientColoredAreas; } private static GradientColoredAreas getCopperWhitePrimarySelectedAreas() { final GradientColoredAreas gradientColoredAreas = StylesFactory.eINSTANCE.createGradientColoredAreas(); gradientColoredAreas.setStyleAdaption(IPredefinedRenderingStyle.STYLE_ADAPTATION_PRIMARY_SELECTED); final EList<GradientColoredArea> gcas = gradientColoredAreas.getGradientColor(); addGradientColoredArea(gcas, "D4B4A1", 0, LocationType.LOCATION_TYPE_ABSOLUTE_START, "D4B4A1", 0, LocationType.LOCATION_TYPE_ABSOLUTE_END); return gradientColoredAreas; } private static GradientColoredAreas getCopperWhiteSecondarySelectedAreas() { final GradientColoredAreas gradientColoredAreas = StylesFactory.eINSTANCE.createGradientColoredAreas(); gradientColoredAreas.setStyleAdaption(IPredefinedRenderingStyle.STYLE_ADAPTATION_SECONDARY_SELECTED); final EList<GradientColoredArea> gcas = gradientColoredAreas.getGradientColor(); addGradientColoredArea(gcas, "E4D0C4", 0, LocationType.LOCATION_TYPE_ABSOLUTE_START, "E4D0C4", 0, LocationType.LOCATION_TYPE_ABSOLUTE_END); return gradientColoredAreas; } public static AdaptedGradientColoredAreas getCopperWhiteAdaptions() { final AdaptedGradientColoredAreas agca = StylesFactory.eINSTANCE.createAdaptedGradientColoredAreas(); agca.setDefinedStyleId(COPPER_WHITE_ID); agca.setGradientType(IGradientType.VERTICAL); agca.getAdaptedGradientColoredAreas().add(IPredefinedRenderingStyle.STYLE_ADAPTATION_DEFAULT, getCopperWhiteDefaultAreas()); agca.getAdaptedGradientColoredAreas().add(IPredefinedRenderingStyle.STYLE_ADAPTATION_PRIMARY_SELECTED, getCopperWhitePrimarySelectedAreas()); agca.getAdaptedGradientColoredAreas().add(IPredefinedRenderingStyle.STYLE_ADAPTATION_SECONDARY_SELECTED, getCopperWhiteSecondarySelectedAreas()); return agca; } }