diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2013-08-28 14:58:42 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2013-08-28 14:58:42 +0200 |
| commit | 7179ca007fe95ab5230df2bd4bceaff5653e7375 (patch) | |
| tree | e859d8e4855862a6681ff24836c8e27f28776acc | |
| parent | a9a08fcac876fcf4d6189de2d8e7cf88ba12d5ef (diff) | |
Initial canvas work
11 files changed, 462 insertions, 3 deletions
diff --git a/src/main/java/com/c2kernel/dev/canvas/CanvasEdgeRenderer.java b/src/main/java/com/c2kernel/dev/canvas/CanvasEdgeRenderer.java new file mode 100644 index 0000000..b572fa8 --- /dev/null +++ b/src/main/java/com/c2kernel/dev/canvas/CanvasEdgeRenderer.java @@ -0,0 +1,45 @@ +/*
+ * ItemCanvasEdgeRenderer.java
+ *
+ * Copyright (c) 2013, The CRISTAL Consortium. All rights reserved.
+ *
+ * CRISTAL kernel is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see:
+ * http://www.gnu.org/licenses/
+ */
+
+package com.c2kernel.dev.canvas;
+
+import java.awt.Graphics2D;
+
+import com.c2kernel.graph.model.DirectedEdge;
+import com.c2kernel.gui.graph.view.DirectedEdgeRenderer;
+
+public class CanvasEdgeRenderer implements DirectedEdgeRenderer {
+
+ /**
+ *
+ */
+ public CanvasEdgeRenderer() {
+ // TODO Auto-generated constructor stub
+ }
+
+ /* (non-Javadoc)
+ * @see com.c2kernel.gui.graph.view.DirectedEdgeRenderer#draw(java.awt.Graphics2D, com.c2kernel.graph.model.DirectedEdge)
+ */
+ public void draw(Graphics2D g2d, DirectedEdge directedEdge) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/src/main/java/com/c2kernel/dev/canvas/CanvasVertexFactory.java b/src/main/java/com/c2kernel/dev/canvas/CanvasVertexFactory.java new file mode 100644 index 0000000..4f5cd2e --- /dev/null +++ b/src/main/java/com/c2kernel/dev/canvas/CanvasVertexFactory.java @@ -0,0 +1,55 @@ +/*
+ * VertexFactory.java
+ *
+ * Copyright (c) 2013, The CRISTAL Consortium. All rights reserved.
+ *
+ * CRISTAL kernel is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see:
+ * http://www.gnu.org/licenses/
+ */
+
+package com.c2kernel.dev.canvas;
+
+import com.c2kernel.graph.model.GraphModelManager;
+import com.c2kernel.graph.model.GraphPoint;
+import com.c2kernel.graph.model.TypeNameAndConstructionInfo;
+import com.c2kernel.graph.model.VertexFactory;
+
+public class CanvasVertexFactory implements VertexFactory {
+
+ /**
+ *
+ */
+ public CanvasVertexFactory() {
+ // TODO Auto-generated constructor stub
+ }
+
+ /* (non-Javadoc)
+ * @see com.c2kernel.graph.model.VertexFactory#create(com.c2kernel.graph.model.GraphModelManager, com.c2kernel.graph.model.GraphPoint, com.c2kernel.graph.model.TypeNameAndConstructionInfo)
+ */
+ public void create(GraphModelManager graphModelManager,
+ GraphPoint location,
+ TypeNameAndConstructionInfo typeNameAndConstructionInfo)
+ throws Exception {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see com.c2kernel.graph.model.VertexFactory#setCreationContext(java.lang.Object)
+ */
+ public void setCreationContext(Object newContext) {
+ // TODO Auto-generated method stub
+
+ }
+}
diff --git a/src/main/java/com/c2kernel/dev/canvas/CanvasVertexRenderer.java b/src/main/java/com/c2kernel/dev/canvas/CanvasVertexRenderer.java new file mode 100644 index 0000000..76b8f6c --- /dev/null +++ b/src/main/java/com/c2kernel/dev/canvas/CanvasVertexRenderer.java @@ -0,0 +1,45 @@ +/*
+ * ItemDescriptionRenderer.java
+ *
+ * Copyright (c) 2013, The CRISTAL Consortium. All rights reserved.
+ *
+ * CRISTAL kernel is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see:
+ * http://www.gnu.org/licenses/
+ */
+
+package com.c2kernel.dev.canvas;
+
+import java.awt.Graphics2D;
+
+import com.c2kernel.graph.model.Vertex;
+import com.c2kernel.gui.graph.view.VertexRenderer;
+
+public class CanvasVertexRenderer implements VertexRenderer {
+
+ /**
+ *
+ */
+ public CanvasVertexRenderer() {
+ // TODO Auto-generated constructor stub
+ }
+
+ /* (non-Javadoc)
+ * @see com.c2kernel.gui.graph.view.VertexRenderer#draw(java.awt.Graphics2D, com.c2kernel.graph.model.Vertex)
+ */
+ public void draw(Graphics2D g2d, Vertex vertex) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/src/main/java/com/c2kernel/dev/canvas/CollectionEdge.java b/src/main/java/com/c2kernel/dev/canvas/CollectionEdge.java new file mode 100644 index 0000000..13936cf --- /dev/null +++ b/src/main/java/com/c2kernel/dev/canvas/CollectionEdge.java @@ -0,0 +1,34 @@ +/*
+ * CollectionEdge.java
+ *
+ * Copyright (c) 2013, The CRISTAL Consortium. All rights reserved.
+ *
+ * CRISTAL kernel is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see:
+ * http://www.gnu.org/licenses/
+ */
+
+package com.c2kernel.dev.canvas;
+
+import com.c2kernel.graph.model.DirectedEdge;
+
+public class CollectionEdge extends DirectedEdge {
+
+ /**
+ *
+ */
+ public CollectionEdge() {
+ // TODO Auto-generated constructor stub
+ }
+
+}
diff --git a/src/main/java/com/c2kernel/dev/canvas/CollectionVertex.java b/src/main/java/com/c2kernel/dev/canvas/CollectionVertex.java new file mode 100644 index 0000000..15f366f --- /dev/null +++ b/src/main/java/com/c2kernel/dev/canvas/CollectionVertex.java @@ -0,0 +1,34 @@ +/*
+ * CollectionNode.java
+ *
+ * Copyright (c) 2013, The CRISTAL Consortium. All rights reserved.
+ *
+ * CRISTAL kernel is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see:
+ * http://www.gnu.org/licenses/
+ */
+
+package com.c2kernel.dev.canvas;
+
+import com.c2kernel.graph.model.GraphableVertex;
+
+public class CollectionVertex extends GraphableVertex {
+
+ /**
+ *
+ */
+ public CollectionVertex() {
+ // TODO Auto-generated constructor stub
+ }
+
+}
diff --git a/src/main/java/com/c2kernel/dev/canvas/ItemCanvas.java b/src/main/java/com/c2kernel/dev/canvas/ItemCanvas.java new file mode 100644 index 0000000..7fcca16 --- /dev/null +++ b/src/main/java/com/c2kernel/dev/canvas/ItemCanvas.java @@ -0,0 +1,32 @@ +/*
+ * ItemCanvas.java
+ *
+ * Copyright (c) 2013, The CRISTAL Consortium. All rights reserved.
+ *
+ * CRISTAL kernel is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see:
+ * http://www.gnu.org/licenses/
+ */
+
+package com.c2kernel.dev.canvas;
+
+public class ItemCanvas {
+
+ /**
+ *
+ */
+ public ItemCanvas() {
+ // TODO Auto-generated constructor stub
+ }
+
+}
diff --git a/src/main/java/com/c2kernel/dev/canvas/ItemDescriptionVertex.java b/src/main/java/com/c2kernel/dev/canvas/ItemDescriptionVertex.java new file mode 100644 index 0000000..4992908 --- /dev/null +++ b/src/main/java/com/c2kernel/dev/canvas/ItemDescriptionVertex.java @@ -0,0 +1,34 @@ +/*
+ * ItemDescription.java
+ *
+ * Copyright (c) 2013, The CRISTAL Consortium. All rights reserved.
+ *
+ * CRISTAL kernel is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see:
+ * http://www.gnu.org/licenses/
+ */
+
+package com.c2kernel.dev.canvas;
+
+import com.c2kernel.graph.model.Vertex;
+
+public class ItemDescriptionVertex extends Vertex {
+
+ /**
+ *
+ */
+ public ItemDescriptionVertex() {
+ // TODO Auto-generated constructor stub
+ }
+
+}
diff --git a/src/main/java/com/c2kernel/dev/canvas/MemberEdge.java b/src/main/java/com/c2kernel/dev/canvas/MemberEdge.java new file mode 100644 index 0000000..19110a3 --- /dev/null +++ b/src/main/java/com/c2kernel/dev/canvas/MemberEdge.java @@ -0,0 +1,34 @@ +/*
+ * MemberEdge.java
+ *
+ * Copyright (c) 2013, The CRISTAL Consortium. All rights reserved.
+ *
+ * CRISTAL kernel is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see:
+ * http://www.gnu.org/licenses/
+ */
+
+package com.c2kernel.dev.canvas;
+
+import com.c2kernel.graph.model.DirectedEdge;
+
+public class MemberEdge extends DirectedEdge {
+
+ /**
+ *
+ */
+ public MemberEdge() {
+ // TODO Auto-generated constructor stub
+ }
+
+}
diff --git a/src/main/resources/boot/OD/ItemCanvas.xsd b/src/main/resources/boot/OD/ItemCanvas.xsd new file mode 100644 index 0000000..12aefaf --- /dev/null +++ b/src/main/resources/boot/OD/ItemCanvas.xsd @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
+ <xs:element name="ItemCanvas">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="ItemDescriptionVertex">
+ <xs:complexType>
+ <xs:sequence>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="CollectionVertex">
+ <xs:complexType>
+ <xs:sequence>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="CollectionEdge">
+ <xs:complexType>
+ <xs:sequence>
+
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="MemberEdge">
+ <xs:complexType>
+ <xs:sequence>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+</xs:schema>
\ No newline at end of file diff --git a/src/main/resources/boot/SC/LocalObjectDefCreator.xml b/src/main/resources/boot/SC/LocalObjectDefCreator.xml index 18de872..6ed88e6 100644 --- a/src/main/resources/boot/SC/LocalObjectDefCreator.xml +++ b/src/main/resources/boot/SC/LocalObjectDefCreator.xml @@ -47,9 +47,12 @@ newItem.requestAction(agent.getSystemKey(), "workflow/domain/EditDefinition", Transitions.DONE, newObj);
// If this script is running in the Cristal GUI, open the new item.
- //var tree = Packages.com.c2kernel.gui.MainFrame.treeBrowser;
- //if (tree != null) // open new item in the gui
- // tree.push(newPath);
+ try {
+ var tree = Packages.com.c2kernel.gui.MainFrame.treeBrowser;
+ if (tree != null) // open new item in the gui
+ tree.push(newPath);
+ } catch (e) { // hopefully catch any classloading errors on headless systems. hopefully.
+ }
]]></script>
</cristalscript>
diff --git a/src/main/resources/mapFiles/CanvasMap.xml b/src/main/resources/mapFiles/CanvasMap.xml new file mode 100644 index 0000000..f623e52 --- /dev/null +++ b/src/main/resources/mapFiles/CanvasMap.xml @@ -0,0 +1,109 @@ +<?xml version="1.0"?>
+<mapping>
+ <class name="com.c2kernel.lifecycle.NextDef" extends="com.c2kernel.graph.model.GraphableEdge">
+ <map-to xml="NextDef"/>
+ </class>
+ <class name="com.c2kernel.lifecycle.WfVertexDef" extends="com.c2kernel.graph.model.GraphableVertex">
+ <map-to xml="WfVertexDef"/>
+ </class>
+ <class name="com.c2kernel.lifecycle.ActivityDef" extends="com.c2kernel.lifecycle.WfVertexDef">
+ <map-to xml="ActivityDef"/>
+ </class>
+ <class name="com.c2kernel.lifecycle.CompositeActivityDef" extends="com.c2kernel.lifecycle.ActivityDef">
+ <map-to xml="CompositeActivityDef"/>
+ <field name="castorNonLayoutableChildren" type="string" direct="false" collection="array">
+ <bind-xml name="castorNonLayoutableChildren" node="element"/>
+ </field>
+ </class>
+ <class name="com.c2kernel.lifecycle.ActivitySlotDef" extends="com.c2kernel.lifecycle.WfVertexDef">
+ <map-to xml="ActivitySlotDef"/>
+ <field name="activityDef" type="string" direct="false">
+ <bind-xml name="activityDef" node="element"/>
+ </field>
+ </class>
+ <class name="com.c2kernel.lifecycle.JoinDef" extends="com.c2kernel.lifecycle.WfVertexDef">
+ <map-to xml="JoinDef"/>
+ </class>
+ <class name="com.c2kernel.lifecycle.AndSplitDef" extends="com.c2kernel.lifecycle.WfVertexDef">
+ <map-to xml="AndSplitDef"/>
+ </class>
+ <class name="com.c2kernel.lifecycle.OrSplitDef" extends="com.c2kernel.lifecycle.AndSplitDef">
+ <map-to xml="OrSplitDef"/>
+ </class>
+ <class name="com.c2kernel.lifecycle.XOrSplitDef" extends="com.c2kernel.lifecycle.AndSplitDef">
+ <map-to xml="XOrSplitDef"/>
+ </class>
+ <class name="com.c2kernel.lifecycle.LoopDef" extends="com.c2kernel.lifecycle.XOrSplitDef">
+ <map-to xml="LoopDef"/>
+ <field name="isNext" type="integer" direct="true">
+ <bind-xml name="isNext" node="attribute"/>
+ </field>
+ </class>
+ <class name="com.c2kernel.lifecycle.instance.Next" extends="com.c2kernel.graph.model.GraphableEdge">
+ <map-to xml="Next"/>
+ </class>
+ <class name="com.c2kernel.lifecycle.instance.WfVertex" extends="com.c2kernel.graph.model.GraphableVertex"/>
+ <class name="com.c2kernel.lifecycle.instance.Activity" extends="com.c2kernel.lifecycle.instance.WfVertex">
+ <map-to xml="AtomicActivity"/>
+ <field name="active" type="boolean" direct="false">
+ <bind-xml name="active" node="attribute"/>
+ </field>
+ <field name="state" type="integer" direct="false">
+ <bind-xml name="state" node="attribute"/>
+ </field>
+ <field name="type" type="string" direct="false">
+ <bind-xml name="Type" node="attribute"/>
+ </field>
+ <field name="startDate" type="com.c2kernel.common.GTimeStamp" direct="false">
+ <bind-xml name="startDate" node="element"/>
+ </field>
+ <field name="activeDate" type="com.c2kernel.common.GTimeStamp" direct="false">
+ <bind-xml name="activeDate" node="element"/>
+ </field>
+ </class>
+ <class name="com.c2kernel.lifecycle.instance.CompositeActivity" extends="com.c2kernel.lifecycle.instance.Activity">
+ <map-to xml="CompositeActivity"/>
+ </class>
+ <class name="com.c2kernel.lifecycle.instance.Workflow" extends="com.c2kernel.lifecycle.instance.CompositeActivity">
+ <map-to xml="Workflow"/>
+ </class>
+ <class name="com.c2kernel.lifecycle.instance.Join" extends="com.c2kernel.lifecycle.instance.WfVertex">
+ <map-to xml="Join"/>
+ <field name="counter" type="integer" direct="true">
+ <bind-xml name="counter" node="attribute"/>
+ </field>
+ </class>
+ <class name="com.c2kernel.lifecycle.instance.Split" extends="com.c2kernel.lifecycle.instance.WfVertex">
+ <map-to xml="Split"/>
+ </class>
+ <class name="com.c2kernel.lifecycle.instance.AndSplit" extends="com.c2kernel.lifecycle.instance.Split">
+ <map-to xml="AndSplit"/>
+ </class>
+ <class name="com.c2kernel.lifecycle.instance.OrSplit" extends="com.c2kernel.lifecycle.instance.Split">
+ <map-to xml="OrSplit"/>
+ </class>
+ <class name="com.c2kernel.lifecycle.instance.XOrSplit" extends="com.c2kernel.lifecycle.instance.Split">
+ <map-to xml="XOrSplit"/>
+ </class>
+ <class name="com.c2kernel.lifecycle.instance.Loop" extends="com.c2kernel.lifecycle.instance.XOrSplit">
+ <map-to xml="Loop"/>
+ </class>
+ <class name="com.c2kernel.lifecycle.instance.predefined.PredefinedStepContainer">
+ <map-to xml="PredefinedStepContainer"/>
+ <field name="ID" type="integer" direct="false">
+ <bind-xml name="id" node="attribute"/>
+ </field>
+ </class>
+ <class name="com.c2kernel.lifecycle.instance.predefined.ServerPredefinedStepContainer" extends="com.c2kernel.lifecycle.instance.predefined.PredefinedStepContainer">
+ <map-to xml="ServerPredefinedStepContainer"/>
+ </class>
+ <class name="com.c2kernel.scripting.ErrorInfo">
+ <map-to xml="Errors"/>
+ <field name="fatal" type="boolean" direct="false">
+ <bind-xml name="fatal" node="attribute"/>
+ </field>
+ <field name="msg" type="string" direct="false" collection="arraylist" get-method="getErrors" set-method="setErrors">
+ <bind-xml name="Message" node="element"/>
+ </field>
+ </class>
+</mapping>
|
