VsdxExport.js 68 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883
  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 createElt(doc, ns, name)
  60. {
  61. return (doc.createElementNS != null) ? doc.createElementNS(ns, name) : doc.createElement(name);
  62. };
  63. function getGraphAttributes(graph)
  64. {
  65. var attr = {};
  66. try
  67. {
  68. //This doesn't work when pageView is off
  69. // // Computes the horizontal and vertical page count
  70. // var bounds = graph.getGraphBounds();
  71. // var sc = graph.view.scale;
  72. // var bgBounds = graph.view.getBackgroundPageBounds();
  73. //
  74. // var x0 = Math.round((bounds.x - bgBounds.x) / sc);
  75. // var y0 = Math.round((bounds.y - bgBounds.y) / sc);
  76. //
  77. // var hpages = Math.max(1, Math.ceil((bounds.width / sc + x0) / graph.pageFormat.width));
  78. // var vpages = Math.max(1, Math.ceil((bounds.height / sc + y0) / graph.pageFormat.height));
  79. // Computes the horizontal and vertical page count
  80. var bounds = graph.getGraphBounds().clone();
  81. var sc = graph.view.scale;
  82. var tr = graph.view.translate;
  83. var x0 = Math.round(bounds.x / sc) - tr.x;
  84. var y0 = Math.round(bounds.y / sc) - tr.y;
  85. // Store the available page area
  86. var availableWidth = graph.pageFormat.width;
  87. var availableHeight = graph.pageFormat.height;
  88. if (x0 < 0)
  89. {
  90. x0 += Math.ceil((tr.x - bounds.x / sc) / availableWidth) * availableWidth;
  91. }
  92. if (y0 < 0)
  93. {
  94. y0 += Math.ceil((tr.y - bounds.y / sc) / availableHeight) * availableHeight;
  95. }
  96. var hpages = Math.max(1, Math.ceil((bounds.width / sc + x0) / availableWidth));
  97. var vpages = Math.max(1, Math.ceil((bounds.height / sc + y0) / availableHeight));
  98. attr['gridEnabled'] = graph.gridEnabled;
  99. attr['gridSize'] = graph.gridSize;
  100. attr['guidesEnabled'] = graph.graphHandler.guidesEnabled
  101. attr['pageVisible'] = graph.pageVisible;
  102. attr['pageScale'] = graph.pageScale;
  103. attr['pageWidth'] = graph.pageFormat.width * hpages;
  104. attr['pageHeight'] = graph.pageFormat.height * vpages;
  105. attr['backgroundClr'] = graph.background;
  106. attr['mathEnabled'] = graph.mathEnabled;
  107. attr['shadowVisible'] = graph.shadowVisible;
  108. }
  109. catch(e)
  110. {
  111. //nothing
  112. }
  113. return attr;
  114. };
  115. function createCellElemScaled(name, val, xmlDoc, formula)
  116. {
  117. return createCellElem(name, val / that.CONVERSION_FACTOR, xmlDoc, formula);
  118. };
  119. function createCellElem(name, val, xmlDoc, formula)
  120. {
  121. var cell = createElt(xmlDoc, that.XMLNS, "Cell");
  122. cell.setAttribute("N", name);
  123. cell.setAttribute("V", val);
  124. if (formula) cell.setAttribute("F", formula);
  125. return cell;
  126. };
  127. function createRow(type, index, x, y, xmlDoc)
  128. {
  129. var row = createElt(xmlDoc, that.XMLNS, "Row");
  130. row.setAttribute("T", type);
  131. row.setAttribute("IX", index);
  132. row.appendChild(createCellElemScaled("X", x, xmlDoc));
  133. row.appendChild(createCellElemScaled("Y", y, xmlDoc));
  134. return row;
  135. };
  136. function applyMxCellStyle(state, shape, xmlDoc)
  137. {
  138. var fillClr = state.style[mxConstants.STYLE_FILLCOLOR];
  139. if (!fillClr || fillClr == "none")
  140. {
  141. shape.appendChild(createCellElem("FillPattern", 0, xmlDoc));
  142. }
  143. else
  144. {
  145. shape.appendChild(createCellElem("FillForegnd", fillClr, xmlDoc));
  146. var gradClr = state.style[mxConstants.STYLE_GRADIENTCOLOR];
  147. if (gradClr && gradClr != "none")
  148. {
  149. shape.appendChild(createCellElem("FillBkgnd", gradClr, xmlDoc));
  150. var gradDir = state.style[mxConstants.STYLE_GRADIENT_DIRECTION];
  151. var dir = 28;
  152. if (gradDir)
  153. {
  154. switch(gradDir)
  155. {
  156. case mxConstants.DIRECTION_EAST:
  157. dir = 25;
  158. break
  159. case mxConstants.DIRECTION_WEST:
  160. dir = 27;
  161. break
  162. case mxConstants.DIRECTION_NORTH:
  163. dir = 30;
  164. break
  165. }
  166. }
  167. shape.appendChild(createCellElem("FillPattern", dir, xmlDoc));
  168. }
  169. }
  170. var strokeClr = state.style[mxConstants.STYLE_STROKECOLOR];
  171. if (!strokeClr || strokeClr == "none")
  172. shape.appendChild(createCellElem("LinePattern", 0, xmlDoc));
  173. else
  174. shape.appendChild(createCellElem("LineColor", strokeClr, xmlDoc));
  175. var strokeW = state.style[mxConstants.STYLE_STROKEWIDTH];
  176. if (strokeW) shape.appendChild(createCellElemScaled("LineWeight", strokeW, xmlDoc));
  177. var opacity = state.style[mxConstants.STYLE_OPACITY];
  178. var fillOpaq;
  179. var strkOpaq;
  180. if (opacity)
  181. {
  182. fillOpaq = opacity;
  183. strkOpaq = opacity;
  184. }
  185. else
  186. {
  187. fillOpaq = state.style[mxConstants.STYLE_FILL_OPACITY];
  188. strkOpaq = state.style[mxConstants.STYLE_STROKE_OPACITY];
  189. }
  190. if (fillOpaq) shape.appendChild(createCellElem("FillForegndTrans", 1 - parseInt(fillOpaq)/100.0, xmlDoc));
  191. if (strkOpaq) shape.appendChild(createCellElem("LineColorTrans", 1 - parseInt(strkOpaq)/100.0, xmlDoc));
  192. var isDashed = state.style[mxConstants.STYLE_DASHED];
  193. if (isDashed == 1)
  194. {
  195. var dashPatrn = state.style[mxConstants.STYLE_DASH_PATTERN];
  196. var pattern = 9
  197. if (dashPatrn)
  198. {
  199. //We only support the patterns of draw.io UI
  200. switch(dashPatrn)
  201. {
  202. case "1 1":
  203. pattern = 10;
  204. break;
  205. case "1 2":
  206. pattern = 3;
  207. break;
  208. case "1 4":
  209. pattern = 17;
  210. break;
  211. }
  212. }
  213. shape.appendChild(createCellElem("LinePattern", pattern, xmlDoc));
  214. }
  215. var hasShadow = state.style[mxConstants.STYLE_SHADOW];
  216. if (hasShadow == 1)
  217. {
  218. shape.appendChild(createCellElem("ShdwPattern", 1, xmlDoc));
  219. shape.appendChild(createCellElem("ShdwForegnd", '#000000', xmlDoc));
  220. shape.appendChild(createCellElem("ShdwForegndTrans", 0.6, xmlDoc));
  221. shape.appendChild(createCellElem("ShapeShdwType", 1, xmlDoc));
  222. shape.appendChild(createCellElem("ShapeShdwOffsetX", '0.02946278254943948', xmlDoc));
  223. shape.appendChild(createCellElem("ShapeShdwOffsetY", '-0.02946278254943948', xmlDoc));
  224. shape.appendChild(createCellElem("ShapeShdwScaleFactor", '1', xmlDoc));
  225. shape.appendChild(createCellElem("ShapeShdwBlur", '0.05555555555555555', xmlDoc));
  226. shape.appendChild(createCellElem("ShapeShdwShow", 2, xmlDoc));
  227. }
  228. //Probably we don't need margins as the canvas get the modified position?
  229. /*
  230. var topMargin = state.style[mxConstants.STYLE_SPACING_TOP];
  231. if (topMargin) shape.appendChild(createCellElemScaled("TopMargin", parseFloat(topMargin) * 2 + 2.8 , xmlDoc));
  232. /* //Defines label bottom spacing
  233. double bottomMargin = getBottomSpacing() * 100/100;
  234. if (bottomMargin != 0)
  235. {
  236. styleMap.put(mxConstants.STYLE_SPACING_BOTTOM, Double.toString(bottomMargin));
  237. }
  238. //Defines label left spacing
  239. double leftMargin = getLeftSpacing() * 100/100;
  240. if (leftMargin != 0)
  241. {
  242. styleMap.put(mxConstants.STYLE_SPACING_LEFT, Double.toString(leftMargin));
  243. }
  244. //Defines label right spacing
  245. double rightMargin = getRightSpacing() * 100/100;
  246. if(rightMargin !=0)
  247. {
  248. styleMap.put(mxConstants.STYLE_SPACING_RIGHT, Double.toString(rightMargin));
  249. }*/
  250. //Direction is not clear that we need it
  251. /*
  252. var direction = state.style[mxConstants.STYLE_DIRECTION];
  253. if (direction != mxConstants.DIRECTION_EAST)
  254. {
  255. styleMap.put(mxConstants.STYLE_DIRECTION, direction);
  256. }
  257. */
  258. var flibX = state.style[mxConstants.STYLE_FLIPH];
  259. if (flibX == 1) shape.appendChild(createCellElem("FlipX", 1, xmlDoc));
  260. var flibY = state.style[mxConstants.STYLE_FLIPV];
  261. if (flibY == 1) shape.appendChild(createCellElem("FlipY", 1, xmlDoc));
  262. var rounded = state.style[mxConstants.STYLE_ROUNDED];
  263. if (rounded == 1) shape.appendChild(createCellElemScaled("Rounding", state.cell.geometry.width*0.1, xmlDoc));
  264. //TODO for some reason, visio doesn't show the label (text) background color!
  265. //May be we need mxSvgCanvas2D.prototype.addTextBackground = function(node, str, x, y, w, h, align, valign, overflow)
  266. var lbkgnd = state.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR];
  267. if (lbkgnd) shape.appendChild(createCellElem("TextBkgnd", lbkgnd, xmlDoc));
  268. };
  269. function createShape(id, geo, xmlDoc, parentHeight)
  270. {
  271. var shape = createElt(xmlDoc, that.XMLNS, "Shape");
  272. shape.setAttribute("ID", id);
  273. shape.setAttribute("NameU", "Shape" + id);
  274. shape.setAttribute("LineStyle", "0");
  275. shape.setAttribute("FillStyle", "0");
  276. shape.setAttribute("TextStyle", "0");
  277. var hw = geo.width/2, hh = geo.height/2;
  278. shape.appendChild(createCellElemScaled("PinX", geo.x + hw + vsdxCanvas.shiftX, xmlDoc));
  279. shape.appendChild(createCellElemScaled("PinY", parentHeight - geo.y - hh - vsdxCanvas.shiftY, xmlDoc));
  280. shape.appendChild(createCellElemScaled("Width", geo.width, xmlDoc));
  281. shape.appendChild(createCellElemScaled("Height", geo.height, xmlDoc));
  282. shape.appendChild(createCellElemScaled("LocPinX", hw, xmlDoc));
  283. shape.appendChild(createCellElemScaled("LocPinY", hh, xmlDoc));
  284. return shape;
  285. };
  286. function getArrowType(arrow, isFilled)
  287. {
  288. isFilled = isFilled == null? "1" : isFilled;
  289. arrow = arrow == null? "none" : arrow;
  290. var key = arrow + "|" + isFilled;
  291. var type = that.ARROWS_MAP[key];
  292. if (type != null)
  293. return type;
  294. else
  295. return 1;
  296. };
  297. function getArrowSize(size)
  298. {
  299. if (size == null) return 2;
  300. if (size <=2)
  301. return 0;
  302. else if (size <= 3)
  303. return 1;
  304. else if (size <= 5)
  305. return 2;
  306. else if (size <= 7)
  307. return 3;
  308. else if (size <= 9)
  309. return 4;
  310. else if (size <= 22)
  311. return 5;
  312. else
  313. return 6;
  314. };
  315. function createEdge(cell, graph, xmlDoc, parentHeight)
  316. {
  317. var state = graph.view.getState(cell);
  318. var shape = createElt(xmlDoc, that.XMLNS, "Shape");
  319. shape.setAttribute("ID", cell.id);
  320. shape.setAttribute("NameU", "Dynamic connector." + cell.id);
  321. shape.setAttribute("Name", "Dynamic connector." + cell.id);
  322. shape.setAttribute("Type", "Shape");
  323. shape.setAttribute("Master", "4"); //Dynamic Connector Master
  324. var s = vsdxCanvas.state;
  325. var points = state.absolutePoints;
  326. var bounds = state.cellBounds;
  327. var hw = bounds.width/2, hh = bounds.height/2;
  328. shape.appendChild(createCellElemScaled("PinX", bounds.x + hw, xmlDoc));
  329. shape.appendChild(createCellElemScaled("PinY", parentHeight - bounds.y - hh, xmlDoc));
  330. shape.appendChild(createCellElemScaled("Width", bounds.width, xmlDoc));
  331. shape.appendChild(createCellElemScaled("Height", bounds.height, xmlDoc));
  332. shape.appendChild(createCellElemScaled("LocPinX", hw, xmlDoc));
  333. shape.appendChild(createCellElemScaled("LocPinY", hh, xmlDoc));
  334. vsdxCanvas.newEdge(shape, state, xmlDoc);
  335. var calcVsdxPoint = function(p, noHeight)
  336. {
  337. var x = p.x, y = p.y;
  338. x = (x * s.scale - bounds.x + s.dx + vsdxCanvas.shiftX) ;
  339. y = ((noHeight? 0 : bounds.height) - y * s.scale + bounds.y - s.dy - vsdxCanvas.shiftY) ;
  340. return {x: x, y: y};
  341. };
  342. var p0 = calcVsdxPoint(points[0], true);
  343. //Formula is used to make the edge dynamic
  344. shape.appendChild(createCellElemScaled("BeginX", bounds.x + p0.x, xmlDoc, "_WALKGLUE(BegTrigger,EndTrigger,WalkPreference)"));
  345. shape.appendChild(createCellElemScaled("BeginY", parentHeight - bounds.y + p0.y, xmlDoc, "_WALKGLUE(BegTrigger,EndTrigger,WalkPreference)"));
  346. var pe = calcVsdxPoint(points[points.length - 1], true);
  347. //Formula is used to make the edge dynamic
  348. shape.appendChild(createCellElemScaled("EndX", bounds.x + pe.x, xmlDoc, "_WALKGLUE(EndTrigger,BegTrigger,WalkPreference)"));
  349. shape.appendChild(createCellElemScaled("EndY", parentHeight - bounds.y + pe.y, xmlDoc, "_WALKGLUE(EndTrigger,BegTrigger,WalkPreference)"));
  350. //Formula is used to make the edge dynamic (specify source id and target id)
  351. shape.appendChild(createCellElem("BegTrigger", "2", xmlDoc, cell.source? "_XFTRIGGER(Sheet."+ cell.source.id +"!EventXFMod)" : null));
  352. shape.appendChild(createCellElem("EndTrigger", "2", xmlDoc, cell.target? "_XFTRIGGER(Sheet."+ cell.target.id +"!EventXFMod)" : null));
  353. shape.appendChild(createCellElem("ConFixedCode", "6", xmlDoc));
  354. shape.appendChild(createCellElem("LayerMember", "0", xmlDoc));
  355. applyMxCellStyle(state, shape, xmlDoc);
  356. //Edge special styles
  357. var startFill = state.style[mxConstants.STYLE_STARTFILL];
  358. var startArrow = state.style[mxConstants.STYLE_STARTARROW];
  359. var startSize = state.style[mxConstants.STYLE_STARTSIZE];
  360. var type = getArrowType(startArrow, startFill);
  361. shape.appendChild(createCellElem("BeginArrow", type, xmlDoc));
  362. shape.appendChild(createCellElem("BeginArrowSize", getArrowSize(startSize), xmlDoc));
  363. var endFill = state.style[mxConstants.STYLE_ENDFILL];
  364. var endArrow = state.style[mxConstants.STYLE_ENDARROW];
  365. var endSize = state.style[mxConstants.STYLE_ENDSIZE];
  366. var type = getArrowType(endArrow, endFill);
  367. shape.appendChild(createCellElem("EndArrow", type, xmlDoc));
  368. shape.appendChild(createCellElem("EndArrowSize", getArrowSize(endSize), xmlDoc));
  369. //Draw text first to have its shape cell elements before visio geo.
  370. if (state.text != null && state.text.checkBounds())
  371. {
  372. vsdxCanvas.save();
  373. state.text.paint(vsdxCanvas);
  374. vsdxCanvas.restore();
  375. }
  376. var geoSec = createElt(xmlDoc, that.XMLNS, "Section");
  377. geoSec.setAttribute("N", "Geometry");
  378. geoSec.setAttribute("IX", "0");
  379. for (var i = 0; i < points.length; i++)
  380. {
  381. var p = calcVsdxPoint(points[i]);
  382. geoSec.appendChild(createRow(i==0 ? "MoveTo" : "LineTo", (i + 1), p.x, p.y, xmlDoc));
  383. }
  384. geoSec.appendChild(createCellElem("NoFill", "1", xmlDoc));
  385. geoSec.appendChild(createCellElem("NoLine", "0", xmlDoc));
  386. shape.appendChild(geoSec);
  387. return shape;
  388. };
  389. function convertMxCell2Shape(cell, graph, xmlDoc, parentHeight, parentGeo)
  390. {
  391. var geo = cell.geometry;
  392. if (geo != null)
  393. {
  394. //fix relative geo coordinates
  395. if (geo.relative && parentGeo)
  396. {
  397. geo = geo.clone();
  398. geo.x *= parentGeo.width;
  399. geo.y *= parentGeo.height;
  400. geo.relative = 0;
  401. }
  402. if (!cell.treatAsSingle && cell.getChildCount() > 0) //Group
  403. {
  404. //Create group shape as an empty shape with no geo
  405. var shape = createShape(cell.id+"10000", geo, xmlDoc, parentHeight);
  406. shape.setAttribute("Type", "Group");
  407. //Create group shape
  408. var gShapes = createElt(xmlDoc, that.XMLNS, "Shapes");
  409. //translate the canvas using the group coordinates
  410. vsdxCanvas.save();
  411. vsdxCanvas.translate(-geo.x, -geo.y);
  412. //Draw the actual group shape as a child (so change its geo coord to 0,0).
  413. // In mxGraph group shape can have styles and stencil
  414. var newGeo = geo.clone();
  415. newGeo.x = 0;
  416. newGeo.y = 0;
  417. cell.setGeometry(newGeo);
  418. cell.treatAsSingle = true;
  419. var subShape = convertMxCell2Shape(cell, graph, xmlDoc, geo.height, geo);
  420. cell.treatAsSingle = false;
  421. cell.setGeometry(geo);
  422. gShapes.appendChild(subShape);
  423. //add group children
  424. for (var i = 0; i < cell.children.length; i++)
  425. {
  426. var child = cell.children[i];
  427. var subShape = convertMxCell2Shape(child, graph, xmlDoc, geo.height, geo);
  428. gShapes.appendChild(subShape);
  429. }
  430. shape.appendChild(gShapes);
  431. //restore the canvas to before group translation
  432. vsdxCanvas.restore();
  433. return shape;
  434. }
  435. else if (cell.vertex)
  436. {
  437. var shape = createShape(cell.id, geo, xmlDoc, parentHeight);
  438. var state = graph.view.getState(cell);
  439. applyMxCellStyle(state, shape, xmlDoc);
  440. vsdxCanvas.newShape(shape, state, xmlDoc);
  441. //Draw text first to have its shape cell elements before visio geo.
  442. if (state.text != null && state.text.checkBounds())
  443. {
  444. vsdxCanvas.save();
  445. state.text.paint(vsdxCanvas);
  446. vsdxCanvas.restore();
  447. }
  448. if (state.shape != null && state.shape.checkBounds())
  449. {
  450. vsdxCanvas.save();
  451. state.shape.paint(vsdxCanvas);
  452. vsdxCanvas.restore();
  453. }
  454. shape.appendChild(vsdxCanvas.getShapeGeo());
  455. vsdxCanvas.endShape();
  456. shape.setAttribute("Type", vsdxCanvas.getShapeType());
  457. return shape;
  458. }
  459. else
  460. {
  461. return createEdge(cell, graph, xmlDoc, parentHeight);
  462. }
  463. }
  464. else
  465. {
  466. return null;
  467. }
  468. };
  469. function convertMxModel2Page(graph, modelAttrib)
  470. {
  471. var xmlDoc = mxUtils.createXmlDocument();
  472. var root = createElt(xmlDoc, that.XMLNS, "PageContents");
  473. // LATER: Fix NS1, NS2... namespaces in IE11-
  474. root.setAttribute("xmlns:r", that.XMLNS_R);
  475. root.setAttribute("xml:space", that.XML_SPACE);
  476. var shapes = createElt(xmlDoc, that.XMLNS, "Shapes");
  477. root.appendChild(shapes);
  478. var model = graph.model;
  479. var t = graph.view.translate;
  480. var s = graph.view.scale;
  481. var bounds = graph.getGraphBounds();
  482. vsdxCanvas.shiftX = 0; vsdxCanvas.shiftY = 0;
  483. //-ve pages
  484. if (bounds.x / s < t.x || bounds.y / s < t.y)
  485. {
  486. vsdxCanvas.shiftX = Math.ceil((t.x - bounds.x / s) / graph.pageFormat.width) * graph.pageFormat.width;
  487. vsdxCanvas.shiftY = Math.ceil((t.y - bounds.y / s) / graph.pageFormat.height) * graph.pageFormat.height;
  488. }
  489. vsdxCanvas.save();
  490. vsdxCanvas.translate(-t.x, -t.y);
  491. vsdxCanvas.scale(1 / s);
  492. vsdxCanvas.newPage();
  493. var defParent = graph.getDefaultParent();
  494. for (var id in model.cells)
  495. {
  496. var cell = model.cells[id];
  497. //top-most cells
  498. if (cell.parent == defParent)
  499. {
  500. var shape = convertMxCell2Shape(cell, graph, xmlDoc, modelAttrib.pageHeight);
  501. if (shape != null)
  502. shapes.appendChild(shape);
  503. }
  504. }
  505. var connects = createElt(xmlDoc, that.XMLNS, "Connects");
  506. root.appendChild(connects);
  507. //Second pass to add edges (connections)
  508. for (var id in model.cells)
  509. {
  510. var cell = model.cells[id];
  511. if (cell.edge)
  512. {
  513. if (cell.source)
  514. {
  515. var connect = createElt(xmlDoc, that.XMLNS, "Connect");
  516. connect.setAttribute("FromSheet", cell.id);
  517. connect.setAttribute("FromCell", "BeginX");
  518. connect.setAttribute("ToSheet", cell.source.id);
  519. connects.appendChild(connect);
  520. }
  521. if (cell.target)
  522. {
  523. var connect = createElt(xmlDoc, that.XMLNS, "Connect");
  524. connect.setAttribute("FromSheet", cell.id);
  525. connect.setAttribute("FromCell", "EndX");
  526. connect.setAttribute("ToSheet", cell.target.id);
  527. connects.appendChild(connect);
  528. }
  529. }
  530. }
  531. xmlDoc.appendChild(root);
  532. vsdxCanvas.restore();
  533. return xmlDoc;
  534. };
  535. function writeXmlDoc2Zip(zip, name, xmlDoc, noHeader)
  536. {
  537. zip.file(name, (noHeader? "" : "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>") + mxUtils.getXml(xmlDoc));
  538. };
  539. function addPagesXML(zip, pages, modelsAttr)
  540. {
  541. var pagesXmlDoc = mxUtils.createXmlDocument();
  542. var pagesRelsXmlDoc = mxUtils.createXmlDocument();
  543. var pagesRoot = createElt(pagesXmlDoc, that.XMLNS, "Pages");
  544. pagesRoot.setAttribute("xmlns:r", that.XMLNS_R);
  545. pagesRoot.setAttribute("xml:space", that.XML_SPACE);
  546. var pagesRelsRoot = createElt(pagesRelsXmlDoc, that.RELS_XMLNS, "Relationships");
  547. var i = 1;
  548. for (var name in pages)
  549. {
  550. var pageName = "page" + i + ".xml";
  551. var pageE = createElt(pagesXmlDoc, that.XMLNS, "Page");
  552. pageE.setAttribute("ID", i-1);
  553. pageE.setAttribute("NameU", name);
  554. pageE.setAttribute("Name", name);
  555. var pageSheet = createElt(pagesXmlDoc, that.XMLNS, "PageSheet");
  556. var modelAttr = modelsAttr[name];
  557. pageSheet.appendChild(createCellElemScaled("PageWidth", modelAttr['pageWidth'], pagesXmlDoc));
  558. pageSheet.appendChild(createCellElemScaled("PageHeight", modelAttr['pageHeight'], pagesXmlDoc));
  559. pageSheet.appendChild(createCellElem("PageScale", modelAttr['pageScale'], pagesXmlDoc));
  560. pageSheet.appendChild(createCellElem("DrawingScale", 1, pagesXmlDoc));
  561. var relE = createElt(pagesXmlDoc, "Rel");
  562. relE.setAttribute("r:id", "rId" + i);
  563. //Layer (not needed!, it works without it)
  564. var layerSec = createElt(pagesXmlDoc, that.XMLNS, "Section");
  565. layerSec.setAttribute("N", "Layer");
  566. var layerRow = createElt(pagesXmlDoc, that.XMLNS, "Row");
  567. layerRow.setAttribute("IX", "0");
  568. layerSec.appendChild(layerRow)
  569. layerRow.appendChild(createCellElem("Name", 'Connector', pagesXmlDoc));
  570. layerRow.appendChild(createCellElem("Color", '255', pagesXmlDoc));
  571. layerRow.appendChild(createCellElem("Status", '0', pagesXmlDoc));
  572. layerRow.appendChild(createCellElem("Visible", '1', pagesXmlDoc));
  573. layerRow.appendChild(createCellElem("Print", '1', pagesXmlDoc));
  574. layerRow.appendChild(createCellElem("Active", '0', pagesXmlDoc));
  575. layerRow.appendChild(createCellElem("Lock", '0', pagesXmlDoc));
  576. layerRow.appendChild(createCellElem("Snap", '1', pagesXmlDoc));
  577. layerRow.appendChild(createCellElem("Glue", '1', pagesXmlDoc));
  578. layerRow.appendChild(createCellElem("NameUniv", 'Connector', pagesXmlDoc));
  579. layerRow.appendChild(createCellElem("ColorTrans", '0', pagesXmlDoc));
  580. pageSheet.appendChild(layerSec);
  581. pageE.appendChild(pageSheet);
  582. pageE.appendChild(relE);
  583. pagesRoot.appendChild(pageE);
  584. var relationship = createElt(pagesRelsXmlDoc, that.RELS_XMLNS, "Relationship");
  585. relationship.setAttribute("Id", "rId" + i);
  586. relationship.setAttribute("Type", that.PAGES_TYPE);
  587. relationship.setAttribute("Target", pageName);
  588. pagesRelsRoot.appendChild(relationship);
  589. //Note:Each page rels is created with the skeleton as they are constants
  590. //write the page docs
  591. var xmlDoc = pages[name];
  592. writeXmlDoc2Zip(zip, that.VISIO_PAGES + pageName, xmlDoc);
  593. i++;
  594. }
  595. pagesXmlDoc.appendChild(pagesRoot);
  596. pagesRelsXmlDoc.appendChild(pagesRelsRoot);
  597. writeXmlDoc2Zip(zip, that.VISIO_PAGES + "pages.xml", pagesXmlDoc);
  598. writeXmlDoc2Zip(zip, that.VISIO_PAGES + "_rels/pages.xml.rels", pagesRelsXmlDoc);
  599. }
  600. function addImagesRels(zip, pIndex)
  601. {
  602. //create a new page rels file
  603. var fId = that.VISIO_PAGES_RELS + "page" + pIndex + ".xml.rels";
  604. var pageRelDoc = mxUtils.createXmlDocument();
  605. var relationships = createElt(pageRelDoc, that.RELS_XMLNS, "Relationships");
  606. //Add master relationship (rId1)
  607. var relationship = createElt(pageRelDoc, that.RELS_XMLNS, "Relationship");
  608. relationship.setAttribute("Type", "http://schemas.microsoft.com/visio/2010/relationships/master");
  609. relationship.setAttribute("Id", "rId1");
  610. relationship.setAttribute("Target", "../masters/master1.xml");
  611. relationships.appendChild(relationship);
  612. var imgs = vsdxCanvas.images;
  613. //create rels of image files
  614. if (imgs.length > 0)
  615. {
  616. for (var i = 0; i < imgs.length; i++)
  617. {
  618. var relationship = createElt(pageRelDoc, that.RELS_XMLNS, "Relationship");
  619. relationship.setAttribute("Type", that.XMLNS_R + "/image");
  620. relationship.setAttribute("Id", "rId" + (i+2));
  621. relationship.setAttribute("Target", "../media/" + imgs[i]);
  622. relationships.appendChild(relationship);
  623. }
  624. }
  625. pageRelDoc.appendChild(relationships);
  626. writeXmlDoc2Zip(zip, fId, pageRelDoc);
  627. };
  628. /**
  629. *
  630. * Convert current Editor UI pages into a vdsx file
  631. * @return true if successful, false otherwise
  632. */
  633. this.exportCurrentDiagrams = function ()
  634. {
  635. try
  636. {
  637. var zip = new JSZip();
  638. vsdxCanvas.init(zip);
  639. pages = {};
  640. modelsAttr = {};
  641. var pagesCount = editorUi.pages != null? editorUi.pages.length : 1;
  642. if (editorUi.pages != null)
  643. {
  644. var selectedCells = editorUi.editor.graph.getSelectionCells();
  645. var currentPage = editorUi.currentPage;
  646. for (var i=0; i < editorUi.pages.length; i++)
  647. {
  648. var page = editorUi.pages[i];
  649. if (editorUi.currentPage != page)
  650. {
  651. editorUi.selectPage(page);
  652. }
  653. var diagramName = page.getName();
  654. var graph = editorUi.editor.graph;
  655. var modelAttrib = getGraphAttributes(graph);
  656. pages[diagramName] = convertMxModel2Page(graph, modelAttrib);
  657. addImagesRels(zip, i+1);
  658. modelsAttr[diagramName] = modelAttrib;
  659. }
  660. if (currentPage != editorUi.currentPage)
  661. {
  662. editorUi.selectPage(currentPage);
  663. }
  664. editorUi.editor.graph.setSelectionCells(selectedCells);
  665. }
  666. else
  667. {
  668. var graph = editorUi.editor.graph;
  669. var modelAttrib = getGraphAttributes(graph);
  670. var diagramName = "Page1";
  671. pages[diagramName] = convertMxModel2Page(graph, modelAttrib);
  672. addImagesRels(zip, 1);
  673. modelsAttr[diagramName] = modelAttrib;
  674. }
  675. createVsdxSkeleton(zip, pagesCount);
  676. addPagesXML(zip, pages, modelsAttr);
  677. //wait until all media files are loaded
  678. var createZipFile = function()
  679. {
  680. if (vsdxCanvas.filesLoading > 0)
  681. {
  682. setTimeout(createZipFile, vsdxCanvas.filesLoading * 200);
  683. }
  684. else
  685. {
  686. zip.generateAsync({type:"base64"}).then(
  687. function(content)
  688. {
  689. var basename = editorUi.getBaseFilename();
  690. editorUi.saveData(basename+".vsdx", 'vsdx', content, 'application/vnd.visio2013', true);
  691. }
  692. );
  693. }
  694. };
  695. createZipFile();
  696. return true;
  697. }
  698. catch(e)
  699. {
  700. console.log(e);
  701. return false;
  702. }
  703. };
  704. }
  705. VsdxExport.prototype.CONVERSION_FACTOR = 40 * 2.54; //screenCoordinatesPerCm (40) x CENTIMETERS_PER_INCHES (2.54)
  706. VsdxExport.prototype.PAGES_TYPE = "http://schemas.microsoft.com/visio/2010/relationships/page";
  707. VsdxExport.prototype.RELS_XMLNS = "http://schemas.openxmlformats.org/package/2006/relationships";
  708. VsdxExport.prototype.XML_SPACE = "preserve";
  709. VsdxExport.prototype.XMLNS_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
  710. VsdxExport.prototype.XMLNS = "http://schemas.microsoft.com/office/visio/2012/main";
  711. VsdxExport.prototype.VISIO_PAGES = "visio/pages/";
  712. VsdxExport.prototype.PREFEX = "com/mxgraph/io/vsdx/resources/export/";
  713. VsdxExport.prototype.VSDX_ENC = "ISO-8859-1";
  714. VsdxExport.prototype.PART_NAME = "PartName";
  715. VsdxExport.prototype.CONTENT_TYPES_XML = "[Content_Types].xml";
  716. VsdxExport.prototype.VISIO_PAGES_RELS = "visio/pages/_rels/";
  717. VsdxExport.prototype.ARROWS_MAP = {
  718. "none|1": 0, "none|0": 0, "open|1": 1, "open|0": 1, "block|1": 4, "block|0": 14, "classic|1": 5, "classic|0": 17,
  719. "oval|1": 10, "oval|0": 20, "diamond|1": 11, "diamond|0": 22, "blockThin|1": 2, "blockThin|0": 15, "dash|1": 23, "dash|0": 23,
  720. "ERone|1": 24, "ERone|0": 24, "ERmandOne|1": 25, "ERmandOne|0": 25, "ERmany|1": 27, "ERmany|0": 27, "ERoneToMany|1": 28, "ERoneToMany|0": 28,
  721. "ERzeroToMany|1": 29, "ERzeroToMany|0": 29, "ERzeroToOne|1": 30, "ERzeroToOne|0": 30, "openAsync|1": 9, "openAsync|0": 9
  722. };