/**
* 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 RHContainerColoredAreas extends PredefinedColoredAreas {
public static final String GREEN_WHITE_ID = "green_white";
public static final String YELLOW_WHITE_ID = "yellow_white";
private static GradientColoredAreas getGreenWhiteDefaultAreas() {
final GradientColoredAreas gradientColoredAreas = StylesFactory.eINSTANCE.createGradientColoredAreas();
final EList<GradientColoredArea> gcas = gradientColoredAreas.getGradientColor();
addGradientColoredArea(gcas, "A4FBB3", 0, LocationType.LOCATION_TYPE_ABSOLUTE_START, "A4FBB3", 1, LocationType.LOCATION_TYPE_ABSOLUTE_START);
addGradientColoredArea(gcas, "1CF641", 1, LocationType.LOCATION_TYPE_ABSOLUTE_START, "F5F0E8", 1, LocationType.LOCATION_TYPE_ABSOLUTE_END);
addGradientColoredArea(gcas, "60F87A", 2, LocationType.LOCATION_TYPE_ABSOLUTE_END, "60F87A", 0, LocationType.LOCATION_TYPE_ABSOLUTE_END);
gradientColoredAreas.setStyleAdaption(IPredefinedRenderingStyle.STYLE_ADAPTATION_DEFAULT);
return gradientColoredAreas;
}
private static GradientColoredAreas getGreenWhitePrimarySelectedAreas() {
final GradientColoredAreas gradientColoredAreas = StylesFactory.eINSTANCE.createGradientColoredAreas();
gradientColoredAreas.setStyleAdaption(IPredefinedRenderingStyle.STYLE_ADAPTATION_PRIMARY_SELECTED);
final EList<GradientColoredArea> gcas = gradientColoredAreas.getGradientColor();
addGradientColoredArea(gcas, "19DD3A", 0, LocationType.LOCATION_TYPE_ABSOLUTE_START, "19DD3A", 0, LocationType.LOCATION_TYPE_ABSOLUTE_END);
return gradientColoredAreas;
}
private static GradientColoredAreas getGreenWhiteSecondarySelectedAreas() {
final GradientColoredAreas gradientColoredAreas = StylesFactory.eINSTANCE.createGradientColoredAreas();
gradientColoredAreas.setStyleAdaption(IPredefinedRenderingStyle.STYLE_ADAPTATION_SECONDARY_SELECTED);
final EList<GradientColoredArea> gcas = gradientColoredAreas.getGradientColor();
addGradientColoredArea(gcas, "1CF641", 0, LocationType.LOCATION_TYPE_ABSOLUTE_START, "1CF641", 0, LocationType.LOCATION_TYPE_ABSOLUTE_END);
return gradientColoredAreas;
}
public static AdaptedGradientColoredAreas getGreenWhiteAdaptions() {
final AdaptedGradientColoredAreas agca = StylesFactory.eINSTANCE.createAdaptedGradientColoredAreas();
agca.setDefinedStyleId(GREEN_WHITE_ID);
agca.setGradientType(IGradientType.VERTICAL);
agca.getAdaptedGradientColoredAreas().add(IPredefinedRenderingStyle.STYLE_ADAPTATION_DEFAULT, getGreenWhiteDefaultAreas());
agca.getAdaptedGradientColoredAreas().add(IPredefinedRenderingStyle.STYLE_ADAPTATION_PRIMARY_SELECTED, getGreenWhitePrimarySelectedAreas());
agca.getAdaptedGradientColoredAreas().add(IPredefinedRenderingStyle.STYLE_ADAPTATION_SECONDARY_SELECTED, getGreenWhiteSecondarySelectedAreas());
return agca;
}
private static GradientColoredAreas getYellowWhiteDefaultAreas() {
final GradientColoredAreas gradientColoredAreas = StylesFactory.eINSTANCE.createGradientColoredAreas();
final EList<GradientColoredArea> gcas = gradientColoredAreas.getGradientColor();
addGradientColoredArea(gcas, "FFFAB2", 0, LocationType.LOCATION_TYPE_ABSOLUTE_START, "FFFAB2", 1, LocationType.LOCATION_TYPE_ABSOLUTE_START);
addGradientColoredArea(gcas, "FFF233", 1, LocationType.LOCATION_TYPE_ABSOLUTE_START, "F5F0E8", 1, LocationType.LOCATION_TYPE_ABSOLUTE_END);
addGradientColoredArea(gcas, "FFF566", 2, LocationType.LOCATION_TYPE_ABSOLUTE_END, "FFF566", 0, LocationType.LOCATION_TYPE_ABSOLUTE_END);
gradientColoredAreas.setStyleAdaption(IPredefinedRenderingStyle.STYLE_ADAPTATION_DEFAULT);
return gradientColoredAreas;
}
private static GradientColoredAreas getYellowWhitePrimarySelectedAreas() {
final GradientColoredAreas gradientColoredAreas = StylesFactory.eINSTANCE.createGradientColoredAreas();
gradientColoredAreas.setStyleAdaption(IPredefinedRenderingStyle.STYLE_ADAPTATION_PRIMARY_SELECTED);
final EList<GradientColoredArea> gcas = gradientColoredAreas.getGradientColor();
addGradientColoredArea(gcas, "FFEF00", 0, LocationType.LOCATION_TYPE_ABSOLUTE_START, "FFEF00", 0, LocationType.LOCATION_TYPE_ABSOLUTE_END);
return gradientColoredAreas;
}
private static GradientColoredAreas getYellowWhiteSecondarySelectedAreas() {
final GradientColoredAreas gradientColoredAreas = StylesFactory.eINSTANCE.createGradientColoredAreas();
gradientColoredAreas.setStyleAdaption(IPredefinedRenderingStyle.STYLE_ADAPTATION_SECONDARY_SELECTED);
final EList<GradientColoredArea> gcas = gradientColoredAreas.getGradientColor();
addGradientColoredArea(gcas, "FFF233", 0, LocationType.LOCATION_TYPE_ABSOLUTE_START, "FFF233", 0, LocationType.LOCATION_TYPE_ABSOLUTE_END);
return gradientColoredAreas;
}
public static AdaptedGradientColoredAreas getYellowWhiteAdaptions() {
final AdaptedGradientColoredAreas agca = StylesFactory.eINSTANCE.createAdaptedGradientColoredAreas();
agca.setDefinedStyleId(YELLOW_WHITE_ID);
agca.setGradientType(IGradientType.VERTICAL);
agca.getAdaptedGradientColoredAreas().add(IPredefinedRenderingStyle.STYLE_ADAPTATION_DEFAULT, getYellowWhiteDefaultAreas());
agca.getAdaptedGradientColoredAreas().add(IPredefinedRenderingStyle.STYLE_ADAPTATION_PRIMARY_SELECTED, getYellowWhitePrimarySelectedAreas());
agca.getAdaptedGradientColoredAreas().add(IPredefinedRenderingStyle.STYLE_ADAPTATION_SECONDARY_SELECTED, getYellowWhiteSecondarySelectedAreas());
return agca;
}
}