last demo import - cleaned
This commit is contained in:
333
static/mxgraph/examples/editors/config/diagrameditor.xml
Normal file
333
static/mxgraph/examples/editors/config/diagrameditor.xml
Normal file
@@ -0,0 +1,333 @@
|
||||
<mxEditor defaultGroup="group" defaultEdge="connector">
|
||||
<include name="config/editor-commons.xml"/>
|
||||
<add as="onInit"><![CDATA[
|
||||
function ()
|
||||
{
|
||||
onInit(this);
|
||||
}
|
||||
]]></add>
|
||||
<ui>
|
||||
<add as="graph" element="graph"/>
|
||||
<add as="status" element="status"/>
|
||||
<add as="toolbar" element="toolbar"/>
|
||||
</ui>
|
||||
<Array as="templates">
|
||||
<add as="group">
|
||||
<Group label="" href="">
|
||||
<mxCell vertex="1" style="group" connectable="0"/>
|
||||
</Group>
|
||||
</add>
|
||||
<add as="connector">
|
||||
<Connector label="" href="">
|
||||
<mxCell edge="1">
|
||||
<mxGeometry as="geometry" relative="1"/>
|
||||
</mxCell>
|
||||
</Connector>
|
||||
</add>
|
||||
<add as="container">
|
||||
<Container label="Container" href="">
|
||||
<mxCell vertex="1" style="swimlane" connectable="0">
|
||||
<mxGeometry as="geometry" width="200" height="200"/>
|
||||
</mxCell>
|
||||
</Container>
|
||||
</add>
|
||||
<add as="rectangle">
|
||||
<Rect label="Rectangle" href="">
|
||||
<mxCell vertex="1">
|
||||
<mxGeometry as="geometry" width="80" height="40"/>
|
||||
</mxCell>
|
||||
</Rect>
|
||||
</add>
|
||||
<add as="text">
|
||||
<Text label="Text Here" href="">
|
||||
<mxCell vertex="1" style="text">
|
||||
<mxGeometry as="geometry" width="80" height="20"/>
|
||||
</mxCell>
|
||||
</Text>
|
||||
</add>
|
||||
<add as="image">
|
||||
<Image label="" href="">
|
||||
<mxCell vertex="1" style="image">
|
||||
<mxGeometry as="geometry" width="80" height="50"/>
|
||||
</mxCell>
|
||||
</Image>
|
||||
</add>
|
||||
<add as="rounded">
|
||||
<Roundrect label="Rounded" href="">
|
||||
<mxCell vertex="1" style="rounded">
|
||||
<mxGeometry as="geometry" width="80" height="40"/>
|
||||
</mxCell>
|
||||
</Roundrect>
|
||||
</add>
|
||||
<add as="shape">
|
||||
<Shape label="Shape" href="">
|
||||
<mxCell vertex="1" style="ellipse">
|
||||
<mxGeometry as="geometry" width="60" height="60"/>
|
||||
</mxCell>
|
||||
</Shape>
|
||||
</add>
|
||||
<add as="actor">
|
||||
<Shape label="Shape" href="">
|
||||
<mxCell vertex="1" style="actor">
|
||||
<mxGeometry as="geometry" width="40" height="60"/>
|
||||
</mxCell>
|
||||
</Shape>
|
||||
</add>
|
||||
<add as="cloud">
|
||||
<Shape label="Shape" href="">
|
||||
<mxCell vertex="1" style="cloud">
|
||||
<mxGeometry as="geometry" width="80" height="60"/>
|
||||
</mxCell>
|
||||
</Shape>
|
||||
</add>
|
||||
<add as="hline">
|
||||
<Shape label="" href="">
|
||||
<mxCell vertex="1" style="ellipse">
|
||||
<mxGeometry as="geometry" width="60" height="10"/>
|
||||
</mxCell>
|
||||
</Shape>
|
||||
</add>
|
||||
</Array>
|
||||
<mxGraph as="graph" alternateEdgeStyle="verticalConnector" allowLoops="1" dropEnabled="1">
|
||||
<add as="isAutoSizeCell"><![CDATA[
|
||||
function(cell)
|
||||
{
|
||||
return mxUtils.isNode(this.model.getValue(cell), 'text');
|
||||
}
|
||||
]]></add>
|
||||
<add as="isSwimlane"><![CDATA[
|
||||
function (cell)
|
||||
{
|
||||
return mxUtils.isNode(this.model.getValue(cell), 'container');
|
||||
}
|
||||
]]></add>
|
||||
<add as="getTooltipForCell"><![CDATA[
|
||||
function(cell)
|
||||
{
|
||||
var label = cell.getAttribute('label');
|
||||
var style = cell.getStyle();
|
||||
|
||||
return ((label != null) ? ('<b>' + label +
|
||||
'</b> (' + cell.getId() + ')<br>') : '') +
|
||||
((style != null) ? ('<br>Style: ' + style + '<br>') : '') +
|
||||
'Connections: ' + cell.getEdgeCount()+
|
||||
'<br>Children: ' + cell.getChildCount();
|
||||
}
|
||||
]]></add>
|
||||
<add as="convertValueToString"><![CDATA[
|
||||
function(cell)
|
||||
{
|
||||
return cell.getAttribute('label');
|
||||
}
|
||||
]]></add>
|
||||
<mxStylesheet as="stylesheet">
|
||||
<add as="text">
|
||||
<add as="shape" value="rectangle"/>
|
||||
<add as="perimeter" value="rectanglePerimeter"/>
|
||||
<add as="fontSize" value="12"/>
|
||||
<add as="align" value="left"/>
|
||||
<add as="verticalAlign" value="top"/>
|
||||
<add as="shadow" value="0"/>
|
||||
<add as="strokeColor" value="none"/>
|
||||
<add as="fillColor" value="none"/>
|
||||
<add as="gradientColor" value="none"/>
|
||||
</add>
|
||||
<add as="defaultVertex" extend="text">
|
||||
<add as="shape" value="rectangle"/>
|
||||
<add as="fontSize" value="11"/>
|
||||
<add as="align" value="center"/>
|
||||
<add as="verticalAlign" value="middle"/>
|
||||
<add as="shadow" value="1"/>
|
||||
<add as="strokeColor" value="#C3D9FF"/>
|
||||
<add as="fillColor" value="#C3D9FF"/>
|
||||
<add as="gradientColor" value="white"/>
|
||||
</add>
|
||||
<add as="group">
|
||||
<add as="shape" value="rectangle"/>
|
||||
<add as="perimeter" value="rectanglePerimeter"/>
|
||||
<add as="fontSize" value="10"/>
|
||||
<add as="align" value="center"/>
|
||||
<add as="verticalAlign" value="middle"/>
|
||||
<add as="strokeColor" value="gray"/>
|
||||
<add as="dashed" value="1"/>
|
||||
</add>
|
||||
<add as="defaultEdge">
|
||||
<add as="shape" value="connector"/>
|
||||
<add as="fontSize" value="10"/>
|
||||
<add as="align" value="center"/>
|
||||
<add as="verticalAlign" value="middle"/>
|
||||
<add as="rounded" value="1"/>
|
||||
<add as="labelBackgroundColor" value="white"/>
|
||||
<add as="strokeColor" value="#36393D"/>
|
||||
<add as="strokeWidth" value="1"/>
|
||||
<add as="edgeStyle" value="elbowEdgeStyle"/>
|
||||
<add as="endArrow" value="classic"/>
|
||||
</add>
|
||||
<add as="verticalConnector">
|
||||
<add as="elbow" value="vertical"/>
|
||||
</add>
|
||||
<add as="straightConnector">
|
||||
<add as="shape" value="connector"/>
|
||||
<add as="endArrow" value="classic"/>
|
||||
<add as="edgeStyle">null</add>
|
||||
</add>
|
||||
<add as="arrowConnector">
|
||||
<add as="shape" value="arrow"/>
|
||||
<add as="fillColor" value="#C3D9FF"/>
|
||||
<add as="endSize" value="20"/>
|
||||
<remove as="edgeStyle"/>
|
||||
</add>
|
||||
<add as="swimlane">
|
||||
<add as="shape" value="swimlane"/>
|
||||
<add as="shadow" value="0"/>
|
||||
<add as="startSize" value="23"/>
|
||||
<add as="align" value="center"/>
|
||||
<add as="verticalAlign" value="top"/>
|
||||
<add as="strokeColor" value="#EEEEEE"/>
|
||||
<add as="fillColor" value="#D4D4D4"/>
|
||||
</add>
|
||||
<add as="rounded">
|
||||
<add as="rounded" value="1"/>
|
||||
</add>
|
||||
<add as="ellipse">
|
||||
<add as="shape" value="ellipse"/>
|
||||
<add as="perimeter" value="ellipsePerimeter"/>
|
||||
<add as="strokeColor" value="#CDEB8B"/>
|
||||
<add as="fillColor" value="#CDEB8B"/>
|
||||
</add>
|
||||
<add as="doubleEllipse" extend="ellipse">
|
||||
<add as="shape" value="doubleEllipse"/>
|
||||
</add>
|
||||
<add as="rhombus">
|
||||
<add as="shape" value="rhombus"/>
|
||||
<add as="perimeter" value="rhombusPerimeter"/>
|
||||
<add as="strokeColor" value="#FFCF8A"/>
|
||||
<add as="fillColor" value="#FFCF8A"/>
|
||||
</add>
|
||||
<add as="triangle" extend="rhombus">
|
||||
<add as="shape" value="triangle"/>
|
||||
<add as="perimeter" value="trianglePerimeter"/>
|
||||
<add as="align" value="left"/>
|
||||
</add>
|
||||
<add as="hexagon">
|
||||
<add as="shape" value="hexagon"/>
|
||||
</add>
|
||||
<add as="actor">
|
||||
<add as="shape" value="actor"/>
|
||||
<add as="strokeColor" value="#FFC7C7"/>
|
||||
<add as="fillColor" value="#FFC7C7"/>
|
||||
</add>
|
||||
<add as="cloud">
|
||||
<add as="shape" value="cloud"/>
|
||||
<add as="perimeter" value="ellipsePerimeter"/>
|
||||
<add as="strokeColor" value="#CDEB8B"/>
|
||||
<add as="fillColor" value="#CDEB8B"/>
|
||||
</add>
|
||||
<add as="cylinder">
|
||||
<add as="shape" value="cylinder"/>
|
||||
<add as="spacingTop" value="10"/>
|
||||
<add as="strokeColor" value="#4096EE"/>
|
||||
<add as="fillColor" value="#4096EE"/>
|
||||
</add>
|
||||
<add as="hline">
|
||||
<add as="shape" value="line"/>
|
||||
<add as="strokeWidth" value="3"/>
|
||||
<add as="perimeter" value="rectanglePerimeter"/>
|
||||
<add as="fontColor" value="black"/>
|
||||
<add as="fontSize" value="10"/>
|
||||
<add as="align" value="center"/>
|
||||
<add as="verticalAlign" value="bottom"/>
|
||||
<add as="strokeColor" value="#36393D"/>
|
||||
</add>
|
||||
<add as="image">
|
||||
<add as="shape" value="image"/>
|
||||
<add as="perimeter" value="rectanglePerimeter"/>
|
||||
<add as="fontSize" value="10"/>
|
||||
<add as="align" value="center"/>
|
||||
<add as="verticalAlign" value="middle"/>
|
||||
<add as="image" value="images/draw/mxlogo.jpg"/>
|
||||
</add>
|
||||
</mxStylesheet>
|
||||
<mxGraphModel as="model">
|
||||
<add as="valueForCellChanged"><![CDATA[
|
||||
function(cell, value)
|
||||
{
|
||||
var previous = null;
|
||||
|
||||
if (value == null || isNaN(value.nodeType))
|
||||
{
|
||||
previous = cell.value.getAttribute('label');
|
||||
|
||||
if (value == null)
|
||||
{
|
||||
cell.value.removeAttribute('label');
|
||||
}
|
||||
else
|
||||
{
|
||||
cell.setAttribute('label', value);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
previous = cell.value;
|
||||
cell.value = value;
|
||||
}
|
||||
|
||||
return previous;
|
||||
}
|
||||
]]></add>
|
||||
<root>
|
||||
<Diagram label="My Diagram" href="http://www.jgraph.com/" id="0">
|
||||
<mxCell/>
|
||||
</Diagram>
|
||||
<Layer label="Default Layer" id="1">
|
||||
<mxCell parent="0"/>
|
||||
</Layer>
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
</mxGraph>
|
||||
<mxDefaultToolbar as="toolbar">
|
||||
<add as="connect" mode="connect" icon="images/connect.gif"><![CDATA[
|
||||
function (editor)
|
||||
{
|
||||
if (editor.defaultEdge != null)
|
||||
{
|
||||
editor.defaultEdge.style = null;
|
||||
}
|
||||
}
|
||||
]]></add>
|
||||
<add as="connect" mode="connect" icon="images/straight.gif"><![CDATA[
|
||||
function (editor)
|
||||
{
|
||||
if (editor.defaultEdge != null)
|
||||
{
|
||||
editor.defaultEdge.style = 'straightConnector';
|
||||
}
|
||||
}
|
||||
]]></add>
|
||||
<add as="connect" mode="connect" icon="images/arrow.gif"><![CDATA[
|
||||
function (editor)
|
||||
{
|
||||
if (editor.defaultEdge != null)
|
||||
{
|
||||
editor.defaultEdge.style = 'arrowConnector';
|
||||
}
|
||||
}
|
||||
]]></add>
|
||||
<br/><br/>
|
||||
<add as="Text" template="text" icon="images/text.gif"/>
|
||||
<add as="Container" template="container" icon="images/swimlane.gif"/>
|
||||
<add as="Rectangle" template="rectangle" icon="images/rectangle.gif"/>
|
||||
<add as="Rounded" template="rounded" icon="images/rounded.gif"/>
|
||||
<add as="Ellipse" template="shape" style="ellipse" icon="images/ellipse.gif"/>
|
||||
<add as="Double Ellipse" template="shape" style="doubleEllipse" icon="images/doubleellipse.gif"/>
|
||||
<add as="Rhombus" template="shape" style="rhombus" icon="images/rhombus.gif"/>
|
||||
<add as="Triangle" template="actor" style="triangle" icon="images/triangle.gif"/>
|
||||
<add as="Hexagon" template="cloud" style="hexagon" icon="images/hexagon.gif"/>
|
||||
<add as="Actor" template="actor" style="actor" icon="images/actor.gif"/>
|
||||
<add as="Cylinder" template="shape" style="cylinder" icon="images/cylinder.gif"/>
|
||||
<add as="Cloud" template="cloud" style="cloud" icon="images/cloud.gif"/>
|
||||
<add as="Line" template="hline" style="hline" icon="images/hline.gif"/>
|
||||
<add as="Image" template="image" icon="images/image.gif"/>
|
||||
</mxDefaultToolbar>
|
||||
</mxEditor>
|
||||
267
static/mxgraph/examples/editors/config/editor-commons.xml
Normal file
267
static/mxgraph/examples/editors/config/editor-commons.xml
Normal file
@@ -0,0 +1,267 @@
|
||||
<mxEditor>
|
||||
<ui>
|
||||
<resource basename="resources/app"/>
|
||||
</ui>
|
||||
<mxDefaultPopupMenu as="popupHandler">
|
||||
<add as="cut" action="cut" icon="images/cut.gif"/>
|
||||
<add as="copy" action="copy" icon="images/copy.gif"/>
|
||||
<add as="paste" action="paste" icon="images/paste.gif"/>
|
||||
<separator/>
|
||||
<add as="delete" action="delete" icon="images/delete.gif" if="cell"/>
|
||||
<separator/>
|
||||
<add as="exitGroup" action="exitGroup" icon="images/up.gif" if="notRoot"/>
|
||||
<add as="enterGroup" action="enterGroup" icon="images/down.gif" if="validRoot"/>
|
||||
<separator/>
|
||||
<add as="shape" if="cell">
|
||||
<add as="group" action="group" icon="images/group.gif" if="ncells"/>
|
||||
<add as="ungroup" action="ungroup" icon="images/ungroup.gif" if="cell"/>
|
||||
<separator/>
|
||||
<add as="removeFromParent" action="removeFromParent" if="cell"/>
|
||||
<separator/>
|
||||
<add as="collapse" action="collapse" icon="images/collapse.gif" if="expandable"/>
|
||||
<add as="expand" action="expand" icon="images/expand.gif" if="collapsable"/>
|
||||
<separator/>
|
||||
<add as="toFront" action="toFront" icon="images/tofront.gif" if="cell"/>
|
||||
<add as="toBack" action="toBack" icon="images/toback.gif" if="cell"/>
|
||||
<separator/>
|
||||
<add as="editStyle" action="editStyle" if="cell"/>
|
||||
</add>
|
||||
<add as="format" if="cell">
|
||||
<add as="fillColor" action="fillColor" icon="images/fillcolor.gif" if="cell"/>
|
||||
<add as="gradientColor" action="gradientColor" if="cell"/>
|
||||
<add as="strokeColor" action="strokeColor" icon="images/linecolor.gif" if="cell"/>
|
||||
<separator/>
|
||||
<add as="toggleRounded" action="toggleRounded" if="cell"/>
|
||||
<add as="toggleShadow" action="toggleShadow" if="cell"/>
|
||||
</add>
|
||||
<add as="font" if="cell">
|
||||
<add as="fontColor" action="fontColor" icon="images/fontcolor.gif" if="cell"/>
|
||||
<add as="fontFamily" action="fontFamily" if="cell"/>
|
||||
<add as="fontSize" action="fontSize" if="cell"/>
|
||||
<separator/>
|
||||
<add as="bold" action="bold" icon="images/bold.gif" if="cell"/>
|
||||
<add as="italic" action="italic" icon="images/italic.gif" if="cell"/>
|
||||
</add>
|
||||
<separator/>
|
||||
<add as="properties" action="showProperties" icon="images/properties.gif"/>
|
||||
<separator/>
|
||||
<add as="openHref" action="openHref" icon="images/link.gif"/>
|
||||
</mxDefaultPopupMenu>
|
||||
<include name="config/keyhandler-commons.xml"/>
|
||||
<Array as="actions">
|
||||
<add as="open"><![CDATA[
|
||||
function (editor)
|
||||
{
|
||||
editor.open(mxUtils.prompt('Enter filename', 'workflow.xml'));
|
||||
}
|
||||
]]></add>
|
||||
<add as="openHref"><![CDATA[
|
||||
function (editor, cell)
|
||||
{
|
||||
cell = cell || editor.graph.getSelectionCell();
|
||||
|
||||
if (cell == null)
|
||||
{
|
||||
cell = editor.graph.getCurrentRoot();
|
||||
|
||||
if (cell == null)
|
||||
{
|
||||
cell = editor.graph.getModel().getRoot();
|
||||
}
|
||||
}
|
||||
|
||||
if (cell != null)
|
||||
{
|
||||
var href = cell.getAttribute('href');
|
||||
|
||||
if (href != null && href.length > 0)
|
||||
{
|
||||
window.open(href);
|
||||
}
|
||||
else
|
||||
{
|
||||
mxUtils.alert('No URL defined. Showing properties...');
|
||||
editor.execute('showProperties', cell);
|
||||
}
|
||||
}
|
||||
}
|
||||
]]></add>
|
||||
<add as="editStyle"><![CDATA[
|
||||
function (editor)
|
||||
{
|
||||
var cell = editor.graph.getSelectionCell();
|
||||
|
||||
if (cell != null)
|
||||
{
|
||||
var model = editor.graph.getModel();
|
||||
var style = mxUtils.prompt(mxResources.get('enterStyle'), model.getStyle(cell) || '');
|
||||
|
||||
if (style != null)
|
||||
{
|
||||
model.setStyle(cell, style);
|
||||
}
|
||||
}
|
||||
}
|
||||
]]></add>
|
||||
<add as="fillColor"><![CDATA[
|
||||
function (editor)
|
||||
{
|
||||
var color = mxUtils.prompt(mxResources.get('enterColorname'), 'red');
|
||||
|
||||
if (color != null)
|
||||
{
|
||||
editor.graph.model.beginUpdate();
|
||||
try
|
||||
{
|
||||
editor.graph.setCellStyles("strokeColor", color);
|
||||
editor.graph.setCellStyles("fillColor", color);
|
||||
}
|
||||
finally
|
||||
{
|
||||
editor.graph.model.endUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
]]></add>
|
||||
<add as="gradientColor"><![CDATA[
|
||||
function (editor)
|
||||
{
|
||||
var color = mxUtils.prompt(mxResources.get('enterColorname'), 'white');
|
||||
|
||||
if (color != null)
|
||||
{
|
||||
editor.graph.setCellStyles("gradientColor", color);
|
||||
}
|
||||
}
|
||||
]]></add>
|
||||
<add as="strokeColor"><![CDATA[
|
||||
function (editor)
|
||||
{
|
||||
var color = mxUtils.prompt(mxResources.get('enterColorname'), 'red');
|
||||
|
||||
if (color != null)
|
||||
{
|
||||
editor.graph.setCellStyles("strokeColor", color);
|
||||
}
|
||||
}
|
||||
]]></add>
|
||||
<add as="fontColor"><![CDATA[
|
||||
function (editor)
|
||||
{
|
||||
var color = mxUtils.prompt(mxResources.get('enterColorname'), 'red');
|
||||
|
||||
if (color != null)
|
||||
{
|
||||
editor.graph.setCellStyles("fontColor", color);
|
||||
}
|
||||
}
|
||||
]]></add>
|
||||
<add as="fontFamily"><![CDATA[
|
||||
function (editor)
|
||||
{
|
||||
var family = mxUtils.prompt(mxResources.get('enterFontfamily'), 'Arial');
|
||||
|
||||
if (family != null && family.length > 0)
|
||||
{
|
||||
editor.graph.setCellStyles("fontFamily", family);
|
||||
}
|
||||
}
|
||||
]]></add>
|
||||
<add as="fontSize"><![CDATA[
|
||||
function (editor)
|
||||
{
|
||||
var size = mxUtils.prompt(mxResources.get('enterFontsize'), '10');
|
||||
|
||||
if (size != null && size > 0 && size < 999)
|
||||
{
|
||||
editor.graph.setCellStyles("fontSize", size);
|
||||
}
|
||||
}
|
||||
]]></add>
|
||||
<add as="image"><![CDATA[
|
||||
function (editor)
|
||||
{
|
||||
var image = mxUtils.prompt(mxResources.get('enterImageUrl'),
|
||||
'examples/images/image.gif');
|
||||
|
||||
if (image != null)
|
||||
{
|
||||
editor.graph.setCellStyles("image", image);
|
||||
}
|
||||
}
|
||||
]]></add>
|
||||
<add as="opacity"><![CDATA[
|
||||
function (editor)
|
||||
{
|
||||
var opacity = mxUtils.prompt(mxResources.get('enterOpacity'), '100');
|
||||
|
||||
if (opacity != null && opacity >= 0 && opacity <= 100)
|
||||
{
|
||||
editor.graph.setCellStyles("opacity", opacity);
|
||||
}
|
||||
}
|
||||
]]></add>
|
||||
<add as="straightConnector"><![CDATA[
|
||||
function (editor)
|
||||
{
|
||||
editor.graph.setCellStyle("straightEdge");
|
||||
}
|
||||
]]></add>
|
||||
<add as="elbowConnector"><![CDATA[
|
||||
function (editor)
|
||||
{
|
||||
editor.graph.setCellStyle("");
|
||||
}
|
||||
]]></add>
|
||||
<add as="arrowConnector"><![CDATA[
|
||||
function (editor)
|
||||
{
|
||||
editor.graph.setCellStyle("arrowEdge");
|
||||
}
|
||||
]]></add>
|
||||
<add as="toggleOrientation"><![CDATA[
|
||||
function (editor, cell)
|
||||
{
|
||||
editor.graph.toggleCellStyles(mxConstants.STYLE_HORIZONTAL, true);
|
||||
}
|
||||
]]></add>
|
||||
<add as="toggleRounded"><![CDATA[
|
||||
function (editor)
|
||||
{
|
||||
editor.graph.toggleCellStyles(mxConstants.STYLE_ROUNDED);
|
||||
}
|
||||
]]></add>
|
||||
<add as="toggleShadow"><![CDATA[
|
||||
function (editor)
|
||||
{
|
||||
editor.graph.toggleCellStyles(mxConstants.STYLE_SHADOW);
|
||||
}
|
||||
]]></add>
|
||||
<add as="horizontalTree"><![CDATA[
|
||||
function (editor, cell)
|
||||
{
|
||||
cell = cell || editor.graph.getSelectionCell();
|
||||
|
||||
if (cell == null)
|
||||
{
|
||||
cell = editor.graph.getDefaultParent();
|
||||
}
|
||||
|
||||
editor.treeLayout(cell, true);
|
||||
}
|
||||
]]></add>
|
||||
<add as="verticalTree"><![CDATA[
|
||||
function (editor, cell)
|
||||
{
|
||||
cell = cell || editor.graph.getSelectionCell();
|
||||
|
||||
if (cell == null)
|
||||
{
|
||||
cell = editor.graph.getDefaultParent();
|
||||
}
|
||||
|
||||
editor.treeLayout(cell, false);
|
||||
}
|
||||
]]></add>
|
||||
</Array>
|
||||
</mxEditor>
|
||||
@@ -0,0 +1,27 @@
|
||||
<mxEditor>
|
||||
<mxDefaultKeyHandler as="keyHandler">
|
||||
<add as="8" action="collapse"/>
|
||||
<add as="13" action="expand"/>
|
||||
<add as="33" action="exitGroup"/>
|
||||
<add as="34" action="enterGroup"/>
|
||||
<add as="35" action="refresh"/>
|
||||
<add as="36" action="home"/>
|
||||
<add as="37" action="selectPrevious"/>
|
||||
<add as="38" action="selectParent"/>
|
||||
<add as="40" action="selectChild"/>
|
||||
<add as="39" action="selectNext"/>
|
||||
<add as="46" action="delete"/>
|
||||
<add as="65" control="1" action="selectAll"/>
|
||||
<add as="90" control="1" action="undo"/>
|
||||
<add as="89" control="1" action="redo"/>
|
||||
<add as="88" control="1" action="cut"/>
|
||||
<add as="67" control="1" action="copy"/>
|
||||
<add as="86" control="1" action="paste"/>
|
||||
<add as="71" control="1" action="group"/>
|
||||
<add as="85" control="1" action="ungroup"/>
|
||||
<add as="113" action="edit"/>
|
||||
<add as="123" action="showProperties"/>
|
||||
<add as="107" action="zoomIn"/>
|
||||
<add as="109" action="zoomOut"/>
|
||||
</mxDefaultKeyHandler>
|
||||
</mxEditor>
|
||||
@@ -0,0 +1,16 @@
|
||||
<mxEditor>
|
||||
<mxDefaultKeyHandler as="keyHandler">
|
||||
<add as="35" action="refresh"/>
|
||||
<add as="37" action="selectPrevious"/>
|
||||
<add as="38" action="selectParent"/>
|
||||
<add as="40" action="selectChild"/>
|
||||
<add as="39" action="selectNext"/>
|
||||
<add as="46" action="delete"/>
|
||||
<add as="65" control="1" action="selectAll"/>
|
||||
<add as="90" control="1" action="undo"/>
|
||||
<add as="89" control="1" action="redo"/>
|
||||
<add as="113" action="edit"/>
|
||||
<add as="107" action="zoomIn"/>
|
||||
<add as="109" action="zoomOut"/>
|
||||
</mxDefaultKeyHandler>
|
||||
</mxEditor>
|
||||
36
static/mxgraph/examples/editors/config/layouteditor.xml
Normal file
36
static/mxgraph/examples/editors/config/layouteditor.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<mxEditor layoutDiagram="1" layoutSwimlanes="1" maintainSwimlanes="1">
|
||||
<include name="config/wfeditor-commons.xml"/>
|
||||
<ui>
|
||||
<add as="graph" element="graph"
|
||||
style="left:70px;right:20px;top:20px;bottom:40px"/>
|
||||
<add as="status" element="status"
|
||||
style="height:20px;bottom:20px;left:20px;right:20px"/>
|
||||
<add as="toolbar" x="10" y="20" width="54"/>
|
||||
</ui>
|
||||
<Array as="templates">
|
||||
<add as="swimlane">
|
||||
<Swimlane label="Swimlane" customAttribute="text value">
|
||||
<mxCell vertex="1" style="swimlane;horizontal=1" connectable="0">
|
||||
<mxGeometry as="geometry" width="190" height="400"/>
|
||||
</mxCell>
|
||||
</Swimlane>
|
||||
</add>
|
||||
</Array>
|
||||
<mxGraph as="graph" swimlaneNesting="0">
|
||||
<include name="config/wfgraph-commons.xml"/>
|
||||
<mxStylesheet as="stylesheet">
|
||||
<add as="defaultEdge">
|
||||
<add as="shape" value="connector"/>
|
||||
<add as="elbow" value="vertical"/>
|
||||
<add as="fontSize" value="10"/>
|
||||
<add as="strokeColor" value="black"/>
|
||||
<add as="rounded" value="1"/>
|
||||
<add as="edgeStyle" value="elbowEdgeStyle"/>
|
||||
<add as="endArrow" value="classic"/>
|
||||
</add>
|
||||
</mxStylesheet>
|
||||
</mxGraph>
|
||||
<mxDefaultToolbar as="toolbar">
|
||||
<include name="config/wftoolbar-commons.xml"/>
|
||||
</mxDefaultToolbar>
|
||||
</mxEditor>
|
||||
333
static/mxgraph/examples/editors/config/processeditor.xml
Normal file
333
static/mxgraph/examples/editors/config/processeditor.xml
Normal file
@@ -0,0 +1,333 @@
|
||||
<mxEditor defaultGroup="group" defaultEdge="edge"
|
||||
layoutDiagram="1" maintainSwimlanes="1"
|
||||
swimlaneRequired="1" forcedInserting="1"
|
||||
helpWindowImage="images/help.gif"
|
||||
tasksWindowImage="images/tasks.gif">
|
||||
<include name="config/editor-commons.xml"/>
|
||||
<add as="onInit"><![CDATA[
|
||||
function ()
|
||||
{
|
||||
// Disables removing cells from parents
|
||||
this.graph.graphHandler.setRemoveCellsFromParent(false);
|
||||
this.showTasks();
|
||||
this.showHelp();
|
||||
}
|
||||
]]></add>
|
||||
<ui>
|
||||
<stylesheet name="css/process.css"/>
|
||||
<add as="graph" element="graph"/>
|
||||
<add as="status" element="status"/>
|
||||
<add as="toolbar" element="toolbar"/>
|
||||
</ui>
|
||||
<Array as="cycleAttributeValues">
|
||||
<add value="#83027F"/>
|
||||
<add value="#66B922"/>
|
||||
<add value="#808913"/>
|
||||
<add value="#CF0056"/>
|
||||
<add value="#4679B6"/>
|
||||
</Array>
|
||||
<Array as="templates">
|
||||
<add as="group">
|
||||
<Group label="" description="">
|
||||
<mxCell vertex="1" style="group" connectable="0"/>
|
||||
</Group>
|
||||
</add>
|
||||
<add as="edge">
|
||||
<Edge label="" description="">
|
||||
<mxCell edge="1">
|
||||
<mxGeometry as="geometry" isRelative="1"/>
|
||||
</mxCell>
|
||||
</Edge>
|
||||
</add>
|
||||
<add as="swimlane">
|
||||
<Swimlane label="Role" customAttribute="text value">
|
||||
<mxCell vertex="1" style="swimlane" connectable="0">
|
||||
<mxGeometry as="geometry" width="220" height="480"/>
|
||||
</mxCell>
|
||||
</Swimlane>
|
||||
</add>
|
||||
<add as="task">
|
||||
<Task label="Task">
|
||||
<mxCell vertex="1">
|
||||
<mxGeometry as="geometry" width="80" height="30"/>
|
||||
</mxCell>
|
||||
</Task>
|
||||
</add>
|
||||
<add as="subprocess">
|
||||
<Subprocess label="Subprocess">
|
||||
<mxCell vertex="1" style="rounded">
|
||||
<mxGeometry as="geometry" width="80" height="30"/>
|
||||
</mxCell>
|
||||
</Subprocess>
|
||||
</add>
|
||||
<add as="shape">
|
||||
<Shape label="Element">
|
||||
<mxCell vertex="1" style="ellipse">
|
||||
<mxGeometry as="geometry" width="60" height="50"/>
|
||||
</mxCell>
|
||||
</Shape>
|
||||
</add>
|
||||
<add as="hline">
|
||||
<Shape label="">
|
||||
<mxCell vertex="1" style="ellipse">
|
||||
<mxGeometry as="geometry" width="60" height="10"/>
|
||||
</mxCell>
|
||||
</Shape>
|
||||
</add>
|
||||
</Array>
|
||||
<add as="createTasks"><![CDATA[
|
||||
function (div)
|
||||
{
|
||||
var off = 30;
|
||||
|
||||
if (this.graph != null)
|
||||
{
|
||||
var layer = this.graph.getModel().getRoot().getChildAt(0);
|
||||
|
||||
if (layer == null || layer.getChildCount() == 0)
|
||||
{
|
||||
mxUtils.para(div, 'Examples:');
|
||||
mxUtils.linkInvoke(div, 'Withdrawal', this, 'open',
|
||||
'diagrams/withdrawal.xml', off);
|
||||
mxUtils.br(div);
|
||||
}
|
||||
else
|
||||
{
|
||||
mxUtils.para(div, 'Clipboard:');
|
||||
|
||||
if (!this.graph.isSelectionEmpty())
|
||||
{
|
||||
mxUtils.linkAction(div, 'Copy to Clipboard', this, 'copy', off);
|
||||
mxUtils.br(div);
|
||||
}
|
||||
|
||||
mxUtils.linkAction(div, 'Paste from Clipboard', this, 'paste', off);
|
||||
mxUtils.br(div);
|
||||
|
||||
if (!this.graph.isSelectionEmpty())
|
||||
{
|
||||
mxUtils.linkAction(div, 'Delete Selected Cells', this, 'delete', off);
|
||||
mxUtils.br(div);
|
||||
mxUtils.linkAction(div, 'Clear Selection', this, 'selectNone', off);
|
||||
mxUtils.br(div);
|
||||
}
|
||||
else
|
||||
{
|
||||
mxUtils.linkAction(div, 'Select All Cells', this, 'selectAll', off);
|
||||
mxUtils.br(div);
|
||||
}
|
||||
|
||||
mxUtils.para(div, 'History:');
|
||||
mxUtils.linkAction(div, 'Undo Last Change', this, 'undo', off);
|
||||
mxUtils.br(div);
|
||||
mxUtils.linkAction(div, 'Redo Last Change', this, 'redo', off);
|
||||
mxUtils.br(div);
|
||||
}
|
||||
|
||||
mxUtils.br(div);
|
||||
}
|
||||
}
|
||||
]]></add>
|
||||
<mxGraph as="graph" alternateEdgeStyle="verticalEdge"
|
||||
swimlaneNesting="0" dropEnabled="1">
|
||||
<add as="isAutoSizeCell"><![CDATA[
|
||||
function(cell)
|
||||
{
|
||||
return this.isSwimlane(cell);
|
||||
}
|
||||
]]></add>
|
||||
<add as="isValidRoot"><![CDATA[
|
||||
function(cell)
|
||||
{
|
||||
return !this.isSwimlane(cell);
|
||||
}
|
||||
]]></add>
|
||||
<add as="isCellFoldable"><![CDATA[
|
||||
function(cell, collapse)
|
||||
{
|
||||
return !this.isSwimlane(cell) &&
|
||||
cell.getChildCount() > 0;
|
||||
}
|
||||
]]></add>
|
||||
<add as="isSwimlane">
|
||||
function (cell)
|
||||
{
|
||||
return mxUtils.isNode(this.model.getValue(cell), 'swimlane');
|
||||
}
|
||||
</add>
|
||||
<add as="isAllowOverlapParent">
|
||||
function(cell)
|
||||
{
|
||||
return !this.isSwimlane(cell.parent);
|
||||
}
|
||||
</add>
|
||||
<add as="getTooltipForCell"><![CDATA[
|
||||
function(cell)
|
||||
{
|
||||
return '<b>'+cell.getAttribute('label')+
|
||||
'</b> ('+cell.getId()+')'+
|
||||
'<br>Style: '+cell.getStyle()+
|
||||
'<br>Edges: '+cell.getEdgeCount()+
|
||||
'<br>Children: '+cell.getChildCount();
|
||||
}
|
||||
]]></add>
|
||||
<add as="convertValueToString"><![CDATA[
|
||||
function(cell)
|
||||
{
|
||||
return cell.getAttribute('label');
|
||||
}
|
||||
]]></add>
|
||||
<mxStylesheet as="stylesheet">
|
||||
<add as="defaultVertex">
|
||||
<add as="shape" value="rectangle"/>
|
||||
<add as="perimeter" value="rectanglePerimeter"/>
|
||||
<add as="fontColor" value="black"/>
|
||||
<add as="fontSize" value="10"/>
|
||||
<add as="align" value="center"/>
|
||||
<add as="verticalAlign" value="middle"/>
|
||||
<add as="fillColor" value="indicated"/>
|
||||
<add as="indicatorColor" value="swimlane"/>
|
||||
<add as="gradientColor" value="white"/>
|
||||
</add>
|
||||
<add as="group">
|
||||
<add as="shape" value="rectangle"/>
|
||||
<add as="perimeter" value="rectanglePerimeter"/>
|
||||
<add as="fontSize" value="10"/>
|
||||
<add as="align" value="center"/>
|
||||
<add as="verticalAlign" value="middle"/>
|
||||
<add as="strokeColor" value="gray"/>
|
||||
<add as="dashed" value="1"/>
|
||||
</add>
|
||||
<add as="defaultEdge">
|
||||
<add as="shape" value="connector"/>
|
||||
<add as="fontSize" value="10"/>
|
||||
<add as="rounded" value="1"/>
|
||||
<add as="strokeColor" value="gray"/>
|
||||
<add as="edgeStyle" value="elbowEdgeStyle"/>
|
||||
<add as="endArrow" value="classic"/>
|
||||
</add>
|
||||
<add as="verticalEdge">
|
||||
<add as="elbow" value="vertical"/>
|
||||
</add>
|
||||
<add as="swimlane">
|
||||
<add as="shape" value="swimlane"/>
|
||||
<add as="perimeter" value="rectanglePerimeter"/>
|
||||
<add as="fontSize" value="12"/>
|
||||
<add as="startSize" value="36"/>
|
||||
<add as="rounded" value="1"/>
|
||||
<add as="align" value="center"/>
|
||||
<add as="verticalAlign" value="top"/>
|
||||
<add as="spacingTop" value="8"/>
|
||||
<add as="fontColor" value="white"/>
|
||||
<add as="separatorColor" value="#c0c0c0"/>
|
||||
</add>
|
||||
<add as="rounded">
|
||||
<add as="rounded" value="1"/>
|
||||
</add>
|
||||
<add as="ellipse">
|
||||
<add as="shape" value="label"/>
|
||||
<add as="indicatorShape" value="ellipse"/>
|
||||
<add as="indicatorWidth" value="34"/>
|
||||
<add as="indicatorHeight" value="34"/>
|
||||
<add as="imageVerticalAlign" value="top"/>
|
||||
<add as="imageAlign" value="center"/>
|
||||
<add as="spacingTop" value="40"/>
|
||||
<add as="perimeter" value="rectanglePerimeter"/>
|
||||
<add as="fontSize" value="10"/>
|
||||
<add as="align" value="center"/>
|
||||
<add as="verticalAlign" value="top"/>
|
||||
<add as="indicatorColor" value="swimlane"/>
|
||||
<add as="indicatorGradientColor" value="white"/>
|
||||
<add as="fillColor" value="none"/>
|
||||
<add as="gradientColor" value="none"/>
|
||||
</add>
|
||||
<add as="rhombus" extend="ellipse">
|
||||
<add as="indicatorShape" value="rhombus"/>
|
||||
</add>
|
||||
<add as="actor" extend="ellipse">
|
||||
<add as="indicatorShape" value="actor"/>
|
||||
<add as="indicatorWidth" value="26"/>
|
||||
</add>
|
||||
<add as="cylinder" extend="actor">
|
||||
<add as="indicatorShape" value="cylinder"/>
|
||||
<add as="imageVerticalAlign" value="bottom"/>
|
||||
<add as="indicatorHeight" value="30"/>
|
||||
<add as="verticalAlign" value="top"/>
|
||||
<add as="spacingTop" value="0"/>
|
||||
</add>
|
||||
<add as="hline">
|
||||
<add as="shape" value="line"/>
|
||||
<add as="strokeWidth" value="3"/>
|
||||
<add as="perimeter" value="rectanglePerimeter"/>
|
||||
<add as="fontColor" value="black"/>
|
||||
<add as="fontSize" value="10"/>
|
||||
<add as="align" value="center"/>
|
||||
<add as="verticalAlign" value="bottom"/>
|
||||
<add as="strokeColor" value="indicated"/>
|
||||
</add>
|
||||
</mxStylesheet>
|
||||
<mxGraphModel as="model">
|
||||
<add as="valueForCellChanged"><![CDATA[
|
||||
function(cell, value)
|
||||
{
|
||||
var previous = null;
|
||||
|
||||
if (isNaN(value.nodeType))
|
||||
{
|
||||
previous = cell.getAttribute('label');
|
||||
cell.setAttribute('label', value);
|
||||
}
|
||||
else
|
||||
{
|
||||
previous = cell.value;
|
||||
cell.value = value;
|
||||
}
|
||||
|
||||
return previous;
|
||||
}
|
||||
]]></add>
|
||||
<root>
|
||||
<Workflow label="MyWorkflow" id="0"/>
|
||||
<Layer label="Default Layer">
|
||||
<mxCell parent="0"/>
|
||||
</Layer>
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
</mxGraph>
|
||||
<mxDefaultToolbar as="toolbar">
|
||||
<add as="Save" action="save" icon="images/save.gif"/>
|
||||
<separator/>
|
||||
<add as="Undo" action="undo" icon="images/undo.gif"/>
|
||||
<add as="Redo" action="redo" icon="images/redo.gif"/>
|
||||
<add as="Cut" action="cut" icon="images/cut.gif"/>
|
||||
<add as="Copy" action="copy" icon="images/copy.gif"/>
|
||||
<add as="Paste" action="paste" icon="images/paste.gif"/>
|
||||
<add as="Delete" action="delete" icon="images/delete.gif"/>
|
||||
<add as="Group" action="group" icon="images/group.gif"/>
|
||||
<add as="Ungroup" action="ungroup" icon="images/ungroup.gif"/>
|
||||
<separator/>
|
||||
<add as="Select" mode="select" icon="images/select.gif"/>
|
||||
<add as="Pan" mode="pan" icon="images/pan.gif"/>
|
||||
<add as="Connect" mode="connect" icon="images/connect.gif"/>
|
||||
<separator/>
|
||||
<add as="Swimlane" template="swimlane" icon="images/swimlane.gif"/>
|
||||
<add as="Task" template="task" icon="images/rectangle.gif"/>
|
||||
<add as="Subprocess" template="subprocess" icon="images/rounded.gif"/>
|
||||
<add as="Ellipse" template="shape" style="ellipse" icon="images/ellipse.gif"/>
|
||||
<add as="Rhombus" template="shape" style="rhombus" icon="images/rhombus.gif"/>
|
||||
<add as="Actor" template="shape" style="actor" icon="images/actor.gif"/>
|
||||
<add as="Cylinder" template="shape" style="cylinder" icon="images/cylinder.gif"/>
|
||||
<add as="Line" template="hline" style="hline" icon="images/hline.gif"/>
|
||||
<separator/>
|
||||
<add as="Fit" action="fit" icon="images/zoom.gif"/>
|
||||
<add as="Zoom In" action="zoomIn" icon="images/zoomin.gif"/>
|
||||
<add as="Zoom Out" action="zoomOut" icon="images/zoomout.gif"/>
|
||||
<add as="Actual Size" action="actualSize" icon="images/zoomactual.gif"/>
|
||||
<add as="Zoom" action="zoom" icon="images/zoom.gif"/>
|
||||
<separator/>
|
||||
<add as="outline" action="toggleOutline" icon="images/outline.gif"/>
|
||||
<add as="Tasks" action="toggleTasks" icon="images/tasks.gif"/>
|
||||
<add as="Help" action="toggleHelp" icon="images/help.gif"/>
|
||||
<add as="Console" action="toggleConsole" icon="images/console.gif"/>
|
||||
</mxDefaultToolbar>
|
||||
</mxEditor>
|
||||
184
static/mxgraph/examples/editors/config/wfeditor-commons.xml
Normal file
184
static/mxgraph/examples/editors/config/wfeditor-commons.xml
Normal file
@@ -0,0 +1,184 @@
|
||||
<mxEditor defaultGroup="group" defaultEdge="edge"
|
||||
helpWindowImage="images/help.gif"
|
||||
tasksWindowImage="images/tasks.gif"
|
||||
forcedInserting="0"
|
||||
swimlaneRequired="0">
|
||||
<include name="config/editor-commons.xml"/>
|
||||
<add as="onInit">
|
||||
function ()
|
||||
{
|
||||
this.showTasks();
|
||||
}
|
||||
</add>
|
||||
<Array as="cycleAttributeValues">
|
||||
<add value="#83027F"/>
|
||||
<add value="#66B922"/>
|
||||
<add value="#808913"/>
|
||||
<add value="#CF0056"/>
|
||||
<add value="#4679B6"/>
|
||||
</Array>
|
||||
<Array as="templates">
|
||||
<add as="group">
|
||||
<Group label="" description="" href="">
|
||||
<mxCell vertex="1" style="group" connectable="0"/>
|
||||
</Group>
|
||||
</add>
|
||||
<add as="edge">
|
||||
<Edge label="" description="">
|
||||
<mxCell edge="1">
|
||||
<mxGeometry as="geometry" relative="1"/>
|
||||
</mxCell>
|
||||
</Edge>
|
||||
</add>
|
||||
<add as="swimlane">
|
||||
<Swimlane label="Swimlane" description="" href="">
|
||||
<mxCell vertex="1" style="swimlane" connectable="0">
|
||||
<mxGeometry as="geometry" width="300" height="160"/>
|
||||
</mxCell>
|
||||
</Swimlane>
|
||||
</add>
|
||||
<add as="task">
|
||||
<Task label="Task" description="" href="">
|
||||
<mxCell vertex="1">
|
||||
<mxGeometry as="geometry" width="72" height="32"/>
|
||||
</mxCell>
|
||||
</Task>
|
||||
</add>
|
||||
<add as="subprocess">
|
||||
<Subprocess label="Subprocess" description="" href="">
|
||||
<mxCell vertex="1" style="rounded">
|
||||
<mxGeometry as="geometry" width="72" height="32"/>
|
||||
</mxCell>
|
||||
</Subprocess>
|
||||
</add>
|
||||
<add as="shape">
|
||||
<Shape label="" description="" href="">
|
||||
<mxCell vertex="1" style="ellipse">
|
||||
<mxGeometry as="geometry" width="32" height="32"/>
|
||||
</mxCell>
|
||||
</Shape>
|
||||
</add>
|
||||
<add as="symbol">
|
||||
<Symbol label="Symbol" description="" href="">
|
||||
<mxCell vertex="1" style="symbol;image=images/symbols/event.png">
|
||||
<mxGeometry as="geometry" width="32" height="32"/>
|
||||
</mxCell>
|
||||
</Symbol>
|
||||
</add>
|
||||
</Array>
|
||||
<add as="createTasks"><![CDATA[
|
||||
function (div)
|
||||
{
|
||||
var off = 30;
|
||||
|
||||
if (this.graph != null)
|
||||
{
|
||||
var layer = this.graph.model.root.getChildAt(0);
|
||||
mxUtils.para(div, mxResources.get('examples'));
|
||||
mxUtils.linkInvoke(div, mxResources.get('newDiagram'), this,
|
||||
'open', 'diagrams/empty.xml', off);
|
||||
mxUtils.br(div);
|
||||
mxUtils.linkInvoke(div, mxResources.get('swimlanes'), this,
|
||||
'open', 'diagrams/swimlanes.xml', off);
|
||||
mxUtils.br(div);
|
||||
mxUtils.linkInvoke(div, mxResources.get('travelBooking'), this,
|
||||
'open', 'diagrams/travel-booking.xml', off);
|
||||
mxUtils.br(div);
|
||||
|
||||
if (!this.graph.isSelectionEmpty())
|
||||
{
|
||||
var cell = this.graph.getSelectionCell();
|
||||
if (this.graph.getSelectionCount() == 1 &&
|
||||
(this.graph.model.isVertex(cell) &&
|
||||
cell.getEdgeCount() > 0) || this.graph.isSwimlane(cell))
|
||||
{
|
||||
mxUtils.para(div, 'Layout');
|
||||
mxUtils.linkAction(div, mxResources.get('verticalTree'),
|
||||
this, 'verticalTree', off);
|
||||
mxUtils.br(div);
|
||||
mxUtils.linkAction(div, mxResources.get('horizontalTree'),
|
||||
this, 'horizontalTree', off);
|
||||
mxUtils.br(div);
|
||||
}
|
||||
|
||||
mxUtils.para(div, 'Format');
|
||||
|
||||
if (mxUtils.isNode(cell.value, 'Symbol'))
|
||||
{
|
||||
mxUtils.linkAction(div, mxResources.get('image'),
|
||||
this, 'image', off);
|
||||
mxUtils.br(div);
|
||||
}
|
||||
else
|
||||
{
|
||||
mxUtils.linkAction(div, mxResources.get('opacity'),
|
||||
this, 'opacity', off);
|
||||
mxUtils.br(div);
|
||||
if (this.graph.model.isVertex(cell) ||
|
||||
(cell.style != null &&
|
||||
cell.style.indexOf("arrowEdge") >= 0))
|
||||
{
|
||||
mxUtils.linkAction(div, mxResources.get('gradientColor'),
|
||||
this, 'gradientColor', off);
|
||||
mxUtils.br(div);
|
||||
}
|
||||
if (this.graph.model.isEdge(cell))
|
||||
{
|
||||
mxUtils.linkAction(div, 'Straight Connector', this, 'straightConnector', off);
|
||||
mxUtils.br(div);
|
||||
mxUtils.linkAction(div, 'Elbow Connector', this, 'elbowConnector', off);
|
||||
mxUtils.br(div);
|
||||
mxUtils.linkAction(div, 'Arrow Connector', this, 'arrowConnector', off);
|
||||
mxUtils.br(div);
|
||||
}
|
||||
}
|
||||
|
||||
mxUtils.linkAction(div, 'Rounded', this, 'toggleRounded', off);
|
||||
mxUtils.br(div);
|
||||
if (this.graph.isSwimlane(cell) || this.graph.model.isEdge(cell))
|
||||
{
|
||||
mxUtils.linkAction(div, 'Orientation', this, 'toggleOrientation', off);
|
||||
mxUtils.br(div);
|
||||
}
|
||||
|
||||
if (this.graph.getSelectionCount() > 1)
|
||||
{
|
||||
mxUtils.para(div, mxResources.get('align'));
|
||||
mxUtils.linkAction(div, mxResources.get('left'),
|
||||
this, 'alignCellsLeft', off);
|
||||
mxUtils.br(div);
|
||||
mxUtils.linkAction(div, mxResources.get('center'),
|
||||
this, 'alignCellsCenter', off);
|
||||
mxUtils.br(div);
|
||||
mxUtils.linkAction(div, mxResources.get('right'),
|
||||
this, 'alignCellsRight', off);
|
||||
mxUtils.br(div);
|
||||
mxUtils.linkAction(div, mxResources.get('top'),
|
||||
this, 'alignCellsTop', off);
|
||||
mxUtils.br(div);
|
||||
mxUtils.linkAction(div, mxResources.get('middle'),
|
||||
this, 'alignCellsMiddle', off);
|
||||
mxUtils.br(div);
|
||||
mxUtils.linkAction(div, mxResources.get('bottom'),
|
||||
this, 'alignCellsBottom', off);
|
||||
mxUtils.br(div);
|
||||
}
|
||||
|
||||
mxUtils.para(div, mxResources.get('selection'));
|
||||
mxUtils.linkAction(div, mxResources.get('clearSelection'),
|
||||
this, 'selectNone', off);
|
||||
mxUtils.br(div);
|
||||
}
|
||||
else if (layer.getChildCount() > 0)
|
||||
{
|
||||
mxUtils.para(div, mxResources.get('selection'));
|
||||
mxUtils.linkAction(div, mxResources.get('selectAll'),
|
||||
this, 'selectAll', off);
|
||||
mxUtils.br(div);
|
||||
}
|
||||
|
||||
mxUtils.br(div);
|
||||
}
|
||||
}
|
||||
]]></add>
|
||||
</mxEditor>
|
||||
152
static/mxgraph/examples/editors/config/wfgraph-commons.xml
Normal file
152
static/mxgraph/examples/editors/config/wfgraph-commons.xml
Normal file
@@ -0,0 +1,152 @@
|
||||
<mxGraph alternateEdgeStyle="verticalEdge" dropEnabled="1">
|
||||
<add as="isAutoSizeCell"><![CDATA[
|
||||
function(cell)
|
||||
{
|
||||
return this.isSwimlane(cell);
|
||||
}
|
||||
]]></add>
|
||||
<add as="isSwimlane"><![CDATA[
|
||||
function (cell)
|
||||
{
|
||||
return mxUtils.isNode(this.model.getValue(cell), 'swimlane');
|
||||
}
|
||||
]]></add>
|
||||
<add as="isAllowOverlapParent"><![CDATA[
|
||||
function(cell)
|
||||
{
|
||||
return !this.isSwimlane(cell.parent);
|
||||
}
|
||||
]]></add>
|
||||
<add as="getTooltipForCell"><![CDATA[
|
||||
function(cell)
|
||||
{
|
||||
var href = cell.getAttribute('href');
|
||||
href = (href != null && href.length > 0) ?
|
||||
'<br>'+href : '';
|
||||
var maxlen = 30;
|
||||
var desc = cell.getAttribute('description');
|
||||
if (desc == null || desc.length == 0)
|
||||
{
|
||||
desc = '';
|
||||
}
|
||||
else if (desc.length < maxlen)
|
||||
{
|
||||
desc = '<br>'+desc;
|
||||
}
|
||||
else
|
||||
{
|
||||
desc = '<br>'+desc.substring(0, maxlen)+'...';
|
||||
}
|
||||
return '<b>'+cell.getAttribute('label')+
|
||||
'</b> ('+cell.getId()+')'+href+desc+
|
||||
'<br>Edges: '+cell.getEdgeCount()+
|
||||
'<br>Children: '+cell.getChildCount();
|
||||
}
|
||||
]]></add>
|
||||
<add as="convertValueToString">
|
||||
function(cell)
|
||||
{
|
||||
return cell.getAttribute('label');
|
||||
}
|
||||
</add>
|
||||
<mxGraphModel as="model">
|
||||
<add as="valueForCellChanged"><![CDATA[
|
||||
function(cell, value)
|
||||
{
|
||||
var previous = null;
|
||||
|
||||
if (isNaN(value.nodeType))
|
||||
{
|
||||
previous = cell.getAttribute('label');
|
||||
cell.setAttribute('label', value);
|
||||
}
|
||||
else
|
||||
{
|
||||
previous = cell.value;
|
||||
cell.value = value;
|
||||
}
|
||||
|
||||
return previous;
|
||||
}
|
||||
]]></add>
|
||||
<root>
|
||||
<Workflow label="MyWorkflow" description="" href="" id="0"/>
|
||||
<Layer label="Default Layer">
|
||||
<mxCell parent="0"/>
|
||||
</Layer>
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
<mxStylesheet as="stylesheet">
|
||||
<add as="defaultVertex">
|
||||
<add as="shape" value="label"/>
|
||||
<add as="perimeter" value="rectanglePerimeter"/>
|
||||
<add as="labelBackgroundColor" value="white"/>
|
||||
<add as="fontSize" value="10"/>
|
||||
<add as="align" value="center"/>
|
||||
<add as="verticalAlign" value="middle"/>
|
||||
<add as="strokeColor" value="black"/>
|
||||
</add>
|
||||
<add as="defaultEdge">
|
||||
<add as="shape" value="connector"/>
|
||||
<add as="labelBackgroundColor" value="white"/>
|
||||
<add as="rounded" value="1"/>
|
||||
<add as="edgeStyle" value="elbowEdgeStyle"/>
|
||||
<add as="endArrow" value="classic"/>
|
||||
<add as="fontSize" value="10"/>
|
||||
<add as="align" value="center"/>
|
||||
<add as="verticalAlign" value="middle"/>
|
||||
<add as="strokeColor" value="black"/>
|
||||
</add>
|
||||
<add as="verticalEdge">
|
||||
<add as="elbow" value="vertical"/>
|
||||
</add>
|
||||
<add as="straightEdge">
|
||||
<add as="shape" value="connector"/>
|
||||
<add as="endArrow" value="classic"/>
|
||||
</add>
|
||||
<add as="arrowEdge">
|
||||
<add as="shape" value="arrow"/>
|
||||
<add as="fillColor" value="red"/>
|
||||
</add>
|
||||
<add as="swimlane">
|
||||
<add as="shape" value="swimlane"/>
|
||||
<add as="fontSize" value="12"/>
|
||||
<add as="startSize" value="23"/>
|
||||
<add as="horizontal" value="0"/>
|
||||
<add as="verticalAlign" value="top"/>
|
||||
<add as="fontColor" value="white"/>
|
||||
<add as="labelBackgroundColor" value="none"/>
|
||||
</add>
|
||||
<add as="group">
|
||||
<add as="shape" value="rectangle"/>
|
||||
<add as="rounded" value="1"/>
|
||||
<add as="verticalAlign" value="top"/>
|
||||
<add as="strokeColor" value="black"/>
|
||||
<add as="dashed" value="1"/>
|
||||
<add as="opacity" value="50"/>
|
||||
</add>
|
||||
<add as="rounded">
|
||||
<add as="rounded" value="1"/>
|
||||
</add>
|
||||
<add as="ellipse">
|
||||
<add as="shape" value="ellipse"/>
|
||||
<add as="perimeter" value="ellipsePerimeter"/>
|
||||
</add>
|
||||
<add as="rhombus">
|
||||
<add as="shape" value="rhombus"/>
|
||||
<add as="perimeter" value="rhombusPerimeter"/>
|
||||
</add>
|
||||
<add as="actor">
|
||||
<add as="shape" value="actor"/>
|
||||
</add>
|
||||
<add as="symbol">
|
||||
<add as="shape" value="image"/>
|
||||
<add as="perimeter" value="rectanglePerimeter"/>
|
||||
<add as="labelBackgroundColor" value="white"/>
|
||||
<add as="fontSize" value="10"/>
|
||||
<add as="align" value="center"/>
|
||||
<add as="verticalAlign" value="top"/>
|
||||
<add as="verticalLabelPosition" value="bottom"/>
|
||||
</add>
|
||||
</mxStylesheet>
|
||||
</mxGraph>
|
||||
74
static/mxgraph/examples/editors/config/wftoolbar-commons.xml
Normal file
74
static/mxgraph/examples/editors/config/wftoolbar-commons.xml
Normal file
@@ -0,0 +1,74 @@
|
||||
<mxDefaultToolbar>
|
||||
<add as="save" action="save" icon="images/save.gif"/>
|
||||
<add as="show" action="show" icon="images/preview.gif"/>
|
||||
<add as="print" action="print" icon="images/print.gif"/>
|
||||
<add as="exportImage" action="exportImage" icon="images/image.gif"/>
|
||||
<br/><hr/>
|
||||
<add as="select" mode="select" icon="images/select.gif"/>
|
||||
<add as="pan" mode="pan" icon="images/pan.gif"/>
|
||||
<add as="connect" mode="connect" icon="images/connect.gif"><![CDATA[
|
||||
function (editor)
|
||||
{
|
||||
if (editor.defaultEdge != null)
|
||||
{
|
||||
editor.defaultEdge.style = null;
|
||||
}
|
||||
}
|
||||
]]></add>
|
||||
<add as="connect" mode="connect" icon="images/straight.gif"><![CDATA[
|
||||
function (editor)
|
||||
{
|
||||
if (editor.defaultEdge != null)
|
||||
{
|
||||
editor.defaultEdge.style = 'straightEdge';
|
||||
}
|
||||
}
|
||||
]]></add>
|
||||
<br/><hr/>
|
||||
<add as="undo" action="undo" icon="images/undo.gif"/>
|
||||
<add as="redo" action="redo" icon="images/redo.gif"/>
|
||||
<br/><hr/>
|
||||
<add as="cut" action="cut" icon="images/cut.gif"/>
|
||||
<add as="copy" action="copy" icon="images/copy.gif"/>
|
||||
<add as="paste" action="paste" icon="images/paste.gif"/>
|
||||
<add as="delete" action="delete" icon="images/delete.gif"/>
|
||||
<br/><hr/>
|
||||
<add as="group" action="group" icon="images/group.gif"/>
|
||||
<add as="ungroup" action="ungroup" icon="images/ungroup.gif"/>
|
||||
<br/><hr/>
|
||||
<add as="Swimlane" template="swimlane" icon="images/swimlane.gif"/>
|
||||
<add as="Task" template="task" icon="images/rectangle.gif"/>
|
||||
<add as="Subprocess" template="subprocess" icon="images/rounded.gif"/>
|
||||
<add as="Ellipse" template="shape" style="ellipse" icon="images/ellipse.gif"/>
|
||||
<add as="Rhombus" template="shape" style="rhombus" icon="images/rhombus.gif"/>
|
||||
<add as="Actor" template="shape" style="actor" icon="images/actor.gif"/>
|
||||
<br/><hr/>
|
||||
<add as="Event" template="symbol" style="symbol;image=images/symbols/event.png" icon="images/symbols/small_event.gif"/>
|
||||
<add as="Event (Intermediate)" template="symbol" style="symbol;image=images/symbols/event_intermediate.png" icon="images/symbols/small_event_intermediate.gif"/>
|
||||
<add as="Event (End)" template="symbol" style="symbol;image=images/symbols/event_end.png" icon="images/symbols/small_event_end.gif"/>
|
||||
<add as="Timer" template="symbol" style="symbol;image=images/symbols/timer.png" icon="images/symbols/small_timer.gif"/>
|
||||
<add as="Message" template="symbol" style="symbol;image=images/symbols/message.png" icon="images/symbols/small_message.gif"/>
|
||||
<add as="Message (Intermediate)" template="symbol" style="symbol;image=images/symbols/message_intermediate.png" icon="images/symbols/small_message_intermediate.gif"/>
|
||||
<add as="Message (End)" template="symbol" style="symbol;image=images/symbols/message_end.png" icon="images/symbols/small_message_end.gif"/>
|
||||
<add as="Terminate" template="symbol" style="symbol;image=images/symbols/terminate.png" icon="images/symbols/small_terminate.gif"/>
|
||||
<add as="Link" template="symbol" style="symbol;image=images/symbols/link.png" icon="images/symbols/small_link.gif"/>
|
||||
<add as="Rule" template="symbol" style="symbol;image=images/symbols/rule.png" icon="images/symbols/small_rule.gif"/>
|
||||
<add as="Multiple" template="symbol" style="symbol;image=images/symbols/multiple.png" icon="images/symbols/small_multiple.gif"/>
|
||||
<add as="Error" template="symbol" style="symbol;image=images/symbols/error.png" icon="images/symbols/small_error.gif"/>
|
||||
<add as="Cancel (End)" template="symbol" style="symbol;image=images/symbols/cancel_end.png" icon="images/symbols/small_cancel_end.gif"/>
|
||||
<add as="Cancel (Intermediate)" template="symbol" style="symbol;image=images/symbols/cancel_intermediate.png" icon="images/symbols/small_cancel_intermediate.gif"/>
|
||||
<add as="Fork" template="symbol" style="symbol;image=images/symbols/fork.png" icon="images/symbols/small_fork.gif"/>
|
||||
<add as="Merge" template="symbol" style="symbol;image=images/symbols/merge.png" icon="images/symbols/small_merge.gif"/>
|
||||
<add as="Inclusive" template="symbol" style="symbol;image=images/symbols/inclusive.png" icon="images/symbols/small_inclusive.gif"/>
|
||||
<br/><hr/>
|
||||
<add as="fit" action="fit" icon="images/zoom.gif"/>
|
||||
<add as="zoomIn" action="zoomIn" icon="images/zoomin.gif"/>
|
||||
<add as="zoomOut" action="zoomOut" icon="images/zoomout.gif"/>
|
||||
<add as="actualSize" action="actualSize" icon="images/zoomactual.gif"/>
|
||||
<add as="zoom" action="zoom" icon="images/zoom.gif"/>
|
||||
<br/><hr/>
|
||||
<add as="outline" action="toggleOutline" icon="images/outline.gif"/>
|
||||
<add as="tasks" action="toggleTasks" icon="images/tasks.gif"/>
|
||||
<add as="help" action="toggleHelp" icon="images/help.gif"/>
|
||||
<add as="console" action="toggleConsole" icon="images/console.gif"/>
|
||||
</mxDefaultToolbar>
|
||||
16
static/mxgraph/examples/editors/config/workfloweditor.xml
Normal file
16
static/mxgraph/examples/editors/config/workfloweditor.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<mxEditor>
|
||||
<include name="config/wfeditor-commons.xml"/>
|
||||
<ui>
|
||||
<add as="graph" element="graph"
|
||||
style="left:70px;right:20px;top:20px;bottom:40px"/>
|
||||
<add as="status" element="status"
|
||||
style="height:20px;bottom:20px;left:20px;right:20px"/>
|
||||
<add as="toolbar" x="16" y="20" width="50" style="padding:5px;padding-top:8px;padding-right:0px;"/>
|
||||
</ui>
|
||||
<mxGraph as="graph">
|
||||
<include name="config/wfgraph-commons.xml"/>
|
||||
</mxGraph>
|
||||
<mxDefaultToolbar as="toolbar">
|
||||
<include name="config/wftoolbar-commons.xml"/>
|
||||
</mxDefaultToolbar>
|
||||
</mxEditor>
|
||||
Reference in New Issue
Block a user