1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-06-05 01:50:49 +00:00

Remove version from UML:model

This commit is contained in:
Arnaud Roques 2022-08-29 18:43:42 +02:00
parent d586be399b
commit 775d2e16c9
4 changed files with 11 additions and 24 deletions

View File

@ -92,15 +92,11 @@ public class XmiDescriptionDiagram implements XmlDiagramTransformer {
final Element content = document.createElement("XMI.content");
xmi.appendChild(content);
// <UML:Model xmi.id="UMLModel.4" name="Design Model"
// visibility="public" isSpecification="false" isRoot="false"
// isLeaf="false" isAbstract="false">
final Element model = document.createElement("UML:Model");
model.setAttribute("xmi.id", CucaDiagramXmiMaker.getModel(diagram));
model.setAttribute("name", "PlantUML " + Version.versionString());
model.setAttribute("name", "PlantUML");
content.appendChild(model);
// <UML:Namespace.ownedElement>
this.ownedElement = document.createElement("UML:Namespace.ownedElement");
model.appendChild(ownedElement);

View File

@ -8,7 +8,6 @@ import net.sourceforge.plantuml.sequencediagram.Event;
import net.sourceforge.plantuml.sequencediagram.Message;
import net.sourceforge.plantuml.sequencediagram.Participant;
import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
import net.sourceforge.plantuml.version.Version;
public class XmiSequenceDiagramArgo extends XmiSequenceDiagram {
public XmiSequenceDiagramArgo(SequenceDiagram diagram, Document document) {
@ -33,11 +32,8 @@ public class XmiSequenceDiagramArgo extends XmiSequenceDiagram {
final Element content = document.createElement("XMI.content");
xmi.appendChild(content);
// <UML:Model xmi.id="UMLModel.4" name="Design Model"
// visibility="public" isSpecification="false" isRoot="false"
// isLeaf="false" isAbstract="false">
final Element model = createElement(diagram, "UML:Model");
model.setAttribute("name", "PlantUML " + Version.versionString());
model.setAttribute("name", "PlantUML");
content.appendChild(model);
Element ownedElement = document.createElement("UML:Namespace.ownedElement");
@ -84,19 +80,17 @@ public class XmiSequenceDiagramArgo extends XmiSequenceDiagram {
private Node createSendAction(Message message) {
Element sendAction = createElement(message, "UML:SendAction");
sendAction.appendChild(document.createElement("UML:Action.script")).appendChild(createElement(
"UML:ActionExpression", new String[][] {
{"xmi.id", getXmiId("UML:ActionExpression", message)},
{"body", getDisplayString(message.getLabel()) }
}));
sendAction.appendChild(document.createElement("UML:Action.script"))
.appendChild(createElement("UML:ActionExpression",
new String[][] { { "xmi.id", getXmiId("UML:ActionExpression", message) },
{ "body", getDisplayString(message.getLabel()) } }));
return sendAction;
}
private Element createElement(Object object, String tag) {
return createElement(tag,
new String[][] { {"xmi.id", getXmiId("UML:ActionExpression", object)}});
return createElement(tag, new String[][] { { "xmi.id", getXmiId("UML:ActionExpression", object) } });
}
private Node createRef(String tag, Object target) {
Element role = document.createElement(tag);
role.setAttribute("xmi.idref", getXmiId(tag, target));

View File

@ -92,12 +92,9 @@ public class XmiStateDiagram implements XmlDiagramTransformer {
final Element content = document.createElement("XMI.content");
xmi.appendChild(content);
// <UML:Model xmi.id="UMLModel.4" name="Design Model"
// visibility="public" isSpecification="false" isRoot="false"
// isLeaf="false" isAbstract="false">
final Element model = document.createElement("UML:Model");
model.setAttribute("xmi.id", CucaDiagramXmiMaker.getModel(diagram));
model.setAttribute("name", "PlantUML "+Version.versionString());
model.setAttribute("name", "PlantUML");
content.appendChild(model);
// <UML:Namespace.ownedElement>

View File

@ -33,7 +33,7 @@ Expected result MUST be put between triple brackets
<XMI.metamodel xmi.name="UML" xmi.version="1.3"/>
</XMI.header>
<XMI.content>
<UML:Model name="PlantUML 1.2022.8beta2" xmi.id="model1">
<UML:Model name="PlantUML" xmi.id="model1">
<UML:Namespace.ownedElement>
<UML:Component name="test" namespace="model1" xmi.id="cl0002">
<UML:Classifier.feature/>
@ -76,7 +76,7 @@ Expected result MUST be put between triple brackets
<XMI.metamodel xmi.name="UML" xmi.version="1.3"/>
</XMI.header>
<XMI.content>
<UML:Model name="PlantUML 1.2022.8beta2" xmi.id="model1">
<UML:Model name="PlantUML" xmi.id="model1">
<UML:Namespace.ownedElement>
<UML:Component name="test" namespace="model1" xmi.id="cl0002">
<UML:Classifier.feature/>