1(function()
2{
3	Sidebar.prototype.addDFDPalette = function()
4	{
5		var w = 100;
6		var h = 100;
7		var s = 'html=1;dashed=0;whitespace=wrap;shape=mxgraph.dfd.';
8		var s2 = mxConstants.STYLE_VERTICAL_LABEL_POSITION + '=bottom;' + mxConstants.STYLE_VERTICAL_ALIGN + '=top;html=1;strokeWidth=2;shape=mxgraph.dfd.';
9		var s3 = mxConstants.STYLE_VERTICAL_LABEL_POSITION + '=bottom;' + mxConstants.STYLE_VERTICAL_ALIGN + '=top;html=1;strokeWidth=2;shape=';
10		var gn = 'mxgraph.flowchart';
11		var dt = 'dfd data flow diagram ';
12		this.setCurrentSearchEntryLibrary('dfd');
13
14		this.addPaletteFunctions('dfd', 'Data Flow Diagram', false,
15		[
16			this.createVertexTemplateEntry(s + 'start', w * 0.8, h * 0.3, '', 'Start / End', null, null, this.getTagsForStencil(gn, 'start end', dt).join(' ')),
17			this.createVertexTemplateEntry('html=1;dashed=0;whitespace=wrap;', w, h * 0.5, '', 'Activity / Process / Entity / External Interactor', null, null, this.getTagsForStencil(gn, 'activity process entity external interactor', dt).join(' ')),
18			this.createVertexTemplateEntry('shape=rhombus;html=1;dashed=0;whitespace=wrap;perimeter=rhombusPerimeter;', w * 0.6, h * 0.5, '', 'Decision / Entity Relationship', null, null, this.getTagsForStencil(gn, 'decision entity relationship', dt).join(' ')),
19			this.createVertexTemplateEntry('shape=ellipse;html=1;dashed=0;whitespace=wrap;aspect=fixed;perimeter=ellipsePerimeter;', w * 0.3, h * 0.3, '', 'Reference', null, null, this.getTagsForStencil(gn, 'reference', dt).join(' ')),
20			this.createVertexTemplateEntry('shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;dashed=0;', w, h * 0.5, '', 'Product / Result', null, null, this.getTagsForStencil(gn, 'product result', dt).join(' ')),
21			this.createVertexTemplateEntry('shape=manualInput;whiteSpace=wrap;html=1;dashed=0;size=15;', w, h * 0.5, '', 'Order / Command', null, null, this.getTagsForStencil(gn, 'order command', dt).join(' ')),
22			this.createVertexTemplateEntry('shape=document;whiteSpace=wrap;html=1;boundedLbl=1;dashed=0;flipH=1;', w, h * 0.7, '', 'Information / Data Carrier / SOP', null, null, this.getTagsForStencil(gn, 'information data carrier sop', dt).join(' ')),
23			this.createVertexTemplateEntry('triangle;whiteSpace=wrap;html=1;dashed=0;direction=south;', w * 0.6, h * 0.6, '', 'Information/Data Carrier/SOP / Stop State', null, null, this.getTagsForStencil(gn, 'information data carrier sop', dt).join(' ')),
24			this.createVertexTemplateEntry(s + 'archive', w * 0.6, h * 0.6, '', 'Final Report / Archive', null, null, this.getTagsForStencil(gn, 'final report archive', dt).join(' ')),
25			this.createVertexTemplateEntry('shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;size=0.25', w, h * 0.5, '', 'Check', null, null, this.getTagsForStencil(gn, 'check', dt).join(' ')),
26			this.createVertexTemplateEntry(s + 'check2', w, h * 0.5, '', 'Check 2', null, null, this.getTagsForStencil(gn, 'check', dt).join(' ')),
27			this.createVertexTemplateEntry('shape=ellipse;html=1;dashed=0;whitespace=wrap;perimeter=ellipsePerimeter;', w * 0.3, h * 0.3, '', 'Data Process', null, null, this.getTagsForStencil(gn, 'data process', dt).join(' ')),
28			this.createVertexTemplateEntry('shape=ellipse;html=1;dashed=0;whitespace=wrap;aspect=fixed;perimeter=ellipsePerimeter;', w * 0.6, h * 0.6, '', 'Data Process / State', null, null, this.getTagsForStencil(gn, 'data process', dt).join(' ')),
29			this.createVertexTemplateEntry('ellipse;shape=doubleEllipse;html=1;dashed=0;whitespace=wrap;aspect=fixed;', w * 0.6, h * 0.6, '', 'Multiple Process / Start State / Multi State', null, null, this.getTagsForStencil(gn, 'multiple process start state multi', dt).join(' ')),
30			this.createVertexTemplateEntry('shape=ellipse;html=1;dashed=0;whitespace=wrap;aspect=fixed;strokeWidth=5;perimeter=ellipsePerimeter;', w * 0.6, h * 0.6, '', 'Stop State', null, null, this.getTagsForStencil(gn, 'stop state', dt).join(' ')),
31			this.createVertexTemplateEntry('html=1;dashed=0;whitespace=wrap;shape=partialRectangle;right=0;left=0;', w, h * 0.3, '', 'Data Store', null, null, this.getTagsForStencil(gn, 'data store', dt).join(' ')),
32			this.createVertexTemplateEntry('html=1;dashed=0;whitespace=wrap;shape=partialRectangle;right=0;', w, h * 0.3, '', 'Data Store', null, null, this.getTagsForStencil(gn, 'data store', dt).join(' ')),
33			this.createVertexTemplateEntry(s + 'dataStoreID;align=left;spacingLeft=3;points=[[0,0],[0.5,0],[1,0],[0,0.5],[1,0.5],[0,1],[0.5,1],[1,1]];', w, h * 0.3, '', 'Data Store with ID', null, null, this.getTagsForStencil(gn, 'data store with id identification', dt).join(' ')),
34			this.createVertexTemplateEntry('swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=20;fillColor=#ffffff;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=0;marginBottom=0;swimlaneFillColor=#ffffff;', w, h * 0.5, '', 'Entity', null, null, this.getTagsForStencil(gn, 'entity', dt).join(' ')),
35			this.createVertexTemplateEntry('shape=cloud;whiteSpace=wrap;html=1;', w * 1.2, h * 1.2, '', 'Object', null, null, this.getTagsForStencil(gn, 'object', dt).join(' ')),
36			this.createVertexTemplateEntry('shape=ellipse;html=1;dashed=0;whitespace=wrap;perimeter=ellipsePerimeter;', w, h * 0.5, '', 'Oval Process', null, null, this.getTagsForStencil(gn, 'oval process', dt).join(' ')),
37			this.createVertexTemplateEntry('shape=cylinder;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;', w * 0.6, h * 0.8, '', 'Data Store', null, null, this.getTagsForStencil(gn, 'data store', dt).join(' ')),
38
39			this.addEntry(dt + 'external entity', function()
40	   		{
41			   	var bg = new mxCell('', new mxGeometry(0, 0, w, h), s + 'externalEntity');
42			   	bg.vertex = true;
43			   	var item1 = new mxCell('Id', new mxGeometry(0, 0, 20, 20), 'autosize=1;part=1;resizable=0;strokeColor=inherit;fillColor=inherit;gradientColor=inherit;');
44			   	item1.geometry.relative = true;
45			   	item1.geometry.offset = new mxPoint(15, 15);
46			   	item1.vertex = true;
47			   	bg.insert(item1);
48
49		   		return sb.createVertexTemplateFromCells([bg], bg.geometry.width, bg.geometry.height, 'External Entity');
50			}),
51
52			this.createVertexTemplateEntry(s + 'loop', w * 0.8, h * 0.3, '', 'Loop', null, null, this.getTagsForStencil(gn, 'loop', dt).join(' ')),
53
54		 	this.createEdgeTemplateEntry('endArrow=classic;html=1;', w * 0.5, h * 0.5, '', 'Directional Connector', null, dt + 'directional directed')
55		]);
56
57		this.setCurrentSearchEntryLibrary();
58	};
59})();
60