use of org.eclipse.gmf.runtime.notation.BooleanValueStyle in project statecharts by Yakindu.
the class StateCompartmentCanonicalEditPolicy method getSemanticChildrenList.
@SuppressWarnings("rawtypes")
@Override
protected List getSemanticChildrenList() {
StateEditPart parent = (StateEditPart) getHost().getParent();
BooleanValueStyle isInline = GMFNotationUtil.getBooleanValueStyle(parent.getNotationView(), INLINE_STYLE);
if (isInline == null || isInline.isBooleanValue())
return getSemanticHost().getRegions();
return Collections.EMPTY_LIST;
}
use of org.eclipse.gmf.runtime.notation.BooleanValueStyle in project statecharts by Yakindu.
the class StateViewFactory method decorateView.
@SuppressWarnings("unchecked")
@Override
protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
IAdaptable eObjectAdapter = null;
EObject eObject = (EObject) semanticAdapter.getAdapter(EObject.class);
if (eObject != null) {
eObjectAdapter = new EObjectAdapter(eObject);
}
// State name
FactoryUtils.createLabel(view, SemanticHints.STATE_NAME);
// Text compartment
getViewService().createNode(eObjectAdapter, view, SemanticHints.STATE_TEXT_COMPARTMENT, ViewUtil.APPEND, true, getPreferencesHint());
// Figure compartment
getViewService().createNode(eObjectAdapter, view, SemanticHints.STATE_FIGURE_COMPARTMENT, ViewUtil.APPEND, true, getPreferencesHint());
// Create a boolean value style that indicates the alignment of
// subregions
BooleanValueStyle layout = (BooleanValueStyle) NotationFactory.eINSTANCE.createBooleanValueStyle();
layout.setBooleanValue(true);
layout.setName(ALIGNMENT_ORIENTATION);
view.getStyles().add(layout);
IPreferenceStore store = (IPreferenceStore) getPreferencesHint().getPreferenceStore();
if (store == null) {
return;
}
// Create states default styles
ShapeStyle style = (ShapeStyle) view.getStyle(NotationPackage.Literals.SHAPE_STYLE);
RGB fillRGB = PreferenceConverter.getColor(store, StatechartPreferenceConstants.PREF_STATE_BACKGROUND);
style.setFillColor(FigureUtilities.RGBToInteger(fillRGB));
RGB lineRGB = PreferenceConverter.getColor(store, StatechartPreferenceConstants.PREF_STATE_LINE);
style.setLineColor(FigureUtilities.RGBToInteger(lineRGB));
}
use of org.eclipse.gmf.runtime.notation.BooleanValueStyle in project statecharts by Yakindu.
the class StatechartDiagramViewFactory method createStyles.
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
protected List createStyles(View view) {
BooleanValueStyle inlineDefinitionSectionStyle = DiagramPartitioningUtil.createInlineDefinitionSectionStyle();
view.getStyles().add(inlineDefinitionSectionStyle);
return super.createStyles(view);
}
use of org.eclipse.gmf.runtime.notation.BooleanValueStyle in project statecharts by Yakindu.
the class StatechartDefinitionSection method updateInlineStyle.
protected void updateInlineStyle() {
TransactionalEditingDomain domain = getTransactionalEditingDomain();
Diagram diagram = getDiagram();
BooleanValueStyle inlineStyle = DiagramPartitioningUtil.getInlineDefinitionSectionStyle(diagram);
if (inlineStyle == null) {
inlineStyle = DiagramPartitioningUtil.createInlineDefinitionSectionStyle();
addInlineStyle(inlineStyle, domain);
}
setInlineStyleValue(inlineStyle, domain);
}
use of org.eclipse.gmf.runtime.notation.BooleanValueStyle in project statecharts by Yakindu.
the class ExtractSubdiagramRefactoring method setNotationStyle.
/**
* Sets the GMF inline {@link Style} to true
*/
@SuppressWarnings("unchecked")
protected void setNotationStyle() {
BooleanValueStyle inlineStyle = getInlineStyle(getContextObject());
if (inlineStyle == null) {
inlineStyle = createInlineStyle();
getContextObject().getStyles().add(inlineStyle);
}
inlineStyle.setBooleanValue(false);
}
Aggregations