/******************************************************************************* | |
* <copyright> | |
* | |
* Copyright (c) 2013, 2013 SAP AG. | |
* 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: | |
* SAP AG - initial API, implementation and documentation | |
* | |
* </copyright> | |
* | |
*******************************************************************************/ | |
package org.eclipse.fmc.blockdiagram.editor.property; | |
import org.eclipse.fmc.blockdiagram.editor.model.FMCTypeChecker; | |
import org.eclipse.fmc.blockdiagram.editor.model.FMCTypeCheckerFactory; | |
import org.eclipse.graphiti.mm.algorithms.styles.Color; | |
import org.eclipse.graphiti.mm.pictograms.PictogramElement; | |
/** | |
* Assumes that agent storage and structure variance are container shape with | |
* children to be updated. | |
* | |
* @author Benjamin Schmeling | |
* | |
*/ | |
public class FMCColorsAndFontsPropertySection extends | |
ColorsAndFontsPropertySection { | |
private FMCTypeChecker helper = FMCTypeCheckerFactory.getInstance(); | |
@Override | |
protected void updateTransparency(PictogramElement el, | |
double transparencyValue) { | |
for (PictogramElement input : super.getInput()) { | |
if (helper.isAgent(input) || helper.isStorage(input) | |
|| helper.isStructureVariance(input)) { | |
super.updateTransparency(input, transparencyValue); | |
} else | |
super.updateTransparency(el, transparencyValue); | |
} | |
} | |
@Override | |
protected void updateStyle(PictogramElement el, String styleId) { | |
for (PictogramElement input : super.getInput()) { | |
if (helper.isAgent(input) || helper.isStorage(input) | |
|| helper.isStructureVariance(input)) { | |
super.updateStyle(input, styleId); | |
} else | |
super.updateStyle(el, styleId); | |
} | |
} | |
@Override | |
protected void updateColors(PictogramElement el, Color c, | |
boolean isForeground) { | |
for (PictogramElement input : super.getInput()) { | |
if (helper.isAgent(input) || helper.isStorage(input) | |
|| helper.isStructureVariance(input)) { | |
super.updateColors(input, c, isForeground); | |
} else | |
super.updateColors(el, c, isForeground); | |
} | |
} | |
} |