|
@@ -1,5 +1,5 @@
|
|
|
import * as React from "react";
|
|
|
-import {SimpleGrid, Text, Title, Stack, Center, Switch, Group, Space} from "@mantine/core";
|
|
|
+import {SimpleGrid, Text, Title, Stack, Center, Image, Group, Space} from "@mantine/core";
|
|
|
|
|
|
import {PrimitiveRegistry} from "../onion/primitive_delta";
|
|
|
import {mockUuid} from "../onion/test_helpers";
|
|
@@ -8,6 +8,11 @@ import {newVersionedModel, VersionedModelState} from "./versioned_model";
|
|
|
import {newCorrespondence} from "./correspondence";
|
|
|
import {newManualRenderer, ManualRendererProps} from "./manual_renderer";
|
|
|
import {makeInfoHoverCardIcon} from "./help_icons";
|
|
|
+import corr_csImage from './assets/corr_cs.svg';
|
|
|
+import corr_asImage from './assets/corr_as.svg';
|
|
|
+import corr_corrImage from './assets/corr_corr.svg';
|
|
|
+import {Actionblock, Resultblock} from "./blocks";
|
|
|
+
|
|
|
|
|
|
export const demo_Corr_description =
|
|
|
<>
|
|
@@ -15,8 +20,101 @@ export const demo_Corr_description =
|
|
|
Correspondence Model
|
|
|
</Title>
|
|
|
<Text>
|
|
|
- To be done.
|
|
|
+ The different parts we have seen in the previous demos, are now in combined in different tabs in one column.
|
|
|
+ The second row is just a copy of the upper one to enable the simultaneous observation of changes in the
|
|
|
+ different models.
|
|
|
+ </Text>
|
|
|
+ <Text>
|
|
|
+ The following picture shows the connection of the different models combined in the "Concrete Syntax" (CS)
|
|
|
+ column.
|
|
|
+ The two abstraction levels of Deltas L1 and L0 are combined as "Delta(s)" and the History is ommitted in the
|
|
|
+ picture.
|
|
|
+ </Text>
|
|
|
+ <Image src={corr_csImage}/>
|
|
|
+ <Space h="10px"/>
|
|
|
+ <Text>
|
|
|
+ Analogously, the third column combines the different models shown in the first demo "Primitive Delta" into
|
|
|
+ one view, representing the "Abstract Syntax model" (AS).
|
|
|
+ The difference to the Concrete Syntax in the first column is, that there is no additional "user-friendly"
|
|
|
+ editor for editing the state. Instead, the state graph can be manipulated directly as reflected in the
|
|
|
+ following picture:
|
|
|
+ </Text>
|
|
|
+ <Image src={corr_asImage}/>
|
|
|
+ <Space h="10px"/>
|
|
|
+ <Text>
|
|
|
+ Inbetween the CS and AS the "Correspondence model" (Corr) encapsulates and connects the Deltas of the CS and
|
|
|
+ AS models as visualized in the following picture.
|
|
|
+ </Text>
|
|
|
+ <Image src={corr_corrImage}/>
|
|
|
+ <Space h="10px"/>
|
|
|
+ <Text>
|
|
|
+ The creation of Deltas of the Correspondence model and AS Deltas is triggered by the "Parsing" process.
|
|
|
+ Parsing can either be automatically started after each user interaction or interactively at specific points
|
|
|
+ in time, simulated by pressing the "Parse >>" button in the upper right corner of the first column.
|
|
|
+ </Text>
|
|
|
+ <Text>
|
|
|
+ In turn, changes to the AS model are taken into account in the rendering process. As some user interaction
|
|
|
+ may be required due to missing information such as layout information, this process is not automatically
|
|
|
+ triggered by default.
|
|
|
+ </Text>
|
|
|
+ <Text>
|
|
|
+ Common to all these three models (CS, Corr, AS) is the central foundation in Deltas encoding any change of
|
|
|
+ the state graph. On this generic basis all other functionality is built on: conflict detection, versioning,
|
|
|
+ undo/redo, etc. That is also the reason why these features can be presented in a homogeneous way for each of
|
|
|
+ the models.
|
|
|
+ </Text>
|
|
|
+ <Text>
|
|
|
+ The interesting part is now the parsing (CS → AS) and rendering (AS → CS).
|
|
|
</Text>
|
|
|
+ <Actionblock>
|
|
|
+ 1. Create a Rountangle!
|
|
|
+ </Actionblock>
|
|
|
+ <Resultblock>
|
|
|
+ Below the rountangle editor, the new State graph of the CS is shown.
|
|
|
+ </Resultblock>
|
|
|
+ <Resultblock>
|
|
|
+ Automatic parsing recognizes this rountangle as a state in the AS with ID = 2 and connects both via the
|
|
|
+ Correspondence model by introducing a "connection node" with ID = 1.
|
|
|
+ </Resultblock>
|
|
|
+ <Resultblock>
|
|
|
+ As visualized in the above picture, the Correspondence model contains the complete CS and AS model plus some
|
|
|
+ more information.
|
|
|
+ </Resultblock>
|
|
|
+ <Actionblock>
|
|
|
+ 2. Draw a second Rountangle and move and resize it such that the new rountangle completely surrounds the
|
|
|
+ first one!
|
|
|
+ </Actionblock>
|
|
|
+ <Resultblock>
|
|
|
+ The parser recognizes the (visual) containment relation between the two rountangles and translates this to a
|
|
|
+ "has-parent" relation between the two (abstract) states. Again, you can find this relation also in the correspondence
|
|
|
+ model.
|
|
|
+ </Resultblock>
|
|
|
+ <Actionblock>
|
|
|
+ 3. Create a new State in the AS by a right click in the canvas!
|
|
|
+ </Actionblock>
|
|
|
+ <Actionblock>
|
|
|
+ 4. Press the "<< Render"-button at the top!
|
|
|
+ </Actionblock>
|
|
|
+ <Resultblock>
|
|
|
+ The rendering process detects missing information while it tries to create a CS model for the new state.
|
|
|
+ </Resultblock>
|
|
|
+ <Resultblock>
|
|
|
+ A new dialog appears where one can position/size the new rectangle.
|
|
|
+ </Resultblock>
|
|
|
+ <Resultblock>
|
|
|
+ The system does not allow any position/size whose parsing would result in a different AS (e.g., additional or missing "hasParent" relation).
|
|
|
+ </Resultblock>
|
|
|
+ <Actionblock>
|
|
|
+ 5. Position the new state according to the given constraints!
|
|
|
+ </Actionblock>
|
|
|
+ <Resultblock>
|
|
|
+ Your CS model is updated and the rountangles are visualized accordingly.
|
|
|
+ </Resultblock>
|
|
|
+ <Space h="20px"/>
|
|
|
+ {/* TODO: remove z-index!
|
|
|
+ TODO: deleted nodes/Rountangles are still considered in the "Missing information"-dialog
|
|
|
+ TODO: everywhere: Arrows with directions!
|
|
|
+ */}
|
|
|
</>;
|
|
|
|
|
|
export function getDemoCorr() {
|
|
@@ -93,7 +191,7 @@ export function getDemoCorr() {
|
|
|
<Space h="sm"/>
|
|
|
<Stack>
|
|
|
{csComponents.makeTabs("editor", csTabs)}
|
|
|
- {csComponents.makeTabs("history", csTabs)}
|
|
|
+ {csComponents.makeTabs("state", csTabs)}
|
|
|
<Center>
|
|
|
{csComponents.undoRedoButtons}
|
|
|
<Space w="sm"/>
|