Class Diagram top/bottom example
See original GitHub issueHi,
I’m a new engineer for the OpenCAESAR project at NASA’s JPL. I’ve been trying to learn how sprotty works and admittedly it’s been difficult since there doesn’t appear to be a lot of documentation.
How exactly should we add labels similar to the top/bottom labels in the Class Diagram example? I looked at the source and it seems like they’re implemented directly in some sort of schema, but why is it done this way?
<SLabelSchema> {
id: 'edge1_label_bottom',
type: 'label:text',
text: 'bottom',
edgePlacement: {
position: 0,
side: 'bottom',
}
},
What if we want different text to render based on certain conditions? Should I be extending the SLabelView?
We created our own LSP with Xtext. Below is a piece of our DiagramGenerator, and the subtext child for the edge below is what I’m trying to render right next to the origin of the edge.
protected dispatch def void addToDiagram(ReifiedRelationship relationship, SGraph diagram) {
if (relationship.source === null || relationship.target === null) {
return
}
postProcesses.add([
var source = semantic2diagram.get(relationship.source)
if (source === null) {
relationship.source.addToDiagram(diagram)
source = semantic2diagram.get(relationship.source)
}
var target = semantic2diagram.get(relationship.target)
if (target === null) {
relationship.target.addToDiagram(diagram)
target = semantic2diagram.get(relationship.target)
}
val id = relationship.getLocalName(resource)
val edge = newEdge(source, target, id, "augments") => [
children += newSElement(SLabel, id + '-label', 'text') => [
text = id
]
if (relationship.inverseFunctional) {
children += newSElement(SLabel, 'oml-invFunc', 'subtext') => [
text = "[0,1]"
]
}
]
semantic2diagram.get(resource.contents.head).children += edge
trace(edge, relationship)
])
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:32 (14 by maintainers)
Top Results From Across the Web
UML Class Diagram Tutorial - Visual Paradigm
A Comprehensive UML Class Diagram tutorial written for everyone who want to learn about Class Diagram. Read this UML guide and learn UML...
Read more >General and common command to handle graphic layout in ...
Appendix: Examples on all diagram with style. DONE. FYI: all is only good for Sequence diagram; title , caption and ...
Read more >The UML 2 class diagram - IBM Developer
Explore the UML 2.0 class diagram, a tool that can be used to help you understand the static structure of classifiers in a...
Read more >transform-origin - CSS: Cascading Style Sheets | MDN
This example shows the effect of choosing different transform-origin values for a variety of transformation functions.
Read more >UML Class Diagram Tutorial | Lucidchart
The Ultimate Guide to Class Diagrams in UML - Includes an overview of class diagrams in UML, benefits for using them, their basic...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Sorry for the accidental close/reopen.
I’m happy to report that the upgrades were successful. We are now on sprotty and theia
next. Though I am still wondering about my question above.Next, I’ll try to add the filter widget as we discussed before.
To continue the discussion: