Changes for page Graphical Modeling with Graphiti
Last modified by msp on 2025/01/30 12:03
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Objects (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -384,7 +384,11 @@ 384 384 385 385 = Handling Text Labels = 386 386 387 -The last section of this tutorial is about text labels in the graphical editor. We will use such labels for state names and transition specifications. The steps required for these tasks are given only coarsely here, since you should now be able to find out yourself about the details using the [[Graphiti documentation>>url:http://www.eclipse.org/graphiti/documentation/||shape="rect"]].387 +The last section of this tutorial is about text labels in the graphical editor. We will use such labels for displaying state names. The steps required for these tasks are given only coarsely here, since you should now be able to find out yourself about the details using the [[Graphiti documentation>>url:http://www.eclipse.org/graphiti/documentation/||shape="rect"]]. 388 388 389 389 1. Add a {{code language="none"}}Text{{/code}} element to states in the {{code language="none"}}StateAddFeature{{/code}} in order to display the name of each state. 390 -1. Create a new class {{code language="none"}}StateDirectEditingFeature{{/code}} extending {{code language="none"}}AbstractDirectEditingFeature{{/code}} and register it by overriding {{code language="none"}}getDirectEditingFeature{{/code}} in the {{code language="none"}}TuringFeatureProvider{{/code}}. This new feature is responsible for connecting the edited text with the name attribute of states. 390 +1. Create a new class {{code language="none"}}StateDirectEditingFeature{{/code}} extending {{code language="none"}}AbstractDirectEditingFeature{{/code}} and register it by overriding {{code language="none"}}getDirectEditingFeature{{/code}} in the {{code language="none"}}TuringFeatureProvider{{/code}}. This new feature is responsible for connecting the name attribute of states with the in-diagram text editing box, i.e. retrieving the current text from the attribute and updating it after the user has entered a new value. 391 +1. Create a new class {{code language="none"}}StateUpdateFeature{{/code}} extending {{code language="none"}}AbstractUpdateFeature{{/code}} and register it by overriding {{code language="none"}}getUpdateFeature{{/code}} in the {{code language="none"}}TuringFeatureProvider{{/code}}. This new feature is responsible for updating the displayed text when the corresponding attribute in the domain model is changed outside the Graphiti editor. For example you could open the Turing Machine model with the //Sample Reflective Ecore Model Editor //in order to modify attributes. You can activate automatic updates of the diagram by extending {{code language="none"}}isAutoUpdateAtRuntime{{/code}} (resp. {{code language="none"}}Startup{{/code}} / {{code language="none"}}Reset{{/code}}) in the {{code language="none"}}TuringDiagramTypeProvider{{/code}} and returning {{code language="none"}}true{{/code}}. The update feature can be invoked explicitly in other features by calling the superclass method {{code language="none"}}updatePictogramElement{{/code}}. 392 +1. Create a new class {{code language="none"}}StateLayoutFeature{{/code}} extending {{code language="none"}}AbstractLayoutFeature{{/code}} and register it by overriding {{code language="none"}}getLayoutFeature{{/code}} in the {{code language="none"}}TuringFeatureProvider{{/code}}. This new feature is responsible for updating the position and size of graphics algorithms of a state when the state is resized in the graphical editor or when the displayed text for the state name is updated. The layout feature can be invoked explicitly in other features by calling the superclass method {{code language="none"}}layoutPictogramElement{{/code}}. 393 + 394 +
- Confluence.Code.ConfluencePageClass[0]
-
- Id
-
... ... @@ -1,1 +1,1 @@ 1 -36045 881 +3604593 - URL
-
... ... @@ -1,1 +1,1 @@ 1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/WS12EclPract/pages/36045 88/Graphical Modeling with Graphiti1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/WS12EclPract/pages/3604593/Graphical Modeling with Graphiti