VsdxExport.js 68 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869
  1. /**
  2. * Export mxFile as Vsdx file
  3. */
  4. function VsdxExport(editorUi)
  5. {
  6. var that = this;
  7. var vsdxCanvas = new mxVsdxCanvas2D();
  8. /**
  9. * Fill the required files in vsdx format which are constants in our exporter
  10. * @param zip JSZip of vsdx file
  11. * @param pageCount The number of pages in the mxFile
  12. */
  13. function createVsdxSkeleton(zip, pageCount)
  14. {
  15. var files = {
  16. "[Content_Types].xml": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Types xmlns='http://schemas.openxmlformats.org/package/2006/content-types'><Default Extension='png' ContentType='image/png'/><Default Extension='jpg' ContentType='image/jpeg'/><Default Extension='jpeg' ContentType='image/jpeg'/><Default Extension='svg' ContentType='image/svg+xml'/><Default Extension='bmp' ContentType='image/bmp'/><Default Extension='gif' ContentType='image/gif'/><Default Extension='emf' ContentType='image/x-emf' /><Default Extension='rels' ContentType='application/vnd.openxmlformats-package.relationships+xml' /><Default Extension='xml' ContentType='application/xml' /><Override PartName='/docProps/app.xml' ContentType='application/vnd.openxmlformats-officedocument.extended-properties+xml' /><Override PartName='/docProps/core.xml' ContentType='application/vnd.openxmlformats-package.core-properties+xml' /><Override PartName='/docProps/custom.xml' ContentType='application/vnd.openxmlformats-officedocument.custom-properties+xml' /><Override PartName='/visio/document.xml' ContentType='application/vnd.ms-visio.drawing.main+xml' /><Override PartName='/visio/masters/masters.xml' ContentType='application/vnd.ms-visio.masters+xml' /><Override PartName='/visio/masters/master1.xml' ContentType='application/vnd.ms-visio.master+xml'/><Override PartName='/visio/pages/page1.xml' ContentType='application/vnd.ms-visio.page+xml' /><Override PartName='/visio/pages/pages.xml' ContentType='application/vnd.ms-visio.pages+xml' /><Override PartName='/visio/windows.xml' ContentType='application/vnd.ms-visio.windows+xml' /></Types>",
  17. "_rels/.rels" : "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Relationships xmlns='http://schemas.openxmlformats.org/package/2006/relationships'><Relationship Id='rId1' Type='http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties' Target='docProps/core.xml' /><Relationship Id='rId2' Type='http://schemas.microsoft.com/visio/2010/relationships/document' Target='visio/document.xml' /><Relationship Id='rId3' Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties' Target='docProps/custom.xml' /><Relationship Id='rId4' Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties' Target='docProps/app.xml' /></Relationships>",
  18. "docProps/app.xml" : "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Properties xmlns='http://schemas.openxmlformats.org/officeDocument/2006/extended-properties' xmlns:vt='http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes'><Application>Microsoft Visio</Application><AppVersion>15.0000</AppVersion><Template /><Manager /><Company /><HyperlinkBase /></Properties>",
  19. "docProps/core.xml" : "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><cp:coreProperties xmlns:cp='http://schemas.openxmlformats.org/package/2006/metadata/core-properties' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:dcterms='http://purl.org/dc/terms/' xmlns:dcmitype='http://purl.org/dc/dcmitype/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><dc:title /><dc:subject /><dc:creator /><cp:keywords /><dc:description /><cp:category /><dc:language>en-US</dc:language></cp:coreProperties>",
  20. "docProps/custom.xml" : "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Properties xmlns='http://schemas.openxmlformats.org/officeDocument/2006/custom-properties' xmlns:vt='http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes' />",
  21. "visio/document.xml": "<?xml version='1.0' encoding='utf-8' ?><VisioDocument xmlns='http://schemas.microsoft.com/office/visio/2012/main' xmlns:r='http://schemas.openxmlformats.org/officeDocument/2006/relationships' xml:space='preserve'><DocumentSettings TopPage='0' DefaultTextStyle='3' DefaultLineStyle='3' DefaultFillStyle='3' DefaultGuideStyle='4'><GlueSettings>9</GlueSettings><SnapSettings>65847</SnapSettings><SnapExtensions>34</SnapExtensions><SnapAngles/><DynamicGridEnabled>1</DynamicGridEnabled><ProtectStyles>0</ProtectStyles><ProtectShapes>0</ProtectShapes><ProtectMasters>0</ProtectMasters><ProtectBkgnds>0</ProtectBkgnds></DocumentSettings><Colors><ColorEntry IX='24' RGB='#000000'/><ColorEntry IX='25' RGB='#FFFFFF'/><ColorEntry IX='26' RGB='#FF0000'/><ColorEntry IX='27' RGB='#00FF00'/><ColorEntry IX='28' RGB='#0000FF'/><ColorEntry IX='29' RGB='#FFFF00'/><ColorEntry IX='30' RGB='#FF00FF'/><ColorEntry IX='31' RGB='#00FFFF'/><ColorEntry IX='32' RGB='#800000'/><ColorEntry IX='33' RGB='#008000'/><ColorEntry IX='34' RGB='#000080'/><ColorEntry IX='35' RGB='#808000'/><ColorEntry IX='36' RGB='#800080'/><ColorEntry IX='37' RGB='#008080'/><ColorEntry IX='38' RGB='#C0C0C0'/><ColorEntry IX='39' RGB='#E6E6E6'/><ColorEntry IX='40' RGB='#CDCDCD'/><ColorEntry IX='41' RGB='#B3B3B3'/><ColorEntry IX='42' RGB='#9A9A9A'/><ColorEntry IX='43' RGB='#808080'/><ColorEntry IX='44' RGB='#666666'/><ColorEntry IX='45' RGB='#4D4D4D'/><ColorEntry IX='46' RGB='#333333'/><ColorEntry IX='47' RGB='#1A1A1A'/><ColorEntry IX='48' RGB='#7F7F7F'/><ColorEntry IX='49' RGB='#99004D'/><ColorEntry IX='50' RGB='#FF0080'/><ColorEntry IX='51' RGB='#CC0066'/></Colors><FaceNames><FaceName NameU='Calibri' UnicodeRanges='-536859905 -1073732485 9 0' CharSets='536871423 0' Panose='2 15 5 2 2 2 4 3 2 4' Flags='325'/></FaceNames><StyleSheets><StyleSheet ID='0' NameU='No Style' IsCustomNameU='1' Name='No Style' IsCustomName='1'><Cell N='EnableLineProps' V='1'/><Cell N='EnableFillProps' V='1'/><Cell N='EnableTextProps' V='1'/><Cell N='HideForApply' V='0'/><Cell N='LineWeight' V='0.01041666666666667'/><Cell N='LineColor' V='0'/><Cell N='LinePattern' V='1'/><Cell N='Rounding' V='0'/><Cell N='EndArrowSize' V='2'/><Cell N='BeginArrow' V='0'/><Cell N='EndArrow' V='0'/><Cell N='LineCap' V='0'/><Cell N='BeginArrowSize' V='2'/><Cell N='LineColorTrans' V='0'/><Cell N='CompoundType' V='0'/><Cell N='FillForegnd' V='1'/><Cell N='FillBkgnd' V='0'/><Cell N='FillPattern' V='1'/><Cell N='ShdwForegnd' V='0'/><Cell N='ShdwPattern' V='0'/><Cell N='FillForegndTrans' V='0'/><Cell N='FillBkgndTrans' V='0'/><Cell N='ShdwForegndTrans' V='0'/><Cell N='ShapeShdwType' V='0'/><Cell N='ShapeShdwOffsetX' V='0'/><Cell N='ShapeShdwOffsetY' V='0'/><Cell N='ShapeShdwObliqueAngle' V='0'/><Cell N='ShapeShdwScaleFactor' V='1'/><Cell N='ShapeShdwBlur' V='0'/><Cell N='ShapeShdwShow' V='0'/><Cell N='LeftMargin' V='0'/><Cell N='RightMargin' V='0'/><Cell N='TopMargin' V='0'/><Cell N='BottomMargin' V='0'/><Cell N='VerticalAlign' V='1'/><Cell N='TextBkgnd' V='0'/><Cell N='DefaultTabStop' V='0.5'/><Cell N='TextDirection' V='0'/><Cell N='TextBkgndTrans' V='0'/><Cell N='LockWidth' V='0'/><Cell N='LockHeight' V='0'/><Cell N='LockMoveX' V='0'/><Cell N='LockMoveY' V='0'/><Cell N='LockAspect' V='0'/><Cell N='LockDelete' V='0'/><Cell N='LockBegin' V='0'/><Cell N='LockEnd' V='0'/><Cell N='LockRotate' V='0'/><Cell N='LockCrop' V='0'/><Cell N='LockVtxEdit' V='0'/><Cell N='LockTextEdit' V='0'/><Cell N='LockFormat' V='0'/><Cell N='LockGroup' V='0'/><Cell N='LockCalcWH' V='0'/><Cell N='LockSelect' V='0'/><Cell N='LockCustProp' V='0'/><Cell N='LockFromGroupFormat' V='0'/><Cell N='LockThemeColors' V='0'/><Cell N='LockThemeEffects' V='0'/><Cell N='LockThemeConnectors' V='0'/><Cell N='LockThemeFonts' V='0'/><Cell N='LockThemeIndex' V='0'/><Cell N='LockReplace' V='0'/><Cell N='LockVariation' V='0'/><Cell N='NoObjHandles' V='0'/><Cell N='NonPrinting' V='0'/><Cell N='NoCtlHandles' V='0'/><Cell N='NoAlignBox' V='0'/><Cell N='UpdateAlignBox' V='0'/><Cell N='HideText' V='0'/><Cell N='DynFeedback' V='0'/><Cell N='GlueType' V='0'/><Cell N='WalkPreference' V='0'/><Cell N='BegTrigger' V='0' F='No Formula'/><Cell N='EndTrigger' V='0' F='No Formula'/><Cell N='ObjType' V='0'/><Cell N='Comment' V=''/><Cell N='IsDropSource' V='0'/><Cell N='NoLiveDynamics' V='0'/><Cell N='LocalizeMerge' V='0'/><Cell N='NoProofing' V='0'/><Cell N='Calendar' V='0'/><Cell N='LangID' V='en-US'/><Cell N='ShapeKeywords' V=''/><Cell N='DropOnPageScale' V='1'/><Cell N='TheData' V='0' F='No Formula'/><Cell N='TheText' V='0' F='No Formula'/><Cell N='EventDblClick' V='0' F='No Formula'/><Cell N='EventXFMod' V='0' F='No Formula'/><Cell N='EventDrop' V='0' F='No Formula'/><Cell N='EventMultiDrop' V='0' F='No Formula'/><Cell N='HelpTopic' V=''/><Cell N='Copyright' V=''/><Cell N='LayerMember' V=''/><Cell N='XRulerDensity' V='32'/><Cell N='YRulerDensity' V='32'/><Cell N='XRulerOrigin' V='0'/><Cell N='YRulerOrigin' V='0'/><Cell N='XGridDensity' V='8'/><Cell N='YGridDensity' V='8'/><Cell N='XGridSpacing' V='0'/><Cell N='YGridSpacing' V='0'/><Cell N='XGridOrigin' V='0'/><Cell N='YGridOrigin' V='0'/><Cell N='Gamma' V='1'/><Cell N='Contrast' V='0.5'/><Cell N='Brightness' V='0.5'/><Cell N='Sharpen' V='0'/><Cell N='Blur' V='0'/><Cell N='Denoise' V='0'/><Cell N='Transparency' V='0'/><Cell N='SelectMode' V='1'/><Cell N='DisplayMode' V='2'/><Cell N='IsDropTarget' V='0'/><Cell N='IsSnapTarget' V='1'/><Cell N='IsTextEditTarget' V='1'/><Cell N='DontMoveChildren' V='0'/><Cell N='ShapePermeableX' V='0'/><Cell N='ShapePermeableY' V='0'/><Cell N='ShapePermeablePlace' V='0'/><Cell N='Relationships' V='0'/><Cell N='ShapeFixedCode' V='0'/><Cell N='ShapePlowCode' V='0'/><Cell N='ShapeRouteStyle' V='0'/><Cell N='ShapePlaceStyle' V='0'/><Cell N='ConFixedCode' V='0'/><Cell N='ConLineJumpCode' V='0'/><Cell N='ConLineJumpStyle' V='0'/><Cell N='ConLineJumpDirX' V='0'/><Cell N='ConLineJumpDirY' V='0'/><Cell N='ShapePlaceFlip' V='0'/><Cell N='ConLineRouteExt' V='0'/><Cell N='ShapeSplit' V='0'/><Cell N='ShapeSplittable' V='0'/><Cell N='DisplayLevel' V='0'/><Cell N='ResizePage' V='0'/><Cell N='EnableGrid' V='0'/><Cell N='DynamicsOff' V='0'/><Cell N='CtrlAsInput' V='0'/><Cell N='AvoidPageBreaks' V='0'/><Cell N='PlaceStyle' V='0'/><Cell N='RouteStyle' V='0'/><Cell N='PlaceDepth' V='0'/><Cell N='PlowCode' V='0'/><Cell N='LineJumpCode' V='1'/><Cell N='LineJumpStyle' V='0'/><Cell N='PageLineJumpDirX' V='0'/><Cell N='PageLineJumpDirY' V='0'/><Cell N='LineToNodeX' V='0.125'/><Cell N='LineToNodeY' V='0.125'/><Cell N='BlockSizeX' V='0.25'/><Cell N='BlockSizeY' V='0.25'/><Cell N='AvenueSizeX' V='0.375'/><Cell N='AvenueSizeY' V='0.375'/><Cell N='LineToLineX' V='0.125'/><Cell N='LineToLineY' V='0.125'/><Cell N='LineJumpFactorX' V='0.66666666666667'/><Cell N='LineJumpFactorY' V='0.66666666666667'/><Cell N='LineAdjustFrom' V='0'/><Cell N='LineAdjustTo' V='0'/><Cell N='PlaceFlip' V='0'/><Cell N='LineRouteExt' V='0'/><Cell N='PageShapeSplit' V='0'/><Cell N='PageLeftMargin' V='0.25'/><Cell N='PageRightMargin' V='0.25'/><Cell N='PageTopMargin' V='0.25'/><Cell N='PageBottomMargin' V='0.25'/><Cell N='ScaleX' V='1'/><Cell N='ScaleY' V='1'/><Cell N='PagesX' V='1'/><Cell N='PagesY' V='1'/><Cell N='CenterX' V='0'/><Cell N='CenterY' V='0'/><Cell N='OnPage' V='0'/><Cell N='PrintGrid' V='0'/><Cell N='PrintPageOrientation' V='1'/><Cell N='PaperKind' V='1'/><Cell N='PaperSource' V='7'/><Cell N='QuickStyleLineColor' V='100'/><Cell N='QuickStyleFillColor' V='100'/><Cell N='QuickStyleShadowColor' V='100'/><Cell N='QuickStyleFontColor' V='100'/><Cell N='QuickStyleLineMatrix' V='100'/><Cell N='QuickStyleFillMatrix' V='100'/><Cell N='QuickStyleEffectsMatrix' V='100'/><Cell N='QuickStyleFontMatrix' V='100'/><Cell N='QuickStyleType' V='0'/><Cell N='QuickStyleVariation' V='0'/><Cell N='LineGradientDir' V='0'/><Cell N='LineGradientAngle' V='1.5707963267949'/><Cell N='FillGradientDir' V='0'/><Cell N='FillGradientAngle' V='1.5707963267949'/><Cell N='LineGradientEnabled' V='0'/><Cell N='FillGradientEnabled' V='0'/><Cell N='RotateGradientWithShape' V='1'/><Cell N='UseGroupGradient' V='0'/><Cell N='BevelTopType' V='0'/><Cell N='BevelTopWidth' V='0'/><Cell N='BevelTopHeight' V='0'/><Cell N='BevelBottomType' V='0'/><Cell N='BevelBottomWidth' V='0'/><Cell N='BevelBottomHeight' V='0'/><Cell N='BevelDepthColor' V='1'/><Cell N='BevelDepthSize' V='0'/><Cell N='BevelContourColor' V='0'/><Cell N='BevelContourSize' V='0'/><Cell N='BevelMaterialType' V='0'/><Cell N='BevelLightingType' V='0'/><Cell N='BevelLightingAngle' V='0'/><Cell N='RotationXAngle' V='0'/><Cell N='RotationYAngle' V='0'/><Cell N='RotationZAngle' V='0'/><Cell N='RotationType' V='0'/><Cell N='Perspective' V='0'/><Cell N='DistanceFromGround' V='0'/><Cell N='KeepTextFlat' V='0'/><Cell N='ReflectionTrans' V='0'/><Cell N='ReflectionSize' V='0'/><Cell N='ReflectionDist' V='0'/><Cell N='ReflectionBlur' V='0'/><Cell N='GlowColor' V='1'/><Cell N='GlowColorTrans' V='0'/><Cell N='GlowSize' V='0'/><Cell N='SoftEdgesSize' V='0'/><Cell N='SketchSeed' V='0'/><Cell N='SketchEnabled' V='0'/><Cell N='SketchAmount' V='5'/><Cell N='SketchLineWeight' V='0.04166666666666666' U='PT'/><Cell N='SketchLineChange' V='0.14'/><Cell N='SketchFillChange' V='0.1'/><Cell N='ColorSchemeIndex' V='0'/><Cell N='EffectSchemeIndex' V='0'/><Cell N='ConnectorSchemeIndex' V='0'/><Cell N='FontSchemeIndex' V='0'/><Cell N='ThemeIndex' V='0'/><Cell N='VariationColorIndex' V='0'/><Cell N='VariationStyleIndex' V='0'/><Cell N='EmbellishmentIndex' V='0'/><Cell N='ReplaceLockShapeData' V='0'/><Cell N='ReplaceLockText' V='0'/><Cell N='ReplaceLockFormat' V='0'/><Cell N='ReplaceCopyCells' V='0' U='BOOL' F='No Formula'/><Cell N='PageWidth' V='0' F='No Formula'/><Cell N='PageHeight' V='0' F='No Formula'/><Cell N='ShdwOffsetX' V='0' F='No Formula'/><Cell N='ShdwOffsetY' V='0' F='No Formula'/><Cell N='PageScale' V='0' U='IN_F' F='No Formula'/><Cell N='DrawingScale' V='0' U='IN_F' F='No Formula'/><Cell N='DrawingSizeType' V='0' F='No Formula'/><Cell N='DrawingScaleType' V='0' F='No Formula'/><Cell N='InhibitSnap' V='0' F='No Formula'/><Cell N='PageLockReplace' V='0' U='BOOL' F='No Formula'/><Cell N='PageLockDuplicate' V='0' U='BOOL' F='No Formula'/><Cell N='UIVisibility' V='0' F='No Formula'/><Cell N='ShdwType' V='0' F='No Formula'/><Cell N='ShdwObliqueAngle' V='0' F='No Formula'/><Cell N='ShdwScaleFactor' V='0' F='No Formula'/><Cell N='DrawingResizeType' V='0' F='No Formula'/><Section N='Character'><Row IX='0'><Cell N='Font' V='Calibri'/><Cell N='Color' V='0'/><Cell N='Style' V='0'/><Cell N='Case' V='0'/><Cell N='Pos' V='0'/><Cell N='FontScale' V='1'/><Cell N='Size' V='0.1666666666666667'/><Cell N='DblUnderline' V='0'/><Cell N='Overline' V='0'/><Cell N='Strikethru' V='0'/><Cell N='DoubleStrikethrough' V='0'/><Cell N='Letterspace' V='0'/><Cell N='ColorTrans' V='0'/><Cell N='AsianFont' V='0'/><Cell N='ComplexScriptFont' V='0'/><Cell N='ComplexScriptSize' V='-1'/><Cell N='LangID' V='en-US'/></Row></Section><Section N='Paragraph'><Row IX='0'><Cell N='IndFirst' V='0'/><Cell N='IndLeft' V='0'/><Cell N='IndRight' V='0'/><Cell N='SpLine' V='-1.2'/><Cell N='SpBefore' V='0'/><Cell N='SpAfter' V='0'/><Cell N='HorzAlign' V='1'/><Cell N='Bullet' V='0'/><Cell N='BulletStr' V=''/><Cell N='BulletFont' V='0'/><Cell N='BulletFontSize' V='-1'/><Cell N='TextPosAfterBullet' V='0'/><Cell N='Flags' V='0'/></Row></Section><Section N='Tabs'><Row IX='0'/></Section><Section N='LineGradient'><Row IX='0'><Cell N='GradientStopColor' V='1'/><Cell N='GradientStopColorTrans' V='0'/><Cell N='GradientStopPosition' V='0'/></Row></Section><Section N='FillGradient'><Row IX='0'><Cell N='GradientStopColor' V='1'/><Cell N='GradientStopColorTrans' V='0'/><Cell N='GradientStopPosition' V='0'/></Row></Section></StyleSheet><StyleSheet ID='1' NameU='Text Only' IsCustomNameU='1' Name='Text Only' IsCustomName='1' LineStyle='3' FillStyle='3' TextStyle='3'><Cell N='EnableLineProps' V='1'/><Cell N='EnableFillProps' V='1'/><Cell N='EnableTextProps' V='1'/><Cell N='HideForApply' V='0'/><Cell N='LineWeight' V='Themed' F='Inh'/><Cell N='LineColor' V='Themed' F='Inh'/><Cell N='LinePattern' V='Themed' F='Inh'/><Cell N='Rounding' V='Themed' F='Inh'/><Cell N='EndArrowSize' V='2' F='Inh'/><Cell N='BeginArrow' V='0' F='Inh'/><Cell N='EndArrow' V='0' F='Inh'/><Cell N='LineCap' V='Themed' F='Inh'/><Cell N='BeginArrowSize' V='2' F='Inh'/><Cell N='LineColorTrans' V='Themed' F='Inh'/><Cell N='CompoundType' V='Themed' F='Inh'/><Cell N='FillForegnd' V='Themed' F='Inh'/><Cell N='FillBkgnd' V='Themed' F='Inh'/><Cell N='FillPattern' V='Themed' F='Inh'/><Cell N='ShdwForegnd' V='Themed' F='Inh'/><Cell N='ShdwPattern' V='Themed' F='Inh'/><Cell N='FillForegndTrans' V='Themed' F='Inh'/><Cell N='FillBkgndTrans' V='Themed' F='Inh'/><Cell N='ShdwForegndTrans' V='Themed' F='Inh'/><Cell N='ShapeShdwType' V='Themed' F='Inh'/><Cell N='ShapeShdwOffsetX' V='Themed' F='Inh'/><Cell N='ShapeShdwOffsetY' V='Themed' F='Inh'/><Cell N='ShapeShdwObliqueAngle' V='Themed' F='Inh'/><Cell N='ShapeShdwScaleFactor' V='Themed' F='Inh'/><Cell N='ShapeShdwBlur' V='Themed' F='Inh'/><Cell N='ShapeShdwShow' V='0' F='Inh'/><Cell N='LeftMargin' V='0'/><Cell N='RightMargin' V='0'/><Cell N='TopMargin' V='0'/><Cell N='BottomMargin' V='0'/><Cell N='VerticalAlign' V='0'/><Cell N='TextBkgnd' V='0'/><Cell N='DefaultTabStop' V='0.5' F='Inh'/><Cell N='TextDirection' V='0' F='Inh'/><Cell N='TextBkgndTrans' V='0' F='Inh'/><Cell N='LineGradientDir' V='Themed' F='Inh'/><Cell N='LineGradientAngle' V='Themed' F='Inh'/><Cell N='FillGradientDir' V='Themed' F='Inh'/><Cell N='FillGradientAngle' V='Themed' F='Inh'/><Cell N='LineGradientEnabled' V='Themed' F='Inh'/><Cell N='FillGradientEnabled' V='Themed' F='Inh'/><Cell N='RotateGradientWithShape' V='Themed' F='Inh'/><Cell N='UseGroupGradient' V='Themed' F='Inh'/><Section N='Paragraph'><Row IX='0'><Cell N='IndFirst' V='0' F='Inh'/><Cell N='IndLeft' V='0' F='Inh'/><Cell N='IndRight' V='0' F='Inh'/><Cell N='SpLine' V='-1.2' F='Inh'/><Cell N='SpBefore' V='0' F='Inh'/><Cell N='SpAfter' V='0' F='Inh'/><Cell N='HorzAlign' V='0'/><Cell N='Bullet' V='0' F='Inh'/><Cell N='BulletStr' V='' F='Inh'/><Cell N='BulletFont' V='0' F='Inh'/><Cell N='BulletFontSize' V='-1' F='Inh'/><Cell N='TextPosAfterBullet' V='0' F='Inh'/><Cell N='Flags' V='0' F='Inh'/></Row></Section></StyleSheet><StyleSheet ID='2' NameU='None' IsCustomNameU='1' Name='None' IsCustomName='1' LineStyle='3' FillStyle='3' TextStyle='3'><Cell N='EnableLineProps' V='1'/><Cell N='EnableFillProps' V='1'/><Cell N='EnableTextProps' V='1'/><Cell N='HideForApply' V='0'/><Cell N='LineWeight' V='Themed' F='Inh'/><Cell N='LineColor' V='Themed' F='Inh'/><Cell N='LinePattern' V='0'/><Cell N='Rounding' V='Themed' F='Inh'/><Cell N='EndArrowSize' V='2' F='Inh'/><Cell N='BeginArrow' V='0' F='Inh'/><Cell N='EndArrow' V='0' F='Inh'/><Cell N='LineCap' V='Themed' F='Inh'/><Cell N='BeginArrowSize' V='2' F='Inh'/><Cell N='LineColorTrans' V='Themed' F='Inh'/><Cell N='CompoundType' V='Themed' F='Inh'/><Cell N='FillForegnd' V='Themed' F='Inh'/><Cell N='FillBkgnd' V='Themed' F='Inh'/><Cell N='FillPattern' V='0'/><Cell N='ShdwForegnd' V='Themed' F='Inh'/><Cell N='ShdwPattern' V='Themed' F='Inh'/><Cell N='FillForegndTrans' V='Themed' F='Inh'/><Cell N='FillBkgndTrans' V='Themed' F='Inh'/><Cell N='ShdwForegndTrans' V='Themed' F='Inh'/><Cell N='ShapeShdwType' V='Themed' F='Inh'/><Cell N='ShapeShdwOffsetX' V='Themed' F='Inh'/><Cell N='ShapeShdwOffsetY' V='Themed' F='Inh'/><Cell N='ShapeShdwObliqueAngle' V='Themed' F='Inh'/><Cell N='ShapeShdwScaleFactor' V='Themed' F='Inh'/><Cell N='ShapeShdwBlur' V='Themed' F='Inh'/><Cell N='ShapeShdwShow' V='0' F='Inh'/><Cell N='LineGradientDir' V='Themed' F='Inh'/><Cell N='LineGradientAngle' V='Themed' F='Inh'/><Cell N='FillGradientDir' V='Themed' F='Inh'/><Cell N='FillGradientAngle' V='Themed' F='Inh'/><Cell N='LineGradientEnabled' V='0'/><Cell N='FillGradientEnabled' V='0'/><Cell N='RotateGradientWithShape' V='Themed' F='Inh'/><Cell N='UseGroupGradient' V='Themed' F='Inh'/><Cell N='QuickStyleLineColor' V='100' F='Inh'/><Cell N='QuickStyleFillColor' V='100' F='Inh'/><Cell N='QuickStyleShadowColor' V='100' F='Inh'/><Cell N='QuickStyleFontColor' V='100' F='Inh'/><Cell N='QuickStyleLineMatrix' V='100' F='Inh'/><Cell N='QuickStyleFillMatrix' V='100' F='Inh'/><Cell N='QuickStyleEffectsMatrix' V='0' F='GUARD(0)'/><Cell N='QuickStyleFontMatrix' V='100' F='Inh'/><Cell N='QuickStyleType' V='0' F='Inh'/><Cell N='QuickStyleVariation' V='2'/></StyleSheet><StyleSheet ID='3' NameU='Normal' IsCustomNameU='1' Name='Normal' IsCustomName='1' LineStyle='6' FillStyle='6' TextStyle='6'><Cell N='EnableLineProps' V='1'/><Cell N='EnableFillProps' V='1'/><Cell N='EnableTextProps' V='1'/><Cell N='HideForApply' V='0'/><Cell N='LeftMargin' V='0.05555555555555555' U='PT'/><Cell N='RightMargin' V='0.05555555555555555' U='PT'/><Cell N='TopMargin' V='0.05555555555555555' U='PT'/><Cell N='BottomMargin' V='0.05555555555555555' U='PT'/><Cell N='VerticalAlign' V='1' F='Inh'/><Cell N='TextBkgnd' V='0' F='Inh'/><Cell N='DefaultTabStop' V='0.5' F='Inh'/><Cell N='TextDirection' V='0' F='Inh'/><Cell N='TextBkgndTrans' V='0' F='Inh'/></StyleSheet><StyleSheet ID='4' NameU='Guide' IsCustomNameU='1' Name='Guide' IsCustomName='1' LineStyle='3' FillStyle='3' TextStyle='3'><Cell N='EnableLineProps' V='1'/><Cell N='EnableFillProps' V='1'/><Cell N='EnableTextProps' V='1'/><Cell N='HideForApply' V='0'/><Cell N='LineWeight' V='0' U='PT'/><Cell N='LineColor' V='#7f7f7f'/><Cell N='LinePattern' V='23'/><Cell N='Rounding' V='Themed' F='Inh'/><Cell N='EndArrowSize' V='2' F='Inh'/><Cell N='BeginArrow' V='0' F='Inh'/><Cell N='EndArrow' V='0' F='Inh'/><Cell N='LineCap' V='Themed' F='Inh'/><Cell N='BeginArrowSize' V='2' F='Inh'/><Cell N='LineColorTrans' V='Themed' F='Inh'/><Cell N='CompoundType' V='Themed' F='Inh'/><Cell N='FillForegnd' V='Themed' F='Inh'/><Cell N='FillBkgnd' V='Themed' F='Inh'/><Cell N='FillPattern' V='0'/><Cell N='ShdwForegnd' V='Themed' F='Inh'/><Cell N='ShdwPattern' V='Themed' F='Inh'/><Cell N='FillForegndTrans' V='Themed' F='Inh'/><Cell N='FillBkgndTrans' V='Themed' F='Inh'/><Cell N='ShdwForegndTrans' V='Themed' F='Inh'/><Cell N='ShapeShdwType' V='Themed' F='Inh'/><Cell N='ShapeShdwOffsetX' V='Themed' F='Inh'/><Cell N='ShapeShdwOffsetY' V='Themed' F='Inh'/><Cell N='ShapeShdwObliqueAngle' V='Themed' F='Inh'/><Cell N='ShapeShdwScaleFactor' V='Themed' F='Inh'/><Cell N='ShapeShdwBlur' V='Themed' F='Inh'/><Cell N='ShapeShdwShow' V='0' F='Inh'/><Cell N='LineGradientDir' V='Themed' F='Inh'/><Cell N='LineGradientAngle' V='Themed' F='Inh'/><Cell N='FillGradientDir' V='Themed' F='Inh'/><Cell N='FillGradientAngle' V='Themed' F='Inh'/><Cell N='LineGradientEnabled' V='0'/><Cell N='FillGradientEnabled' V='0'/><Cell N='RotateGradientWithShape' V='Themed' F='Inh'/><Cell N='UseGroupGradient' V='Themed' F='Inh'/><Cell N='LeftMargin' V='0.05555555555555555' U='PT' F='Inh'/><Cell N='RightMargin' V='0.05555555555555555' U='PT' F='Inh'/><Cell N='TopMargin' V='0'/><Cell N='BottomMargin' V='0'/><Cell N='VerticalAlign' V='2'/><Cell N='TextBkgnd' V='0' F='Inh'/><Cell N='DefaultTabStop' V='0.5' F='Inh'/><Cell N='TextDirection' V='0' F='Inh'/><Cell N='TextBkgndTrans' V='0' F='Inh'/><Cell N='NoObjHandles' V='0' F='Inh'/><Cell N='NonPrinting' V='1'/><Cell N='NoCtlHandles' V='0' F='Inh'/><Cell N='NoAlignBox' V='0' F='Inh'/><Cell N='UpdateAlignBox' V='0' F='Inh'/><Cell N='HideText' V='0' F='Inh'/><Cell N='DynFeedback' V='0' F='Inh'/><Cell N='GlueType' V='0' F='Inh'/><Cell N='WalkPreference' V='0' F='Inh'/><Cell N='BegTrigger' V='0' F='No Formula'/><Cell N='EndTrigger' V='0' F='No Formula'/><Cell N='ObjType' V='0' F='Inh'/><Cell N='Comment' V='' F='Inh'/><Cell N='IsDropSource' V='0' F='Inh'/><Cell N='NoLiveDynamics' V='0' F='Inh'/><Cell N='LocalizeMerge' V='0' F='Inh'/><Cell N='NoProofing' V='0' F='Inh'/><Cell N='Calendar' V='0' F='Inh'/><Cell N='LangID' V='en-US' F='Inh'/><Cell N='ShapeKeywords' V='' F='Inh'/><Cell N='DropOnPageScale' V='1' F='Inh'/><Cell N='ShapePermeableX' V='1'/><Cell N='ShapePermeableY' V='1'/><Cell N='ShapePermeablePlace' V='1'/><Cell N='Relationships' V='0' F='Inh'/><Cell N='ShapeFixedCode' V='0' F='Inh'/><Cell N='ShapePlowCode' V='0' F='Inh'/><Cell N='ShapeRouteStyle' V='0' F='Inh'/><Cell N='ShapePlaceStyle' V='0' F='Inh'/><Cell N='ConFixedCode' V='0' F='Inh'/><Cell N='ConLineJumpCode' V='0' F='Inh'/><Cell N='ConLineJumpStyle' V='0' F='Inh'/><Cell N='ConLineJumpDirX' V='0' F='Inh'/><Cell N='ConLineJumpDirY' V='0' F='Inh'/><Cell N='ShapePlaceFlip' V='0' F='Inh'/><Cell N='ConLineRouteExt' V='0' F='Inh'/><Cell N='ShapeSplit' V='0' F='Inh'/><Cell N='ShapeSplittable' V='0' F='Inh'/><Cell N='DisplayLevel' V='0' F='Inh'/><Section N='Character'><Row IX='0'><Cell N='Font' V='Themed' F='Inh'/><Cell N='Color' V='4'/><Cell N='Style' V='Themed' F='Inh'/><Cell N='Case' V='0' F='Inh'/><Cell N='Pos' V='0' F='Inh'/><Cell N='FontScale' V='1' F='Inh'/><Cell N='Size' V='0.125'/><Cell N='DblUnderline' V='0' F='Inh'/><Cell N='Overline' V='0' F='Inh'/><Cell N='Strikethru' V='0' F='Inh'/><Cell N='DoubleStrikethrough' V='0' F='Inh'/><Cell N='Letterspace' V='0' F='Inh'/><Cell N='ColorTrans' V='0' F='Inh'/><Cell N='AsianFont' V='Themed' F='Inh'/><Cell N='ComplexScriptFont' V='Themed' F='Inh'/><Cell N='ComplexScriptSize' V='-1' F='Inh'/><Cell N='LangID' V='en-US' F='Inh'/></Row></Section></StyleSheet><StyleSheet ID='6' NameU='Theme' IsCustomNameU='1' Name='Theme' IsCustomName='1' LineStyle='0' FillStyle='0' TextStyle='0'><Cell N='EnableLineProps' V='1'/><Cell N='EnableFillProps' V='1'/><Cell N='EnableTextProps' V='1'/><Cell N='HideForApply' V='0'/><Cell N='LineWeight' V='Themed' F='THEMEVAL()'/><Cell N='LineColor' V='Themed' F='THEMEVAL()'/><Cell N='LinePattern' V='Themed' F='THEMEVAL()'/><Cell N='Rounding' V='Themed' F='THEMEVAL()'/><Cell N='EndArrowSize' V='2' F='Inh'/><Cell N='BeginArrow' V='0' F='Inh'/><Cell N='EndArrow' V='0' F='Inh'/><Cell N='LineCap' V='Themed' F='THEMEVAL()'/><Cell N='BeginArrowSize' V='2' F='Inh'/><Cell N='LineColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='CompoundType' V='Themed' F='THEMEVAL()'/><Cell N='FillForegnd' V='Themed' F='THEMEVAL()'/><Cell N='FillBkgnd' V='Themed' F='THEMEVAL()'/><Cell N='FillPattern' V='Themed' F='THEMEVAL()'/><Cell N='ShdwForegnd' V='Themed' F='THEMEVAL()'/><Cell N='ShdwPattern' V='Themed' F='THEMEVAL()'/><Cell N='FillForegndTrans' V='Themed' F='THEMEVAL()'/><Cell N='FillBkgndTrans' V='Themed' F='THEMEVAL()'/><Cell N='ShdwForegndTrans' V='Themed' F='THEMEVAL()'/><Cell N='ShapeShdwType' V='Themed' F='THEMEVAL()'/><Cell N='ShapeShdwOffsetX' V='Themed' F='THEMEVAL()'/><Cell N='ShapeShdwOffsetY' V='Themed' F='THEMEVAL()'/><Cell N='ShapeShdwObliqueAngle' V='Themed' F='THEMEVAL()'/><Cell N='ShapeShdwScaleFactor' V='Themed' F='THEMEVAL()'/><Cell N='ShapeShdwBlur' V='Themed' F='THEMEVAL()'/><Cell N='ShapeShdwShow' V='0' F='Inh'/><Cell N='LineGradientDir' V='Themed' F='THEMEVAL()'/><Cell N='LineGradientAngle' V='Themed' F='THEMEVAL()'/><Cell N='FillGradientDir' V='Themed' F='THEMEVAL()'/><Cell N='FillGradientAngle' V='Themed' F='THEMEVAL()'/><Cell N='LineGradientEnabled' V='Themed' F='THEMEVAL()'/><Cell N='FillGradientEnabled' V='Themed' F='THEMEVAL()'/><Cell N='RotateGradientWithShape' V='Themed' F='THEMEVAL()'/><Cell N='UseGroupGradient' V='Themed' F='THEMEVAL()'/><Cell N='BevelTopType' V='Themed' F='THEMEVAL()'/><Cell N='BevelTopWidth' V='Themed' F='THEMEVAL()'/><Cell N='BevelTopHeight' V='Themed' F='THEMEVAL()'/><Cell N='BevelBottomType' V='0' F='Inh'/><Cell N='BevelBottomWidth' V='0' F='Inh'/><Cell N='BevelBottomHeight' V='0' F='Inh'/><Cell N='BevelDepthColor' V='1' F='Inh'/><Cell N='BevelDepthSize' V='0' F='Inh'/><Cell N='BevelContourColor' V='Themed' F='THEMEVAL()'/><Cell N='BevelContourSize' V='Themed' F='THEMEVAL()'/><Cell N='BevelMaterialType' V='Themed' F='THEMEVAL()'/><Cell N='BevelLightingType' V='Themed' F='THEMEVAL()'/><Cell N='BevelLightingAngle' V='Themed' F='THEMEVAL()'/><Cell N='ReflectionTrans' V='Themed' F='THEMEVAL()'/><Cell N='ReflectionSize' V='Themed' F='THEMEVAL()'/><Cell N='ReflectionDist' V='Themed' F='THEMEVAL()'/><Cell N='ReflectionBlur' V='Themed' F='THEMEVAL()'/><Cell N='GlowColor' V='Themed' F='THEMEVAL()'/><Cell N='GlowColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GlowSize' V='Themed' F='THEMEVAL()'/><Cell N='SoftEdgesSize' V='Themed' F='THEMEVAL()'/><Cell N='SketchSeed' V='0' F='Inh'/><Cell N='SketchEnabled' V='Themed' F='THEMEVAL()'/><Cell N='SketchAmount' V='Themed' F='THEMEVAL()'/><Cell N='SketchLineWeight' V='Themed' F='THEMEVAL()'/><Cell N='SketchLineChange' V='Themed' F='THEMEVAL()'/><Cell N='SketchFillChange' V='Themed' F='THEMEVAL()'/><Cell N='QuickStyleLineColor' V='100'/><Cell N='QuickStyleFillColor' V='100'/><Cell N='QuickStyleShadowColor' V='100'/><Cell N='QuickStyleFontColor' V='100'/><Cell N='QuickStyleLineMatrix' V='100'/><Cell N='QuickStyleFillMatrix' V='100'/><Cell N='QuickStyleEffectsMatrix' V='100'/><Cell N='QuickStyleFontMatrix' V='100'/><Cell N='QuickStyleType' V='0' F='Inh'/><Cell N='QuickStyleVariation' V='0' F='Inh'/><Cell N='ColorSchemeIndex' V='65534'/><Cell N='EffectSchemeIndex' V='65534'/><Cell N='ConnectorSchemeIndex' V='65534'/><Cell N='FontSchemeIndex' V='65534'/><Cell N='ThemeIndex' V='65534'/><Cell N='VariationColorIndex' V='65534'/><Cell N='VariationStyleIndex' V='65534'/><Cell N='EmbellishmentIndex' V='65534'/><Section N='Character'><Row IX='0'><Cell N='Font' V='Themed' F='THEMEVAL()'/><Cell N='Color' V='Themed' F='THEMEVAL()'/><Cell N='Style' V='Themed' F='THEMEVAL()'/><Cell N='Case' V='0' F='Inh'/><Cell N='Pos' V='0' F='Inh'/><Cell N='FontScale' V='1' F='Inh'/><Cell N='Size' V='0.1666666666666667' F='Inh'/><Cell N='DblUnderline' V='0' F='Inh'/><Cell N='Overline' V='0' F='Inh'/><Cell N='Strikethru' V='0' F='Inh'/><Cell N='DoubleStrikethrough' V='0' F='Inh'/><Cell N='Letterspace' V='0' F='Inh'/><Cell N='ColorTrans' V='0' F='Inh'/><Cell N='AsianFont' V='Themed' F='THEMEVAL()'/><Cell N='ComplexScriptFont' V='Themed' F='THEMEVAL()'/><Cell N='ComplexScriptSize' V='-1' F='Inh'/><Cell N='LangID' V='en-US' F='Inh'/></Row></Section><Section N='FillGradient'><Row IX='0'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='1'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='2'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='3'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='4'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='5'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='6'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='7'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='8'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='9'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row></Section><Section N='LineGradient'><Row IX='0'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='1'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='2'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='3'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='4'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='5'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='6'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='7'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='8'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='9'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row></Section></StyleSheet><StyleSheet ID='7' NameU='Connector' IsCustomNameU='1' Name='Connector' IsCustomName='1' LineStyle='3' FillStyle='3' TextStyle='3'><Cell N='EnableLineProps' V='1'/><Cell N='EnableFillProps' V='1'/><Cell N='EnableTextProps' V='1'/><Cell N='HideForApply' V='0'/><Cell N='LeftMargin' V='0.05555555555555555' U='PT' F='Inh'/><Cell N='RightMargin' V='0.05555555555555555' U='PT' F='Inh'/><Cell N='TopMargin' V='0.05555555555555555' U='PT' F='Inh'/><Cell N='BottomMargin' V='0.05555555555555555' U='PT' F='Inh'/><Cell N='VerticalAlign' V='1' F='Inh'/><Cell N='TextBkgnd' V='#ffffff' F='THEMEGUARD(THEMEVAL(\"BackgroundColor\")+1)'/><Cell N='DefaultTabStop' V='0.5' F='Inh'/><Cell N='TextDirection' V='0' F='Inh'/><Cell N='TextBkgndTrans' V='0' F='Inh'/><Cell N='NoObjHandles' V='0' F='Inh'/><Cell N='NonPrinting' V='0' F='Inh'/><Cell N='NoCtlHandles' V='0' F='Inh'/><Cell N='NoAlignBox' V='0' F='Inh'/><Cell N='UpdateAlignBox' V='0' F='Inh'/><Cell N='HideText' V='0' F='Inh'/><Cell N='DynFeedback' V='0' F='Inh'/><Cell N='GlueType' V='0' F='Inh'/><Cell N='WalkPreference' V='0' F='Inh'/><Cell N='BegTrigger' V='0' F='No Formula'/><Cell N='EndTrigger' V='0' F='No Formula'/><Cell N='ObjType' V='0' F='Inh'/><Cell N='Comment' V='' F='Inh'/><Cell N='IsDropSource' V='0' F='Inh'/><Cell N='NoLiveDynamics' V='0' F='Inh'/><Cell N='LocalizeMerge' V='0' F='Inh'/><Cell N='NoProofing' V='0' F='Inh'/><Cell N='Calendar' V='0' F='Inh'/><Cell N='LangID' V='en-US' F='Inh'/><Cell N='ShapeKeywords' V='' F='Inh'/><Cell N='DropOnPageScale' V='1' F='Inh'/><Cell N='QuickStyleLineColor' V='100'/><Cell N='QuickStyleFillColor' V='100'/><Cell N='QuickStyleShadowColor' V='100'/><Cell N='QuickStyleFontColor' V='100'/><Cell N='QuickStyleLineMatrix' V='1'/><Cell N='QuickStyleFillMatrix' V='1'/><Cell N='QuickStyleEffectsMatrix' V='1'/><Cell N='QuickStyleFontMatrix' V='1'/><Cell N='QuickStyleType' V='0'/><Cell N='QuickStyleVariation' V='0'/><Cell N='LineWeight' V='Themed' F='Inh'/><Cell N='LineColor' V='Themed' F='Inh'/><Cell N='LinePattern' V='Themed' F='Inh'/><Cell N='Rounding' V='Themed' F='Inh'/><Cell N='EndArrowSize' V='Themed' F='THEMEVAL()'/><Cell N='BeginArrow' V='Themed' F='THEMEVAL()'/><Cell N='EndArrow' V='Themed' F='THEMEVAL()'/><Cell N='LineCap' V='Themed' F='Inh'/><Cell N='BeginArrowSize' V='Themed' F='THEMEVAL()'/><Cell N='LineColorTrans' V='Themed' F='Inh'/><Cell N='CompoundType' V='Themed' F='Inh'/><Section N='Character'><Row IX='0'><Cell N='Font' V='Themed' F='Inh'/><Cell N='Color' V='Themed' F='Inh'/><Cell N='Style' V='Themed' F='Inh'/><Cell N='Case' V='0' F='Inh'/><Cell N='Pos' V='0' F='Inh'/><Cell N='FontScale' V='1' F='Inh'/><Cell N='Size' V='0.1111111111111111'/><Cell N='DblUnderline' V='0' F='Inh'/><Cell N='Overline' V='0' F='Inh'/><Cell N='Strikethru' V='0' F='Inh'/><Cell N='DoubleStrikethrough' V='0' F='Inh'/><Cell N='Letterspace' V='0' F='Inh'/><Cell N='ColorTrans' V='0' F='Inh'/><Cell N='AsianFont' V='Themed' F='Inh'/><Cell N='ComplexScriptFont' V='Themed' F='Inh'/><Cell N='ComplexScriptSize' V='-1' F='Inh'/><Cell N='LangID' V='en-US' F='Inh'/></Row></Section></StyleSheet></StyleSheets><DocumentSheet NameU='TheDoc' IsCustomNameU='1' Name='TheDoc' IsCustomName='1' LineStyle='0' FillStyle='0' TextStyle='0'><Cell N='OutputFormat' V='0'/><Cell N='LockPreview' V='0'/><Cell N='AddMarkup' V='0'/><Cell N='ViewMarkup' V='0'/><Cell N='DocLockReplace' V='0' U='BOOL'/><Cell N='NoCoauth' V='0' U='BOOL'/><Cell N='DocLockDuplicatePage' V='0' U='BOOL'/><Cell N='PreviewQuality' V='0'/><Cell N='PreviewScope' V='0'/><Cell N='DocLangID' V='en-US'/><Section N='User'><Row N='msvNoAutoConnect'><Cell N='Value' V='1'/><Cell N='Prompt' V='' F='No Formula'/></Row></Section></DocumentSheet></VisioDocument>",
  22. "visio/windows.xml" : "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Windows ClientWidth='0' ClientHeight='0' xmlns='http://schemas.microsoft.com/office/visio/2012/main' xmlns:r='http://schemas.openxmlformats.org/officeDocument/2006/relationships' xml:space='preserve' />",
  23. "visio/_rels/document.xml.rels" : "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Relationships xmlns='http://schemas.openxmlformats.org/package/2006/relationships'><Relationship Id='rId1' Type='http://schemas.microsoft.com/visio/2010/relationships/masters' Target='masters/masters.xml' /><Relationship Id='rId2' Type='http://schemas.microsoft.com/visio/2010/relationships/pages' Target='pages/pages.xml' /><Relationship Id='rId3' Type='http://schemas.microsoft.com/visio/2010/relationships/windows' Target='windows.xml' /></Relationships>",
  24. "visio/masters/_rels/masters.xml.rels" : '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.microsoft.com/visio/2010/relationships/master" Target="master1.xml"/></Relationships>',
  25. "visio/masters/masters.xml" : "<?xml version='1.0' encoding='utf-8' ?><Masters xmlns='http://schemas.microsoft.com/office/visio/2012/main' xmlns:r='http://schemas.openxmlformats.org/officeDocument/2006/relationships' xml:space='preserve'><Master ID='4' NameU='Dynamic connector' IsCustomNameU='1' Name='Dynamic connector' IsCustomName='1' Prompt='This connector automatically routes between the shapes it connects.' IconSize='1' AlignName='2' MatchByName='1' IconUpdate='0' UniqueID='{002A9108-0000-0000-8E40-00608CF305B2}' BaseID='{F7290A45-E3AD-11D2-AE4F-006008C9F5A9}' PatternFlags='0' Hidden='0' MasterType='0'><PageSheet LineStyle='0' FillStyle='0' TextStyle='0'><Cell N='PageWidth' V='3'/><Cell N='PageHeight' V='3'/><Cell N='ShdwOffsetX' V='0.125'/><Cell N='ShdwOffsetY' V='-0.125'/><Cell N='PageScale' V='1' U='IN_F'/><Cell N='DrawingScale' V='1' U='IN_F'/><Cell N='DrawingSizeType' V='4'/><Cell N='DrawingScaleType' V='0'/><Cell N='InhibitSnap' V='0'/><Cell N='PageLockReplace' V='0' U='BOOL'/><Cell N='PageLockDuplicate' V='0' U='BOOL'/><Cell N='UIVisibility' V='0'/><Cell N='ShdwType' V='0'/><Cell N='ShdwObliqueAngle' V='0'/><Cell N='ShdwScaleFactor' V='1'/><Cell N='DrawingResizeType' V='0'/><Section N='Layer'><Row IX='0'><Cell N='Name' V='Connector'/><Cell N='Color' V='255'/><Cell N='Status' V='0'/><Cell N='Visible' V='1'/><Cell N='Print' V='1'/><Cell N='Active' V='0'/><Cell N='Lock' V='0'/><Cell N='Snap' V='1'/><Cell N='Glue' V='1'/><Cell N='NameUniv' V='Connector'/><Cell N='ColorTrans' V='0'/></Row></Section></PageSheet><Rel r:id='rId1'/></Master></Masters>",
  26. "visio/masters/master1.xml" : "<?xml version='1.0' encoding='utf-8' ?><MasterContents xmlns='http://schemas.microsoft.com/office/visio/2012/main' xmlns:r='http://schemas.openxmlformats.org/officeDocument/2006/relationships' xml:space='preserve'><Shapes><Shape ID='5' OriginalID='0' Type='Shape' LineStyle='7' FillStyle='7' TextStyle='7'><Cell N='PinX' V='1.5' F='GUARD((BeginX+EndX)/2)'/><Cell N='PinY' V='1.5' F='GUARD((BeginY+EndY)/2)'/><Cell N='Width' V='1' F='GUARD(EndX-BeginX)'/><Cell N='Height' V='-1' F='GUARD(EndY-BeginY)'/><Cell N='LocPinX' V='0.5' F='GUARD(Width*0.5)'/><Cell N='LocPinY' V='-0.5' F='GUARD(Height*0.5)'/><Cell N='Angle' V='0' F='GUARD(0DA)'/><Cell N='FlipX' V='0' F='GUARD(FALSE)'/><Cell N='FlipY' V='0' F='GUARD(FALSE)'/><Cell N='ResizeMode' V='0'/><Cell N='BeginX' V='1'/><Cell N='BeginY' V='2'/><Cell N='EndX' V='2'/><Cell N='EndY' V='1'/><Cell N='TxtPinX' V='0' F='SETATREF(Controls.TextPosition)'/><Cell N='TxtPinY' V='-1' F='SETATREF(Controls.TextPosition.Y)'/><Cell N='TxtWidth' V='0.5555555555555556' F='MAX(TEXTWIDTH(TheText),5*Char.Size)'/><Cell N='TxtHeight' V='0.2444444444444444' F='TEXTHEIGHT(TheText,TxtWidth)'/><Cell N='TxtLocPinX' V='0.2777777777777778' F='TxtWidth*0.5'/><Cell N='TxtLocPinY' V='0.1222222222222222' F='TxtHeight*0.5'/><Cell N='TxtAngle' V='0'/><Cell N='LockHeight' V='1'/><Cell N='LockCalcWH' V='1'/><Cell N='HelpTopic' V='Vis_SE.chm!#20000'/><Cell N='Copyright' V='Copyright 2001 Microsoft Corporation. All rights reserved.'/><Cell N='NoAlignBox' V='1'/><Cell N='DynFeedback' V='2'/><Cell N='GlueType' V='2'/><Cell N='ObjType' V='2'/><Cell N='NoLiveDynamics' V='1'/><Cell N='ShapeSplittable' V='1'/><Cell N='LayerMember' V='0'/><Section N='Control'><Row N='TextPosition'><Cell N='X' V='0'/><Cell N='Y' V='-1'/><Cell N='XDyn' V='0' F='Controls.TextPosition'/><Cell N='YDyn' V='-1' F='Controls.TextPosition.Y'/><Cell N='XCon' V='5' F='IF(OR(STRSAME(SHAPETEXT(TheText),\"\"),HideText),5,0)'/><Cell N='YCon' V='0'/><Cell N='CanGlue' V='0'/><Cell N='Prompt' V='Reposition Text'/></Row></Section><Section N='Geometry' IX='0'><Cell N='NoFill' V='1'/><Cell N='NoLine' V='0'/><Cell N='NoShow' V='0'/><Cell N='NoSnap' V='0'/><Cell N='NoQuickDrag' V='0'/><Row T='MoveTo' IX='1'><Cell N='X' V='0'/><Cell N='Y' V='0'/></Row><Row T='LineTo' IX='2'><Cell N='X' V='0'/><Cell N='Y' V='-1'/></Row></Section></Shape></Shapes></MasterContents>"
  27. };
  28. for (var id in files)
  29. {
  30. if (pageCount > 1 && id == that.CONTENT_TYPES_XML)
  31. {
  32. //Add the remaining pages
  33. var doc = mxUtils.parseXml(files[id]);
  34. var root = doc.documentElement;
  35. var children = root.children;
  36. var page1 = null;
  37. for (var i = 0; i < children.length; i++)
  38. {
  39. var child = children[i];
  40. if ("/visio/pages/page1.xml" == child.getAttribute(that.PART_NAME))
  41. {
  42. page1 = child;
  43. }
  44. }
  45. for (var i = 2; i <= pageCount; i++)
  46. {
  47. var newPage = page1.cloneNode();
  48. newPage.setAttribute(that.PART_NAME, "/visio/pages/page" + i + ".xml");
  49. root.appendChild(newPage);
  50. }
  51. writeXmlDoc2Zip(zip, id, doc, true);
  52. }
  53. else
  54. {
  55. zip.file(id, files[id]);
  56. }
  57. }
  58. };
  59. function getGraphAttributes(graph)
  60. {
  61. var attr = {};
  62. try
  63. {
  64. //This doesn't work when pageView is off
  65. // // Computes the horizontal and vertical page count
  66. // var bounds = graph.getGraphBounds();
  67. // var sc = graph.view.scale;
  68. // var bgBounds = graph.view.getBackgroundPageBounds();
  69. //
  70. // var x0 = Math.round((bounds.x - bgBounds.x) / sc);
  71. // var y0 = Math.round((bounds.y - bgBounds.y) / sc);
  72. //
  73. // var hpages = Math.max(1, Math.ceil((bounds.width / sc + x0) / graph.pageFormat.width));
  74. // var vpages = Math.max(1, Math.ceil((bounds.height / sc + y0) / graph.pageFormat.height));
  75. // Computes the horizontal and vertical page count
  76. var bounds = graph.getGraphBounds().clone();
  77. var sc = graph.view.scale;
  78. var tr = graph.view.translate;
  79. var x0 = Math.round(bounds.x / sc) - tr.x;
  80. var y0 = Math.round(bounds.y / sc) - tr.y;
  81. // Store the available page area
  82. var availableWidth = graph.pageFormat.width;
  83. var availableHeight = graph.pageFormat.height;
  84. if (x0 < 0)
  85. {
  86. x0 += Math.ceil((tr.x - bounds.x / sc) / availableWidth) * availableWidth;
  87. }
  88. if (y0 < 0)
  89. {
  90. y0 += Math.ceil((tr.y - bounds.y / sc) / availableHeight) * availableHeight;
  91. }
  92. var hpages = Math.max(1, Math.ceil((bounds.width / sc + x0) / availableWidth));
  93. var vpages = Math.max(1, Math.ceil((bounds.height / sc + y0) / availableHeight));
  94. attr['gridEnabled'] = graph.gridEnabled;
  95. attr['gridSize'] = graph.gridSize;
  96. attr['guidesEnabled'] = graph.graphHandler.guidesEnabled
  97. attr['pageVisible'] = graph.pageVisible;
  98. attr['pageScale'] = graph.pageScale;
  99. attr['pageWidth'] = graph.pageFormat.width * hpages;
  100. attr['pageHeight'] = graph.pageFormat.height * vpages;
  101. attr['backgroundClr'] = graph.background;
  102. attr['mathEnabled'] = graph.mathEnabled;
  103. attr['shadowVisible'] = graph.shadowVisible;
  104. }
  105. catch(e)
  106. {
  107. //nothing
  108. }
  109. return attr;
  110. };
  111. function createCellElemScaled(name, val, xmlDoc, formula)
  112. {
  113. return createCellElem(name, val / that.CONVERSION_FACTOR, xmlDoc, formula);
  114. };
  115. function createCellElem(name, val, xmlDoc, formula)
  116. {
  117. var cell = xmlDoc.createElement("Cell");
  118. cell.setAttribute("N", name);
  119. cell.setAttribute("V", val);
  120. if (formula) cell.setAttribute("F", formula);
  121. return cell;
  122. };
  123. function createRow(type, index, x, y, xmlDoc)
  124. {
  125. var row = xmlDoc.createElement("Row");
  126. row.setAttribute("T", type);
  127. row.setAttribute("IX", index);
  128. row.appendChild(createCellElemScaled("X", x, xmlDoc));
  129. row.appendChild(createCellElemScaled("Y", y, xmlDoc));
  130. return row;
  131. };
  132. function applyMxCellStyle(state, shape, xmlDoc)
  133. {
  134. var fillClr = state.style[mxConstants.STYLE_FILLCOLOR];
  135. if (!fillClr || fillClr == "none")
  136. {
  137. shape.appendChild(createCellElem("FillPattern", 0, xmlDoc));
  138. }
  139. else
  140. {
  141. shape.appendChild(createCellElem("FillForegnd", fillClr, xmlDoc));
  142. var gradClr = state.style[mxConstants.STYLE_GRADIENTCOLOR];
  143. if (gradClr && gradClr != "none")
  144. {
  145. shape.appendChild(createCellElem("FillBkgnd", gradClr, xmlDoc));
  146. var gradDir = state.style[mxConstants.STYLE_GRADIENT_DIRECTION];
  147. var dir = 28;
  148. if (gradDir)
  149. {
  150. switch(gradDir)
  151. {
  152. case mxConstants.DIRECTION_EAST:
  153. dir = 25;
  154. break
  155. case mxConstants.DIRECTION_WEST:
  156. dir = 27;
  157. break
  158. case mxConstants.DIRECTION_NORTH:
  159. dir = 30;
  160. break
  161. }
  162. }
  163. shape.appendChild(createCellElem("FillPattern", dir, xmlDoc));
  164. }
  165. }
  166. var strokeClr = state.style[mxConstants.STYLE_STROKECOLOR];
  167. if (!strokeClr || strokeClr == "none")
  168. shape.appendChild(createCellElem("LinePattern", 0, xmlDoc));
  169. else
  170. shape.appendChild(createCellElem("LineColor", strokeClr, xmlDoc));
  171. var strokeW = state.style[mxConstants.STYLE_STROKEWIDTH];
  172. if (strokeW) shape.appendChild(createCellElemScaled("LineWeight", strokeW, xmlDoc));
  173. var opacity = state.style[mxConstants.STYLE_OPACITY];
  174. var fillOpaq;
  175. var strkOpaq;
  176. if (opacity)
  177. {
  178. fillOpaq = opacity;
  179. strkOpaq = opacity;
  180. }
  181. else
  182. {
  183. fillOpaq = state.style[mxConstants.STYLE_FILL_OPACITY];
  184. strkOpaq = state.style[mxConstants.STYLE_STROKE_OPACITY];
  185. }
  186. if (fillOpaq) shape.appendChild(createCellElem("FillForegndTrans", 1 - parseInt(fillOpaq)/100.0, xmlDoc));
  187. if (strkOpaq) shape.appendChild(createCellElem("LineColorTrans", 1 - parseInt(strkOpaq)/100.0, xmlDoc));
  188. var isDashed = state.style[mxConstants.STYLE_DASHED];
  189. if (isDashed == 1)
  190. {
  191. var dashPatrn = state.style[mxConstants.STYLE_DASH_PATTERN];
  192. var pattern = 9
  193. if (dashPatrn)
  194. {
  195. //We only support the patterns of draw.io UI
  196. switch(dashPatrn)
  197. {
  198. case "1 1":
  199. pattern = 10;
  200. break;
  201. case "1 2":
  202. pattern = 3;
  203. break;
  204. case "1 4":
  205. pattern = 17;
  206. break;
  207. }
  208. }
  209. shape.appendChild(createCellElem("LinePattern", pattern, xmlDoc));
  210. }
  211. var hasShadow = state.style[mxConstants.STYLE_SHADOW];
  212. if (hasShadow == 1)
  213. {
  214. shape.appendChild(createCellElem("ShdwPattern", 1, xmlDoc));
  215. shape.appendChild(createCellElem("ShdwForegnd", '#000000', xmlDoc));
  216. shape.appendChild(createCellElem("ShdwForegndTrans", 0.6, xmlDoc));
  217. shape.appendChild(createCellElem("ShapeShdwType", 1, xmlDoc));
  218. shape.appendChild(createCellElem("ShapeShdwOffsetX", '0.02946278254943948', xmlDoc));
  219. shape.appendChild(createCellElem("ShapeShdwOffsetY", '-0.02946278254943948', xmlDoc));
  220. shape.appendChild(createCellElem("ShapeShdwScaleFactor", '1', xmlDoc));
  221. shape.appendChild(createCellElem("ShapeShdwBlur", '0.05555555555555555', xmlDoc));
  222. shape.appendChild(createCellElem("ShapeShdwShow", 2, xmlDoc));
  223. }
  224. //Probably we don't need margins as the canvas get the modified position?
  225. /*
  226. var topMargin = state.style[mxConstants.STYLE_SPACING_TOP];
  227. if (topMargin) shape.appendChild(createCellElemScaled("TopMargin", parseFloat(topMargin) * 2 + 2.8 , xmlDoc));
  228. /* //Defines label bottom spacing
  229. double bottomMargin = getBottomSpacing() * 100/100;
  230. if (bottomMargin != 0)
  231. {
  232. styleMap.put(mxConstants.STYLE_SPACING_BOTTOM, Double.toString(bottomMargin));
  233. }
  234. //Defines label left spacing
  235. double leftMargin = getLeftSpacing() * 100/100;
  236. if (leftMargin != 0)
  237. {
  238. styleMap.put(mxConstants.STYLE_SPACING_LEFT, Double.toString(leftMargin));
  239. }
  240. //Defines label right spacing
  241. double rightMargin = getRightSpacing() * 100/100;
  242. if(rightMargin !=0)
  243. {
  244. styleMap.put(mxConstants.STYLE_SPACING_RIGHT, Double.toString(rightMargin));
  245. }*/
  246. //Direction is not clear that we need it
  247. /*
  248. var direction = state.style[mxConstants.STYLE_DIRECTION];
  249. if (direction != mxConstants.DIRECTION_EAST)
  250. {
  251. styleMap.put(mxConstants.STYLE_DIRECTION, direction);
  252. }
  253. */
  254. var flibX = state.style[mxConstants.STYLE_FLIPH];
  255. if (flibX == 1) shape.appendChild(createCellElem("FlipX", 1, xmlDoc));
  256. var flibY = state.style[mxConstants.STYLE_FLIPV];
  257. if (flibY == 1) shape.appendChild(createCellElem("FlipY", 1, xmlDoc));
  258. var rounded = state.style[mxConstants.STYLE_ROUNDED];
  259. if (rounded == 1) shape.appendChild(createCellElemScaled("Rounding", state.cell.geometry.width*0.1, xmlDoc));
  260. //TODO for some reason, visio doesn't show the label (text) background color!
  261. //May be we need mxSvgCanvas2D.prototype.addTextBackground = function(node, str, x, y, w, h, align, valign, overflow)
  262. var lbkgnd = state.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR];
  263. if (lbkgnd) shape.appendChild(createCellElem("TextBkgnd", lbkgnd, xmlDoc));
  264. };
  265. function createShape(id, geo, xmlDoc, parentHeight)
  266. {
  267. var shape = xmlDoc.createElement("Shape");
  268. shape.setAttribute("ID", id);
  269. shape.setAttribute("NameU", "Shape" + id);
  270. shape.setAttribute("LineStyle", "0");
  271. shape.setAttribute("FillStyle", "0");
  272. shape.setAttribute("TextStyle", "0");
  273. var hw = geo.width/2, hh = geo.height/2;
  274. shape.appendChild(createCellElemScaled("PinX", geo.x + hw + vsdxCanvas.shiftX, xmlDoc));
  275. shape.appendChild(createCellElemScaled("PinY", parentHeight - geo.y - hh - vsdxCanvas.shiftY, xmlDoc));
  276. shape.appendChild(createCellElemScaled("Width", geo.width, xmlDoc));
  277. shape.appendChild(createCellElemScaled("Height", geo.height, xmlDoc));
  278. shape.appendChild(createCellElemScaled("LocPinX", hw, xmlDoc));
  279. shape.appendChild(createCellElemScaled("LocPinY", hh, xmlDoc));
  280. return shape;
  281. };
  282. function getArrowType(arrow, isFilled)
  283. {
  284. isFilled = isFilled == null? "1" : isFilled;
  285. arrow = arrow == null? "none" : arrow;
  286. var key = arrow + "|" + isFilled;
  287. var type = that.ARROWS_MAP[key];
  288. if (type != null)
  289. return type;
  290. else
  291. return 1;
  292. };
  293. function getArrowSize(size)
  294. {
  295. if (size == null) return 2;
  296. if (size <=2)
  297. return 0;
  298. else if (size <= 3)
  299. return 1;
  300. else if (size <= 5)
  301. return 2;
  302. else if (size <= 7)
  303. return 3;
  304. else if (size <= 9)
  305. return 4;
  306. else if (size <= 22)
  307. return 5;
  308. else
  309. return 6;
  310. };
  311. function createEdge(cell, graph, xmlDoc, parentHeight)
  312. {
  313. var state = graph.view.getState(cell);
  314. var shape = xmlDoc.createElement("Shape");
  315. shape.setAttribute("ID", cell.id);
  316. shape.setAttribute("NameU", "Dynamic connector." + cell.id);
  317. shape.setAttribute("Name", "Dynamic connector." + cell.id);
  318. shape.setAttribute("Type", "Shape");
  319. shape.setAttribute("Master", "4"); //Dynamic Connector Master
  320. var s = vsdxCanvas.state;
  321. var points = state.absolutePoints;
  322. var bounds = state.cellBounds;
  323. var hw = bounds.width/2, hh = bounds.height/2;
  324. shape.appendChild(createCellElemScaled("PinX", bounds.x + hw, xmlDoc));
  325. shape.appendChild(createCellElemScaled("PinY", parentHeight - bounds.y - hh, xmlDoc));
  326. shape.appendChild(createCellElemScaled("Width", bounds.width, xmlDoc));
  327. shape.appendChild(createCellElemScaled("Height", bounds.height, xmlDoc));
  328. shape.appendChild(createCellElemScaled("LocPinX", hw, xmlDoc));
  329. shape.appendChild(createCellElemScaled("LocPinY", hh, xmlDoc));
  330. vsdxCanvas.newEdge(shape, state, xmlDoc);
  331. var calcVsdxPoint = function(p, noHeight)
  332. {
  333. var x = p.x, y = p.y;
  334. x = (x * s.scale - bounds.x + s.dx + vsdxCanvas.shiftX) ;
  335. y = ((noHeight? 0 : bounds.height) - y * s.scale + bounds.y - s.dy - vsdxCanvas.shiftY) ;
  336. return {x: x, y: y};
  337. };
  338. var p0 = calcVsdxPoint(points[0], true);
  339. //Formula is used to make the edge dynamic
  340. shape.appendChild(createCellElemScaled("BeginX", bounds.x + p0.x, xmlDoc, "_WALKGLUE(BegTrigger,EndTrigger,WalkPreference)"));
  341. shape.appendChild(createCellElemScaled("BeginY", parentHeight - bounds.y + p0.y, xmlDoc, "_WALKGLUE(BegTrigger,EndTrigger,WalkPreference)"));
  342. var pe = calcVsdxPoint(points[points.length - 1], true);
  343. //Formula is used to make the edge dynamic
  344. shape.appendChild(createCellElemScaled("EndX", bounds.x + pe.x, xmlDoc, "_WALKGLUE(EndTrigger,BegTrigger,WalkPreference)"));
  345. shape.appendChild(createCellElemScaled("EndY", parentHeight - bounds.y + pe.y, xmlDoc, "_WALKGLUE(EndTrigger,BegTrigger,WalkPreference)"));
  346. //Formula is used to make the edge dynamic (specify source id and target id)
  347. shape.appendChild(createCellElem("BegTrigger", "2", xmlDoc, cell.source? "_XFTRIGGER(Sheet."+ cell.source.id +"!EventXFMod)" : null));
  348. shape.appendChild(createCellElem("EndTrigger", "2", xmlDoc, cell.target? "_XFTRIGGER(Sheet."+ cell.target.id +"!EventXFMod)" : null));
  349. shape.appendChild(createCellElem("ConFixedCode", "6", xmlDoc));
  350. shape.appendChild(createCellElem("LayerMember", "0", xmlDoc));
  351. applyMxCellStyle(state, shape, xmlDoc);
  352. //Edge special styles
  353. var startFill = state.style[mxConstants.STYLE_STARTFILL];
  354. var startArrow = state.style[mxConstants.STYLE_STARTARROW];
  355. var startSize = state.style[mxConstants.STYLE_STARTSIZE];
  356. var type = getArrowType(startArrow, startFill);
  357. shape.appendChild(createCellElem("BeginArrow", type, xmlDoc));
  358. shape.appendChild(createCellElem("BeginArrowSize", getArrowSize(startSize), xmlDoc));
  359. var endFill = state.style[mxConstants.STYLE_ENDFILL];
  360. var endArrow = state.style[mxConstants.STYLE_ENDARROW];
  361. var endSize = state.style[mxConstants.STYLE_ENDSIZE];
  362. var type = getArrowType(endArrow, endFill);
  363. shape.appendChild(createCellElem("EndArrow", type, xmlDoc));
  364. shape.appendChild(createCellElem("EndArrowSize", getArrowSize(endSize), xmlDoc));
  365. //Draw text first to have its shape cell elements before visio geo.
  366. if (state.text != null && state.text.checkBounds())
  367. {
  368. vsdxCanvas.save();
  369. state.text.paint(vsdxCanvas);
  370. vsdxCanvas.restore();
  371. }
  372. var geoSec = xmlDoc.createElement("Section");
  373. geoSec.setAttribute("N", "Geometry");
  374. geoSec.setAttribute("IX", "0");
  375. for (var i = 0; i < points.length; i++)
  376. {
  377. var p = calcVsdxPoint(points[i]);
  378. geoSec.appendChild(createRow(i==0 ? "MoveTo" : "LineTo", (i + 1), p.x, p.y, xmlDoc));
  379. }
  380. geoSec.appendChild(createCellElem("NoFill", "1", xmlDoc));
  381. geoSec.appendChild(createCellElem("NoLine", "0", xmlDoc));
  382. shape.appendChild(geoSec);
  383. return shape;
  384. };
  385. function convertMxCell2Shape(cell, graph, xmlDoc, parentHeight, parentGeo)
  386. {
  387. var geo = cell.geometry;
  388. if (geo != null)
  389. {
  390. //fix relative geo coordinates
  391. if (geo.relative && parentGeo)
  392. {
  393. geo = geo.clone();
  394. geo.x *= parentGeo.width;
  395. geo.y *= parentGeo.height;
  396. geo.relative = 0;
  397. }
  398. if (!cell.treatAsSingle && cell.getChildCount() > 0) //Group
  399. {
  400. //Create group shape as an empty shape with no geo
  401. var shape = createShape(cell.id+"10000", geo, xmlDoc, parentHeight);
  402. shape.setAttribute("Type", "Group");
  403. //Create group shape
  404. var gShapes = xmlDoc.createElement("Shapes");
  405. //translate the canvas using the group coordinates
  406. vsdxCanvas.save();
  407. vsdxCanvas.translate(-geo.x, -geo.y);
  408. //Draw the actual group shape as a child (so change its geo coord to 0,0).
  409. // In mxGraph group shape can have styles and stencil
  410. var newGeo = geo.clone();
  411. newGeo.x = 0;
  412. newGeo.y = 0;
  413. cell.setGeometry(newGeo);
  414. cell.treatAsSingle = true;
  415. var subShape = convertMxCell2Shape(cell, graph, xmlDoc, geo.height, geo);
  416. cell.treatAsSingle = false;
  417. cell.setGeometry(geo);
  418. gShapes.appendChild(subShape);
  419. //add group children
  420. for (var i = 0; i < cell.children.length; i++)
  421. {
  422. var child = cell.children[i];
  423. var subShape = convertMxCell2Shape(child, graph, xmlDoc, geo.height, geo);
  424. gShapes.appendChild(subShape);
  425. }
  426. shape.appendChild(gShapes);
  427. //restore the canvas to before group translation
  428. vsdxCanvas.restore();
  429. return shape;
  430. }
  431. else if (cell.vertex)
  432. {
  433. var shape = createShape(cell.id, geo, xmlDoc, parentHeight);
  434. var state = graph.view.getState(cell);
  435. applyMxCellStyle(state, shape, xmlDoc);
  436. vsdxCanvas.newShape(shape, state, xmlDoc);
  437. //Draw text first to have its shape cell elements before visio geo.
  438. if (state.text != null && state.text.checkBounds())
  439. {
  440. vsdxCanvas.save();
  441. state.text.paint(vsdxCanvas);
  442. vsdxCanvas.restore();
  443. }
  444. if (state.shape != null && state.shape.checkBounds())
  445. {
  446. vsdxCanvas.save();
  447. state.shape.paint(vsdxCanvas);
  448. vsdxCanvas.restore();
  449. }
  450. shape.appendChild(vsdxCanvas.getShapeGeo());
  451. vsdxCanvas.endShape();
  452. shape.setAttribute("Type", vsdxCanvas.getShapeType());
  453. return shape;
  454. }
  455. else
  456. {
  457. return createEdge(cell, graph, xmlDoc, parentHeight);
  458. }
  459. }
  460. else
  461. {
  462. return null;
  463. }
  464. };
  465. function convertMxModel2Page(graph, modelAttrib)
  466. {
  467. var xmlDoc = mxUtils.createXmlDocument();
  468. var root = xmlDoc.createElement("PageContents");
  469. root.setAttribute("xmlns", that.XMLNS);
  470. root.setAttribute("xmlns:r", that.XMLNS_R);
  471. root.setAttribute("xml:space", that.XML_SPACE);
  472. var shapes = xmlDoc.createElement("Shapes");
  473. root.appendChild(shapes);
  474. var model = graph.model;
  475. var t = graph.view.translate;
  476. var s = graph.view.scale;
  477. var bounds = graph.getGraphBounds();
  478. vsdxCanvas.shiftX = 0; vsdxCanvas.shiftY = 0;
  479. //-ve pages
  480. if (bounds.x / s < t.x || bounds.y / s < t.y)
  481. {
  482. vsdxCanvas.shiftX = Math.ceil((t.x - bounds.x / s) / graph.pageFormat.width) * graph.pageFormat.width;
  483. vsdxCanvas.shiftY = Math.ceil((t.y - bounds.y / s) / graph.pageFormat.height) * graph.pageFormat.height;
  484. }
  485. vsdxCanvas.save();
  486. vsdxCanvas.translate(-t.x, -t.y);
  487. vsdxCanvas.scale(1 / s);
  488. vsdxCanvas.newPage();
  489. var defParent = graph.getDefaultParent();
  490. for (var id in model.cells)
  491. {
  492. var cell = model.cells[id];
  493. //top-most cells
  494. if (cell.parent == defParent)
  495. {
  496. var shape = convertMxCell2Shape(cell, graph, xmlDoc, modelAttrib.pageHeight);
  497. if (shape != null)
  498. shapes.appendChild(shape);
  499. }
  500. }
  501. var connects = xmlDoc.createElement("Connects");
  502. root.appendChild(connects);
  503. //Second pass to add edges (connections)
  504. for (var id in model.cells)
  505. {
  506. var cell = model.cells[id];
  507. if (cell.edge)
  508. {
  509. if (cell.source)
  510. {
  511. var connect = xmlDoc.createElement("Connect");
  512. connect.setAttribute("FromSheet", cell.id);
  513. connect.setAttribute("FromCell", "BeginX");
  514. connect.setAttribute("ToSheet", cell.source.id);
  515. connects.appendChild(connect);
  516. }
  517. if (cell.target)
  518. {
  519. var connect = xmlDoc.createElement("Connect");
  520. connect.setAttribute("FromSheet", cell.id);
  521. connect.setAttribute("FromCell", "EndX");
  522. connect.setAttribute("ToSheet", cell.target.id);
  523. connects.appendChild(connect);
  524. }
  525. }
  526. }
  527. xmlDoc.appendChild(root);
  528. vsdxCanvas.restore();
  529. return xmlDoc;
  530. };
  531. function writeXmlDoc2Zip(zip, name, xmlDoc, noHeader)
  532. {
  533. zip.file(name, (noHeader? "" : "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>") + mxUtils.getXml(xmlDoc));
  534. };
  535. function addPagesXML(zip, pages, modelsAttr)
  536. {
  537. var pagesXmlDoc = mxUtils.createXmlDocument();
  538. var pagesRelsXmlDoc = mxUtils.createXmlDocument();
  539. var pagesRoot = pagesXmlDoc.createElement("Pages");
  540. pagesRoot.setAttribute("xmlns", that.XMLNS);
  541. pagesRoot.setAttribute("xmlns:r", that.XMLNS_R);
  542. pagesRoot.setAttribute("xml:space", that.XML_SPACE);
  543. var pagesRelsRoot = pagesRelsXmlDoc.createElement("Relationships");
  544. pagesRelsRoot.setAttribute("xmlns", that.RELS_XMLNS);
  545. var i = 1;
  546. for (var name in pages)
  547. {
  548. var pageName = "page" + i + ".xml";
  549. var pageE = pagesXmlDoc.createElement("Page");
  550. pageE.setAttribute("ID", i-1);
  551. pageE.setAttribute("NameU", name);
  552. pageE.setAttribute("Name", name);
  553. var pageSheet = pagesXmlDoc.createElement("PageSheet");
  554. var modelAttr = modelsAttr[name];
  555. pageSheet.appendChild(createCellElemScaled("PageWidth", modelAttr['pageWidth'], pagesXmlDoc));
  556. pageSheet.appendChild(createCellElemScaled("PageHeight", modelAttr['pageHeight'], pagesXmlDoc));
  557. pageSheet.appendChild(createCellElem("PageScale", modelAttr['pageScale'], pagesXmlDoc));
  558. pageSheet.appendChild(createCellElem("DrawingScale", 1, pagesXmlDoc));
  559. var relE = pagesXmlDoc.createElement("Rel");
  560. relE.setAttribute("r:id", "rId" + i);
  561. //Layer (not needed!, it works without it)
  562. var layerSec = pagesXmlDoc.createElement("Section");
  563. layerSec.setAttribute("N", "Layer");
  564. var layerRow = pagesXmlDoc.createElement("Row");
  565. layerRow.setAttribute("IX", "0");
  566. layerSec.appendChild(layerRow)
  567. layerRow.appendChild(createCellElem("Name", 'Connector', pagesXmlDoc));
  568. layerRow.appendChild(createCellElem("Color", '255', pagesXmlDoc));
  569. layerRow.appendChild(createCellElem("Status", '0', pagesXmlDoc));
  570. layerRow.appendChild(createCellElem("Visible", '1', pagesXmlDoc));
  571. layerRow.appendChild(createCellElem("Print", '1', pagesXmlDoc));
  572. layerRow.appendChild(createCellElem("Active", '0', pagesXmlDoc));
  573. layerRow.appendChild(createCellElem("Lock", '0', pagesXmlDoc));
  574. layerRow.appendChild(createCellElem("Snap", '1', pagesXmlDoc));
  575. layerRow.appendChild(createCellElem("Glue", '1', pagesXmlDoc));
  576. layerRow.appendChild(createCellElem("NameUniv", 'Connector', pagesXmlDoc));
  577. layerRow.appendChild(createCellElem("ColorTrans", '0', pagesXmlDoc));
  578. pageSheet.appendChild(layerSec);
  579. pageE.appendChild(pageSheet);
  580. pageE.appendChild(relE);
  581. pagesRoot.appendChild(pageE);
  582. var relationship = pagesRelsXmlDoc.createElement("Relationship");
  583. relationship.setAttribute("Id", "rId" + i);
  584. relationship.setAttribute("Type", that.PAGES_TYPE);
  585. relationship.setAttribute("Target", pageName);
  586. pagesRelsRoot.appendChild(relationship);
  587. //Note:Each page rels is created with the skeleton as they are constants
  588. //write the page docs
  589. var xmlDoc = pages[name];
  590. writeXmlDoc2Zip(zip, that.VISIO_PAGES + pageName, xmlDoc);
  591. i++;
  592. }
  593. pagesXmlDoc.appendChild(pagesRoot);
  594. pagesRelsXmlDoc.appendChild(pagesRelsRoot);
  595. writeXmlDoc2Zip(zip, that.VISIO_PAGES + "pages.xml", pagesXmlDoc);
  596. writeXmlDoc2Zip(zip, that.VISIO_PAGES + "_rels/pages.xml.rels", pagesRelsXmlDoc);
  597. }
  598. function addImagesRels(zip, pIndex)
  599. {
  600. //create a new page rels file
  601. var fId = that.VISIO_PAGES_RELS + "page" + pIndex + ".xml.rels";
  602. var pageRelDoc = mxUtils.createXmlDocument();
  603. var relationships = pageRelDoc.createElement("Relationships");
  604. relationships.setAttribute("xmlns", that.RELS_XMLNS);
  605. //Add master relationship (rId1)
  606. var relationship = pageRelDoc.createElement("Relationship");
  607. relationship.setAttribute("Type", "http://schemas.microsoft.com/visio/2010/relationships/master");
  608. relationship.setAttribute("Id", "rId1");
  609. relationship.setAttribute("Target", "../masters/master1.xml");
  610. relationships.appendChild(relationship);
  611. var imgs = vsdxCanvas.images;
  612. //create rels of image files
  613. if (imgs.length > 0)
  614. {
  615. for (var i = 0; i < imgs.length; i++)
  616. {
  617. var relationship = pageRelDoc.createElement("Relationship");
  618. relationship.setAttribute("Type", that.XMLNS_R + "/image");
  619. relationship.setAttribute("Id", "rId" + (i+2));
  620. relationship.setAttribute("Target", "../media/" + imgs[i]);
  621. relationships.appendChild(relationship);
  622. }
  623. }
  624. pageRelDoc.appendChild(relationships);
  625. writeXmlDoc2Zip(zip, fId, pageRelDoc);
  626. };
  627. /**
  628. *
  629. * Convert current Editor UI pages into a vdsx file
  630. * @return true if successful, false otherwise
  631. */
  632. this.exportCurrentDiagrams = function ()
  633. {
  634. try
  635. {
  636. var zip = new JSZip();
  637. vsdxCanvas.init(zip);
  638. pages = {};
  639. modelsAttr = {};
  640. var pagesCount = editorUi.pages != null? editorUi.pages.length : 1;
  641. if (editorUi.pages != null)
  642. {
  643. var currentPage = editorUi.currentPage;
  644. for (var i=0; i < editorUi.pages.length; i++)
  645. {
  646. var page = editorUi.pages[i];
  647. editorUi.selectPage(page);
  648. var diagramName = page.getName();
  649. var graph = editorUi.editor.graph;
  650. var modelAttrib = getGraphAttributes(graph);
  651. pages[diagramName] = convertMxModel2Page(graph, modelAttrib);
  652. addImagesRels(zip, i+1);
  653. modelsAttr[diagramName] = modelAttrib;
  654. }
  655. editorUi.selectPage(currentPage);
  656. }
  657. else
  658. {
  659. var graph = editorUi.editor.graph;
  660. var modelAttrib = getGraphAttributes(graph);
  661. var diagramName = "Page1";
  662. pages[diagramName] = convertMxModel2Page(graph, modelAttrib);
  663. addImagesRels(zip, 1);
  664. modelsAttr[diagramName] = modelAttrib;
  665. }
  666. createVsdxSkeleton(zip, pagesCount);
  667. addPagesXML(zip, pages, modelsAttr);
  668. //wait until all media files are loaded
  669. var createZipFile = function()
  670. {
  671. if (vsdxCanvas.filesLoading > 0)
  672. {
  673. setTimeout(createZipFile, vsdxCanvas.filesLoading * 200);
  674. }
  675. else
  676. {
  677. zip.generateAsync({type:"base64"}).then(
  678. function(content)
  679. {
  680. var basename = editorUi.getBaseFilename();
  681. editorUi.saveData(basename+".vsdx", 'vsdx', content, 'application/vnd.visio2013', true);
  682. }
  683. );
  684. }
  685. };
  686. createZipFile();
  687. return true;
  688. }
  689. catch(e)
  690. {
  691. console.log(e);
  692. return false;
  693. }
  694. };
  695. }
  696. VsdxExport.prototype.CONVERSION_FACTOR = 40 * 2.54; //screenCoordinatesPerCm (40) x CENTIMETERS_PER_INCHES (2.54)
  697. VsdxExport.prototype.PAGES_TYPE = "http://schemas.microsoft.com/visio/2010/relationships/page";
  698. VsdxExport.prototype.RELS_XMLNS = "http://schemas.openxmlformats.org/package/2006/relationships";
  699. VsdxExport.prototype.XML_SPACE = "preserve";
  700. VsdxExport.prototype.XMLNS_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
  701. VsdxExport.prototype.XMLNS = "http://schemas.microsoft.com/office/visio/2012/main";
  702. VsdxExport.prototype.VISIO_PAGES = "visio/pages/";
  703. VsdxExport.prototype.PREFEX = "com/mxgraph/io/vsdx/resources/export/";
  704. VsdxExport.prototype.VSDX_ENC = "ISO-8859-1";
  705. VsdxExport.prototype.PART_NAME = "PartName";
  706. VsdxExport.prototype.CONTENT_TYPES_XML = "[Content_Types].xml";
  707. VsdxExport.prototype.VISIO_PAGES_RELS = "visio/pages/_rels/";
  708. VsdxExport.prototype.ARROWS_MAP = {
  709. "none|1": 0, "none|0": 0, "open|1": 1, "open|0": 1, "block|1": 4, "block|0": 14, "classic|1": 5, "classic|0": 17,
  710. "oval|1": 10, "oval|0": 20, "diamond|1": 11, "diamond|0": 22, "blockThin|1": 2, "blockThin|0": 15, "dash|1": 23, "dash|0": 23,
  711. "ERone|1": 24, "ERone|0": 24, "ERmandOne|1": 25, "ERmandOne|0": 25, "ERmany|1": 27, "ERmany|0": 27, "ERoneToMany|1": 28, "ERoneToMany|0": 28,
  712. "ERzeroToMany|1": 29, "ERzeroToMany|0": 29, "ERzeroToOne|1": 30, "ERzeroToOne|0": 30, "openAsync|1": 9, "openAsync|0": 9
  713. };