Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Modify the Metamodel by adding two attributes (isInitial, isFinal) to the State Class in org.yakindu.sct.model.sgraph/model/emf/sgraph.genmodel

...

 Image Added

 Generate the EMF Model Code


Image Added

 

Modify the State Figure in org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/editor/figures/StateFigure.java

...

by setting the constants NORMAL_BORDER_WIDTH and THICK_BORDER_WIDTH and adding two variables isDoubleLineBorder and isThickBorder. If the value of isDoubleLineBorder is set to true, the RoundedRectangle is represented with a double line border. If the value of isThickBorder is set to true, the RoundedRectangle is represented with a thicker line border.

Image Modified

...

Overwrite the outlineShape method

 

Image Modified

And add the method getBorderWidth

Image Modified

 

  1. Modify the Propertysheets (org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/propertysheets/StatePropertySection.java) by adding an Is Initial ComboBox and an Is Final ComboBox. The user may select the option true or false.








    After that, the State Properties View will look like this:






  2. Modify the State EditPart (org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/editparts/StateEditPart.java) by adding the following code lines in the method handleNotificationEvent to update the border width or to add a double line border to the state, if the user changes the Is Initial or Is Final options.


  3. Remove the Initial and Final State Icon from the palette by removing them from the list of Elements situated in the file org.yakindu.sct.ui.editor/plugin.xml.

  4. Modify the SGraphValidator (org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/util/SGraphValidator.java).

  5. The creation wizard creates a new diagram which includes an Initial State and a Normal State. We should modify the creation wizard by modifying the method createStatechartModel (org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/factories/FactoryUtils.java)



  6. Clean the code where the old Initial and Final States are implemented (FinalStateFigure, InitialStateFigure, ...)