StatechartDiagramViewFactory.java 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /**
  2. * Copyright (c) 2010 committers of YAKINDU and others.
  3. * All rights reserved. This program and the accompanying materials
  4. * are made available under the terms of the Eclipse Public License v1.0
  5. * which accompanies this distribution, and is available at
  6. * http://www.eclipse.org/legal/epl-v10.html
  7. * Contributors:
  8. * committers of YAKINDU - initial API and implementation
  9. *
  10. */
  11. package org.yakindu.sct.ui.editor.factories;
  12. import java.util.List;
  13. import org.eclipse.gmf.runtime.diagram.ui.view.factories.DiagramViewFactory;
  14. import org.eclipse.gmf.runtime.notation.BooleanValueStyle;
  15. import org.eclipse.gmf.runtime.notation.MeasurementUnit;
  16. import org.eclipse.gmf.runtime.notation.View;
  17. import org.yakindu.sct.ui.editor.partitioning.DiagramPartitioningUtil;
  18. /**
  19. *
  20. * @author muelder
  21. *
  22. */
  23. public class StatechartDiagramViewFactory extends DiagramViewFactory {
  24. @Override
  25. protected MeasurementUnit getMeasurementUnit() {
  26. return MeasurementUnit.PIXEL_LITERAL;
  27. }
  28. @SuppressWarnings({"rawtypes", "unchecked"})
  29. @Override
  30. protected List createStyles(View view) {
  31. BooleanValueStyle inlineDefinitionSectionStyle = DiagramPartitioningUtil.createInlineDefinitionSectionStyle();
  32. view.getStyles().add(inlineDefinitionSectionStyle);
  33. return super.createStyles(view);
  34. }
  35. }