Skip to content
Snippets Groups Projects
Commit b19ff8e2 authored by tj's avatar tj
Browse files

issue #4 seems fixed; I added a nodepage, which is basically a normal page...

issue #4 seems fixed; I added a nodepage, which is basically a normal page with other label and color - there might be unintended things possible, that are allowed for pages, but not nodes; export to .xml works fine
parent accb0fe8
Branches
No related tags found
No related merge requests found
Showing
with 189 additions and 94 deletions
......@@ -108,6 +108,10 @@ svg {
filter: brightness(0) saturate(100%) invert(19%) sepia(41%) saturate(5461%) hue-rotate(218deg) brightness(98%) contrast(80%);
}
.nodePage-node {
fill:#34d2f2
}
.service-node {
fill: #89d681;
}
......
......@@ -38,5 +38,7 @@ export enum PNMLModelTypes {
SERVICE_CHANNEL = 'serviceChannel',
SERVICE_CHANNEL_LINK = 'serviceChannelLink',
SERVER_PAGE = 'serverPrototype',
SERVICE_SERVER_LINK = 'serviceServerLink'
SERVICE_SERVER_LINK = 'serviceServerLink',
NODE_PAGE_NODE = 'nodePageNode'
}
......@@ -127,6 +127,8 @@ const taskListDiagramModule = new ContainerModule((bind, unbind, isBound, rebind
configureModelElement(context, 'signalClauseLabel', GLabel, GLabelView);
configureModelElement(context, 'edgeTextLabel', GLabel, GLabelView);
configureModelElement(context, 'topicLinkLimitLabel', GLabel, GLabelView, { enable: [editLabelFeature] });
configureModelElement(context, 'nodePageNode', PageNode, PageNodeView, { enable: [resizeFeature], disable: [hoverFeedbackFeature] })
});
export function initializeTasklistDiagramContainer(container: Container, ...containerConfiguration: ContainerConfiguration): Container {
......
<?xml version="1.0" encoding="UTF-8"?>
<pnml xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns="http://www.pnml.org/version-2009/grammar/pnml">
<net id="base">
<page id="global">
<name text="global"/>
<nodegraphics>
<position x="136" y="6"/>
<dimension x="2286" y="1387"/>
</nodegraphics>
</page>
</net>
</pnml>
<?xml version="1.0" encoding="UTF-8"?>
<pnml xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns="http://www.pnml.org/version-2009/grammar/pnml">
<net id="Untitled">
<page id="b95e1e03-4345-457f-8f41-a1f87c45dc6a">
<name text="NewPage0"/>
<nodegraphics>
<position x="170" y="98"/>
<dimension x="500" y="500"/>
</nodegraphics>
<place id="0b20eb18-2f49-4459-acc3-fdde1c976041">
<name text="NewPlace3"/>
<nodegraphics>
<position x="100" y="300"/>
<dimension x="70" y="70"/>
</nodegraphics>
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1" node="b95e1e03-4345-457f-8f41-a1f87c45dc6a" subnet=""/>
</place>
<place id="761e4b70-ede4-43fc-8e09-8fcd693f52f4">
<name text="NewPlace4"/>
<nodegraphics>
<position x="312" y="386"/>
<dimension x="70" y="70"/>
</nodegraphics>
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1" node="b95e1e03-4345-457f-8f41-a1f87c45dc6a" subnet=""/>
</place>
<transition id="d0e045f1-b811-42da-bb75-32467644b421">
<name text="NewTopic1"/>
<nodegraphics>
<position x="299" y="161"/>
<dimension x="100" y="150"/>
</nodegraphics>
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1" type="topicTransitionType" topicName="NewTopic1">
<subscribers>
<subscriber id="0b20eb18-2f49-4459-acc3-fdde1c976041" limit="10"/>
<subscriber id="761e4b70-ede4-43fc-8e09-8fcd693f52f4" limit="10"/>
</subscribers>
</toolspecific>
</transition>
</page>
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<inputsignals>
<inputsignal inputsignalID="4"/>
</inputsignals>
</toolspecific>
</net>
</pnml>
<?xml version="1.0" encoding="UTF-8"?>
<pnml xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns="http://www.pnml.org/version-2009/grammar/pnml">
<net id="Untitled4">
<page id="07e5a2b3-7401-4d18-9f98-fe16c34b9240">
<name text="NewPage0"/>
<nodegraphics>
<position x="85" y="86"/>
<dimension x="500" y="500"/>
</nodegraphics>
</page>
<page id="d0798fe2-4bbb-48f0-8eeb-9db871bf5f85">
<name text="NewPage1"/>
<nodegraphics>
<position x="858" y="326"/>
<dimension x="500" y="500"/>
</nodegraphics>
</page>
</net>
</pnml>
......@@ -5,7 +5,7 @@
<name text="NewPage5"/>
<nodegraphics>
<position x="224" y="27"/>
<dimension x="500" y="500"/>
<dimension x="810" y="584"/>
</nodegraphics>
<arc id="89e0d428-4f7a-463a-80d9-6d33f0541d22" source="2d062086-da61-4f6e-a247-635f8c6af7e9" target="c896e5ab-19e9-44b5-94f0-111700b7cd5f">
<name text="NewArc0"/>
......@@ -38,6 +38,14 @@
</subscribers>
</toolspecific>
</transition>
<page id="ca424757-8b64-41d7-bb2b-7f92e63578da">
<name text="NewNode7"/>
<nodegraphics>
<position x="482" y="83"/>
<dimension x="250" y="250"/>
</nodegraphics>
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1" type="nodePageNode" serviceName="NewNode7"/>
</page>
</page>
</net>
</pnml>
<svg xmlns="http://www.w3.org/2000/svg" class="sprotty-graph" id="9edb881d-167b-486b-b39a-944365c07d6d" style="width: 500px !important;height: 500px !important;border: none !important;background-color:rgb(255, 255, 255);block-size:726.4px;border-block-end-color:rgb(187, 187, 187);border-block-end-style:solid;border-block-start-color:rgb(187, 187, 187);border-block-start-style:solid;border-bottom-color:rgb(187, 187, 187);border-bottom-style:solid;border-inline-end-color:rgb(187, 187, 187);border-inline-end-style:solid;border-inline-start-color:rgb(187, 187, 187);border-inline-start-style:solid;border-left-color:rgb(187, 187, 187);border-left-style:solid;border-right-color:rgb(187, 187, 187);border-right-style:solid;border-top-color:rgb(187, 187, 187);border-top-style:solid;caret-color:rgb(97, 97, 97);color:rgb(97, 97, 97);column-rule-color:rgb(97, 97, 97);cursor:default;flex-basis:0%;flex-grow:1;font-family:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;inline-size:0px;outline-color:rgb(97, 97, 97);perspective-origin:0px 363.2px;text-decoration:none solid rgb(97, 97, 97);text-decoration-color:rgb(97, 97, 97);text-emphasis-color:rgb(97, 97, 97);transform-origin:0px 363.2px;-webkit-locale:&quot;en&quot;;-webkit-text-fill-color:rgb(97, 97, 97);-webkit-text-stroke-color:rgb(97, 97, 97);" version="1.1" viewBox="224 27 500 500"><g transform="scale(1) translate(0,0)"><g id="tasklist-diagram_2_264f2fbc-b832-48a7-8222-0541aa4707ee" transform="translate(224, 27)" class="node page-node" style="fill:rgba(150, 150, 150, 0.4);"><defs><clipPath id="264f2fbc-b832-48a7-8222-0541aa4707ee_clip_path"><path d="M2,20q0,-18 18,-18h460q18,0 18,18v460q0,18 -18,18h-460q-18,0 -18,-18z "/></clipPath></defs><path d="M0,20q0,-20 20,-20h460q20,0 20,20v460q0,20 -20,20h-460q-20,0 -20,-20z " class="sprotty-node" style="stroke:rgb(0, 0, 0);stroke-width:0px;"/><text class="label sprotty-label" id="tasklist-diagram_2_264f2fbc-b832-48a7-8222-0541aa4707ee_label" transform="translate(5, 5) translate(26.087499618530273, 9.600000381469727)" style="fill:rgb(0, 0, 0);font-family:sans-serif;font-size:10.6667px;perspective-origin:10.425px 0.95px;stroke:rgb(0, 0, 0);stroke-width:0px;text-anchor:middle;">NewPage5</text><g transform="translate(5, 18)" class="page sprotty-comp page-comp" id="tasklist-diagram_2_264f2fbc-b832-48a7-8222-0541aa4707ee_comp"><g id="tasklist-diagram_2_c896e5ab-19e9-44b5-94f0-111700b7cd5f" transform="translate(268, 122)" class="place" style="border-bottom-left-radius:1000px;border-bottom-right-radius:1000px;border-end-end-radius:1000px;border-end-start-radius:1000px;border-start-end-radius:1000px;border-start-start-radius:1000px;border-top-left-radius:1000px;border-top-right-radius:1000px;fill:rgb(241, 189, 108);outline-color:rgb(0, 0, 0);outline-style:solid;outline-width:0.8px;"><circle r="35" cx="35" cy="35" class="sprotty-node" style="stroke:rgb(0, 0, 0);stroke-width:0px;"/><text class="markingLabel sprotty-label" id="tasklist-diagram_2_c896e5ab-19e9-44b5-94f0-111700b7cd5f_marking" transform="translate(32.03125, 30) translate(2.96875, 9.600000381469727)" style="fill:rgb(0, 0, 0);font-family:sans-serif;font-size:10.6667px;perspective-origin:1.1875px 0.95px;stroke:rgb(0, 0, 0);stroke-width:0px;text-anchor:middle;">0</text></g><g id="tasklist-diagram_2_c896e5ab-19e9-44b5-94f0-111700b7cd5f_labelNode" transform="translate(253, 192)" class="label-node" style="fill:rgba(255, 255, 255, 0);"><rect x="0" y="0" width="100" height="22" class="sprotty-node" style="stroke:rgb(0, 0, 0);stroke-width:0px;"/><text class="label sprotty-label" id="tasklist-diagram_2_c896e5ab-19e9-44b5-94f0-111700b7cd5f_label" transform="translate(19.830217361450195, 5) translate(29.9375, 9.600000381469727)" style="fill:rgb(0, 0, 0);font-family:sans-serif;font-size:10.6667px;perspective-origin:11.975px 0.95px;stroke:rgb(0, 0, 0);stroke-width:0px;text-anchor:middle;">NewPlace14</text></g><g id="tasklist-diagram_2_2d062086-da61-4f6e-a247-635f8c6af7e9" transform="translate(111, 126)" class="transition" style="fill:rgb(241, 189, 108);outline-color:rgb(0, 0, 0);outline-style:solid;outline-width:0.8px;"><rect x="0" y="0" width="30" height="70" class="sprotty-node" style="stroke:rgb(0, 0, 0);stroke-width:0px;"/></g><g id="tasklist-diagram_2_2d062086-da61-4f6e-a247-635f8c6af7e9_labelNode" transform="translate(76, 196)" class="label-node" style="fill:rgba(255, 255, 255, 0);"><rect x="0" y="0" width="100" height="22" class="sprotty-node" style="stroke:rgb(0, 0, 0);stroke-width:0px;"/><text class="label sprotty-label" id="tasklist-diagram_2_2d062086-da61-4f6e-a247-635f8c6af7e9_label" transform="translate(10.581249237060547, 5) translate(39.41875076293945, 9.600000381469727)" style="fill:rgb(0, 0, 0);font-family:sans-serif;font-size:10.6667px;perspective-origin:15.7625px 0.95px;stroke:rgb(0, 0, 0);stroke-width:0px;text-anchor:middle;">NewTransition11</text></g><g id="tasklist-diagram_2_2d062086-da61-4f6e-a247-635f8c6af7e9_signalClauseLabelNode" transform="translate(26, 106)" class="label-node" style="fill:rgba(255, 255, 255, 0);"><rect x="0" y="0" width="200" height="20" class="sprotty-node" style="stroke:rgb(0, 0, 0);stroke-width:0px;"/><text class="signalClauseLabel sprotty-label signal-clause-true" id="tasklist-diagram_2_2d062086-da61-4f6e-a247-635f8c6af7e9_signalClause" transform="translate(100, 5)" style="fill:rgb(0, 0, 0);filter:invert(0.23) sepia(0.76) saturate(27.84) hue-rotate(84deg) brightness(0.96) contrast(0.97);font-family:sans-serif;font-size:10.6667px;stroke:rgb(0, 0, 0);stroke-width:0px;text-anchor:middle;"/></g><g id="tasklist-diagram_2_d5f3a600-7f20-42bf-9bc8-c011e11ab22e" transform="translate(246, 312)" class="node topic-node" style="fill:rgb(131, 182, 221);"><defs><clipPath id="d5f3a600-7f20-42bf-9bc8-c011e11ab22e_clip_path"><path d="M2,20q0,-18 18,-18h60q18,0 18,18v110q0,18 -18,18h-60q-18,0 -18,-18z "/></clipPath></defs><path d="M0,20q0,-20 20,-20h60q20,0 20,20v110q0,20 -20,20h-60q-20,0 -20,-20z " class="sprotty-node" style="stroke:rgb(0, 0, 0);stroke-width:0px;"/><text class="label sprotty-label" id="tasklist-diagram_2_d5f3a600-7f20-42bf-9bc8-c011e11ab22e_label" transform="translate(5, 5) translate(26.08125114440918, 9.600000381469727)" style="fill:rgb(0, 0, 0);font-family:sans-serif;font-size:10.6667px;perspective-origin:10.425px 0.95px;stroke:rgb(0, 0, 0);stroke-width:0px;text-anchor:middle;">NewTopic7</text></g><g id="tasklist-diagram_2_d5f3a600-7f20-42bf-9bc8-c011e11ab22e_c896e5ab-19e9-44b5-94f0-111700b7cd5f_topicLink" class="sprotty-edge topic-link" style="fill:none;filter:brightness(0) saturate(1) invert(0.19) sepia(0.41) saturate(54.61) hue-rotate(218deg) brightness(0.98) contrast(0.8);stroke:rgb(0, 0, 0);stroke-width:1.5px;"><path d="M 298.2826086956522,312 L 301.9352756088795,191.98380142252915"/><text class="edgeTextLabel sprotty-label" id="tasklist-diagram_2_d5f3a600-7f20-42bf-9bc8-c011e11ab22e_c896e5ab-19e9-44b5-94f0-111700b7cd5f_topicLinkLabel" transform="translate(300.10894215226585, 251.99190071126458) rotate(-88.25675351569421) translate(-0.21977615356445312, -2.3999996185302734)" style="fill:rgb(0, 0, 0);font-family:sans-serif;font-size:10.6667px;perspective-origin:9.8375px 0.95px;stroke-width:0px;text-anchor:middle;">subscriber</text><text class="topicLinkLimitLabel sprotty-label" id="tasklist-diagram_2_d5f3a600-7f20-42bf-9bc8-c011e11ab22e_c896e5ab-19e9-44b5-94f0-111700b7cd5f_subscriber_topicLinkLimitLabel" transform="translate(300.10894215226585, 251.99190071126458) rotate(-88.25675351569421) translate(0, 9.600000381469727)" style="fill:rgb(0, 0, 0);font-family:sans-serif;font-size:10.6667px;perspective-origin:2.3625px 0.95px;stroke-width:0px;text-anchor:middle;">10</text></g><g id="tasklist-diagram_2_89e0d428-4f7a-463a-80d9-6d33f0541d22" class="sprotty-edge arc" style="fill:none;stroke:rgb(0, 0, 0);stroke-width:1.5px;"><path d="M 141,160.66101694915255 L 268.0089339843835,157.79075855402525"/><path d="M 1,0 L 10,-4 L 10,4 Z" transform="rotate(178.7054004818357 268.0089339843835 157.79075855402525) translate(268.0089339843835 157.79075855402525)" class="sprotty-edge arrow" style="fill:rgb(0, 0, 0);"/><text class="arcWeightLabel sprotty-label" id="tasklist-diagram_2_89e0d428-4f7a-463a-80d9-6d33f0541d22_arcWeight" transform="translate(204.50446699219174, 159.2258877515889) rotate(-1.2945995181642798) translate(0, -2.3999996185302734)" style="fill:rgb(0, 0, 0);font-family:sans-serif;font-size:10.6667px;perspective-origin:1.1875px 0.95px;stroke-width:0px;text-anchor:middle;">1</text></g></g></g></g></svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<pnml xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns="http://www.pnml.org/version-2009/grammar/pnml">
<net id="test1">
<page id="4d884d55-8758-4920-a868-f5f8a987888d">
<name text="NewPage0"/>
<nodegraphics>
<position x="336" y="4"/>
<dimension x="741" y="583"/>
</nodegraphics>
<arc id="c8912776-f1f9-420d-b2ee-a97af8b3290e" source="9dc009ee-13e0-48fa-ae9e-c4fb2259288d" target="d5fd7182-98e6-4af2-ad0b-72bb8f528c9a">
<name text="NewArc1"/>
</arc>
<place id="9dc009ee-13e0-48fa-ae9e-c4fb2259288d" OutArcs="c8912776-f1f9-420d-b2ee-a97af8b3290e">
<name text="NewPlace8"/>
<nodegraphics>
<position x="101" y="409"/>
<dimension x="70" y="70"/>
</nodegraphics>
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1" node="4d884d55-8758-4920-a868-f5f8a987888d" subnet=""/>
</place>
<transition id="2ce07163-4cae-4394-ac6e-d4c02cedd075">
<name text="NewTopic2"/>
<nodegraphics>
<position x="522" y="300"/>
<dimension x="100" y="150"/>
</nodegraphics>
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1" type="topicTransitionType" topicName="NewTopic2">
<subscribers>
<subscriber id="9dc009ee-13e0-48fa-ae9e-c4fb2259288d" limit="10"/>
</subscribers>
</toolspecific>
</transition>
<transition id="d5fd7182-98e6-4af2-ad0b-72bb8f528c9a" InArcs="c8912776-f1f9-420d-b2ee-a97af8b3290e">
<name text="NewTransition5"/>
<nodegraphics>
<position x="384" y="245"/>
<dimension x="30" y="70"/>
</nodegraphics>
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1" type="discreteTransitionType" node="4d884d55-8758-4920-a868-f5f8a987888d" subnet=""/>
</transition>
<page id="cce6dce1-4765-48a9-b0b9-592d76ec8c57">
<name text="NewNode2"/>
<nodegraphics>
<position x="9" y="15"/>
<dimension x="328" y="258"/>
</nodegraphics>
<place id="dba55467-d00b-4c52-ac98-27fff3d108cd">
<name text="NewPlace10"/>
<nodegraphics>
<position x="70" y="67"/>
<dimension x="70" y="70"/>
</nodegraphics>
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1" node="cce6dce1-4765-48a9-b0b9-592d76ec8c57" subnet=""/>
</place>
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1" type="nodePageNode" serviceName="NewNode1"/>
</page>
<page id="31e8a2b4-01dc-4810-921c-41daa177b360">
<name text="NewServer12"/>
<nodegraphics>
<position x="450" y="11"/>
<dimension x="250" y="250"/>
</nodegraphics>
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1" type="serverPrototype" serviceName="NewServer12"/>
</page>
<referenceTransition id="ff6b5716-1095-41cb-b6a0-7c66bde26ba9">
<name text="NewRefTransition3"/>
<nodegraphics>
<position x="353" y="457"/>
<dimension x="30" y="70"/>
</nodegraphics>
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1" node="4d884d55-8758-4920-a868-f5f8a987888d" subnet=""/>
</referenceTransition>
</page>
</net>
</pnml>
......@@ -42,6 +42,8 @@ public final class PNMLModelTypes {
public static final String DINEROS_TOOL_NAME = "de.tudresden.inf.st.pnml.distributedPN";
public static final String DINEROS_VERSION = "0.1";
public static final String NODE_PAGE_NODE = "nodePageNode";
public static final int TOPIC_DEFAULT_LIMIT = 10;
......@@ -67,6 +69,9 @@ public final class PNMLModelTypes {
public static final int ServerPageWidth = 250;
public static final int ServerPageHeight = 250;
public static final int NodePageNodeWidth = 250;
public static final int NodePageNodeHeight = 250;
}
}
......@@ -116,9 +116,10 @@ public class TaskListDiagramModule extends EMFNotationDiagramModule {
binding.add(DeleteDiNeROSTokenHandler.class);
binding.add(SetDiNeROSTokenHandler.class);
binding.add(CreateNodePageNodeHandler.class);
}
@Override
protected Class<? extends ActionDispatcher> bindActionDispatcher() {
return MyActionDispatcher.class;
}
......
package org.eclipse.glsp.example.javaemf.handler.DiNeROS.ElementCreation;
import java.util.Optional;
import org.eclipse.glsp.example.javaemf.PNMLModelTypes;
import org.eclipse.glsp.example.javaemf.handler.NodeCreation.CreatePageHandler;
import org.eclipse.glsp.server.operations.CreateNodeOperation;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.edit.command.AddCommand;
import org.eclipse.glsp.graph.GModelElement;
import org.eclipse.glsp.graph.util.GraphUtil;
import org.pnml.emf.ptnet.*;
public class CreateNodePageNodeHandler extends CreatePageHandler
{
public CreateNodePageNodeHandler(){super(PNMLModelTypes.NODE_PAGE_NODE);}
@Override
public String getLabel(){return "NodePageNode";}
@Override
public Optional<Command> createCommand(final CreateNodeOperation operation)
{
GModelElement container =
modelState.getIndex().get(operation.getContainerId())
.orElseGet(modelState::getRoot);
EObject parentElement = getParentElement(container);
EReference relationshipLiteral = getRelationshipLiteral(container);
Page newPage = PtnetFactory.eINSTANCE.createPage();
setElementId(newPage);
setInitialName(newPage, "Node");
newPage.getToolspecific().add(createNodePageToolInfo(newPage));
NodeGraphics shape =
createShape(idGenerator.getOrCreateId(newPage),
getRelativeLocation(operation),
GraphUtil.dimension(
PNMLModelTypes.DefaultSizes.NodePageNodeWidth,
PNMLModelTypes.DefaultSizes.NodePageNodeHeight));
newPage.setNodegraphics(shape);
Command pageCommand =
AddCommand.create(
modelState.getEditingDomain(),
parentElement,
relationshipLiteral,
newPage);
return Optional.of(pageCommand);
}
protected ToolInfoPage createNodePageToolInfo (Page newPage)
{
ToolInfoPage toolSpecifics = PtnetFactory.eINSTANCE.createToolInfoPage();
toolSpecifics.setTool(PNMLModelTypes.DINEROS_TOOL_NAME);
toolSpecifics.setVersion(PNMLModelTypes.DINEROS_VERSION);
toolSpecifics.setType(PNMLModelTypes.NODE_PAGE_NODE);
toolSpecifics.setServiceName(newPage.getName().getText());
return toolSpecifics;
}
}
......@@ -4,11 +4,9 @@ import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.edit.command.AddCommand;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.glsp.example.javaemf.PNMLModelTypes;
import org.eclipse.glsp.example.javaemf.handler.NodeCreation.CreatePageHandler;
import org.eclipse.glsp.graph.GModelElement;
import org.eclipse.glsp.graph.GPoint;
import org.eclipse.glsp.graph.util.GraphUtil;
import org.eclipse.glsp.server.operations.CreateNodeOperation;
import org.pnml.emf.ptnet.*;
......@@ -33,7 +31,7 @@ public class CreateServerPageHandler extends CreatePageHandler {
EObject parentElement = getParentElement(container);
EReference relationshipLiteral = getRelationshipLiteral(container);
Page newPage = PtnetFactory.eINSTANCE.createPage();;
Page newPage = PtnetFactory.eINSTANCE.createPage();
setElementId(newPage);
setInitialName(newPage, "Server");
newPage.getToolspecific().add(createServerPageToolInfo(newPage));
......
......@@ -7,11 +7,8 @@ import org.eclipse.emf.edit.command.AddCommand;
import org.eclipse.emf.edit.command.SetCommand;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.glsp.example.javaemf.PNMLModelTypes;
import org.eclipse.glsp.example.javaemf.handler.NodeCreation.AbstractCreateNodeHandler;
import org.eclipse.glsp.example.javaemf.model.ModelAccessUtil;
import org.eclipse.glsp.graph.GPoint;
import org.eclipse.glsp.graph.GraphPackage;
import org.eclipse.glsp.graph.util.GraphUtil;
import org.eclipse.glsp.server.emf.EMFCreateOperationHandler;
import org.eclipse.glsp.server.operations.CreateNodeOperation;
import org.pnml.emf.ptnet.*;
......
package org.eclipse.glsp.example.javaemf.model;
import jakarta.inject.Inject;
import org.eclipse.emf.common.util.EList;
import org.eclipse.glsp.example.javaemf.PNMLModelTypes;
import org.eclipse.glsp.graph.GPoint;
import org.eclipse.glsp.graph.impl.GPointImpl;
......@@ -115,6 +114,15 @@ public class ModelAccessUtil {
.noneMatch(toolInfo -> Objects.equals(toolInfo.getTool(), PNMLModelTypes.DINEROS_TOOL_NAME));
}
public boolean isNodePageNode(Page page)
{
if(page.getToolspecific() == null || page.getToolspecific().isEmpty()){
return false;
}
return page.getToolspecific().stream()
.anyMatch(toolInfo -> Objects.equals(toolInfo.getType(), PNMLModelTypes.NODE_PAGE_NODE));
}
public boolean isServerPage(Page page) {
if(page.getToolspecific() == null || page.getToolspecific().isEmpty()){
return false;
......
......@@ -229,6 +229,15 @@ public class TaskListGModelFactory extends EMFNotationGModelFactory {
.text((modelAccessUtil.getName(page)))
.id(idGenerator.getOrCreateId(page) + "_label")
.build());
} else
if(modelAccessUtil.isNodePageNode(page)){
pageNodeBuilder
.type(PNMLModelTypes.NODE_PAGE_NODE)
.addCssClass("nodePage-node")
.add(new GLabelBuilder(DefaultTypes.LABEL)
.text((modelAccessUtil.getName(page)))
.id(idGenerator.getOrCreateId(page) + "_label")
.build());
} else {
pageNodeBuilder
.type(PNMLModelTypes.PAGE_NODE)
......
......@@ -75,6 +75,7 @@ public class TaskListToolPaletteItemProvider implements ToolPaletteItemProvider
PaletteItem createServiceChannelLink = edge(PNMLModelTypes.SERVICE_CHANNEL_LINK, "Service Link");
PaletteItem createServiceServerlLink = edge(PNMLModelTypes.SERVICE_SERVER_LINK, "Server Link");
PaletteItem createNodePageNode = node(PNMLModelTypes.NODE_PAGE_NODE, "Node Page");
List<PaletteItem> nodes = Lists.newArrayList(
createTopic,
......@@ -83,7 +84,8 @@ public class TaskListToolPaletteItemProvider implements ToolPaletteItemProvider
createServiceChannel,
createServerPage,
createServiceChannelLink,
createServiceServerlLink
createServiceServerlLink,
createNodePageNode
);
return PaletteItem.createPaletteGroup("dineros", "DiNeROS Elements", nodes, "symbol-property");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment