@formicoidea/labre-framework-uml 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +384 -0
- package/dist/actions.d.ts +430 -0
- package/dist/actions.js +724 -0
- package/dist/background.d.ts +153 -0
- package/dist/background.js +557 -0
- package/dist/board-hit.d.ts +137 -0
- package/dist/board-hit.js +191 -0
- package/dist/commands-manifest.d.ts +19 -0
- package/dist/commands-manifest.js +571 -0
- package/dist/commands.d.ts +4 -0
- package/dist/commands.js +983 -0
- package/dist/component.d.ts +521 -0
- package/dist/component.js +708 -0
- package/dist/consts.d.ts +365 -0
- package/dist/consts.js +463 -0
- package/dist/descriptor.d.ts +12 -0
- package/dist/descriptor.js +10 -0
- package/dist/drawio-decode.d.ts +32 -0
- package/dist/drawio-decode.js +96 -0
- package/dist/drawio-import.d.ts +133 -0
- package/dist/drawio-import.js +885 -0
- package/dist/edge-morph.d.ts +154 -0
- package/dist/edge-morph.js +153 -0
- package/dist/edge-styles.d.ts +78 -0
- package/dist/edge-styles.js +210 -0
- package/dist/effects.d.ts +9 -0
- package/dist/effects.js +6 -0
- package/dist/element-renderer.d.ts +64 -0
- package/dist/element-renderer.js +114 -0
- package/dist/element-view.d.ts +234 -0
- package/dist/element-view.js +430 -0
- package/dist/export.d.ts +61 -0
- package/dist/export.js +41 -0
- package/dist/filename.d.ts +17 -0
- package/dist/filename.js +26 -0
- package/dist/frame-tag.d.ts +70 -0
- package/dist/frame-tag.js +78 -0
- package/dist/grammar.d.ts +695 -0
- package/dist/grammar.js +1436 -0
- package/dist/import.d.ts +306 -0
- package/dist/import.js +1270 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.js +67 -0
- package/dist/interchange.d.ts +125 -0
- package/dist/interchange.js +372 -0
- package/dist/keywords.d.ts +204 -0
- package/dist/keywords.js +361 -0
- package/dist/kinds.d.ts +73 -0
- package/dist/kinds.js +91 -0
- package/dist/legend.d.ts +30 -0
- package/dist/legend.js +255 -0
- package/dist/model.d.ts +862 -0
- package/dist/model.js +1316 -0
- package/dist/morph.d.ts +178 -0
- package/dist/morph.js +496 -0
- package/dist/node/act-glyphs.d.ts +30 -0
- package/dist/node/act-glyphs.js +142 -0
- package/dist/node/compartment-watcher.d.ts +107 -0
- package/dist/node/compartment-watcher.js +163 -0
- package/dist/node/fit.d.ts +85 -0
- package/dist/node/fit.js +129 -0
- package/dist/node/node-renderer.d.ts +49 -0
- package/dist/node/node-renderer.js +611 -0
- package/dist/node/node-view.d.ts +51 -0
- package/dist/node/node-view.js +89 -0
- package/dist/node/paint.d.ts +84 -0
- package/dist/node/paint.js +143 -0
- package/dist/node/sd-glyphs.d.ts +36 -0
- package/dist/node/sd-glyphs.js +79 -0
- package/dist/node/stm-glyphs.d.ts +22 -0
- package/dist/node/stm-glyphs.js +111 -0
- package/dist/node/tier-metrics.d.ts +38 -0
- package/dist/node/tier-metrics.js +45 -0
- package/dist/operators.d.ts +45 -0
- package/dist/operators.js +75 -0
- package/dist/plantuml-import.d.ts +113 -0
- package/dist/plantuml-import.js +1723 -0
- package/dist/plantuml.d.ts +94 -0
- package/dist/plantuml.js +985 -0
- package/dist/presets.d.ts +149 -0
- package/dist/presets.js +302 -0
- package/dist/profiles.d.ts +2 -0
- package/dist/profiles.js +358 -0
- package/dist/reading.d.ts +160 -0
- package/dist/reading.js +648 -0
- package/dist/roles.d.ts +257 -0
- package/dist/roles.js +997 -0
- package/dist/rules.d.ts +267 -0
- package/dist/rules.js +3090 -0
- package/dist/templates.d.ts +2 -0
- package/dist/templates.js +197 -0
- package/dist/toolbar/config.d.ts +228 -0
- package/dist/toolbar/config.js +833 -0
- package/dist/toolbar/icons.d.ts +440 -0
- package/dist/toolbar/icons.js +711 -0
- package/dist/toolbar/senior-tool.d.ts +11 -0
- package/dist/toolbar/senior-tool.js +21 -0
- package/dist/toolbar/uml-menu.d.ts +17 -0
- package/dist/toolbar/uml-menu.js +20 -0
- package/dist/toolbar/uml-senior-button.d.ts +18 -0
- package/dist/toolbar/uml-senior-button.js +22 -0
- package/dist/translations.d.ts +27 -0
- package/dist/translations.js +117 -0
- package/dist/view.d.ts +33 -0
- package/dist/view.js +236 -0
- package/dist/xmi-import.d.ts +174 -0
- package/dist/xmi-import.js +2268 -0
- package/dist/xmi.d.ts +61 -0
- package/dist/xmi.js +1860 -0
- package/dist/xml-reader.d.ts +157 -0
- package/dist/xml-reader.js +430 -0
- package/dist/xml.d.ts +72 -0
- package/dist/xml.js +96 -0
- package/package.json +38 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type ElementRenderer } from '@formicoidea/labre-core/blocks/surface';
|
|
2
|
+
import type { UmlDiagramElementModel, UmlFragmentElementModel, UmlPartitionElementModel, UmlRegionElementModel, UmlSubjectElementModel } from '@formicoidea/labre-core/model';
|
|
3
|
+
/**
|
|
4
|
+
* Canvas renderers for the four UML frames.
|
|
5
|
+
*
|
|
6
|
+
* There is almost no UML drawing code here: both are INSTANTIATIONS of the
|
|
7
|
+
* framework-background primitive, configured by the declarations in
|
|
8
|
+
* `background.ts`. The diagram frame adds exactly one thing the primitive has no
|
|
9
|
+
* vocabulary for — the cut-corner heading tag of Annex A — through the decorator
|
|
10
|
+
* in `frame-tag.ts`.
|
|
11
|
+
*
|
|
12
|
+
* Exported as functions as well as extensions because the fidelity suite drives
|
|
13
|
+
* them directly with a canvas stub.
|
|
14
|
+
*/
|
|
15
|
+
export declare const umlDiagram: ElementRenderer<UmlDiagramElementModel>;
|
|
16
|
+
export declare const UmlDiagramRendererExtension: import("@formicoidea/labre-core/store/index.js").ExtensionType & {
|
|
17
|
+
identifier: import("@formicoidea/labre-core/_pkgs/global/di/types.js").ServiceIdentifier<ElementRenderer<UmlDiagramElementModel>>;
|
|
18
|
+
};
|
|
19
|
+
export declare const umlSubject: ElementRenderer<UmlSubjectElementModel>;
|
|
20
|
+
export declare const UmlSubjectRendererExtension: import("@formicoidea/labre-core/store/index.js").ExtensionType & {
|
|
21
|
+
identifier: import("@formicoidea/labre-core/_pkgs/global/di/types.js").ServiceIdentifier<ElementRenderer<UmlSubjectElementModel>>;
|
|
22
|
+
};
|
|
23
|
+
export declare const umlPartition: ElementRenderer<UmlPartitionElementModel>;
|
|
24
|
+
export declare const UmlPartitionRendererExtension: import("@formicoidea/labre-core/store/index.js").ExtensionType & {
|
|
25
|
+
identifier: import("@formicoidea/labre-core/_pkgs/global/di/types.js").ServiceIdentifier<ElementRenderer<UmlPartitionElementModel>>;
|
|
26
|
+
};
|
|
27
|
+
/** The composite state (§14.2.4) — one declaration, no orientation to turn. */
|
|
28
|
+
export declare const umlRegion: ElementRenderer<UmlRegionElementModel>;
|
|
29
|
+
export declare const UmlRegionRendererExtension: import("@formicoidea/labre-core/store/index.js").ExtensionType & {
|
|
30
|
+
identifier: import("@formicoidea/labre-core/_pkgs/global/di/types.js").ServiceIdentifier<ElementRenderer<UmlRegionElementModel>>;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* A SPLIT fragment as it is painted: its declared `name` hidden behind operand
|
|
34
|
+
* zero's own guard.
|
|
35
|
+
*
|
|
36
|
+
* The contract is `background.ts`'s — an unsplit fragment's guard is the
|
|
37
|
+
* background's `name`, a split one's guards are its `operands[].name` and
|
|
38
|
+
* nothing else — and the writers keep it (`toolbar/config.ts` clears `name` as
|
|
39
|
+
* it splits, `import.ts` never writes both). This is the DEFENSIVE half: the
|
|
40
|
+
* declared guard label and operand zero's are anchored in the very same corner,
|
|
41
|
+
* so a document that still carries both — one written by an older build, or by
|
|
42
|
+
* hand — would paint two strings one over the other, which reads as a smudge
|
|
43
|
+
* rather than as a mistake. A shadowing own prop rather than a second
|
|
44
|
+
* declaration, because the suppression is conditional on another prop and the
|
|
45
|
+
* declaration language has no vocabulary for that (`visibleProp` gates on
|
|
46
|
+
* presence, never on absence).
|
|
47
|
+
*
|
|
48
|
+
* ## Exported, because the HIT TEST has to read the same declaration
|
|
49
|
+
*
|
|
50
|
+
* A suppression the renderer keeps to itself is a label drawn nowhere and
|
|
51
|
+
* clickable anyway: `UmlFragmentView` derives its rename boxes from
|
|
52
|
+
* `backgroundLabelHits`, and given the raw model that call still returns
|
|
53
|
+
* `name`'s box — so a double-click in the corner of such a document would open
|
|
54
|
+
* an editor on a string the canvas does not paint. The view therefore hit-tests
|
|
55
|
+
* against THIS declaration rather than the stored one
|
|
56
|
+
* (`element-view.ts`, `UmlFragmentView._painted`), which is the invariant the
|
|
57
|
+
* class comment there already claims: "a label can never be drawn in one place
|
|
58
|
+
* and clicked in another".
|
|
59
|
+
*/
|
|
60
|
+
export declare function umlFragmentAsPainted(model: UmlFragmentElementModel): UmlFragmentElementModel;
|
|
61
|
+
export declare const umlFragment: ElementRenderer<UmlFragmentElementModel>;
|
|
62
|
+
export declare const UmlFragmentRendererExtension: import("@formicoidea/labre-core/store/index.js").ExtensionType & {
|
|
63
|
+
identifier: import("@formicoidea/labre-core/_pkgs/global/di/types.js").ServiceIdentifier<ElementRenderer<UmlFragmentElementModel>>;
|
|
64
|
+
};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { createFrameworkBackgroundRenderer, ElementRendererExtension, } from '@formicoidea/labre-core/blocks/surface';
|
|
2
|
+
import { UML_DIAGRAM_FRAME, UML_FRAGMENT_FRAME, UML_PARTITION_FRAME_H, UML_PARTITION_FRAME_V, UML_REGION_FRAME, UML_SUBJECT_FRAME, } from './background.js';
|
|
3
|
+
import { UML_DIAGRAM_MARGIN, UML_FRAGMENT_BAND, UML_FRAGMENT_BORDER_WIDTH, UML_FRAGMENT_MARGIN, UML_FRAME_BAND_HEIGHT, UML_FRAME_BORDER_WIDTH, UML_FRAME_INK, UML_FRAME_TAG_CUT, UML_FRAME_TAG_FOOT, } from './consts.js';
|
|
4
|
+
import { withUmlFrameTag } from './frame-tag.js';
|
|
5
|
+
/**
|
|
6
|
+
* Canvas renderers for the four UML frames.
|
|
7
|
+
*
|
|
8
|
+
* There is almost no UML drawing code here: both are INSTANTIATIONS of the
|
|
9
|
+
* framework-background primitive, configured by the declarations in
|
|
10
|
+
* `background.ts`. The diagram frame adds exactly one thing the primitive has no
|
|
11
|
+
* vocabulary for — the cut-corner heading tag of Annex A — through the decorator
|
|
12
|
+
* in `frame-tag.ts`.
|
|
13
|
+
*
|
|
14
|
+
* Exported as functions as well as extensions because the fidelity suite drives
|
|
15
|
+
* them directly with a canvas stub.
|
|
16
|
+
*/
|
|
17
|
+
export const umlDiagram = withUmlFrameTag(UML_DIAGRAM_FRAME, {
|
|
18
|
+
// The DERIVED `<kind> <name>` the declaration's band label paints.
|
|
19
|
+
prop: 'heading',
|
|
20
|
+
bandHeight: UML_FRAME_BAND_HEIGHT,
|
|
21
|
+
foot: UML_FRAME_TAG_FOOT,
|
|
22
|
+
// The plot's left inset: the heading starts there, so a tag padded by the
|
|
23
|
+
// same number has its words centred in it, with one number and no drift.
|
|
24
|
+
padding: UML_DIAGRAM_MARGIN,
|
|
25
|
+
cut: UML_FRAME_TAG_CUT,
|
|
26
|
+
stroke: UML_FRAME_INK,
|
|
27
|
+
lineWidth: UML_FRAME_BORDER_WIDTH,
|
|
28
|
+
});
|
|
29
|
+
export const UmlDiagramRendererExtension = ElementRendererExtension(UML_DIAGRAM_FRAME.type, umlDiagram);
|
|
30
|
+
export const umlSubject = createFrameworkBackgroundRenderer(UML_SUBJECT_FRAME);
|
|
31
|
+
export const UmlSubjectRendererExtension = ElementRendererExtension(UML_SUBJECT_FRAME.type, umlSubject);
|
|
32
|
+
/**
|
|
33
|
+
* The activity partition (§15.6.4), in whichever orientation the element
|
|
34
|
+
* declares.
|
|
35
|
+
*
|
|
36
|
+
* The one renderer in the pack that CHOOSES a declaration rather than being
|
|
37
|
+
* built from one, and the choice is two lines because the alternative is a
|
|
38
|
+
* change to the declaration language: a side band's edge and the geometry's deep
|
|
39
|
+
* margin are not things `variantProp` can vary (`background.ts` states the
|
|
40
|
+
* argument in full). So two renderers are built at module load — no work per
|
|
41
|
+
* frame — and the element's own prop picks between them.
|
|
42
|
+
*
|
|
43
|
+
* An orientation this build has never heard of paints the VERTICAL lane rather
|
|
44
|
+
* than nothing, the same promise the diagram frame's heading makes about an
|
|
45
|
+
* unknown kind.
|
|
46
|
+
*/
|
|
47
|
+
const umlPartitionV = createFrameworkBackgroundRenderer(UML_PARTITION_FRAME_V);
|
|
48
|
+
const umlPartitionH = createFrameworkBackgroundRenderer(UML_PARTITION_FRAME_H);
|
|
49
|
+
export const umlPartition = (model, ...rest) => (model.orientation === 'horizontal' ? umlPartitionH : umlPartitionV)(model, ...rest);
|
|
50
|
+
export const UmlPartitionRendererExtension = ElementRendererExtension(UML_PARTITION_FRAME_V.type, umlPartition);
|
|
51
|
+
/** The composite state (§14.2.4) — one declaration, no orientation to turn. */
|
|
52
|
+
export const umlRegion = createFrameworkBackgroundRenderer(UML_REGION_FRAME);
|
|
53
|
+
export const UmlRegionRendererExtension = ElementRendererExtension(UML_REGION_FRAME.type, umlRegion);
|
|
54
|
+
/**
|
|
55
|
+
* The combined fragment (§17.6.4) — the second frame in the pack to wear Annex
|
|
56
|
+
* A's cut-corner pentagon, and the reason `frame-tag.ts` was written as a
|
|
57
|
+
* parameterised decorator rather than as the diagram frame's own private code.
|
|
58
|
+
*
|
|
59
|
+
* The word in the tag is the OPERATOR and not a derived heading: a fragment
|
|
60
|
+
* says one word about itself, and the guard is written down in the operand
|
|
61
|
+
* rather than beside the operator (`background.ts`).
|
|
62
|
+
*/
|
|
63
|
+
const paintUmlFragment = withUmlFrameTag(UML_FRAGMENT_FRAME, {
|
|
64
|
+
prop: 'operator',
|
|
65
|
+
bandHeight: UML_FRAGMENT_BAND,
|
|
66
|
+
foot: UML_FRAME_TAG_FOOT,
|
|
67
|
+
// The plot's left inset, as the diagram frame's padding is its own: the
|
|
68
|
+
// operator is written at the plot's left edge, so a tag padded by the same
|
|
69
|
+
// number has its word centred in it, with one number and no drift.
|
|
70
|
+
padding: UML_FRAGMENT_MARGIN,
|
|
71
|
+
cut: UML_FRAME_TAG_CUT,
|
|
72
|
+
stroke: UML_FRAME_INK,
|
|
73
|
+
lineWidth: UML_FRAGMENT_BORDER_WIDTH,
|
|
74
|
+
});
|
|
75
|
+
/**
|
|
76
|
+
* A SPLIT fragment as it is painted: its declared `name` hidden behind operand
|
|
77
|
+
* zero's own guard.
|
|
78
|
+
*
|
|
79
|
+
* The contract is `background.ts`'s — an unsplit fragment's guard is the
|
|
80
|
+
* background's `name`, a split one's guards are its `operands[].name` and
|
|
81
|
+
* nothing else — and the writers keep it (`toolbar/config.ts` clears `name` as
|
|
82
|
+
* it splits, `import.ts` never writes both). This is the DEFENSIVE half: the
|
|
83
|
+
* declared guard label and operand zero's are anchored in the very same corner,
|
|
84
|
+
* so a document that still carries both — one written by an older build, or by
|
|
85
|
+
* hand — would paint two strings one over the other, which reads as a smudge
|
|
86
|
+
* rather than as a mistake. A shadowing own prop rather than a second
|
|
87
|
+
* declaration, because the suppression is conditional on another prop and the
|
|
88
|
+
* declaration language has no vocabulary for that (`visibleProp` gates on
|
|
89
|
+
* presence, never on absence).
|
|
90
|
+
*
|
|
91
|
+
* ## Exported, because the HIT TEST has to read the same declaration
|
|
92
|
+
*
|
|
93
|
+
* A suppression the renderer keeps to itself is a label drawn nowhere and
|
|
94
|
+
* clickable anyway: `UmlFragmentView` derives its rename boxes from
|
|
95
|
+
* `backgroundLabelHits`, and given the raw model that call still returns
|
|
96
|
+
* `name`'s box — so a double-click in the corner of such a document would open
|
|
97
|
+
* an editor on a string the canvas does not paint. The view therefore hit-tests
|
|
98
|
+
* against THIS declaration rather than the stored one
|
|
99
|
+
* (`element-view.ts`, `UmlFragmentView._painted`), which is the invariant the
|
|
100
|
+
* class comment there already claims: "a label can never be drawn in one place
|
|
101
|
+
* and clicked in another".
|
|
102
|
+
*/
|
|
103
|
+
export function umlFragmentAsPainted(model) {
|
|
104
|
+
const operands = model.operands;
|
|
105
|
+
if (!Array.isArray(operands) || operands.length === 0)
|
|
106
|
+
return model;
|
|
107
|
+
if (!model.name)
|
|
108
|
+
return model;
|
|
109
|
+
return Object.create(model, {
|
|
110
|
+
name: { value: '', enumerable: true },
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
export const umlFragment = (model, ...rest) => paintUmlFragment(umlFragmentAsPainted(model), ...rest);
|
|
114
|
+
export const UmlFragmentRendererExtension = ElementRendererExtension(UML_FRAGMENT_FRAME.type, umlFragment);
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import type { BackgroundLabelHit, EditableBackgroundLabel, FrameworkBackgroundDef } from '@formicoidea/labre-core/blocks/surface';
|
|
2
|
+
import { DeclaredBackgroundView } from '@formicoidea/labre-core/blocks/surface';
|
|
3
|
+
import type { UmlDiagramElementModel, UmlFragmentElementModel, UmlPartitionElementModel, UmlRegionElementModel, UmlSubjectElementModel } from '@formicoidea/labre-core/model';
|
|
4
|
+
import type { EditorHost } from '@formicoidea/labre-core/std';
|
|
5
|
+
import type { PointTestOptions } from '@formicoidea/labre-core/std/gfx';
|
|
6
|
+
/**
|
|
7
|
+
* The one gesture every UML frame carries: a double-click on the name edits it
|
|
8
|
+
* in place.
|
|
9
|
+
*
|
|
10
|
+
* The gesture itself — the rotation arithmetic, the widened `includesPoint`,
|
|
11
|
+
* the double-click handler and the `<input>` — is the library's shared one,
|
|
12
|
+
* `DeclaredBackgroundView` (issue #355, R14: extend, never copy). What this
|
|
13
|
+
* class adds is only what UML answers differently: WHICH words a double-click
|
|
14
|
+
* aims at, and the model those words are read from.
|
|
15
|
+
*
|
|
16
|
+
* Which labels exist, where they sit and what they SAY all come from the
|
|
17
|
+
* declaration the renderer paints (`backgroundLabelHits`), so a label can never
|
|
18
|
+
* be drawn in one place and clicked in another — which is why this class has no
|
|
19
|
+
* coordinates of its own.
|
|
20
|
+
*
|
|
21
|
+
* ponytail: like every other framework view in the library, only `name` may be
|
|
22
|
+
* written — see {@link UmlDiagramView} for what that costs the diagram frame,
|
|
23
|
+
* whose drawn label is not `name`.
|
|
24
|
+
*/
|
|
25
|
+
declare abstract class UmlFrameView<T extends UmlDiagramElementModel | UmlSubjectElementModel | UmlPartitionElementModel | UmlRegionElementModel | UmlFragmentElementModel> extends DeclaredBackgroundView<T> {
|
|
26
|
+
/**
|
|
27
|
+
* The model this view hit-tests against — the one the RENDERER was handed.
|
|
28
|
+
*
|
|
29
|
+
* The stored model for every frame but one, and the hook exists for that one:
|
|
30
|
+
* a combined fragment paints through `umlFragmentAsPainted`, which hides a
|
|
31
|
+
* declared `name` that operand zero's guard already covers. The boxes
|
|
32
|
+
* `backgroundLabelHits` derives are only the drawn words if they are derived
|
|
33
|
+
* from the same declaration — otherwise the suppressed corner stays clickable
|
|
34
|
+
* and opens an editor on a string nothing paints.
|
|
35
|
+
*
|
|
36
|
+
* A getter and not a cached value: the props it reads are the document's, and
|
|
37
|
+
* a view outlives every edit to them.
|
|
38
|
+
*/
|
|
39
|
+
protected get _painted(): T;
|
|
40
|
+
/**
|
|
41
|
+
* The declaration's editable labels, element-local, derived from the PAINTED
|
|
42
|
+
* model — see {@link _painted}. This is `DeclaredBackgroundView.labelAt`'s
|
|
43
|
+
* own walk with that one substitution, which is why the frames below do not
|
|
44
|
+
* call `super.labelAt`.
|
|
45
|
+
*/
|
|
46
|
+
protected _hits(w: number, h: number): BackgroundLabelHit[];
|
|
47
|
+
/**
|
|
48
|
+
* Which region of the frame aims at the name, given an ELEMENT-LOCAL point.
|
|
49
|
+
*
|
|
50
|
+
* The DRAWN WORDS by default — the box `backgroundLabelHits` derives from the
|
|
51
|
+
* very anchor the renderer paints at. That is the right answer for a name
|
|
52
|
+
* written INSIDE the plot, over the drawing, where anything wider would
|
|
53
|
+
* swallow clicks meant for the elements around it: the subject's name sits in
|
|
54
|
+
* its top-left corner, and this is its whole story.
|
|
55
|
+
*
|
|
56
|
+
* A frame whose name has a band of its own overrides this — see
|
|
57
|
+
* {@link UmlDiagramView}.
|
|
58
|
+
*/
|
|
59
|
+
protected labelAt(lx: number, ly: number, w: number, h: number): EditableBackgroundLabel | null;
|
|
60
|
+
/**
|
|
61
|
+
* The name label, answered over a whole BAND rather than over its words —
|
|
62
|
+
* for the frames whose name has a strip of its own.
|
|
63
|
+
*
|
|
64
|
+
* @param inBand whether the point is in the frame's band, as the frame's own
|
|
65
|
+
* band helper (`board-hit.ts`) decides.
|
|
66
|
+
*/
|
|
67
|
+
protected _nameInBand(inBand: boolean, w: number, h: number): EditableBackgroundLabel | null;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* The sheet a UML diagram is drawn on. Double-click ANYWHERE in its heading band
|
|
71
|
+
* to rename it.
|
|
72
|
+
*
|
|
73
|
+
* The band and not the words, which is the first thing this subclass changes —
|
|
74
|
+
* the same call the C4 board and the BPMN pool's participant band both make: a
|
|
75
|
+
* strip you may only double-click the eleven characters of is a target that lies
|
|
76
|
+
* about where it is. Here it also buys something they do not need: the tag is
|
|
77
|
+
* drawn round the words with padding on either side, so a user aiming at the
|
|
78
|
+
* pentagon they can see is inside the zone whether or not they hit a glyph.
|
|
79
|
+
*
|
|
80
|
+
* The second is what the editor opens on, and that is the one place UML parts
|
|
81
|
+
* company with the C4 board it is modelled on. Annex A's heading is
|
|
82
|
+
* `<kind> <name>` — a derived string, joined from a closed discriminant the
|
|
83
|
+
* picker owns and a name the author owns — so opening on the drawn words would
|
|
84
|
+
* hand the user `class Orders` to edit, and committing it would write the kind
|
|
85
|
+
* INTO the name, to be prefixed again on the next paint. The editor therefore
|
|
86
|
+
* opens on `name` — the author's half — and writes `name` back, never the drawn
|
|
87
|
+
* label's own prop: `heading` is a getter, and a getter is not somewhere a
|
|
88
|
+
* rename can land.
|
|
89
|
+
*/
|
|
90
|
+
export declare class UmlDiagramView extends UmlFrameView<UmlDiagramElementModel> {
|
|
91
|
+
static type: string;
|
|
92
|
+
protected get def(): FrameworkBackgroundDef;
|
|
93
|
+
protected labelAt(lx: number, ly: number, w: number, h: number): EditableBackgroundLabel | null;
|
|
94
|
+
}
|
|
95
|
+
/** The rectangle drawn round a system's use cases. Double-click its name. */
|
|
96
|
+
export declare class UmlSubjectView extends UmlFrameView<UmlSubjectElementModel> {
|
|
97
|
+
static type: string;
|
|
98
|
+
protected get def(): FrameworkBackgroundDef;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* An activity swimlane (§15.6.4). Double-click ANYWHERE in its name band to
|
|
102
|
+
* rename it — across the top of a vertical lane, down the left edge of a
|
|
103
|
+
* horizontal one.
|
|
104
|
+
*
|
|
105
|
+
* The band and not the words, the same call the diagram frame makes: a strip you
|
|
106
|
+
* may only double-click the eight characters of is a target that lies about
|
|
107
|
+
* where it is. It matters more here than on the sheet, because a partition is
|
|
108
|
+
* TRANSPARENT: every point that is not its own furniture falls through to the
|
|
109
|
+
* actions drawn inside it, so the header is the only place a user can take hold
|
|
110
|
+
* of the lane at all.
|
|
111
|
+
*
|
|
112
|
+
* The declaration this hit-tests against is chosen by the element's own
|
|
113
|
+
* `orientation`, through the one function that makes that choice — so the view,
|
|
114
|
+
* the renderer and the band helper cannot disagree about which edge the band is
|
|
115
|
+
* on.
|
|
116
|
+
*/
|
|
117
|
+
export declare class UmlPartitionView extends UmlFrameView<UmlPartitionElementModel> {
|
|
118
|
+
static type: string;
|
|
119
|
+
protected get def(): FrameworkBackgroundDef;
|
|
120
|
+
protected labelAt(lx: number, ly: number, w: number, h: number): EditableBackgroundLabel | null;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* A composite state (§14.2.4). Double-click anywhere in its name band to rename
|
|
124
|
+
* it.
|
|
125
|
+
*
|
|
126
|
+
* The partition's story with no orientation to turn: the band is across the top,
|
|
127
|
+
* always, because that is where §14.2.4 writes a state's name.
|
|
128
|
+
*/
|
|
129
|
+
export declare class UmlRegionView extends UmlFrameView<UmlRegionElementModel> {
|
|
130
|
+
static type: string;
|
|
131
|
+
protected get def(): FrameworkBackgroundDef;
|
|
132
|
+
protected labelAt(lx: number, ly: number, w: number, h: number): EditableBackgroundLabel | null;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* A COMBINED FRAGMENT (§17.6.4). Two gestures of its own, on top of the rename
|
|
136
|
+
* every UML frame carries:
|
|
137
|
+
*
|
|
138
|
+
* - **dblclick on a GUARD** — the `[condition]` written in an operand's
|
|
139
|
+
* top-left corner — edits that guard in place. On an unsplit fragment there
|
|
140
|
+
* is one, and it is the element's own `name`; once the box has been cut into
|
|
141
|
+
* operands each of them carries its own, in `operands[i].name`;
|
|
142
|
+
* - **drag on an internal operand SEPARATOR** moves the dashed line, taking
|
|
143
|
+
* from one operand and giving to the other.
|
|
144
|
+
*
|
|
145
|
+
* ## The operator is NOT renamed here
|
|
146
|
+
*
|
|
147
|
+
* Double-clicking the pentagon does nothing, deliberately. `operator` is a
|
|
148
|
+
* closed discriminant of thirteen values (§17.6.4 plus §17.7.4's `ref`) and it
|
|
149
|
+
* is picked from the toolbar; a free-text editor over it would let an author
|
|
150
|
+
* type `altt` and lose every rule, every reading and every export that keys on
|
|
151
|
+
* the word. The same call the diagram frame's `kind` already makes.
|
|
152
|
+
*
|
|
153
|
+
* ## How the separator drag takes the gesture
|
|
154
|
+
*
|
|
155
|
+
* Armed, exactly as `BpmnPoolView`'s is and for the reason stated there:
|
|
156
|
+
* `GfxElementModelView.dispatch` reports a drag as handled whenever a handler
|
|
157
|
+
* is REGISTERED, so a permanent `dragstart` would make the fragment
|
|
158
|
+
* undraggable. The handlers are attached while the pointer is over a separator
|
|
159
|
+
* of a SELECTED fragment and detached the moment it is not.
|
|
160
|
+
*
|
|
161
|
+
* ponytail: a ROTATED fragment is not accounted for by the separator drag —
|
|
162
|
+
* its pointer is converted to element-local coordinates by subtraction, so the
|
|
163
|
+
* separator boxes assume an upright frame (the guards do not: the shared base
|
|
164
|
+
* de-rotates before {@link labelAt}). The same reserve `board-hit.ts`
|
|
165
|
+
* documents; nothing rotates a framework background today.
|
|
166
|
+
*/
|
|
167
|
+
export declare class UmlFragmentView extends UmlFrameView<UmlFragmentElementModel> {
|
|
168
|
+
static type: string;
|
|
169
|
+
/** The separator the pointer is over, and the handlers armed for it. */
|
|
170
|
+
private _armed;
|
|
171
|
+
/** Everything a separator drag needs, frozen at `dragstart`. */
|
|
172
|
+
private _drag;
|
|
173
|
+
protected get def(): FrameworkBackgroundDef;
|
|
174
|
+
/**
|
|
175
|
+
* The suppression the renderer applies, read back here so the rename boxes
|
|
176
|
+
* are the drawn words and nothing else.
|
|
177
|
+
*
|
|
178
|
+
* On a SPLIT fragment written by an older build the stored model carries both
|
|
179
|
+
* `name` and `operands`, and the canvas paints operand zero's guard over the
|
|
180
|
+
* declared one's corner — i.e. paints `name` nowhere. `umlFragmentAsPainted`
|
|
181
|
+
* is the single statement of which of the two wins; calling it here is what
|
|
182
|
+
* keeps {@link labelAt}'s fallback from opening an editor on the invisible
|
|
183
|
+
* corner. The operand branch of that method is unaffected: it reads
|
|
184
|
+
* `operands`, which the suppression never touches.
|
|
185
|
+
*/
|
|
186
|
+
protected get _painted(): UmlFragmentElementModel;
|
|
187
|
+
onCreated(): void;
|
|
188
|
+
onDestroyed(): void;
|
|
189
|
+
/**
|
|
190
|
+
* The operand guards first, the declaration's own label second.
|
|
191
|
+
*
|
|
192
|
+
* The order is the order the gestures win in, and it only matters on a SPLIT
|
|
193
|
+
* fragment: the first operand's corner is the very corner the declared
|
|
194
|
+
* `guard` label is anchored in. The operand takes it, because on a split
|
|
195
|
+
* fragment the guards live in `operands` and `name` has been moved into the
|
|
196
|
+
* first of them (`background.ts` states the contract) — handing the
|
|
197
|
+
* double-click to `name` would open an editor on a string nothing paints.
|
|
198
|
+
*/
|
|
199
|
+
protected labelAt(lx: number, ly: number, w: number, h: number): EditableBackgroundLabel | null;
|
|
200
|
+
private _operands;
|
|
201
|
+
/**
|
|
202
|
+
* Write one operand's guard, dropping the key entirely when it is cleared.
|
|
203
|
+
*
|
|
204
|
+
* The same shape `renameBpmnLane` writes: an absent `name` is an unguarded
|
|
205
|
+
* operand — which is what an `else` branch with no condition is — and an
|
|
206
|
+
* empty string left in the array would be a key that means nothing and
|
|
207
|
+
* paints nothing.
|
|
208
|
+
*
|
|
209
|
+
* No undo boundary here: the shared editor captures one before it calls a
|
|
210
|
+
* label's `commit`.
|
|
211
|
+
*/
|
|
212
|
+
private _writeGuard;
|
|
213
|
+
/**
|
|
214
|
+
* A fragment is SELECTED by its border and its operator band — but the
|
|
215
|
+
* internal operand separators are twelve-unit strips in the middle of the
|
|
216
|
+
* plot, and they must still receive their pointer events.
|
|
217
|
+
*
|
|
218
|
+
* Not a selection zone: a click between two messages still goes to whatever
|
|
219
|
+
* is under it, because picking asks the MODEL. This only decides where the
|
|
220
|
+
* fragment's own gestures are heard.
|
|
221
|
+
*/
|
|
222
|
+
includesPoint(x: number, y: number, options: PointTestOptions, host: EditorHost): boolean;
|
|
223
|
+
/** Whether this fragment may be written to at all. */
|
|
224
|
+
private get _writable();
|
|
225
|
+
private _leave;
|
|
226
|
+
private _localPoint;
|
|
227
|
+
/** One pass over the pointer: the cursor, and whether a drag is armed. */
|
|
228
|
+
private _updateHover;
|
|
229
|
+
private _disarm;
|
|
230
|
+
private _onDragStart;
|
|
231
|
+
private _onDragMove;
|
|
232
|
+
private _onDragEnd;
|
|
233
|
+
}
|
|
234
|
+
export {};
|