mxMockupiOS.js 200 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694
  1. /**
  2. * $Id: mxMockupiOS.js,v 1.5 2013/11/12 06:25:46 mate Exp $
  3. * Copyright (c) 2006-2010, JGraph Ltd
  4. */
  5. var mxMockupC =
  6. {
  7. BAR_HEIGHT : 'barHeight',
  8. BAR_POS : 'barPos',
  9. BG_STYLE : 'bgStyle',
  10. BG_FLAT_GREEN : 'bgGreen',
  11. BG_FLAT_WHITE : 'bgWhite',
  12. BG_FLAT_GRAY : 'bgGray',
  13. BG_FLAT_CUSTOM : 'bgFlat',
  14. BG_MAP : 'bgMap',
  15. BG_STRIPED : 'bgStriped',
  16. BUTTON_STYLE : 'buttonStyle',
  17. BUTTON_TEXT : 'buttonText',
  18. BUTTON_STATE : 'buttonState',
  19. CHEVRON : 'chevron',
  20. GRID_SIZE : 'gridSize',
  21. POINTER_BOTTOM : 'bottom',
  22. POINTER_POS : 'pointerPos',
  23. POINTER_TOP : 'top',
  24. ROUND : 'round',
  25. SELECTED : '+', //has to be one character long
  26. STATE_ON : 'on',
  27. STATE_OFF : 'off',
  28. SUB_TEXT : 'subText',
  29. SHAPE_IADD_ICON : 'mxgraph.ios.iAddIcon',
  30. SHAPE_IALERT_BOX : 'mxgraph.ios.iAlertBox',
  31. SHAPE_IALPHA_LIST : 'mxgraph.ios.iAlphaList',
  32. SHAPE_IAPP_BAR : 'mxgraph.ios.iAppBar',
  33. SHAPE_IARROW_ICON : 'mxgraph.ios.iArrowIcon',
  34. SHAPE_IBG_FLAT : 'mxgraph.ios.iBgFlat',
  35. SHAPE_IBG_MAP : 'mxgraph.ios.iBgMap',
  36. SHAPE_IBG_STRIPED : 'mxgraph.ios.iBgStriped',
  37. SHAPE_IBUTTON : 'mxgraph.ios.iButton',
  38. SHAPE_IBUTTON_BACK : 'mxgraph.ios.iButtonBack',
  39. SHAPE_IBUTTON_FORWARD : 'mxgraph.ios.iButtonFw',
  40. SHAPE_IBUTTON_BAR : 'mxgraph.ios.iButtonBar',
  41. SHAPE_ICALL_BUTTONS : 'mxgraph.ios.iCallButtons',
  42. SHAPE_ICALL_DIALOG : 'mxgraph.ios.iCallDialog',
  43. SHAPE_ICHECKBOX_GROUP : 'mxgraph.ios.iCheckboxGroup',
  44. SHAPE_ICHECK_ICON : 'mxgraph.ios.iCheckIcon',
  45. SHAPE_ICLOUD_PROGRESS_BAR : 'mxgraph.ios.iCloudProgressBar',
  46. SHAPE_ICOMBO_BOX : 'mxgraph.ios.iComboBox',
  47. SHAPE_ICOPY : 'mxgraph.ios.iCopy',
  48. SHAPE_ICOPY_AREA : 'mxgraph.ios.iCopyArea',
  49. SHAPE_IICON_GRID : 'mxgraph.ios.iIconGrid',
  50. SHAPE_IDELETE_APP : 'mxgraph.ios.iDeleteApp',
  51. SHAPE_IDELETE_ICON : 'mxgraph.ios.iDeleteIcon',
  52. SHAPE_IDOWNLOAD_BAR : 'mxgraph.ios.iDownloadBar',
  53. SHAPE_IDIALOG_BOX : 'mxgraph.ios.iDialogBox',
  54. SHAPE_IDIRECTION : 'mxgraph.ios.iDir',
  55. SHAPE_IHOME_PAGE_CONTROL : 'mxgraph.ios.iHomePageControl',
  56. SHAPE_IKEYB_LETTERS : 'mxgraph.ios.iKeybLett',
  57. SHAPE_IKEYB_NUMBERS : 'mxgraph.ios.iKeybNumb',
  58. SHAPE_IKEYB_SYMBOLS : 'mxgraph.ios.iKeybSymb',
  59. SHAPE_ILOCATION_BAR : 'mxgraph.ios.iLocBar',
  60. SHAPE_ILOCK_BUTTON : 'mxgraph.ios.iLockButton',
  61. SHAPE_IHOR_BUTTON_BAR : 'mxgraph.ios.iHorButtonBar',
  62. SHAPE_IINFO_ICON : 'mxgraph.ios.iInfoIcon',
  63. SHAPE_ION_OFF_BUTTON : 'mxgraph.ios.iOnOffButton',
  64. SHAPE_IOPTION : 'mxgraph.ios.iOption',
  65. SHAPE_IPAGE_CONTROL : 'mxgraph.ios.iPageControl',
  66. SHAPE_IPAD : 'mxgraph.ios.iPad',
  67. SHAPE_IPHONE : 'mxgraph.ios.iPhone',
  68. SHAPE_IPIN : 'mxgraph.ios.iPin',
  69. SHAPE_IPREV_NEXT : 'mxgraph.ios.iPrevNext',
  70. SHAPE_IPROGRESS_BAR : 'mxgraph.ios.iProgressBar',
  71. SHAPE_IRADIO_GROUP : 'mxgraph.ios.iRadioGroup',
  72. SHAPE_ISLIDER : 'mxgraph.ios.iSlider',
  73. SHAPE_ISORT_FIND_ICON : 'mxgraph.ios.iSortFindIcon',
  74. SHAPE_ITEXT_INPUT : 'mxgraph.ios.iTextInput',
  75. SHAPE_ITOP_BAR : 'mxgraph.ios.iTopBar',
  76. SHAPE_ITOP_BAR_LOCKED : 'mxgraph.ios.iTopBarLocked',
  77. SHAPE_IURL_BAR : 'mxgraph.ios.iURLBar',
  78. SHAPE_IVIDEO_CONTROLS : 'mxgraph.ios.iVideoControls',
  79. SHAPE_ISCREEN_NAME_BAR: 'mxgraph.ios.iScreenNameBar',
  80. STYLE_FILLCOLOR2 : 'fillColor2',
  81. STYLE_FILLCOLOR3 : 'fillColor3',
  82. STYLE_TEXTCOLOR : 'textColor',
  83. STYLE_TEXTCOLOR2 : 'textColor2',
  84. STYLE_STROKECOLOR2 : 'strokeColor2',
  85. STYLE_STROKECOLOR3 : 'strokeColor3'
  86. };
  87. //**********************************************************************************************************************************************************
  88. //iPhone Vertical
  89. //**********************************************************************************************************************************************************
  90. /**
  91. * Extends mxShape.
  92. */
  93. function mxShapeMockupiPhone(bounds, fill, stroke, strokewidth)
  94. {
  95. mxShape.call(this);
  96. this.bounds = bounds;
  97. this.fill = fill;
  98. this.stroke = stroke;
  99. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  100. };
  101. /**
  102. * Extends mxShape.
  103. */
  104. mxUtils.extend(mxShapeMockupiPhone, mxShape);
  105. mxShapeMockupiPhone.prototype.customProperties = [
  106. {name: 'bgStyle', dispName: 'Background', type: 'enum',
  107. enumList: [{val: 'bgGreen', dispName: 'Green'},
  108. {val: 'bgWhite', dispName: 'White'},
  109. {val: 'bgGray', dispName: 'Gray'},
  110. {val: 'bgFlat', dispName: 'Flat'},
  111. {val: 'bgMap', dispName: 'Map'},
  112. {val: 'bgStriped', dispName: 'Striped'}]}
  113. ];
  114. /**
  115. * Function: paintVertexShape
  116. *
  117. * Paints the vertex shape.
  118. */
  119. mxShapeMockupiPhone.prototype.paintVertexShape = function(c, x, y, w, h)
  120. {
  121. c.translate(x, y);
  122. var rSize = w < 100 ? 4 : 25;
  123. this.background(c, x, y, w, h, rSize);
  124. c.setShadow(false);
  125. this.foreground(c, x, y, w, h, rSize);
  126. };
  127. mxShapeMockupiPhone.prototype.background = function(c, x, y, w, h, rSize)
  128. {
  129. c.setFillColor('#000000');
  130. c.setStrokeColor('#000000');
  131. c.roundrect(0, 0, w, h, rSize, rSize);
  132. c.fillAndStroke();
  133. };
  134. mxShapeMockupiPhone.prototype.foreground = function(c, x, y, w, h, rSize)
  135. {
  136. c.setStrokeWidth(1.5);
  137. c.begin();
  138. c.setGradient('#808080', '#000000', w * 0.325, 0, w * 0.675, h * 0.5, mxConstants.DIRECTION_SOUTH, 1, 1);
  139. c.moveTo(w * 0.325, 0);
  140. c.lineTo(w - rSize, 0);
  141. c.arcTo(rSize, rSize, 0, 0, 1, w, rSize);
  142. c.lineTo(w, h * 0.5);
  143. c.lineTo(w * 0.7, h * 0.5);
  144. c.close();
  145. c.fill();
  146. var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '');
  147. var bgStyle = mxUtils.getValue(this.style, mxMockupC.BG_STYLE, mxMockupC.BG_FLAT_GREEN);
  148. c.setStrokeWidth(1);
  149. if (bgStyle === mxMockupC.BG_FLAT_WHITE)
  150. {
  151. c.setFillColor('#ffffff');
  152. c.rect(w * 0.0625, h * 0.15, w * 0.875, h * 0.7);
  153. c.fill();
  154. }
  155. else if (bgStyle === mxMockupC.BG_FLAT_GREEN)
  156. {
  157. c.setFillColor('#1f2923');
  158. c.rect(w * 0.0625, h * 0.15, w * 0.875, h * 0.7);
  159. c.fill();
  160. }
  161. else if (bgStyle === mxMockupC.BG_FLAT_GRAY)
  162. {
  163. c.setFillColor('#dddddd');
  164. c.rect(w * 0.0625, h * 0.15, w * 0.875, h * 0.7);
  165. c.fill();
  166. }
  167. else if (bgStyle === mxMockupC.BG_FLAT_CUSTOM)
  168. {
  169. c.setFillColor(fillColor);
  170. c.rect(w * 0.0625, h * 0.15, w * 0.875, h * 0.7);
  171. c.fill();
  172. }
  173. else if (bgStyle === mxMockupC.BG_STRIPED)
  174. {
  175. var xOld = x;
  176. var yOld = y;
  177. var wOld = w;
  178. var hOld = h;
  179. c.translate(w * 0.0625, h * 0.15);
  180. w = w * 0.875;
  181. h = h * 0.7;
  182. c.setFillColor('#5D7585');
  183. c.rect(0, 0, w, h);
  184. c.fillAndStroke();
  185. var strokeColor = '#18211b';
  186. var strokeColor2 = '#657E8F';
  187. c.setStrokeColor(strokeColor2);
  188. var i = 5;
  189. c.begin();
  190. while (i < w)
  191. {
  192. c.moveTo(i, 0);
  193. c.lineTo(i, h);
  194. i = i + 5;
  195. }
  196. c.stroke();
  197. c.setStrokeColor(strokeColor);
  198. c.begin();
  199. c.rect(0, 0, w, h);
  200. c.stroke();
  201. w = wOld;
  202. h = hOld;
  203. c.translate( - w * 0.0625, - h * 0.15);
  204. }
  205. else if (bgStyle === mxMockupC.BG_MAP)
  206. {
  207. var xOld = x;
  208. var yOld = y;
  209. var wOld = w;
  210. var hOld = h;
  211. c.translate(w * 0.0625, h * 0.15);
  212. w = w * 0.875;
  213. h = h * 0.7;
  214. c.setFillColor('#ffffff');
  215. c.rect(0, 0, w, h);
  216. c.fillAndStroke();
  217. var fillColor2 = '#96D1FF';
  218. var strokeColor = '#18211b';
  219. var strokeColor2 = '#008cff';
  220. c.setFillColor(fillColor2);
  221. c.setStrokeColor(strokeColor2);
  222. c.setStrokeWidth(1);
  223. c.begin();
  224. c.moveTo(0, 0);
  225. c.lineTo(w * 0.1171, 0);
  226. c.lineTo(w * 0.1136, h * 0.0438);
  227. c.lineTo(w * 0.0993, h * 0.054);
  228. c.lineTo(0, h * 0.0446);
  229. c.close();
  230. c.fillAndStroke();
  231. c.begin();
  232. c.moveTo(w * 0.1993, 0);
  233. c.lineTo(w * 0.1914, h * 0.03884);
  234. c.lineTo(w * 0.1536, h * 0.0362);
  235. c.lineTo(w * 0.1586, 0);
  236. c.close();
  237. c.fillAndStroke();
  238. c.begin();
  239. c.moveTo(w * 0.24, 0);
  240. c.lineTo(w * 0.2257, h * 0.054);
  241. c.lineTo(w * 0.2414, h * 0.0674);
  242. c.lineTo(w * 0.4707, h * 0.0835);
  243. c.lineTo(w * 0.5264, h * 0.0906);
  244. c.lineTo(w * 0.6429, h * 0.0929);
  245. c.arcTo(w * 0.0857, h * 0.0536, 0, 0, 0, w * 0.7193, h * 0.0621);
  246. c.arcTo(w * 0.48, h * 0.2143, 0, 0, 0, w * 0.7286, 0);
  247. c.close();
  248. c.fillAndStroke();
  249. c.begin();
  250. c.moveTo(w * 0.8, 0);
  251. c.lineTo(w * 0.7886, h * 0.04554);
  252. c.arcTo(w * 0.0857, h * 0.0536, 0, 0, 0, w * 0.8164, h * 0.0875);
  253. c.arcTo(w * 0.1429, h * 0.0893, 0, 0, 0, w * 0.88, h * 0.1036);
  254. c.lineTo(w, h * 0.1112);
  255. c.lineTo(w, 0);
  256. c.close();
  257. c.fillAndStroke();
  258. c.begin();
  259. c.moveTo(0, h * 0.0933);
  260. c.lineTo(w * 0.08, h * 0.1036);
  261. c.lineTo(w * 0.1021, h * 0.1246);
  262. c.lineTo(w * 0.1007, h * 0.1768);
  263. c.lineTo(w * 0.0471, h * 0.2241);
  264. c.lineTo(0, h * 0.2527);
  265. c.close();
  266. c.fillAndStroke();
  267. c.ellipse(w * 0.1214, h * 0.0603, w * 0.0843, h * 0.0576);
  268. c.fillAndStroke();
  269. c.begin();
  270. c.moveTo(w * 0.1293, h * 0.1924);
  271. c.lineTo(w * 0.1729, h * 0.142);
  272. c.lineTo(w * 0.1407, h * 0.1411);
  273. c.lineTo(w * 0.14, h * 0.1777);
  274. c.close();
  275. c.fillAndStroke();
  276. c.begin();
  277. c.moveTo(w * 0.4586, h * 0.1241);
  278. c.lineTo(w * 0.455, h * 0.1835);
  279. c.lineTo(w * 0.3893, h * 0.2246);
  280. c.lineTo(w * 0.2171, h * 0.1362);
  281. c.lineTo(w * 0.2171, h * 0.1308);
  282. c.lineTo(w * 0.2293, h * 0.1214);
  283. c.lineTo(w * 0.2857, h * 0.1174);
  284. c.close();
  285. c.fillAndStroke();
  286. c.begin();
  287. c.moveTo(w * 0.5079, h * 0.1134);
  288. c.lineTo(w * 0.7307, h * 0.1223);
  289. c.lineTo(w * 0.7279, h * 0.1625);
  290. c.lineTo(w * 0.715, h * 0.1772);
  291. c.lineTo(w * 0.6929, h * 0.1688);
  292. c.lineTo(w * 0.625, h * 0.1795);
  293. c.lineTo(w * 0.4779, h * 0.2835);
  294. c.lineTo(w * 0.395, h * 0.2299);
  295. c.lineTo(w * 0.4657, h * 0.1826);
  296. c.lineTo(w * 0.4707, h * 0.1223);
  297. c.close();
  298. c.fillAndStroke();
  299. c.begin();
  300. c.moveTo(w, h * 0.1362);
  301. c.lineTo(w * 0.7643, h * 0.1237);
  302. c.lineTo(w * 0.7543, h * 0.1562);
  303. c.lineTo(w * 0.7643, h * 0.1585);
  304. c.lineTo(w * 0.9186, h * 0.2366);
  305. c.lineTo(w, h * 0.1732);
  306. c.close();
  307. c.fillAndStroke();
  308. c.begin();
  309. c.moveTo(w * 0.2079, h * 0.1545);
  310. c.lineTo(w * 0.3886, h * 0.2536);
  311. c.lineTo(w * 0.3414, h * 0.2933);
  312. c.lineTo(w * 0.1743, h * 0.1969);
  313. c.close();
  314. c.fillAndStroke();
  315. c.begin();
  316. c.moveTo(w * 0.1579, h * 0.2134);
  317. c.lineTo(w * 0.3221, h * 0.3067);
  318. c.lineTo(w * 0.2957, h * 0.3237);
  319. c.lineTo(w * 0.1157, h * 0.2424);
  320. c.close();
  321. c.fillAndStroke();
  322. c.begin();
  323. c.moveTo(w * 0.405, h * 0.2656);
  324. c.lineTo(w * 0.31, h * 0.3353);
  325. c.lineTo(w * 0.3693, h * 0.3661);
  326. c.lineTo(w * 0.4571, h * 0.2982);
  327. c.close();
  328. c.fillAndStroke();
  329. c.begin();
  330. c.moveTo(w * 0.7121, h * 0.1848);
  331. c.lineTo(w * 0.6879, h * 0.1754);
  332. c.lineTo(w * 0.6329, h * 0.1844);
  333. c.lineTo(w * 0.61, h * 0.2018);
  334. c.lineTo(w * 0.6207, h * 0.2085);
  335. c.lineTo(w * 0.4986, h * 0.2982);
  336. c.lineTo(w * 0.535, h * 0.3237);
  337. c.close();
  338. c.fillAndStroke();
  339. c.begin();
  340. c.moveTo(w * 0.5557, h * 0.3379);
  341. c.lineTo(w * 0.7464, h * 0.1826);
  342. c.lineTo(w * 0.8036, h * 0.2076);
  343. c.lineTo(w * 0.595, h * 0.3616);
  344. c.close();
  345. c.fillAndStroke();
  346. c.begin();
  347. c.moveTo(w * 0.8293, h * 0.2188);
  348. c.lineTo(w * 0.8979, h * 0.2509);
  349. c.lineTo(w * 0.6936, h * 0.4125);
  350. c.lineTo(w * 0.6171, h * 0.3737);
  351. c.close();
  352. c.fillAndStroke();
  353. c.begin();
  354. c.moveTo(w, h * 0.2138);
  355. c.lineTo(w * 0.6821, h * 0.4603);
  356. c.lineTo(w * 0.815, h * 0.5277);
  357. c.lineTo(w, h * 0.4);
  358. c.close();
  359. c.fillAndStroke();
  360. c.begin();
  361. c.moveTo(0, h * 0.317);
  362. c.lineTo(w * 0.0971, h * 0.2554);
  363. c.lineTo(w * 0.4121, h * 0.4143);
  364. c.lineTo(w * 0.3736, h * 0.4415);
  365. c.lineTo(w * 0.315, h * 0.4076);
  366. c.lineTo(w * 0.3093, h * 0.4116);
  367. c.lineTo(w * 0.3686, h * 0.4455);
  368. c.lineTo(w * 0.285, h * 0.5045);
  369. c.lineTo(w * 0.1114, h * 0.4134);
  370. c.lineTo(w * 0.025, h * 0.4603);
  371. c.lineTo(w * 0.0371, h * 0.4723);
  372. c.lineTo(w * 0.1114, h * 0.4371);
  373. c.lineTo(w * 0.2871, h * 0.5312);
  374. c.lineTo(w * 0.1929, h * 0.6058);
  375. c.lineTo(w * 0.2271, h * 0.6705);
  376. c.lineTo(w * 0.17, h * 0.7147);
  377. c.lineTo(w * 0.0314, h * 0.6321);
  378. c.lineTo(0, h * 0.6246);
  379. c.close();
  380. c.fillAndStroke();
  381. c.begin();
  382. c.moveTo(w * 0.48, h * 0.3121);
  383. c.lineTo(w * 0.5157, h * 0.3375);
  384. c.lineTo(w * 0.4314, h * 0.3982);
  385. c.lineTo(w * 0.3929, h * 0.3786);
  386. c.close();
  387. c.fillAndStroke();
  388. c.begin();
  389. c.moveTo(w * 0.3086, h * 0.5179);
  390. c.lineTo(w * 0.53, h * 0.3518);
  391. c.lineTo(w * 0.5757, h * 0.3745);
  392. c.lineTo(w * 0.3479, h * 0.5411);
  393. c.close();
  394. c.fillAndStroke();
  395. c.begin();
  396. c.moveTo(w * 0.5964, h * 0.3884);
  397. c.lineTo(w * 0.6736, h * 0.4277);
  398. c.lineTo(w * 0.445, h * 0.5991);
  399. c.lineTo(w * 0.3664, h * 0.5531);
  400. c.lineTo(w * 0.5057, h * 0.4545);
  401. c.lineTo(w * 0.5507, h * 0.4754);
  402. c.lineTo(w * 0.5571, h * 0.4723);
  403. c.lineTo(w * 0.5114, h * 0.4504);
  404. c.close();
  405. c.fillAndStroke();
  406. c.begin();
  407. c.moveTo(w * 0.4793, h * 0.6161);
  408. c.lineTo(w * 0.6771, h * 0.4643);
  409. c.lineTo(w * 0.8086, h * 0.5326);
  410. c.lineTo(w * 0.7471, h * 0.5817);
  411. c.lineTo(w * 0.7214, h * 0.567);
  412. c.lineTo(w * 0.715, h * 0.571);
  413. c.lineTo(w * 0.7421, h * 0.5871);
  414. c.lineTo(w * 0.6014, h * 0.6933);
  415. c.close();
  416. c.fillAndStroke();
  417. c.begin();
  418. c.moveTo(w, h * 0.4371);
  419. c.lineTo(w * 0.8443, h * 0.546);
  420. c.lineTo(w * 0.9071, h * 0.5701);
  421. c.lineTo(w, h * 0.5022);
  422. c.close();
  423. c.fillAndStroke();
  424. c.begin();
  425. c.moveTo(w * 0.8407, h * 0.5504);
  426. c.lineTo(w * 0.8993, h * 0.5759);
  427. c.lineTo(w * 0.6757, h * 0.7416);
  428. c.lineTo(w * 0.6286, h * 0.7139);
  429. c.close();
  430. c.fillAndStroke();
  431. c.begin();
  432. c.moveTo(w, h * 0.5321);
  433. c.lineTo(w * 0.6979, h * 0.7549);
  434. c.lineTo(w * 0.7457, h * 0.7781);
  435. c.lineTo(w * 0.9814, h * 0.6094);
  436. c.lineTo(w, h * 0.6067);
  437. c.close();
  438. c.fillAndStroke();
  439. c.begin();
  440. c.moveTo(w, h * 0.6254);
  441. c.lineTo(w * 0.7664, h * 0.792);
  442. c.lineTo(w * 0.9586, h * 0.9062);
  443. c.lineTo(w, h * 0.8786);
  444. c.close();
  445. c.fillAndStroke();
  446. c.begin();
  447. c.moveTo(w * 0.3093, h * 0.5464);
  448. c.lineTo(w * 0.4271, h * 0.6152);
  449. c.lineTo(w * 0.245, h * 0.7643);
  450. c.lineTo(w * 0.185, h * 0.7228);
  451. c.lineTo(w * 0.2493, h * 0.6728);
  452. c.lineTo(w * 0.2214, h * 0.6143);
  453. c.close();
  454. c.fillAndStroke();
  455. c.begin();
  456. c.moveTo(0, h * 0.65);
  457. c.lineTo(w * 0.2179, h * 0.7826);
  458. c.lineTo(w * 0.1136, h * 0.8424);
  459. c.close();
  460. c.fillAndStroke();
  461. c.begin();
  462. c.moveTo(0, h * 0.7272);
  463. c.lineTo(w * 0.0821, h * 0.859);
  464. c.lineTo(0, h * 0.9085);
  465. c.close();
  466. c.fillAndStroke();
  467. c.begin();
  468. c.moveTo(w * 0.4529, h * 0.6366);
  469. c.lineTo(w * 0.575, h * 0.7143);
  470. c.lineTo(w * 0.39, h * 0.8621);
  471. c.lineTo(w * 0.2657, h * 0.7902);
  472. c.close();
  473. c.fillAndStroke();
  474. c.begin();
  475. c.moveTo(0, h * 0.9415);
  476. c.lineTo(w * 0.1036, h * 0.8821);
  477. c.lineTo(w * 0.2343, h * 0.959);
  478. c.lineTo(w * 0.1721, h);
  479. c.lineTo(0, h);
  480. c.close();
  481. c.fillAndStroke();
  482. c.begin();
  483. c.moveTo(w * 0.2586, h * 0.7951);
  484. c.lineTo(w * 0.3829, h * 0.8674);
  485. c.lineTo(w * 0.2543, h * 0.9451);
  486. c.lineTo(w * 0.1279, h * 0.8692);
  487. c.close();
  488. c.fillAndStroke();
  489. c.begin();
  490. c.moveTo(w * 0.2836, h * 0.9639);
  491. c.lineTo(w * 0.4207, h * 0.8772);
  492. c.lineTo(w * 0.605, h * 0.7321);
  493. c.lineTo(w * 0.6521, h * 0.7634);
  494. c.lineTo(w * 0.3486, h);
  495. c.lineTo(w * 0.3393, h);
  496. c.close();
  497. c.fillAndStroke();
  498. c.begin();
  499. c.moveTo(w * 0.3879, h);
  500. c.lineTo(w * 0.6721, h * 0.7759);
  501. c.lineTo(w * 0.7171, h * 0.7982);
  502. c.lineTo(w * 0.4564, h);
  503. c.close();
  504. c.fillAndStroke();
  505. c.begin();
  506. c.moveTo(w * 0.4986, h);
  507. c.lineTo(w * 0.7386, h * 0.8125);
  508. c.lineTo(w * 0.9307, h * 0.925);
  509. c.lineTo(w * 0.8264, h);
  510. c.close();
  511. c.fillAndStroke();
  512. c.begin();
  513. c.moveTo(w * 0.8671, h);
  514. c.lineTo(w * 0.9464, h * 0.9491);
  515. c.lineTo(w, h * 0.975);
  516. c.lineTo(w, h);
  517. c.close();
  518. c.fillAndStroke();
  519. c.begin();
  520. c.moveTo(w * 0.2295, h);
  521. c.lineTo(w * 0.2648, h * 0.9792);
  522. c.lineTo(w * 0.2981, h);
  523. c.close();
  524. c.fillAndStroke();
  525. w = wOld;
  526. h = hOld;
  527. c.translate( - w * 0.0625, - h * 0.15);
  528. }
  529. c.setStrokeWidth(1);
  530. c.setStrokeColor('#18211b');
  531. c.rect(w * 0.0625, h * 0.15, w * 0.875, h * 0.7);
  532. c.stroke();
  533. c.setStrokeWidth(1.5);
  534. c.setAlpha(0.8);
  535. c.setStrokeColor('#dddddd');
  536. c.roundrect(0, 0, w, h, rSize, rSize);
  537. c.stroke();
  538. if (w > 50)
  539. {
  540. rSize = w < 100? 3 : 22.5;
  541. c.begin();
  542. c.setStrokeColor('#666666');
  543. c.roundrect(5, 5, w - 10, h - 10, rSize, rSize);
  544. c.stroke();
  545. }
  546. c.setAlpha(1);
  547. c.ellipse(w * 0.4875, h * 0.04125, w * 0.025, h * 0.0125);
  548. c.setStrokeWidth(2.5);
  549. c.setStrokeColor('#000000');
  550. c.setFillColor('#000099');
  551. c.fillAndStroke();
  552. c.begin();
  553. c.setStrokeWidth(1.5);
  554. c.setFillColor('#444444');
  555. c.setStrokeColor('#333333');
  556. rSize = 4;
  557. c.roundrect(w * 0.375, h * 0.075, w * 0.25, h * 0.01875, w * 0.02, h * 0.01);
  558. c.fillAndStroke();
  559. c.setGradient('#bbbbbb', '#000000', w * 0.4, h * 0.875, w * 0.2, h * 0.1, mxConstants.DIRECTION_SOUTH, 1, 1);
  560. c.ellipse(w * 0.4, h * 0.875, w * 0.2, h * 0.1);
  561. c.fill();
  562. c.setAlpha(0.5);
  563. c.ellipse(w * 0.404, h * 0.876, w * 0.19, h * 0.095);
  564. c.stroke();
  565. c.begin();
  566. c.setAlpha(0.85);
  567. c.setFillColor('#000000');
  568. c.moveTo(w * 0.4025, h * 0.925);
  569. c.arcTo(w * 0.0975, h * 0.04625, 0, 0, 1, w * 0.5975, h * 0.925);
  570. c.arcTo(w * 0.2, h * 0.1, 0, 0, 1, w * 0.4025, h * 0.925);
  571. c.close();
  572. c.fillAndStroke();
  573. c.begin();
  574. c.setAlpha(0.7);
  575. c.setStrokeWidth(1.5);
  576. c.setStrokeColor('#dddddd');
  577. rSize = 4;
  578. c.roundrect(w * 0.4575, h * 0.905, w * 0.0875, h * 0.04375, h * 0.00625, h * 0.00625);
  579. c.stroke();
  580. };
  581. mxCellRenderer.registerShape(mxMockupC.SHAPE_IPHONE, mxShapeMockupiPhone);
  582. //**********************************************************************************************************************************************************
  583. //iPhone flat colored background
  584. //**********************************************************************************************************************************************************
  585. /**
  586. * Extends mxShape.
  587. */
  588. function mxShapeMockupiBgFlat(bounds, fill, stroke, strokewidth)
  589. {
  590. mxShape.call(this);
  591. this.bounds = bounds;
  592. this.fill = fill;
  593. this.stroke = stroke;
  594. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  595. };
  596. /**
  597. * Extends mxShape.
  598. */
  599. mxUtils.extend(mxShapeMockupiBgFlat, mxShape);
  600. /**
  601. * Function: paintVertexShape
  602. *
  603. * Paints the vertex shape.
  604. */
  605. mxShapeMockupiBgFlat.prototype.paintVertexShape = function(c, x, y, w, h)
  606. {
  607. c.translate(x, y);
  608. this.background(c, x, y, w, h);
  609. };
  610. mxShapeMockupiBgFlat.prototype.background = function(c, x, y, w, h)
  611. {
  612. c.begin();
  613. c.rect(0, 0, w, h);
  614. c.fillAndStroke();
  615. };
  616. mxCellRenderer.registerShape(mxMockupC.SHAPE_IBG_FLAT, mxShapeMockupiBgFlat);
  617. //**********************************************************************************************************************************************************
  618. //iPhone striped background
  619. //**********************************************************************************************************************************************************
  620. /**
  621. * Extends mxShape.
  622. */
  623. function mxShapeMockupiBgStriped(bounds, fill, stroke, strokewidth)
  624. {
  625. mxShape.call(this);
  626. this.bounds = bounds;
  627. this.fill = fill;
  628. this.stroke = stroke;
  629. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  630. };
  631. /**
  632. * Extends mxShape.
  633. */
  634. mxUtils.extend(mxShapeMockupiBgStriped, mxShape);
  635. /**
  636. * Function: paintVertexShape
  637. *
  638. * Paints the vertex shape.
  639. */
  640. mxShapeMockupiBgStriped.prototype.paintVertexShape = function(c, x, y, w, h)
  641. {
  642. c.translate(x, y);
  643. this.background(c, x, y, w, h);
  644. c.setShadow(false);
  645. this.foreground(c, x, y, w, h);
  646. };
  647. mxShapeMockupiBgStriped.prototype.background = function(c, x, y, w, h)
  648. {
  649. c.setStrokeWidth(1);
  650. c.begin();
  651. c.rect(0, 0, w, h);
  652. c.fillAndStroke();
  653. };
  654. mxShapeMockupiBgStriped.prototype.foreground = function(c, x, y, w, h)
  655. {
  656. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '');
  657. var strokeColor2 = mxUtils.getValue(this.style, mxMockupC.STYLE_STROKECOLOR2, '');
  658. c.setStrokeColor(strokeColor2);
  659. var i = 5;
  660. c.begin();
  661. while (i < w)
  662. {
  663. c.moveTo(i, 0);
  664. c.lineTo(i, h);
  665. i = i + 5;
  666. }
  667. c.stroke();
  668. c.setStrokeColor(strokeColor);
  669. c.begin();
  670. c.rect(0, 0, w, h);
  671. c.stroke();
  672. };
  673. mxCellRenderer.registerShape(mxMockupC.SHAPE_IBG_STRIPED, mxShapeMockupiBgStriped);
  674. //**********************************************************************************************************************************************************
  675. //iPhone map background
  676. //**********************************************************************************************************************************************************
  677. /**
  678. * Extends mxShape.
  679. */
  680. function mxShapeMockupiBgMap(bounds, fill, stroke, strokewidth)
  681. {
  682. mxShape.call(this);
  683. this.bounds = bounds;
  684. this.fill = fill;
  685. this.stroke = stroke;
  686. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  687. };
  688. /**
  689. * Extends mxShape.
  690. */
  691. mxUtils.extend(mxShapeMockupiBgMap, mxShape);
  692. /**
  693. * Function: paintVertexShape
  694. *
  695. * Paints the vertex shape.
  696. */
  697. mxShapeMockupiBgMap.prototype.paintVertexShape = function(c, x, y, w, h)
  698. {
  699. c.translate(x, y);
  700. this.background(c, x, y, w, h);
  701. c.setShadow(false);
  702. this.foreground(c, x, y, w, h);
  703. };
  704. mxShapeMockupiBgMap.prototype.background = function(c, x, y, w, h)
  705. {
  706. c.begin();
  707. c.rect(0, 0, w, h);
  708. c.fillAndStroke();
  709. };
  710. mxShapeMockupiBgMap.prototype.foreground = function(c, x, y, w, h)
  711. {
  712. var fillColor2 = mxUtils.getValue(this.style, mxMockupC.STYLE_FILLCOLOR2, '');
  713. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '');
  714. var strokeColor2 = mxUtils.getValue(this.style, mxMockupC.STYLE_STROKECOLOR2, '');
  715. c.setFillColor(fillColor2);
  716. c.setStrokeColor(strokeColor2);
  717. c.setStrokeWidth(0.5);
  718. c.begin();
  719. c.moveTo(0, 0);
  720. c.lineTo(w * 0.1171, 0);
  721. c.lineTo(w * 0.1136, h * 0.0438);
  722. c.lineTo(w * 0.0993, h * 0.054);
  723. c.lineTo(0, h * 0.0446);
  724. c.close();
  725. c.fillAndStroke();
  726. c.begin();
  727. c.moveTo(w * 0.1993, 0);
  728. c.lineTo(w * 0.1914, h * 0.03884);
  729. c.lineTo(w * 0.1536, h * 0.0362);
  730. c.lineTo(w * 0.1586, 0);
  731. c.close();
  732. c.fillAndStroke();
  733. c.begin();
  734. c.moveTo(w * 0.24, 0);
  735. c.lineTo(w * 0.2257, h * 0.054);
  736. c.lineTo(w * 0.2414, h * 0.0674);
  737. c.lineTo(w * 0.4707, h * 0.0835);
  738. c.lineTo(w * 0.5264, h * 0.0906);
  739. c.lineTo(w * 0.6429, h * 0.0929);
  740. c.arcTo(w * 0.0857, h * 0.0536, 0, 0, 0, w * 0.7193, h * 0.0621);
  741. c.arcTo(w * 0.48, h * 0.2143, 0, 0, 0, w * 0.7286, 0);
  742. c.close();
  743. c.fillAndStroke();
  744. c.begin();
  745. c.moveTo(w * 0.8, 0);
  746. c.lineTo(w * 0.7886, h * 0.04554);
  747. c.arcTo(w * 0.0857, h * 0.0536, 0, 0, 0, w * 0.8164, h * 0.0875);
  748. c.arcTo(w * 0.1429, h * 0.0893, 0, 0, 0, w * 0.88, h * 0.1036);
  749. c.lineTo(w, h * 0.1112);
  750. c.lineTo(w, 0);
  751. c.close();
  752. c.fillAndStroke();
  753. c.begin();
  754. c.moveTo(0, h * 0.0933);
  755. c.lineTo(w * 0.08, h * 0.1036);
  756. c.lineTo(w * 0.1021, h * 0.1246);
  757. c.lineTo(w * 0.1007, h * 0.1768);
  758. c.lineTo(w * 0.0471, h * 0.2241);
  759. c.lineTo(0, h * 0.2527);
  760. c.close();
  761. c.fillAndStroke();
  762. c.ellipse(w * 0.1214, h * 0.0603, w * 0.0843, h * 0.0576);
  763. c.fillAndStroke();
  764. c.begin();
  765. c.moveTo(w * 0.1293, h * 0.1924);
  766. c.lineTo(w * 0.1729, h * 0.142);
  767. c.lineTo(w * 0.1407, h * 0.1411);
  768. c.lineTo(w * 0.14, h * 0.1777);
  769. c.close();
  770. c.fillAndStroke();
  771. c.begin();
  772. c.moveTo(w * 0.4586, h * 0.1241);
  773. c.lineTo(w * 0.455, h * 0.1835);
  774. c.lineTo(w * 0.3893, h * 0.2246);
  775. c.lineTo(w * 0.2171, h * 0.1362);
  776. c.lineTo(w * 0.2171, h * 0.1308);
  777. c.lineTo(w * 0.2293, h * 0.1214);
  778. c.lineTo(w * 0.2857, h * 0.1174);
  779. c.close();
  780. c.fillAndStroke();
  781. c.begin();
  782. c.moveTo(w * 0.5079, h * 0.1134);
  783. c.lineTo(w * 0.7307, h * 0.1223);
  784. c.lineTo(w * 0.7279, h * 0.1625);
  785. c.lineTo(w * 0.715, h * 0.1772);
  786. c.lineTo(w * 0.6929, h * 0.1688);
  787. c.lineTo(w * 0.625, h * 0.1795);
  788. c.lineTo(w * 0.4779, h * 0.2835);
  789. c.lineTo(w * 0.395, h * 0.2299);
  790. c.lineTo(w * 0.4657, h * 0.1826);
  791. c.lineTo(w * 0.4707, h * 0.1223);
  792. c.close();
  793. c.fillAndStroke();
  794. c.begin();
  795. c.moveTo(w, h * 0.1362);
  796. c.lineTo(w * 0.7643, h * 0.1237);
  797. c.lineTo(w * 0.7543, h * 0.1562);
  798. c.lineTo(w * 0.7643, h * 0.1585);
  799. c.lineTo(w * 0.9186, h * 0.2366);
  800. c.lineTo(w, h * 0.1732);
  801. c.close();
  802. c.fillAndStroke();
  803. c.begin();
  804. c.moveTo(w * 0.2079, h * 0.1545);
  805. c.lineTo(w * 0.3886, h * 0.2536);
  806. c.lineTo(w * 0.3414, h * 0.2933);
  807. c.lineTo(w * 0.1743, h * 0.1969);
  808. c.close();
  809. c.fillAndStroke();
  810. c.begin();
  811. c.moveTo(w * 0.1579, h * 0.2134);
  812. c.lineTo(w * 0.3221, h * 0.3067);
  813. c.lineTo(w * 0.2957, h * 0.3237);
  814. c.lineTo(w * 0.1157, h * 0.2424);
  815. c.close();
  816. c.fillAndStroke();
  817. c.begin();
  818. c.moveTo(w * 0.405, h * 0.2656);
  819. c.lineTo(w * 0.31, h * 0.3353);
  820. c.lineTo(w * 0.3693, h * 0.3661);
  821. c.lineTo(w * 0.4571, h * 0.2982);
  822. c.close();
  823. c.fillAndStroke();
  824. c.begin();
  825. c.moveTo(w * 0.7121, h * 0.1848);
  826. c.lineTo(w * 0.6879, h * 0.1754);
  827. c.lineTo(w * 0.6329, h * 0.1844);
  828. c.lineTo(w * 0.61, h * 0.2018);
  829. c.lineTo(w * 0.6207, h * 0.2085);
  830. c.lineTo(w * 0.4986, h * 0.2982);
  831. c.lineTo(w * 0.535, h * 0.3237);
  832. c.close();
  833. c.fillAndStroke();
  834. c.begin();
  835. c.moveTo(w * 0.5557, h * 0.3379);
  836. c.lineTo(w * 0.7464, h * 0.1826);
  837. c.lineTo(w * 0.8036, h * 0.2076);
  838. c.lineTo(w * 0.595, h * 0.3616);
  839. c.close();
  840. c.fillAndStroke();
  841. c.begin();
  842. c.moveTo(w * 0.8293, h * 0.2188);
  843. c.lineTo(w * 0.8979, h * 0.2509);
  844. c.lineTo(w * 0.6936, h * 0.4125);
  845. c.lineTo(w * 0.6171, h * 0.3737);
  846. c.close();
  847. c.fillAndStroke();
  848. c.begin();
  849. c.moveTo(w, h * 0.2138);
  850. c.lineTo(w * 0.6821, h * 0.4603);
  851. c.lineTo(w * 0.815, h * 0.5277);
  852. c.lineTo(w, h * 0.4);
  853. c.close();
  854. c.fillAndStroke();
  855. c.begin();
  856. c.moveTo(0, h * 0.317);
  857. c.lineTo(w * 0.0971, h * 0.2554);
  858. c.lineTo(w * 0.4121, h * 0.4143);
  859. c.lineTo(w * 0.3736, h * 0.4415);
  860. c.lineTo(w * 0.315, h * 0.4076);
  861. c.lineTo(w * 0.3093, h * 0.4116);
  862. c.lineTo(w * 0.3686, h * 0.4455);
  863. c.lineTo(w * 0.285, h * 0.5045);
  864. c.lineTo(w * 0.1114, h * 0.4134);
  865. c.lineTo(w * 0.025, h * 0.4603);
  866. c.lineTo(w * 0.0371, h * 0.4723);
  867. c.lineTo(w * 0.1114, h * 0.4371);
  868. c.lineTo(w * 0.2871, h * 0.5312);
  869. c.lineTo(w * 0.1929, h * 0.6058);
  870. c.lineTo(w * 0.2271, h * 0.6705);
  871. c.lineTo(w * 0.17, h * 0.7147);
  872. c.lineTo(w * 0.0314, h * 0.6321);
  873. c.lineTo(0, h * 0.6246);
  874. c.close();
  875. c.fillAndStroke();
  876. c.begin();
  877. c.moveTo(w * 0.48, h * 0.3121);
  878. c.lineTo(w * 0.5157, h * 0.3375);
  879. c.lineTo(w * 0.4314, h * 0.3982);
  880. c.lineTo(w * 0.3929, h * 0.3786);
  881. c.close();
  882. c.fillAndStroke();
  883. c.begin();
  884. c.moveTo(w * 0.3086, h * 0.5179);
  885. c.lineTo(w * 0.53, h * 0.3518);
  886. c.lineTo(w * 0.5757, h * 0.3745);
  887. c.lineTo(w * 0.3479, h * 0.5411);
  888. c.close();
  889. c.fillAndStroke();
  890. c.begin();
  891. c.moveTo(w * 0.5964, h * 0.3884);
  892. c.lineTo(w * 0.6736, h * 0.4277);
  893. c.lineTo(w * 0.445, h * 0.5991);
  894. c.lineTo(w * 0.3664, h * 0.5531);
  895. c.lineTo(w * 0.5057, h * 0.4545);
  896. c.lineTo(w * 0.5507, h * 0.4754);
  897. c.lineTo(w * 0.5571, h * 0.4723);
  898. c.lineTo(w * 0.5114, h * 0.4504);
  899. c.close();
  900. c.fillAndStroke();
  901. c.begin();
  902. c.moveTo(w * 0.4793, h * 0.6161);
  903. c.lineTo(w * 0.6771, h * 0.4643);
  904. c.lineTo(w * 0.8086, h * 0.5326);
  905. c.lineTo(w * 0.7471, h * 0.5817);
  906. c.lineTo(w * 0.7214, h * 0.567);
  907. c.lineTo(w * 0.715, h * 0.571);
  908. c.lineTo(w * 0.7421, h * 0.5871);
  909. c.lineTo(w * 0.6014, h * 0.6933);
  910. c.close();
  911. c.fillAndStroke();
  912. c.begin();
  913. c.moveTo(w, h * 0.4371);
  914. c.lineTo(w * 0.8443, h * 0.546);
  915. c.lineTo(w * 0.9071, h * 0.5701);
  916. c.lineTo(w, h * 0.5022);
  917. c.close();
  918. c.fillAndStroke();
  919. c.begin();
  920. c.moveTo(w * 0.8407, h * 0.5504);
  921. c.lineTo(w * 0.8993, h * 0.5759);
  922. c.lineTo(w * 0.6757, h * 0.7416);
  923. c.lineTo(w * 0.6286, h * 0.7139);
  924. c.close();
  925. c.fillAndStroke();
  926. c.begin();
  927. c.moveTo(w, h * 0.5321);
  928. c.lineTo(w * 0.6979, h * 0.7549);
  929. c.lineTo(w * 0.7457, h * 0.7781);
  930. c.lineTo(w * 0.9814, h * 0.6094);
  931. c.lineTo(w, h * 0.6067);
  932. c.close();
  933. c.fillAndStroke();
  934. c.begin();
  935. c.moveTo(w, h * 0.6254);
  936. c.lineTo(w * 0.7664, h * 0.792);
  937. c.lineTo(w * 0.9586, h * 0.9062);
  938. c.lineTo(w, h * 0.8786);
  939. c.close();
  940. c.fillAndStroke();
  941. c.begin();
  942. c.moveTo(w * 0.3093, h * 0.5464);
  943. c.lineTo(w * 0.4271, h * 0.6152);
  944. c.lineTo(w * 0.245, h * 0.7643);
  945. c.lineTo(w * 0.185, h * 0.7228);
  946. c.lineTo(w * 0.2493, h * 0.6728);
  947. c.lineTo(w * 0.2214, h * 0.6143);
  948. c.close();
  949. c.fillAndStroke();
  950. c.begin();
  951. c.moveTo(0, h * 0.65);
  952. c.lineTo(w * 0.2179, h * 0.7826);
  953. c.lineTo(w * 0.1136, h * 0.8424);
  954. c.close();
  955. c.fillAndStroke();
  956. c.begin();
  957. c.moveTo(0, h * 0.7272);
  958. c.lineTo(w * 0.0821, h * 0.859);
  959. c.lineTo(0, h * 0.9085);
  960. c.close();
  961. c.fillAndStroke();
  962. c.begin();
  963. c.moveTo(w * 0.4529, h * 0.6366);
  964. c.lineTo(w * 0.575, h * 0.7143);
  965. c.lineTo(w * 0.39, h * 0.8621);
  966. c.lineTo(w * 0.2657, h * 0.7902);
  967. c.close();
  968. c.fillAndStroke();
  969. c.begin();
  970. c.moveTo(0, h * 0.9415);
  971. c.lineTo(w * 0.1036, h * 0.8821);
  972. c.lineTo(w * 0.2343, h * 0.959);
  973. c.lineTo(w * 0.1721, h);
  974. c.lineTo(0, h);
  975. c.close();
  976. c.fillAndStroke();
  977. c.begin();
  978. c.moveTo(w * 0.2586, h * 0.7951);
  979. c.lineTo(w * 0.3829, h * 0.8674);
  980. c.lineTo(w * 0.2543, h * 0.9451);
  981. c.lineTo(w * 0.1279, h * 0.8692);
  982. c.close();
  983. c.fillAndStroke();
  984. c.begin();
  985. c.moveTo(w * 0.2836, h * 0.9639);
  986. c.lineTo(w * 0.4207, h * 0.8772);
  987. c.lineTo(w * 0.605, h * 0.7321);
  988. c.lineTo(w * 0.6521, h * 0.7634);
  989. c.lineTo(w * 0.3486, h);
  990. c.lineTo(w * 0.3393, h);
  991. c.close();
  992. c.fillAndStroke();
  993. c.begin();
  994. c.moveTo(w * 0.3879, h);
  995. c.lineTo(w * 0.6721, h * 0.7759);
  996. c.lineTo(w * 0.7171, h * 0.7982);
  997. c.lineTo(w * 0.4564, h);
  998. c.close();
  999. c.fillAndStroke();
  1000. c.begin();
  1001. c.moveTo(w * 0.4986, h);
  1002. c.lineTo(w * 0.7386, h * 0.8125);
  1003. c.lineTo(w * 0.9307, h * 0.925);
  1004. c.lineTo(w * 0.8264, h);
  1005. c.close();
  1006. c.fillAndStroke();
  1007. c.begin();
  1008. c.moveTo(w * 0.8671, h);
  1009. c.lineTo(w * 0.9464, h * 0.9491);
  1010. c.lineTo(w, h * 0.975);
  1011. c.lineTo(w, h);
  1012. c.close();
  1013. c.fillAndStroke();
  1014. c.begin();
  1015. c.moveTo(w * 0.2295, h);
  1016. c.lineTo(w * 0.2648, h * 0.9792);
  1017. c.lineTo(w * 0.2981, h);
  1018. c.close();
  1019. c.fillAndStroke();
  1020. c.setStrokeWidth(1);
  1021. c.setStrokeColor(strokeColor);
  1022. c.begin();
  1023. c.rect(0, 0, w, h);
  1024. c.stroke();
  1025. };
  1026. mxCellRenderer.registerShape(mxMockupC.SHAPE_IBG_MAP, mxShapeMockupiBgMap);
  1027. //**********************************************************************************************************************************************************
  1028. //Vertical Button Bar
  1029. //**********************************************************************************************************************************************************
  1030. /**
  1031. * Extends mxShape.
  1032. */
  1033. function mxShapeMockupiButtonBar(bounds, fill, stroke, strokewidth)
  1034. {
  1035. mxShape.call(this);
  1036. this.bounds = bounds;
  1037. this.fill = fill;
  1038. this.stroke = stroke;
  1039. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1040. };
  1041. /**
  1042. * Extends mxShape.
  1043. */
  1044. mxUtils.extend(mxShapeMockupiButtonBar, mxShape);
  1045. mxShapeMockupiButtonBar.prototype.customProperties = [
  1046. {name: 'buttonText', dispName: 'Labels', type: 'string'},
  1047. {name: 'textColor', dispName: 'Text Color', type: 'color'},
  1048. {name: 'textColor2', dispName: 'Text2 Color', type: 'color'},
  1049. {name: 'strokeColor2', dispName: 'Stroke2 Color', type: 'color'}
  1050. ];
  1051. /**
  1052. * Function: paintVertexShape
  1053. *
  1054. * Paints the vertex shape.
  1055. */
  1056. mxShapeMockupiButtonBar.prototype.paintVertexShape = function(c, x, y, w, h)
  1057. {
  1058. var textStrings = decodeURIComponent(mxUtils.getValue(this.style, mxMockupC.BUTTON_TEXT, '+Button 1, Button 2, Button 3').toString()).split(',');
  1059. var fontColor = mxUtils.getValue(this.style, mxMockupC.STYLE_TEXTCOLOR, '#666666');
  1060. var selectedFontColor = mxUtils.getValue(this.style, mxMockupC.STYLE_TEXTCOLOR2, '#ffffff');
  1061. var fontSize = mxUtils.getValue(this.style, mxConstants.STYLE_FONTSIZE, '17').toString();
  1062. var frameColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#666666');
  1063. var separatorColor = mxUtils.getValue(this.style, mxMockupC.STYLE_STROKECOLOR2, '#c4c4c4');
  1064. var bgColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '#ffffff');
  1065. var buttonNum = textStrings.length;
  1066. var maxButtonWidth = 0;
  1067. var selectedButton = -1;
  1068. var rSize = 2.5; //rounding size
  1069. var labelOffset = 2.5;
  1070. for (var i = 0; i < buttonNum; i++)
  1071. {
  1072. var buttonText = textStrings[i];
  1073. if(buttonText.charAt(0) === mxMockupC.SELECTED)
  1074. {
  1075. buttonText = textStrings[i].substring(1);
  1076. selectedButton = i;
  1077. }
  1078. var currWidth = mxUtils.getSizeForString(buttonText, fontSize, mxConstants.DEFAULT_FONTFAMILY).width;
  1079. if (currWidth > maxButtonWidth)
  1080. {
  1081. maxButtonWidth = currWidth;
  1082. }
  1083. }
  1084. var minButtonHeight = fontSize * 1.5;
  1085. var minH = buttonNum * minButtonHeight;
  1086. var trueH = Math.max(h, minH);
  1087. var minW = 2 * labelOffset + maxButtonWidth;
  1088. var trueW = Math.max(w, minW);
  1089. c.translate(x, y);
  1090. this.background(c, trueW, trueH, rSize, buttonNum, labelOffset, buttonNum * minButtonHeight, frameColor, separatorColor, bgColor, selectedButton, minButtonHeight);
  1091. c.setShadow(false);
  1092. this.foreground(c, trueW, trueH, rSize, buttonNum, labelOffset, buttonNum * minButtonHeight, frameColor, separatorColor, bgColor, selectedButton, minButtonHeight);
  1093. var currWidth = 0;
  1094. for (var i = 0; i < buttonNum; i++)
  1095. {
  1096. if (i === selectedButton)
  1097. {
  1098. c.setFontColor(selectedFontColor);
  1099. }
  1100. else
  1101. {
  1102. c.setFontColor(fontColor);
  1103. }
  1104. currWidth = currWidth + labelOffset;
  1105. var currHeight = (i * minButtonHeight + minButtonHeight * 0.5) * trueH / minH;
  1106. this.buttonText(c, trueW, currHeight, textStrings[i], fontSize, separatorColor);
  1107. }
  1108. };
  1109. mxShapeMockupiButtonBar.prototype.background = function(c, w, h, rSize, buttonNum, labelOffset, minH, frameColor, separatorColor, bgColor, selectedButton, minButtonHeight)
  1110. {
  1111. c.begin();
  1112. c.setStrokeWidth(1);
  1113. //draw the frame
  1114. c.setStrokeColor(frameColor);
  1115. c.setFillColor(bgColor);
  1116. c.moveTo(0, rSize);
  1117. c.arcTo(rSize, rSize, 0, 0, 1, rSize, 0);
  1118. c.lineTo(w - rSize, 0);
  1119. c.arcTo(rSize, rSize, 0, 0, 1, w, rSize);
  1120. c.lineTo(w, h - rSize);
  1121. c.arcTo(rSize, rSize, 0, 0, 1, w - rSize, h);
  1122. c.lineTo(rSize, h);
  1123. c.arcTo(rSize, rSize, 0, 0, 1, 0, h - rSize);
  1124. c.close();
  1125. c.fillAndStroke();
  1126. };
  1127. mxShapeMockupiButtonBar.prototype.foreground = function(c, w, h, rSize, buttonNum, labelOffset, minH, frameColor, separatorColor, bgColor, selectedButton, minButtonHeight)
  1128. {
  1129. //draw the button separators
  1130. var strokeWidth = mxUtils.getValue(this.style, mxConstants.STYLE_STROKEWIDTH, '1');
  1131. c.setStrokeWidth(strokeWidth);
  1132. c.setStrokeColor(separatorColor);
  1133. c.begin();
  1134. for (var i = 1; i < buttonNum; i++)
  1135. {
  1136. if (i !== selectedButton && i !== (selectedButton + 1))
  1137. {
  1138. var currHeight = i * minButtonHeight * h / minH;
  1139. c.moveTo(0, currHeight);
  1140. c.lineTo(w, currHeight);
  1141. }
  1142. }
  1143. c.stroke();
  1144. //draw the selected button
  1145. c.setStrokeColor(mxConstants.NONE);
  1146. if (selectedButton === 0)
  1147. {
  1148. // we draw a path for the first button
  1149. c.begin();
  1150. var buttonBottom = minButtonHeight * h / minH;
  1151. c.setGradient('#5D7585', '#008cff', 0, 0, w, buttonBottom, mxConstants.DIRECTION_SOUTH, 1, 1);
  1152. c.moveTo(0, rSize);
  1153. c.arcTo(rSize, rSize, 0, 0, 1, rSize, 0);
  1154. c.lineTo(w - rSize, 0);
  1155. c.arcTo(rSize, rSize, 0, 0, 1, w, rSize);
  1156. c.lineTo(w, buttonBottom);
  1157. c.lineTo(0, buttonBottom);
  1158. c.close();
  1159. c.fill();
  1160. }
  1161. else if (selectedButton === buttonNum - 1)
  1162. {
  1163. // we draw a path for the last button
  1164. c.begin();
  1165. var buttonTop = h - minButtonHeight * h / minH;
  1166. c.setGradient('#5D7585', '#008cff', 0, buttonTop, w, h - buttonTop, mxConstants.DIRECTION_SOUTH, 1, 1);
  1167. c.moveTo(0, buttonTop);
  1168. c.lineTo(w, buttonTop);
  1169. c.lineTo(w, h - rSize);
  1170. c.arcTo(rSize, rSize, 0, 0, 1, w - rSize, h);
  1171. c.lineTo(rSize, h);
  1172. c.arcTo(rSize, rSize, 0, 0, 1, 0, h - rSize);
  1173. c.close();
  1174. c.fill();
  1175. }
  1176. else if (selectedButton !== -1)
  1177. {
  1178. // we draw a path rectangle for one of the buttons in the middle
  1179. c.begin();
  1180. var buttonTop = minButtonHeight * selectedButton * h / minH;
  1181. var buttonBottom = minButtonHeight * (selectedButton + 1) * h / minH;
  1182. c.setGradient('#5D7585', '#008cff', 0, buttonTop, w, buttonBottom - buttonTop, mxConstants.DIRECTION_SOUTH, 1, 1);
  1183. c.moveTo(0, buttonTop);
  1184. c.lineTo(w, buttonTop);
  1185. c.lineTo(w, buttonBottom);
  1186. c.lineTo(0, buttonBottom);
  1187. c.close();
  1188. c.fill();
  1189. }
  1190. // //draw the frame again, to achieve a nicer effect
  1191. c.begin();
  1192. c.setStrokeColor(frameColor);
  1193. c.setFillColor(bgColor);
  1194. c.moveTo(0, rSize);
  1195. c.arcTo(rSize, rSize, 0, 0, 1, rSize, 0);
  1196. c.lineTo(w - rSize, 0);
  1197. c.arcTo(rSize, rSize, 0, 0, 1, w, rSize);
  1198. c.lineTo(w, h - rSize);
  1199. c.arcTo(rSize, rSize, 0, 0, 1, w - rSize, h);
  1200. c.lineTo(rSize, h);
  1201. c.arcTo(rSize, rSize, 0, 0, 1, 0, h - rSize);
  1202. c.close();
  1203. c.stroke();
  1204. };
  1205. mxShapeMockupiButtonBar.prototype.buttonText = function(c, w, h, textString, fontSize, separatorColor)
  1206. {
  1207. if(textString.charAt(0) === mxMockupC.SELECTED)
  1208. {
  1209. textString = textString.substring(1);
  1210. }
  1211. c.setFontSize(fontSize);
  1212. c.text(10, h, 0, 0, textString, mxConstants.ALIGN_LEFT, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  1213. var mSize = fontSize * 0.5;
  1214. c.setStrokeWidth(fontSize * 0.3);
  1215. c.setStrokeColor(separatorColor);
  1216. c.begin();
  1217. c.moveTo(w - 20 - mSize, h - mSize);
  1218. c.lineTo(w - 20, h);
  1219. c.lineTo(w - 20 - mSize, h + mSize);
  1220. c.stroke();
  1221. };
  1222. mxCellRenderer.registerShape(mxMockupC.SHAPE_IBUTTON_BAR, mxShapeMockupiButtonBar);
  1223. //**********************************************************************************************************************************************************
  1224. //iPhone Application Bar
  1225. //**********************************************************************************************************************************************************
  1226. /**
  1227. * Extends mxShape.
  1228. */
  1229. function mxShapeMockupiAppBar(bounds, fill, stroke, strokewidth)
  1230. {
  1231. mxShape.call(this);
  1232. this.bounds = bounds;
  1233. this.fill = fill;
  1234. this.stroke = stroke;
  1235. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1236. };
  1237. /**
  1238. * Extends mxShape.
  1239. */
  1240. mxUtils.extend(mxShapeMockupiAppBar, mxShape);
  1241. /**
  1242. * Function: paintVertexShape
  1243. *
  1244. * Paints the vertex shape.
  1245. */
  1246. mxShapeMockupiAppBar.prototype.paintVertexShape = function(c, x, y, w, h)
  1247. {
  1248. c.translate(x, y);
  1249. this.background(c, x, y, w, h);
  1250. c.setShadow(false);
  1251. this.foreground(c, x, y, w, h);
  1252. };
  1253. mxShapeMockupiAppBar.prototype.background = function(c, x, y, w, h)
  1254. {
  1255. c.setGradient('#eeeeee', '#999999', 0, 0, w, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  1256. c.rect(0, 0, w, h);
  1257. c.fill();
  1258. };
  1259. mxShapeMockupiAppBar.prototype.foreground = function(c, x, y, w, h)
  1260. {
  1261. c.setFillColor('#0099ff');
  1262. c.rect(5, h * 0.5 + 1.75, 1.5, 2.5);
  1263. c.fill();
  1264. c.rect(7, h * 0.5 + 0.75, 1.5, 3.5);
  1265. c.fill();
  1266. c.rect(9, h * 0.5 - 0.25, 1.5, 4.5);
  1267. c.fill();
  1268. c.rect(11, h * 0.5 - 1.25, 1.5, 5.5);
  1269. c.fill();
  1270. c.rect(13, h * 0.5 - 2.25, 1.5, 6.5);
  1271. c.fill();
  1272. c.rect(15, h * 0.5 - 3.25, 1.5, 7.5);
  1273. c.fill();
  1274. c.setFillColor('#999999');
  1275. c.ellipse(w - 56.5, h * 0.5 - 4, 8, 8);
  1276. c.fill();
  1277. c.setStrokeColor('#cccccc');
  1278. c.begin();
  1279. c.moveTo(w - 52.5, h * 0.5 - 3);
  1280. c.lineTo(w - 52.5, h * 0.5);
  1281. c.lineTo(w - 54.5, h * 0.5);
  1282. c.stroke();
  1283. c.setStrokeWidth(0.5);
  1284. c.setStrokeColor('#333333');
  1285. c.setFillColor('#990000');
  1286. c.begin();
  1287. c.moveTo(w - 45.5, h * 0.5);
  1288. c.lineTo(w - 37.5, h * 0.5 - 5);
  1289. c.lineTo(w - 41.5, h * 0.5 + 4);
  1290. c.lineTo(w - 42, h * 0.5 + 0.5);
  1291. c.close();
  1292. c.fillAndStroke();
  1293. c.setFillColor('#999999');
  1294. c.setStrokeColor('#999999');
  1295. c.begin();
  1296. c.moveTo(w - 28.5, h * 0.5 + 3.5);
  1297. c.arcTo(3.5, 3.5, 0, 1, 1, w - 26.5, h * 0.5 + 1);
  1298. c.stroke();
  1299. c.begin();
  1300. c.moveTo(w - 27.25, h * 0.5 + 0.25);
  1301. c.lineTo(w - 25.75, h * 0.5 + 0.25);
  1302. c.lineTo(w - 26.5, h * 0.5 + 1.5);
  1303. c.close();
  1304. c.fillAndStroke();
  1305. c.begin();
  1306. c.moveTo(w - 31, h * 0.5 - 0.5);
  1307. c.arcTo(1, 1.5, 0, 0, 1, w - 29, h * 0.5 - 0.5);
  1308. c.stroke();
  1309. c.rect(w - 31.5, h * 0.5 - 0.5, 3, 2);
  1310. c.fillAndStroke();
  1311. c.setGradient('#eeeeee', '#444444', w - 20, h * 0.5 - 3, 16.5, 6, mxConstants.DIRECTION_NORTH, 1, 1);
  1312. c.begin();
  1313. c.moveTo(w - 20, h * 0.5 - 3);
  1314. c.lineTo(w - 5, h * 0.5 - 3);
  1315. c.lineTo(w - 5, h * 0.5 - 1);
  1316. c.lineTo(w - 3.5, h * 0.5 - 1);
  1317. c.lineTo(w - 3.5, h * 0.5 + 1);
  1318. c.lineTo(w - 5, h * 0.5 + 1);
  1319. c.lineTo(w - 5, h * 0.5 + 3);
  1320. c.lineTo(w - 20, h * 0.5 + 3);
  1321. c.close();
  1322. c.fill();
  1323. c.setGradient('#E2FFEB', '#008215', w - 20, h * 0.5 - 3, 10, 6, mxConstants.DIRECTION_SOUTH, 1, 1);
  1324. c.begin();
  1325. c.moveTo(w - 20, h * 0.5 - 3);
  1326. c.lineTo(w - 10, h * 0.5 - 3);
  1327. c.lineTo(w - 10, h * 0.5 + 3);
  1328. c.lineTo(w - 20, h * 0.5 + 3);
  1329. c.close();
  1330. c.fill();
  1331. c.setStrokeColor('#666666');
  1332. c.begin();
  1333. c.moveTo(w - 20, h * 0.5 - 3);
  1334. c.lineTo(w - 5, h * 0.5 - 3);
  1335. c.lineTo(w - 5, h * 0.5 - 1);
  1336. c.lineTo(w - 3.5, h * 0.5 - 1);
  1337. c.lineTo(w - 3.5, h * 0.5 + 1);
  1338. c.lineTo(w - 5, h * 0.5 + 1);
  1339. c.lineTo(w - 5, h * 0.5 + 3);
  1340. c.lineTo(w - 20, h * 0.5 + 3);
  1341. c.close();
  1342. c.stroke();
  1343. };
  1344. mxCellRenderer.registerShape(mxMockupC.SHAPE_IAPP_BAR, mxShapeMockupiAppBar);
  1345. //**********************************************************************************************************************************************************
  1346. //iPhone Top Bar (LEGACY)
  1347. //**********************************************************************************************************************************************************
  1348. /**
  1349. * Extends mxShape.
  1350. */
  1351. function mxShapeMockupiTopBar(bounds, fill, stroke, strokewidth)
  1352. {
  1353. mxShape.call(this);
  1354. this.bounds = bounds;
  1355. this.fill = fill;
  1356. this.stroke = stroke;
  1357. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1358. };
  1359. /**
  1360. * Extends mxShape.
  1361. */
  1362. mxUtils.extend(mxShapeMockupiTopBar, mxShape);
  1363. /**
  1364. * Function: paintVertexShape
  1365. *
  1366. * Paints the vertex shape.
  1367. */
  1368. mxShapeMockupiTopBar.prototype.paintVertexShape = function(c, x, y, w, h)
  1369. {
  1370. c.translate(x, y);
  1371. this.background(c, x, y, w, h);
  1372. c.setShadow(false);
  1373. this.foreground(c, x, y, w, h);
  1374. };
  1375. mxShapeMockupiTopBar.prototype.background = function(c, x, y, w, h)
  1376. {
  1377. c.setAlpha(0.5);
  1378. c.setFillColor('#999999');
  1379. c.rect(0, 0, w, h);
  1380. c.fill();
  1381. };
  1382. mxShapeMockupiTopBar.prototype.foreground = function(c, x, y, w, h)
  1383. {
  1384. c.setFillColor('#cccccc');
  1385. c.setStrokeColor('#cccccc');
  1386. c.setFontColor('#cccccc');
  1387. c.setFontSize(7.5);
  1388. c.rect(5, h * 0.5 + 1.75, 1.5, 2.5);
  1389. c.fill();
  1390. c.rect(7, h * 0.5 + 0.75, 1.5, 3.5);
  1391. c.fill();
  1392. c.rect(9, h * 0.5 - 0.25, 1.5, 4.5);
  1393. c.fill();
  1394. c.rect(11, h * 0.5 - 1.25, 1.5, 5.5);
  1395. c.fill();
  1396. c.rect(13, h * 0.5 - 2.25, 1.5, 6.5);
  1397. c.fill();
  1398. c.rect(15, h * 0.5 - 3.25, 1.5, 7.5);
  1399. c.fill();
  1400. c.text(18, h * 0.5, 0, 0, 'CARRIER', mxConstants.ALIGN_LEFT, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  1401. c.text(w * 0.5, h * 0.5, 0, 0, '11:15AM', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  1402. c.begin();
  1403. c.moveTo(w - 19, h * 0.5 - 2);
  1404. c.lineTo(w - 10, h * 0.5 - 2);
  1405. c.lineTo(w - 10, h * 0.5 + 2);
  1406. c.lineTo(w - 19, h * 0.5 + 2);
  1407. c.close();
  1408. c.fill();
  1409. c.begin();
  1410. c.moveTo(w - 20, h * 0.5 - 3);
  1411. c.lineTo(w - 5, h * 0.5 - 3);
  1412. c.lineTo(w - 5, h * 0.5 - 1);
  1413. c.lineTo(w - 3.5, h * 0.5 - 1);
  1414. c.lineTo(w - 3.5, h * 0.5 + 1);
  1415. c.lineTo(w - 5, h * 0.5 + 1);
  1416. c.lineTo(w - 5, h * 0.5 + 3);
  1417. c.lineTo(w - 20, h * 0.5 + 3);
  1418. c.close();
  1419. c.stroke();
  1420. };
  1421. mxCellRenderer.registerShape(mxMockupC.SHAPE_ITOP_BAR, mxShapeMockupiTopBar);
  1422. //**********************************************************************************************************************************************************
  1423. //iPhone Top Bar 2
  1424. //**********************************************************************************************************************************************************
  1425. /**
  1426. * Extends mxShape.
  1427. */
  1428. function mxShapeMockupiTopBar2(bounds, fill, stroke, strokewidth)
  1429. {
  1430. mxShape.call(this);
  1431. this.bounds = bounds;
  1432. this.fill = fill;
  1433. this.stroke = stroke;
  1434. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1435. };
  1436. /**
  1437. * Extends mxShape.
  1438. */
  1439. mxUtils.extend(mxShapeMockupiTopBar2, mxShape);
  1440. mxShapeMockupiTopBar2.prototype.cst = {
  1441. SHAPE_ITOP_BAR2 : 'mxgraph.ios.iTopBar2'
  1442. };
  1443. /**
  1444. * Function: paintVertexShape
  1445. *
  1446. * Paints the vertex shape.
  1447. */
  1448. mxShapeMockupiTopBar2.prototype.paintVertexShape = function(c, x, y, w, h)
  1449. {
  1450. c.translate(x, y);
  1451. this.background(c, x, y, w, h);
  1452. c.setShadow(false);
  1453. this.foreground(c, x, y, w, h);
  1454. };
  1455. mxShapeMockupiTopBar2.prototype.background = function(c, x, y, w, h)
  1456. {
  1457. c.rect(0, 0, w, h);
  1458. c.fill();
  1459. };
  1460. mxShapeMockupiTopBar2.prototype.foreground = function(c, x, y, w, h)
  1461. {
  1462. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  1463. c.setFillColor(strokeColor);
  1464. c.setStrokeColor(strokeColor);
  1465. c.rect(5, h * 0.5 + 1.75, 1.5, 2.5);
  1466. c.fill();
  1467. c.rect(7, h * 0.5 + 0.75, 1.5, 3.5);
  1468. c.fill();
  1469. c.rect(9, h * 0.5 - 0.25, 1.5, 4.5);
  1470. c.fill();
  1471. c.rect(11, h * 0.5 - 1.25, 1.5, 5.5);
  1472. c.fill();
  1473. c.rect(13, h * 0.5 - 2.25, 1.5, 6.5);
  1474. c.fill();
  1475. c.rect(15, h * 0.5 - 3.25, 1.5, 7.5);
  1476. c.fill();
  1477. c.begin();
  1478. c.moveTo(w - 19, h * 0.5 - 2);
  1479. c.lineTo(w - 10, h * 0.5 - 2);
  1480. c.lineTo(w - 10, h * 0.5 + 2);
  1481. c.lineTo(w - 19, h * 0.5 + 2);
  1482. c.close();
  1483. c.fill();
  1484. c.begin();
  1485. c.moveTo(w - 20, h * 0.5 - 3);
  1486. c.lineTo(w - 5, h * 0.5 - 3);
  1487. c.lineTo(w - 5, h * 0.5 - 1);
  1488. c.lineTo(w - 3.5, h * 0.5 - 1);
  1489. c.lineTo(w - 3.5, h * 0.5 + 1);
  1490. c.lineTo(w - 5, h * 0.5 + 1);
  1491. c.lineTo(w - 5, h * 0.5 + 3);
  1492. c.lineTo(w - 20, h * 0.5 + 3);
  1493. c.close();
  1494. c.stroke();
  1495. };
  1496. mxCellRenderer.registerShape(mxShapeMockupiTopBar2.prototype.cst.SHAPE_ITOP_BAR2, mxShapeMockupiTopBar2);
  1497. //**********************************************************************************************************************************************************
  1498. //iPhone Top Bar Locked
  1499. //**********************************************************************************************************************************************************
  1500. /**
  1501. * Extends mxShape.
  1502. */
  1503. function mxShapeMockupiTopBarLocked(bounds, fill, stroke, strokewidth)
  1504. {
  1505. mxShape.call(this);
  1506. this.bounds = bounds;
  1507. this.fill = fill;
  1508. this.stroke = stroke;
  1509. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1510. };
  1511. /**
  1512. * Extends mxShape.
  1513. */
  1514. mxUtils.extend(mxShapeMockupiTopBarLocked, mxShape);
  1515. /**
  1516. * Function: paintVertexShape
  1517. *
  1518. * Paints the vertex shape.
  1519. */
  1520. mxShapeMockupiTopBarLocked.prototype.paintVertexShape = function(c, x, y, w, h)
  1521. {
  1522. c.translate(x, y);
  1523. this.background(c, x, y, w, h);
  1524. c.setShadow(false);
  1525. this.foreground(c, x, y, w, h);
  1526. };
  1527. mxShapeMockupiTopBarLocked.prototype.background = function(c, x, y, w, h)
  1528. {
  1529. c.setFillColor('#000000');
  1530. c.rect(0, 0, w, h);
  1531. c.fill();
  1532. };
  1533. mxShapeMockupiTopBarLocked.prototype.foreground = function(c, x, y, w, h)
  1534. {
  1535. c.setFillColor('#cccccc');
  1536. c.setStrokeColor('#cccccc');
  1537. c.rect(5, h * 0.5 + 1.75, 1.5, 2.5);
  1538. c.fill();
  1539. c.rect(7, h * 0.5 + 0.75, 1.5, 3.5);
  1540. c.fill();
  1541. c.rect(9, h * 0.5 - 0.25, 1.5, 4.5);
  1542. c.fill();
  1543. c.rect(11, h * 0.5 - 1.25, 1.5, 5.5);
  1544. c.fill();
  1545. c.rect(13, h * 0.5 - 2.25, 1.5, 6.5);
  1546. c.fill();
  1547. c.rect(15, h * 0.5 - 3.25, 1.5, 7.5);
  1548. c.fill();
  1549. c.begin();
  1550. c.moveTo(w * 0.5 - 2, h * 0.5 - 1);
  1551. c.arcTo(2, 3, 0, 0, 1, w * 0.5 + 2, h * 0.5 - 1);
  1552. c.stroke();
  1553. c.rect(w * 0.5 - 3, h * 0.5 - 1, 6, 4);
  1554. c.fillAndStroke();
  1555. c.begin();
  1556. c.moveTo(w - 19, h * 0.5 - 2);
  1557. c.lineTo(w - 10, h * 0.5 - 2);
  1558. c.lineTo(w - 10, h * 0.5 + 2);
  1559. c.lineTo(w - 19, h * 0.5 + 2);
  1560. c.close();
  1561. c.fill();
  1562. c.begin();
  1563. c.moveTo(w - 20, h * 0.5 - 3);
  1564. c.lineTo(w - 5, h * 0.5 - 3);
  1565. c.lineTo(w - 5, h * 0.5 - 1);
  1566. c.lineTo(w - 3.5, h * 0.5 - 1);
  1567. c.lineTo(w - 3.5, h * 0.5 + 1);
  1568. c.lineTo(w - 5, h * 0.5 + 1);
  1569. c.lineTo(w - 5, h * 0.5 + 3);
  1570. c.lineTo(w - 20, h * 0.5 + 3);
  1571. c.close();
  1572. c.stroke();
  1573. };
  1574. mxCellRenderer.registerShape(mxMockupC.SHAPE_ITOP_BAR_LOCKED, mxShapeMockupiTopBarLocked);
  1575. //**********************************************************************************************************************************************************
  1576. //Button
  1577. //**********************************************************************************************************************************************************
  1578. /**
  1579. * Extends mxShape.
  1580. */
  1581. function mxShapeMockupiButton(bounds, fill, stroke, strokewidth)
  1582. {
  1583. mxShape.call(this);
  1584. this.bounds = bounds;
  1585. this.fill = fill;
  1586. this.stroke = stroke;
  1587. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1588. };
  1589. /**
  1590. * Extends mxShape.
  1591. */
  1592. mxUtils.extend(mxShapeMockupiButton, mxShape);
  1593. /**
  1594. * Function: paintVertexShape
  1595. *
  1596. * Paints the vertex shape.
  1597. */
  1598. mxShapeMockupiButton.prototype.paintVertexShape = function(c, x, y, w, h)
  1599. {
  1600. var mainText = decodeURIComponent(mxUtils.getValue(this.style, mxMockupC.BUTTON_TEXT, 'Main Text'));
  1601. var fontColor = mxUtils.getValue(this.style, mxMockupC.STYLE_TEXTCOLOR2, '#666666').toString();
  1602. var fontSize = mxUtils.getValue(this.style, mxConstants.STYLE_FONTSIZE, '8.5').toString();
  1603. c.translate(x, y);
  1604. this.background(c, x, y, w, h);
  1605. c.setShadow(false);
  1606. this.mainText(c, x, y, w, h, mainText, fontSize, fontColor);
  1607. };
  1608. mxShapeMockupiButton.prototype.background = function(c, x, y, w, h)
  1609. {
  1610. var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '').toString();
  1611. var fillColor2 = mxUtils.getValue(this.style, mxMockupC.STYLE_FILLCOLOR2, '').toString();
  1612. c.setGradient(fillColor, fillColor2, 0, 0, w, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  1613. c.roundrect(0, 0, w, h, 2.5, 2.5);
  1614. c.fill();
  1615. };
  1616. mxShapeMockupiButton.prototype.mainText = function(c, x, y, w, h, text, fontSize, fontColor)
  1617. {
  1618. c.begin();
  1619. c.setFontSize(fontSize);
  1620. c.setFontColor(fontColor);
  1621. c.text(w / 2, h / 2, 0, 0, text, mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  1622. };
  1623. mxCellRenderer.registerShape(mxMockupC.SHAPE_IBUTTON, mxShapeMockupiButton);
  1624. //**********************************************************************************************************************************************************
  1625. //Button Back
  1626. //**********************************************************************************************************************************************************
  1627. /**
  1628. * Extends mxShape.
  1629. */
  1630. function mxShapeMockupiButtonBack(bounds, fill, stroke, strokewidth)
  1631. {
  1632. mxShape.call(this);
  1633. this.bounds = bounds;
  1634. this.fill = fill;
  1635. this.stroke = stroke;
  1636. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1637. };
  1638. /**
  1639. * Extends mxShape.
  1640. */
  1641. mxUtils.extend(mxShapeMockupiButtonBack, mxShape);
  1642. /**
  1643. * Function: paintVertexShape
  1644. *
  1645. * Paints the vertex shape.
  1646. */
  1647. mxShapeMockupiButtonBack.prototype.paintVertexShape = function(c, x, y, w, h)
  1648. {
  1649. var mainText = decodeURIComponent(mxUtils.getValue(this.style, mxMockupC.BUTTON_TEXT, 'Main Text'));
  1650. var fontColor = mxUtils.getValue(this.style, mxMockupC.STYLE_TEXTCOLOR2, '#666666').toString();
  1651. var fontSize = mxUtils.getValue(this.style, mxConstants.STYLE_FONTSIZE, '17').toString();
  1652. c.translate(x, y);
  1653. this.background(c, x, y, w, h);
  1654. c.setShadow(false);
  1655. this.mainText(c, x, y, w, h, mainText, fontSize, fontColor);
  1656. };
  1657. mxShapeMockupiButtonBack.prototype.background = function(c, x, y, w, h)
  1658. {
  1659. var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '').toString();
  1660. var fillColor2 = mxUtils.getValue(this.style, mxMockupC.STYLE_FILLCOLOR2, '').toString();
  1661. c.setGradient(fillColor, fillColor2, 0, 0, w, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  1662. rSize = 2.5;
  1663. c.begin();
  1664. c.moveTo(w, rSize);
  1665. c.arcTo(rSize, rSize, 0, 0, 0, w - rSize, 0);
  1666. c.lineTo(10, 0);
  1667. c.lineTo(0.87, h * 0.5 - 0.75);
  1668. c.arcTo(rSize, rSize, 0, 0, 0, 0.87, h * 0.5 + 0.75);
  1669. c.lineTo(10, h);
  1670. c.lineTo(w - rSize, h);
  1671. c.arcTo(rSize, rSize, 0, 0, 0, w, h - rSize);
  1672. c.close();
  1673. c.fill();
  1674. };
  1675. mxShapeMockupiButtonBack.prototype.mainText = function(c, x, y, w, h, text, fontSize, fontColor)
  1676. {
  1677. c.begin();
  1678. c.setFontSize(fontSize);
  1679. c.setFontColor(fontColor);
  1680. c.text(w * 0.5 + 2.5, h * 0.5, 0, 0, text, mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  1681. };
  1682. mxCellRenderer.registerShape(mxMockupC.SHAPE_IBUTTON_BACK, mxShapeMockupiButtonBack);
  1683. //**********************************************************************************************************************************************************
  1684. //Button Forward
  1685. //**********************************************************************************************************************************************************
  1686. /**
  1687. * Extends mxShape.
  1688. */
  1689. function mxShapeMockupiButtonForward(bounds, fill, stroke, strokewidth)
  1690. {
  1691. mxShape.call(this);
  1692. this.bounds = bounds;
  1693. this.fill = fill;
  1694. this.stroke = stroke;
  1695. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1696. };
  1697. /**
  1698. * Extends mxShape.
  1699. */
  1700. mxUtils.extend(mxShapeMockupiButtonForward, mxShape);
  1701. /**
  1702. * Function: paintVertexShape
  1703. *
  1704. * Paints the vertex shape.
  1705. */
  1706. mxShapeMockupiButtonForward.prototype.paintVertexShape = function(c, x, y, w, h)
  1707. {
  1708. var mainText = decodeURIComponent(mxUtils.getValue(this.style, mxMockupC.BUTTON_TEXT, 'Main Text'));
  1709. var fontColor = mxUtils.getValue(this.style, mxMockupC.STYLE_TEXTCOLOR2, '#666666').toString();
  1710. var fontSize = mxUtils.getValue(this.style, mxConstants.STYLE_FONTSIZE, '17').toString();
  1711. c.translate(x, y);
  1712. this.background(c, x, y, w, h);
  1713. c.setShadow(false);
  1714. this.mainText(c, x, y, w, h, mainText, fontSize, fontColor);
  1715. };
  1716. mxShapeMockupiButtonForward.prototype.background = function(c, x, y, w, h)
  1717. {
  1718. var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '').toString();
  1719. var fillColor2 = mxUtils.getValue(this.style, mxMockupC.STYLE_FILLCOLOR2, '').toString();
  1720. c.setGradient(fillColor, fillColor2, 0, 0, w, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  1721. rSize = 2.5;
  1722. c.begin();
  1723. c.moveTo(0, rSize);
  1724. c.arcTo(rSize, rSize, 0, 0, 1, rSize, 0);
  1725. c.lineTo(w - 10, 0);
  1726. c.lineTo(w - 0.87, h * 0.5 - 0.75);
  1727. c.arcTo(rSize, rSize, 0, 0, 1, w - 0.87, h * 0.5 + 0.75);
  1728. c.lineTo(w - 10, h);
  1729. c.lineTo(rSize, h);
  1730. c.arcTo(rSize, rSize, 0, 0, 1, 0, h - rSize);
  1731. c.close();
  1732. c.fill();
  1733. };
  1734. mxShapeMockupiButtonForward.prototype.mainText = function(c, x, y, w, h, text, fontSize, fontColor)
  1735. {
  1736. c.begin();
  1737. c.setFontSize(fontSize);
  1738. c.setFontColor(fontColor);
  1739. c.text(w * 0.5 - 2.5, h * 0.5, 0, 0, text, mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  1740. };
  1741. mxCellRenderer.registerShape(mxMockupC.SHAPE_IBUTTON_FORWARD, mxShapeMockupiButtonForward);
  1742. //**********************************************************************************************************************************************************
  1743. //Prev/Next Button
  1744. //**********************************************************************************************************************************************************
  1745. /**
  1746. * Extends mxShape.
  1747. */
  1748. function mxShapeMockupiPrevNextButton(bounds, fill, stroke, strokewidth)
  1749. {
  1750. mxShape.call(this);
  1751. this.bounds = bounds;
  1752. this.fill = fill;
  1753. this.stroke = stroke;
  1754. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1755. };
  1756. /**
  1757. * Extends mxShape.
  1758. */
  1759. mxUtils.extend(mxShapeMockupiPrevNextButton, mxShape);
  1760. /**
  1761. * Function: paintVertexShape
  1762. *
  1763. * Paints the vertex shape.
  1764. */
  1765. mxShapeMockupiPrevNextButton.prototype.paintVertexShape = function(c, x, y, w, h)
  1766. {
  1767. c.translate(x, y);
  1768. this.background(c, x, y, w, h);
  1769. c.setShadow(false);
  1770. this.foreground(c, x, y, w, h);
  1771. };
  1772. mxShapeMockupiPrevNextButton.prototype.background = function(c, x, y, w, h)
  1773. {
  1774. var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '').toString();
  1775. var fillColor2 = mxUtils.getValue(this.style, mxMockupC.STYLE_FILLCOLOR2, '').toString();
  1776. c.setGradient(fillColor, fillColor2, 0, 0, w, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  1777. var rSize = 5;
  1778. c.roundrect(0, 0, w, h, rSize, rSize);
  1779. c.fill();
  1780. c.begin();
  1781. c.moveTo(w * 0.5, 0);
  1782. c.lineTo(w * 0.5, h);
  1783. c.stroke();
  1784. };
  1785. mxShapeMockupiPrevNextButton.prototype.foreground = function(c, x, y, w, h)
  1786. {
  1787. var fillColor3 = mxUtils.getValue(this.style, mxMockupC.STYLE_FILLCOLOR3, '').toString();
  1788. c.setFillColor(fillColor3);
  1789. c.begin();
  1790. c.moveTo(w * 0.25, h * 0.25);
  1791. c.lineTo(w * 0.35, h * 0.75);
  1792. c.lineTo(w * 0.15, h * 0.75);
  1793. c.close();
  1794. c.fill();
  1795. c.begin();
  1796. c.moveTo(w * 0.75, h * 0.75);
  1797. c.lineTo(w * 0.85, h * 0.25);
  1798. c.lineTo(w * 0.65, h * 0.25);
  1799. c.close();
  1800. c.fill();
  1801. };
  1802. mxCellRenderer.registerShape(mxMockupC.SHAPE_IPREV_NEXT, mxShapeMockupiPrevNextButton);
  1803. //**********************************************************************************************************************************************************
  1804. //Text Input
  1805. //**********************************************************************************************************************************************************
  1806. /**
  1807. * Extends mxShape.
  1808. */
  1809. function mxShapeMockupiTextInput(bounds, fill, stroke, strokewidth)
  1810. {
  1811. mxShape.call(this);
  1812. this.bounds = bounds;
  1813. this.fill = fill;
  1814. this.stroke = stroke;
  1815. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1816. };
  1817. /**
  1818. * Extends mxShape.
  1819. */
  1820. mxUtils.extend(mxShapeMockupiTextInput, mxShape);
  1821. /**
  1822. * Function: paintVertexShape
  1823. *
  1824. * Paints the vertex shape.
  1825. */
  1826. mxShapeMockupiTextInput.prototype.paintVertexShape = function(c, x, y, w, h)
  1827. {
  1828. var mainText = decodeURIComponent(mxUtils.getValue(this.style, mxMockupC.BUTTON_TEXT, 'Main Text'));
  1829. var fontColor = mxUtils.getValue(this.style, mxMockupC.STYLE_TEXTCOLOR2, '#000000').toString();
  1830. var fontSize = mxUtils.getValue(this.style, mxConstants.STYLE_FONTSIZE, '8').toString();
  1831. c.translate(x, y);
  1832. this.background(c, x, y, w, h);
  1833. c.setShadow(false);
  1834. this.mainText(c, x, y, w, h, mainText, fontSize, fontColor);
  1835. };
  1836. mxShapeMockupiTextInput.prototype.background = function(c, x, y, w, h)
  1837. {
  1838. c.roundrect(0, 0, w, h, 2.5, 2.5);
  1839. c.fillAndStroke();
  1840. };
  1841. mxShapeMockupiTextInput.prototype.mainText = function(c, x, y, w, h, text, fontSize, fontColor)
  1842. {
  1843. c.begin();
  1844. c.setFontSize(fontSize);
  1845. c.setFontColor(fontColor);
  1846. c.text(2, h * 0.5, 0, 0, text, mxConstants.ALIGN_LEFT, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  1847. };
  1848. mxCellRenderer.registerShape(mxMockupC.SHAPE_ITEXT_INPUT, mxShapeMockupiTextInput);
  1849. //**********************************************************************************************************************************************************
  1850. //Radio Button Group (LEGACY)
  1851. //**********************************************************************************************************************************************************
  1852. /**
  1853. * Extends mxShape.
  1854. */
  1855. function mxShapeMockupiRadioGroup(bounds, fill, stroke, strokewidth)
  1856. {
  1857. mxShape.call(this);
  1858. this.bounds = bounds;
  1859. this.fill = fill;
  1860. this.stroke = stroke;
  1861. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1862. };
  1863. /**
  1864. * Extends mxShape.
  1865. */
  1866. mxUtils.extend(mxShapeMockupiRadioGroup, mxShape);
  1867. /**
  1868. * Function: paintVertexShape
  1869. *
  1870. * Paints the vertex shape.
  1871. */
  1872. mxShapeMockupiRadioGroup.prototype.paintVertexShape = function(c, x, y, w, h)
  1873. {
  1874. c.translate(x, y);
  1875. var fontColor = mxUtils.getValue(this.style, mxMockupC.STYLE_TEXTCOLOR2, '#666666').toString();
  1876. var fontSize = mxUtils.getValue(this.style, mxConstants.STYLE_FONTSIZE, '8').toString();
  1877. var optionText = decodeURIComponent(mxUtils.getValue(this.style, mxMockupC.BUTTON_TEXT, 'Option 1').toString()).split(',');
  1878. var optionNum = optionText.length;
  1879. var buttonSize = 5;
  1880. var lineH = Math.max(fontSize * 1.5, buttonSize);
  1881. var maxTextWidth = 0;
  1882. var selected = -1;
  1883. var labelOffset = 2.5;
  1884. var minH = optionNum * lineH;
  1885. var trueH = Math.max(h, minH);
  1886. //get min width and selected option
  1887. for (var i = 0; i < optionNum; i++)
  1888. {
  1889. var currText = optionText[i];
  1890. if(currText.charAt(0) === mxMockupC.SELECTED)
  1891. {
  1892. currText = optionText[i].substring(1);
  1893. selected = i;
  1894. }
  1895. var currWidth = mxUtils.getSizeForString(currText, fontSize, mxConstants.DEFAULT_FONTFAMILY).width;
  1896. if (currWidth > maxTextWidth)
  1897. {
  1898. maxTextWidth = currWidth;
  1899. }
  1900. }
  1901. var minW = 2 * labelOffset + maxTextWidth + 2 * buttonSize;
  1902. var trueW = Math.max(w, minW);
  1903. //draw the background
  1904. c.roundrect(0, 0, trueW, trueH, 2.5, 2.5);
  1905. c.fillAndStroke();
  1906. c.setShadow(false);
  1907. c.setFontSize(fontSize);
  1908. c.setFontColor(fontColor);
  1909. for (var i = 0; i < optionNum; i++)
  1910. {
  1911. var currHeight = (i * lineH + lineH * 0.5) * trueH / minH;
  1912. var currText = optionText[i];
  1913. if(currText.charAt(0) === mxMockupC.SELECTED)
  1914. {
  1915. currText = optionText[i].substring(1);
  1916. selected = i;
  1917. }
  1918. c.text(buttonSize * 2 + labelOffset, currHeight, 0, 0, currText, mxConstants.ALIGN_LEFT, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  1919. var iconX = buttonSize * 0.5;
  1920. var iconY = currHeight - buttonSize * 0.5;
  1921. c.setFillColor('#dddddd');
  1922. c.setStrokeColor('#000000');
  1923. if (selected === i)
  1924. {
  1925. c.setGradient('#aaaaaa', '#666666', iconX, iconY, buttonSize, buttonSize, mxConstants.DIRECTION_SOUTH, 1, 1);
  1926. c.ellipse(iconX, iconY, buttonSize, buttonSize);
  1927. c.fillAndStroke();
  1928. c.setFillColor('#333333');
  1929. c.setStrokeColor('#333333');
  1930. c.ellipse(iconX + buttonSize * 0.25, iconY + buttonSize * 0.25, buttonSize * 0.5, buttonSize * 0.5);
  1931. c.fillAndStroke();
  1932. }
  1933. else
  1934. {
  1935. c.setGradient('#eeeeee', '#cccccc', iconX, iconY, buttonSize, buttonSize, mxConstants.DIRECTION_SOUTH, 1, 1);
  1936. c.ellipse(iconX, iconY, buttonSize, buttonSize);
  1937. c.fillAndStroke();
  1938. }
  1939. }
  1940. };
  1941. mxCellRenderer.registerShape(mxMockupC.SHAPE_IRADIO_GROUP, mxShapeMockupiRadioGroup);
  1942. //**********************************************************************************************************************************************************
  1943. //Checkbox Group (LEGACY)
  1944. //**********************************************************************************************************************************************************
  1945. /**
  1946. * Extends mxShape.
  1947. */
  1948. function mxShapeMockupiCheckboxGroup(bounds, fill, stroke, strokewidth)
  1949. {
  1950. mxShape.call(this);
  1951. this.bounds = bounds;
  1952. this.fill = fill;
  1953. this.stroke = stroke;
  1954. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1955. };
  1956. /**
  1957. * Extends mxShape.
  1958. */
  1959. mxUtils.extend(mxShapeMockupiCheckboxGroup, mxShape);
  1960. /**
  1961. * Function: paintVertexShape
  1962. *
  1963. * Paints the vertex shape.
  1964. */
  1965. mxShapeMockupiCheckboxGroup.prototype.paintVertexShape = function(c, x, y, w, h)
  1966. {
  1967. c.translate(x, y);
  1968. var fontColor = mxUtils.getValue(this.style, mxMockupC.STYLE_TEXTCOLOR2, '#666666').toString();
  1969. var fontSize = mxUtils.getValue(this.style, mxConstants.STYLE_FONTSIZE, '8').toString();
  1970. var optionText = decodeURIComponent(mxUtils.getValue(this.style, mxMockupC.BUTTON_TEXT, 'Option 1').toString()).split(',');
  1971. var optionNum = optionText.length;
  1972. var buttonSize = 5;
  1973. var lineH = Math.max(fontSize * 1.5, buttonSize);
  1974. var maxTextWidth = 0;
  1975. var selected = -1;
  1976. var labelOffset = 2.5;
  1977. var minH = optionNum * lineH;
  1978. var trueH = Math.max(h, minH);
  1979. //get min width and selected option
  1980. for (var i = 0; i < optionNum; i++)
  1981. {
  1982. var currText = optionText[i];
  1983. if(currText.charAt(0) === mxMockupC.SELECTED)
  1984. {
  1985. currText = optionText[i].substring(1);
  1986. selected = i;
  1987. }
  1988. var currWidth = mxUtils.getSizeForString(currText, fontSize, mxConstants.DEFAULT_FONTFAMILY).width;
  1989. if (currWidth > maxTextWidth)
  1990. {
  1991. maxTextWidth = currWidth;
  1992. }
  1993. }
  1994. var minW = 2 * labelOffset + maxTextWidth + 2 * buttonSize;
  1995. var trueW = Math.max(w, minW);
  1996. //draw the background
  1997. c.roundrect(0, 0, trueW, trueH, 2.5, 2.5);
  1998. c.fillAndStroke();
  1999. c.setShadow(false);
  2000. c.setFontSize(fontSize);
  2001. c.setFontColor(fontColor);
  2002. for (var i = 0; i < optionNum; i++)
  2003. {
  2004. var currHeight = (i * lineH + lineH * 0.5) * trueH / minH;
  2005. var currText = optionText[i];
  2006. if(currText.charAt(0) === mxMockupC.SELECTED)
  2007. {
  2008. currText = optionText[i].substring(1);
  2009. selected = i;
  2010. }
  2011. c.text(buttonSize * 2 + labelOffset, currHeight, 0, 0, currText, mxConstants.ALIGN_LEFT, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2012. var iconX = buttonSize * 0.5;
  2013. var iconY = currHeight - buttonSize * 0.5;
  2014. c.setFillColor('#dddddd');
  2015. c.setStrokeColor('#000000');
  2016. if (selected === i)
  2017. {
  2018. c.setGradient('#aaaaaa', '#666666', iconX, iconY, buttonSize, buttonSize, mxConstants.DIRECTION_SOUTH, 1, 1);
  2019. c.rect(iconX, iconY, buttonSize, buttonSize);
  2020. c.fillAndStroke();
  2021. c.setStrokeColor('#333333');
  2022. c.begin();
  2023. c.moveTo(iconX + buttonSize * 0.25, iconY + buttonSize * 0.5);
  2024. c.lineTo(iconX + buttonSize * 0.5, iconY + buttonSize * 0.75);
  2025. c.lineTo(iconX + buttonSize * 0.75, iconY + buttonSize * 0.25);
  2026. c.stroke();
  2027. }
  2028. else
  2029. {
  2030. c.setGradient('#eeeeee', '#cccccc', iconX, iconY, buttonSize, buttonSize, mxConstants.DIRECTION_SOUTH, 1, 1);
  2031. c.rect(iconX, iconY, buttonSize, buttonSize);
  2032. c.fillAndStroke();
  2033. }
  2034. selected = -1;
  2035. }
  2036. };
  2037. mxCellRenderer.registerShape(mxMockupC.SHAPE_ICHECKBOX_GROUP, mxShapeMockupiCheckboxGroup);
  2038. //**********************************************************************************************************************************************************
  2039. //Combo box
  2040. //**********************************************************************************************************************************************************
  2041. /**
  2042. * Extends mxShape.
  2043. */
  2044. function mxShapeMockupiComboBox(bounds, fill, stroke, strokewidth)
  2045. {
  2046. mxShape.call(this);
  2047. this.bounds = bounds;
  2048. this.fill = fill;
  2049. this.stroke = stroke;
  2050. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  2051. };
  2052. /**
  2053. * Extends mxShape.
  2054. */
  2055. mxUtils.extend(mxShapeMockupiComboBox, mxShape);
  2056. /**
  2057. * Function: paintVertexShape
  2058. *
  2059. * Paints the vertex shape.
  2060. */
  2061. mxShapeMockupiComboBox.prototype.paintVertexShape = function(c, x, y, w, h)
  2062. {
  2063. var mainText = decodeURIComponent(mxUtils.getValue(this.style, mxMockupC.BUTTON_TEXT, 'Main Text'));
  2064. var fontColor = mxUtils.getValue(this.style, mxMockupC.STYLE_TEXTCOLOR2, '#666666').toString();
  2065. var fontSize = mxUtils.getValue(this.style, mxConstants.STYLE_FONTSIZE, '8.5').toString();
  2066. c.translate(x, y);
  2067. this.background(c, x, y, w, h);
  2068. c.setShadow(false);
  2069. this.foreground(c, x, y, w, h);
  2070. this.mainText(c, x, y, w, h, mainText, fontSize, fontColor);
  2071. };
  2072. mxShapeMockupiComboBox.prototype.background = function(c, x, y, w, h)
  2073. {
  2074. c.setFillColor('#ffffff');
  2075. c.roundrect(0, 0, w, h, 2.5, 2.5);
  2076. c.fillAndStroke();
  2077. };
  2078. mxShapeMockupiComboBox.prototype.foreground = function(c, x, y, w, h)
  2079. {
  2080. var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '').toString();
  2081. var fillColor2 = mxUtils.getValue(this.style, mxMockupC.STYLE_FILLCOLOR2, '').toString();
  2082. c.setGradient(fillColor, fillColor2, w - 30, 0, 30, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  2083. c.begin();
  2084. c.moveTo(w - 15, 0);
  2085. c.lineTo(w - 2.5, 0);
  2086. c.arcTo(2.5, 2.5, 0, 0, 1, w, 2.5);
  2087. c.lineTo(w, h - 2.5);
  2088. c.arcTo(2.5, 2.5, 0, 0, 1, w - 2.5, h);
  2089. c.lineTo(w - 15, h);
  2090. c.close();
  2091. c.fillAndStroke();
  2092. c.setFillColor('#ffffff');
  2093. c.begin();
  2094. c.moveTo(w - 11, 5);
  2095. c.lineTo(w - 7.5, 10);
  2096. c.lineTo(w - 4, 5);
  2097. c.fill();
  2098. };
  2099. mxShapeMockupiComboBox.prototype.mainText = function(c, x, y, w, h, text, fontSize, fontColor)
  2100. {
  2101. c.begin();
  2102. c.setFontSize(fontSize);
  2103. c.setFontColor(fontColor);
  2104. c.text(2.5, h * 0.5, 0, 0, text, mxConstants.ALIGN_LEFT, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2105. };
  2106. mxCellRenderer.registerShape(mxMockupC.SHAPE_ICOMBO_BOX, mxShapeMockupiComboBox);
  2107. //**********************************************************************************************************************************************************
  2108. //On-Off Button
  2109. //**********************************************************************************************************************************************************
  2110. /**
  2111. * Extends mxShape.
  2112. */
  2113. function mxShapeMockupiOnOffButton(bounds, fill, stroke, strokewidth)
  2114. {
  2115. mxShape.call(this);
  2116. this.bounds = bounds;
  2117. this.fill = fill;
  2118. this.stroke = stroke;
  2119. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  2120. };
  2121. /**
  2122. * Extends mxShape.
  2123. */
  2124. mxUtils.extend(mxShapeMockupiOnOffButton, mxShape);
  2125. mxShapeMockupiOnOffButton.prototype.customProperties = [
  2126. { name: 'buttonState', dispName: 'State', type: 'enum',
  2127. enumList: [{val: 'on', dispName: 'On'}, {val: 'off', dispName: 'Off'}]}
  2128. ];
  2129. /**
  2130. * Function: paintVertexShape
  2131. *
  2132. * Paints the vertex shape.
  2133. */
  2134. mxShapeMockupiOnOffButton.prototype.paintVertexShape = function(c, x, y, w, h)
  2135. {
  2136. c.translate(x, y);
  2137. w = Math.max(w, 2 * h);
  2138. var state = mxUtils.getValue(this.style, mxMockupC.BUTTON_STATE, mxMockupC.STATE_ON);
  2139. this.background(c, x, y, w, h, state);
  2140. c.setShadow(false);
  2141. this.foreground(c, x, y, w, h, state);
  2142. this.mainText(c, x, y, w, h, state);
  2143. };
  2144. mxShapeMockupiOnOffButton.prototype.background = function(c, x, y, w, h, state)
  2145. {
  2146. if (state === mxMockupC.STATE_ON)
  2147. {
  2148. c.setGradient('#E2FFEB', '#008215', 0, 0, w, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  2149. c.roundrect(0, 0, w, h, h * 0.5, h * 0.5);
  2150. c.fillAndStroke();
  2151. }
  2152. else if (state === mxMockupC.STATE_OFF)
  2153. {
  2154. c.setGradient('#cc9999', '#881100', 0, 0, w, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  2155. c.roundrect(0, 0, w, h, h * 0.5, h * 0.5);
  2156. c.fillAndStroke();
  2157. }
  2158. };
  2159. mxShapeMockupiOnOffButton.prototype.foreground = function(c, x, y, w, h, state)
  2160. {
  2161. if (state === mxMockupC.STATE_ON)
  2162. {
  2163. c.setGradient('#ffffff', '#888888', w - h, 0, h, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  2164. c.ellipse(w - h, 0, h, h);
  2165. c.fillAndStroke();
  2166. }
  2167. else
  2168. {
  2169. c.setGradient('#ffffff', '#888888', 0, 0, h, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  2170. c.ellipse(0, 0, h, h);
  2171. c.fillAndStroke();
  2172. }
  2173. };
  2174. mxShapeMockupiOnOffButton.prototype.mainText = function(c, x, y, w, h, state)
  2175. {
  2176. var mainText = mxUtils.getValue(this.style, 'mainText', null);
  2177. c.setFontColor('#ffffff');
  2178. c.setFontSize(8.5);
  2179. if (mainText != '')
  2180. {
  2181. if(state === mxMockupC.STATE_ON)
  2182. {
  2183. c.text(w * 0.5 - h * 0.4, h * 0.5, 0, 0, mainText || 'ON', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2184. }
  2185. else if (state === mxMockupC.STATE_OFF)
  2186. {
  2187. c.text(w * 0.5 + h * 0.4, h * 0.5, 0, 0, mainText || 'OFF', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2188. }
  2189. }
  2190. };
  2191. mxCellRenderer.registerShape(mxMockupC.SHAPE_ION_OFF_BUTTON, mxShapeMockupiOnOffButton);
  2192. //**********************************************************************************************************************************************************
  2193. //Alert Box
  2194. //**********************************************************************************************************************************************************
  2195. /**
  2196. * Extends mxShape.
  2197. */
  2198. function mxShapeMockupiAlertBox(bounds, fill, stroke, strokewidth)
  2199. {
  2200. mxShape.call(this);
  2201. this.bounds = bounds;
  2202. this.fill = fill;
  2203. this.stroke = stroke;
  2204. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  2205. };
  2206. /**
  2207. * Extends mxShape.
  2208. */
  2209. mxUtils.extend(mxShapeMockupiAlertBox, mxShape);
  2210. /**
  2211. * Function: paintVertexShape
  2212. *
  2213. * Paints the vertex shape.
  2214. */
  2215. mxShapeMockupiAlertBox.prototype.paintVertexShape = function(c, x, y, w, h)
  2216. {
  2217. w = Math.max(w, 15);
  2218. h = Math.max(h, 15);
  2219. c.translate(x, y);
  2220. rSize = 7.5;
  2221. this.background(c, x, y, w, h, rSize);
  2222. c.setShadow(false);
  2223. this.foreground(c, x, y, w, h, rSize);
  2224. };
  2225. mxShapeMockupiAlertBox.prototype.background = function(c, x, y, w, h, rSize)
  2226. {
  2227. c.setGradient('#497198', '#193168', 0, 0, w, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  2228. c.setAlpha(0.8);
  2229. c.setStrokeWidth(1);
  2230. c.roundrect(0, 0, w, h, rSize, rSize);
  2231. c.fillAndStroke();
  2232. };
  2233. mxShapeMockupiAlertBox.prototype.foreground = function(c, x, y, w, h, rSize)
  2234. {
  2235. var mainText = decodeURIComponent(mxUtils.getValue(this.style, mxMockupC.BUTTON_TEXT, 'Main Text').toString()).split(',');
  2236. c.setStrokeColor('#497198');
  2237. c.setGradient('#497198', '#c5cee1', 0, 0, w, 22.5, mxConstants.DIRECTION_SOUTH, 1, 1);
  2238. c.setAlpha(0.5);
  2239. c.begin();
  2240. c.moveTo(w - rSize, 0);
  2241. c.arcTo(rSize, rSize, 0, 0, 1, w, rSize);
  2242. c.lineTo(w, 17.5);
  2243. c.arcTo(w * 1.67, h * 2.5, 0, 0, 1, 0, 17.5);
  2244. c.lineTo(0, rSize);
  2245. c.arcTo(rSize, rSize, 0, 0, 1, rSize, 0);
  2246. c.close();
  2247. c.fillAndStroke();
  2248. c.setAlpha(0.8);
  2249. c.setStrokeColor('#ffffff');
  2250. c.setStrokeWidth(1);
  2251. c.roundrect(0, 0, w, h, rSize, rSize);
  2252. c.stroke();
  2253. c.setGradient('#497198', '#c5cee1', 5, h - 50, w - 20, 20, mxConstants.DIRECTION_SOUTH, 1, 1);
  2254. c.roundrect(5, h - 25, w - 10, 20, 2.5, 2.5);
  2255. c.fillAndStroke();
  2256. c.setAlpha(0.9);
  2257. c.setFontSize(9.5);
  2258. c.setFontColor('#ffffff');
  2259. c.text(w * 0.5, h * 0.15, 0, 0, mainText[0], mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2260. c.setFontSize(8);
  2261. c.text(w * 0.5, h * 0.4, 0, 0, mainText[2], mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2262. c.text(w * 0.5, h * 0.55, 0, 0, mainText[3], mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2263. c.setFontSize(8.5);
  2264. c.text(w * 0.5, h - 15, 0, 0, mainText[1], mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2265. };
  2266. mxCellRenderer.registerShape(mxMockupC.SHAPE_IALERT_BOX, mxShapeMockupiAlertBox);
  2267. //**********************************************************************************************************************************************************
  2268. //Dialog Box
  2269. //**********************************************************************************************************************************************************
  2270. /**
  2271. * Extends mxShape.
  2272. */
  2273. function mxShapeMockupiDialogBox(bounds, fill, stroke, strokewidth)
  2274. {
  2275. mxShape.call(this);
  2276. this.bounds = bounds;
  2277. this.fill = fill;
  2278. this.stroke = stroke;
  2279. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  2280. };
  2281. /**
  2282. * Extends mxShape.
  2283. */
  2284. mxUtils.extend(mxShapeMockupiDialogBox, mxShape);
  2285. /**
  2286. * Function: paintVertexShape
  2287. *
  2288. * Paints the vertex shape.
  2289. */
  2290. mxShapeMockupiDialogBox.prototype.paintVertexShape = function(c, x, y, w, h)
  2291. {
  2292. w = Math.max(w, 15);
  2293. h = Math.max(h, 15);
  2294. c.translate(x, y);
  2295. rSize = 7.5;
  2296. this.background(c, x, y, w, h, rSize);
  2297. c.setShadow(false);
  2298. this.foreground(c, x, y, w, h, rSize);
  2299. };
  2300. mxShapeMockupiDialogBox.prototype.background = function(c, x, y, w, h, rSize)
  2301. {
  2302. c.setGradient('#497198', '#193168', 0, 0, w, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  2303. c.setAlpha(0.8);
  2304. c.setStrokeWidth(1);
  2305. c.roundrect(0, 0, w, h, rSize, rSize);
  2306. c.fillAndStroke();
  2307. };
  2308. mxShapeMockupiDialogBox.prototype.foreground = function(c, x, y, w, h, rSize)
  2309. {
  2310. var mainText = decodeURIComponent(mxUtils.getValue(this.style, mxMockupC.BUTTON_TEXT, 'Main Text').toString()).split(',');
  2311. c.setStrokeColor('#497198');
  2312. c.setGradient('#497198', '#c5cee1', 0, 0, w, 22.5, mxConstants.DIRECTION_SOUTH, 1, 1);
  2313. c.setAlpha(0.5);
  2314. c.begin();
  2315. c.moveTo(w - rSize, 0);
  2316. c.arcTo(rSize, rSize, 0, 0, 1, w, rSize);
  2317. c.lineTo(w, 17.5);
  2318. c.arcTo(w * 1.67, h * 2.5, 0, 0, 1, 0, 17.5);
  2319. c.lineTo(0, rSize);
  2320. c.arcTo(rSize, rSize, 0, 0, 1, rSize, 0);
  2321. c.close();
  2322. c.fillAndStroke();
  2323. c.setAlpha(0.8);
  2324. c.setStrokeColor('#ffffff');
  2325. c.setStrokeWidth(1);
  2326. c.roundrect(0, 0, w, h, rSize, rSize);
  2327. c.stroke();
  2328. c.setGradient('#497198', '#c5cee1', 5, h - 25, w * 0.5 - 10, 20, mxConstants.DIRECTION_SOUTH, 1, 1);
  2329. c.roundrect(5, h - 25, w * 0.5 - 10, 20, 2.5, 2.5);
  2330. c.fillAndStroke();
  2331. c.roundrect(w * 0.5 + 2.5, h - 25, w * 0.5 - 10, 20, 2.5, 2.5);
  2332. c.fillAndStroke();
  2333. c.setAlpha(0.9);
  2334. c.setFontSize(9.5);
  2335. c.setFontColor('#ffffff');
  2336. c.text(w * 0.5, h * 0.15, 0, 0, mainText[0], mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2337. c.setFontSize(8);
  2338. c.text(w * 0.5, h * 0.4, 0, 0, mainText[3], mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2339. c.text(w * 0.5, h * 0.55, 0, 0, mainText[4], mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2340. c.setFontSize(8.5);
  2341. c.text(w * 0.25, h - 15, 0, 0, mainText[1], mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2342. c.text(w * 0.75, h - 15, 0, 0, mainText[2], mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2343. };
  2344. mxCellRenderer.registerShape(mxMockupC.SHAPE_IDIALOG_BOX, mxShapeMockupiDialogBox);
  2345. //**********************************************************************************************************************************************************
  2346. //Lock Button
  2347. //**********************************************************************************************************************************************************
  2348. /**
  2349. * Extends mxShape.
  2350. */
  2351. function mxShapeMockupiLockButton(bounds, fill, stroke, strokewidth)
  2352. {
  2353. mxShape.call(this);
  2354. this.bounds = bounds;
  2355. this.fill = fill;
  2356. this.stroke = stroke;
  2357. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  2358. };
  2359. /**
  2360. * Extends mxShape.
  2361. */
  2362. mxUtils.extend(mxShapeMockupiLockButton, mxShape);
  2363. /**
  2364. * Function: paintVertexShape
  2365. *
  2366. * Paints the vertex shape.
  2367. */
  2368. mxShapeMockupiLockButton.prototype.paintVertexShape = function(c, x, y, w, h)
  2369. {
  2370. c.translate(x, y);
  2371. c.setShadow(false);
  2372. c.setAlpha(0.7);
  2373. c.setGradient('#4A4F56', '#70757B', 0, 0, w, h, mxConstants.DIRECTION_NORTH, 1, 1);
  2374. c.rect(0, 0, w, h);
  2375. c.fill();
  2376. c.setAlpha(0.8);
  2377. c.setGradient('#18232D', '#1F2933', 10, 10, 154, 30, mxConstants.DIRECTION_NORTH, 1, 1);
  2378. c.roundrect(10, h * 0.5 - 15, w - 20, 30, 7.5, 7.5);
  2379. c.fill();
  2380. c.setAlpha(1);
  2381. c.setGradient('#E9F3FD', '#ADB7C1', 12.5, 12.5, 40, 25, mxConstants.DIRECTION_SOUTH, 1, 1);
  2382. c.roundrect(12.5, h * 0.5 - 12.5, 40, 25, 5, 5);
  2383. c.fill();
  2384. c.setAlpha(0.8);
  2385. c.setStrokeWidth(0.5);
  2386. c.setStrokeColor('#aabbbb');
  2387. c.setGradient('#AEB7C1', '#667079', 20, 17.5, 25, 15, mxConstants.DIRECTION_SOUTH, 1, 1);
  2388. c.begin();
  2389. c.moveTo(20, h * 0.5 - 3.5);
  2390. c.lineTo(35, h * 0.5 - 3.5);
  2391. c.lineTo(35, h * 0.5 - 7.5);
  2392. c.lineTo(45, h * 0.5);
  2393. c.lineTo(35, h * 0.5 + 7.5);
  2394. c.lineTo(35, h * 0.5 + 3.5);
  2395. c.lineTo(20, h * 0.5 + 3.5);
  2396. c.close();
  2397. c.fillAndStroke();
  2398. var mainText = mxUtils.getValue(this.style, 'mainText', null);
  2399. if (mainText != '')
  2400. {
  2401. c.setFontSize(12.5);
  2402. c.setFontColor('#cccccc');
  2403. c.text(w / 2 + 20.5, h / 2, 0, 0, 'slide to unlock', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2404. }
  2405. };
  2406. mxCellRenderer.registerShape(mxMockupC.SHAPE_ILOCK_BUTTON, mxShapeMockupiLockButton);
  2407. //**********************************************************************************************************************************************************
  2408. //Arrow Icon
  2409. //**********************************************************************************************************************************************************
  2410. /**
  2411. * Extends mxShape.
  2412. */
  2413. function mxShapeMockupiArrowIcon(bounds, fill, stroke, strokewidth)
  2414. {
  2415. mxShape.call(this);
  2416. this.bounds = bounds;
  2417. this.fill = fill;
  2418. this.stroke = stroke;
  2419. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  2420. };
  2421. /**
  2422. * Extends mxShape.
  2423. */
  2424. mxUtils.extend(mxShapeMockupiArrowIcon, mxShape);
  2425. /**
  2426. * Function: paintVertexShape
  2427. *
  2428. * Paints the vertex shape.
  2429. */
  2430. mxShapeMockupiArrowIcon.prototype.paintVertexShape = function(c, x, y, w, h)
  2431. {
  2432. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '').toString();
  2433. c.translate(x, y);
  2434. this.background(c, x, y, w, h, strokeColor);
  2435. c.setShadow(false);
  2436. this.foreground(c, x, y, w, h, strokeColor);
  2437. };
  2438. mxShapeMockupiArrowIcon.prototype.background = function(c, x, y, w, h, strokeColor)
  2439. {
  2440. var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '').toString();
  2441. var fillColor2 = mxUtils.getValue(this.style, mxMockupC.STYLE_FILLCOLOR2, '').toString();
  2442. c.setGradient(fillColor, fillColor2, 0, 0, w, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  2443. c.setStrokeWidth(1.5);
  2444. c.setStrokeColor(strokeColor);
  2445. c.ellipse(0, 0, w, h);
  2446. c.fillAndStroke();
  2447. };
  2448. mxShapeMockupiArrowIcon.prototype.foreground = function(c, x, y, w, h, strokeColor)
  2449. {
  2450. c.setStrokeWidth(2.5);
  2451. c.begin();
  2452. c.moveTo(w * 0.4, h * 0.22);
  2453. c.lineTo(w * 0.65, h * 0.5);
  2454. c.lineTo(w * 0.4, h * 0.78);
  2455. c.stroke();
  2456. };
  2457. mxCellRenderer.registerShape(mxMockupC.SHAPE_IARROW_ICON, mxShapeMockupiArrowIcon);
  2458. //**********************************************************************************************************************************************************
  2459. //Delete Icon
  2460. //**********************************************************************************************************************************************************
  2461. /**
  2462. * Extends mxShape.
  2463. */
  2464. function mxShapeMockupiDeleteIcon(bounds, fill, stroke, strokewidth)
  2465. {
  2466. mxShape.call(this);
  2467. this.bounds = bounds;
  2468. this.fill = fill;
  2469. this.stroke = stroke;
  2470. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  2471. };
  2472. /**
  2473. * Extends mxShape.
  2474. */
  2475. mxUtils.extend(mxShapeMockupiDeleteIcon, mxShape);
  2476. /**
  2477. * Function: paintVertexShape
  2478. *
  2479. * Paints the vertex shape.
  2480. */
  2481. mxShapeMockupiDeleteIcon.prototype.paintVertexShape = function(c, x, y, w, h)
  2482. {
  2483. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '').toString();
  2484. c.translate(x, y);
  2485. this.background(c, x, y, w, h, strokeColor);
  2486. c.setShadow(false);
  2487. this.foreground(c, x, y, w, h, strokeColor);
  2488. };
  2489. mxShapeMockupiDeleteIcon.prototype.background = function(c, x, y, w, h, strokeColor)
  2490. {
  2491. var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '').toString();
  2492. var fillColor2 = mxUtils.getValue(this.style, mxMockupC.STYLE_FILLCOLOR2, '').toString();
  2493. c.setGradient(fillColor, fillColor2, 0, 0, w, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  2494. c.setStrokeWidth(1.5);
  2495. c.setStrokeColor(strokeColor);
  2496. c.ellipse(0, 0, w, h);
  2497. c.fillAndStroke();
  2498. };
  2499. mxShapeMockupiDeleteIcon.prototype.foreground = function(c, x, y, w, h, strokeColor)
  2500. {
  2501. c.setStrokeWidth(2.5);
  2502. c.begin();
  2503. c.moveTo(w * 0.25, h * 0.5);
  2504. c.lineTo(w * 0.75, h * 0.5);
  2505. c.stroke();
  2506. };
  2507. mxCellRenderer.registerShape(mxMockupC.SHAPE_IDELETE_ICON, mxShapeMockupiDeleteIcon);
  2508. //**********************************************************************************************************************************************************
  2509. //Add Icon
  2510. //**********************************************************************************************************************************************************
  2511. /**
  2512. * Extends mxShape.
  2513. */
  2514. function mxShapeMockupiAddIcon(bounds, fill, stroke, strokewidth)
  2515. {
  2516. mxShape.call(this);
  2517. this.bounds = bounds;
  2518. this.fill = fill;
  2519. this.stroke = stroke;
  2520. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  2521. };
  2522. /**
  2523. * Extends mxShape.
  2524. */
  2525. mxUtils.extend(mxShapeMockupiAddIcon, mxShape);
  2526. /**
  2527. * Function: paintVertexShape
  2528. *
  2529. * Paints the vertex shape.
  2530. */
  2531. mxShapeMockupiAddIcon.prototype.paintVertexShape = function(c, x, y, w, h)
  2532. {
  2533. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '').toString();
  2534. var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '').toString();
  2535. var fillColor2 = mxUtils.getValue(this.style, mxMockupC.STYLE_FILLCOLOR2, '').toString();
  2536. c.setGradient(fillColor, fillColor2, 0, 0, w, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  2537. c.setStrokeColor(strokeColor);
  2538. c.translate(x, y);
  2539. this.background(c, x, y, w, h, strokeColor);
  2540. c.setShadow(false);
  2541. this.foreground(c, x, y, w, h, strokeColor);
  2542. };
  2543. mxShapeMockupiAddIcon.prototype.background = function(c, x, y, w, h, strokeColor)
  2544. {
  2545. c.setStrokeWidth(1.5);
  2546. c.ellipse(0, 0, w, h);
  2547. c.fillAndStroke();
  2548. };
  2549. mxShapeMockupiAddIcon.prototype.foreground = function(c, x, y, w, h, strokeColor)
  2550. {
  2551. c.setStrokeWidth(2.5);
  2552. c.begin();
  2553. c.moveTo(w * 0.25, h * 0.5);
  2554. c.lineTo(w * 0.75, h * 0.5);
  2555. c.moveTo(w * 0.5, h * 0.25);
  2556. c.lineTo(w * 0.5, h * 0.75);
  2557. c.stroke();
  2558. };
  2559. mxCellRenderer.registerShape(mxMockupC.SHAPE_IADD_ICON, mxShapeMockupiAddIcon);
  2560. //**********************************************************************************************************************************************************
  2561. //Info Icon
  2562. //**********************************************************************************************************************************************************
  2563. /**
  2564. * Extends mxShape.
  2565. */
  2566. function mxShapeMockupiInfoIcon(bounds, fill, stroke, strokewidth)
  2567. {
  2568. mxShape.call(this);
  2569. this.bounds = bounds;
  2570. this.fill = fill;
  2571. this.stroke = stroke;
  2572. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  2573. };
  2574. /**
  2575. * Extends mxShape.
  2576. */
  2577. mxUtils.extend(mxShapeMockupiInfoIcon, mxShape);
  2578. /**
  2579. * Function: paintVertexShape
  2580. *
  2581. * Paints the vertex shape.
  2582. */
  2583. mxShapeMockupiInfoIcon.prototype.paintVertexShape = function(c, x, y, w, h)
  2584. {
  2585. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '').toString();
  2586. c.translate(x, y);
  2587. this.background(c, x, y, w, h, strokeColor);
  2588. c.setShadow(false);
  2589. this.foreground(c, x, y, w, h, strokeColor);
  2590. };
  2591. mxShapeMockupiInfoIcon.prototype.background = function(c, x, y, w, h, strokeColor)
  2592. {
  2593. var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '').toString();
  2594. var fillColor2 = mxUtils.getValue(this.style, mxMockupC.STYLE_FILLCOLOR2, '').toString();
  2595. c.setGradient(fillColor, fillColor2, 0, 0, w, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  2596. c.setStrokeWidth(1.5);
  2597. c.setStrokeColor(strokeColor);
  2598. c.ellipse(0, 0, w, h);
  2599. c.fillAndStroke();
  2600. };
  2601. mxShapeMockupiInfoIcon.prototype.foreground = function(c, x, y, w, h, strokeColor)
  2602. {
  2603. c.setStrokeWidth(2.5);
  2604. c.begin();
  2605. c.setFillColor('#ffffff');
  2606. c.moveTo(w * 0.47, h * 0.334);
  2607. c.arcTo(w * 0.1, h * 0.15, 60, 0, 1, w * 0.61, h * 0.42);
  2608. c.lineTo(w * 0.51, h * 0.7);
  2609. c.arcTo(w * 0.026, h * 0.03, 30, 0, 0, w * 0.54, h * 0.74);
  2610. c.lineTo(w * 0.608, h * 0.684);
  2611. c.arcTo(w * 0.02, h * 0.015, 0, 0, 1, w * 0.638, h * 0.706);
  2612. c.arcTo(w * 0.45, h * 0.45, 0, 0, 1, w * 0.42, h * 0.865);
  2613. c.arcTo(w * 0.1, h * 0.08, -15, 0, 1, w * 0.325, h * 0.77);
  2614. c.lineTo(w * 0.358, h * 0.66);
  2615. c.lineTo(w * 0.435, h * 0.46);
  2616. c.arcTo(w * 0.023, h * 0.03, 0, 0, 0, w * 0.4, h * 0.43);
  2617. c.lineTo(w * 0.338, h * 0.484);
  2618. c.arcTo(w * 0.01, h * 0.015, 45, 0, 1, w * 0.31, h * 0.47);
  2619. c.arcTo(w * 0.3, h * 0.3, 0, 0, 1, w * 0.47, h * 0.334);
  2620. c.fill();
  2621. c.begin();
  2622. c.moveTo(w * 0.5438, h * 0.141);
  2623. c.arcTo(w * 0.0776, h * 0.0898, 40, 0, 1, w * 0.6671, h * 0.2308);
  2624. c.arcTo(w * 0.0776, h * 0.0898, 40, 0, 1, w * 0.5438, h * 0.141);
  2625. c.close();
  2626. c.fill();
  2627. };
  2628. mxCellRenderer.registerShape(mxMockupC.SHAPE_IINFO_ICON, mxShapeMockupiInfoIcon);
  2629. //**********************************************************************************************************************************************************
  2630. //Sort/Find Icon
  2631. //**********************************************************************************************************************************************************
  2632. /**
  2633. * Extends mxShape.
  2634. */
  2635. function mxShapeMockupiSortFindIcon(bounds, fill, stroke, strokewidth)
  2636. {
  2637. mxShape.call(this);
  2638. this.bounds = bounds;
  2639. this.fill = fill;
  2640. this.stroke = stroke;
  2641. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  2642. };
  2643. /**
  2644. * Extends mxShape.
  2645. */
  2646. mxUtils.extend(mxShapeMockupiSortFindIcon, mxShape);
  2647. /**
  2648. * Function: paintVertexShape
  2649. *
  2650. * Paints the vertex shape.
  2651. */
  2652. mxShapeMockupiSortFindIcon.prototype.paintVertexShape = function(c, x, y, w, h)
  2653. {
  2654. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '').toString();
  2655. c.translate(x, y);
  2656. this.background(c, x, y, w, h, strokeColor);
  2657. c.setShadow(false);
  2658. this.foreground(c, x, y, w, h, strokeColor);
  2659. };
  2660. mxShapeMockupiSortFindIcon.prototype.background = function(c, x, y, w, h, strokeColor)
  2661. {
  2662. var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '').toString();
  2663. var fillColor2 = mxUtils.getValue(this.style, mxMockupC.STYLE_FILLCOLOR2, '').toString();
  2664. c.setGradient(fillColor, fillColor2, 0, 0, w, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  2665. c.setStrokeWidth(1.5);
  2666. c.setStrokeColor(strokeColor);
  2667. c.roundrect(0, 0, w, h, w * 0.1, h * 0.1);
  2668. c.fillAndStroke();
  2669. };
  2670. mxShapeMockupiSortFindIcon.prototype.foreground = function(c, x, y, w, h, strokeColor)
  2671. {
  2672. c.setStrokeWidth((Math.min(h, w)) / 20);
  2673. c.begin();
  2674. c.setFillColor('#ffffff');
  2675. c.moveTo(w * 0.1, h * 0.25);
  2676. c.lineTo(w * 0.9, h * 0.25);
  2677. c.moveTo(w * 0.1, h * 0.4);
  2678. c.lineTo(w * 0.9, h * 0.4);
  2679. c.moveTo(w * 0.1, h * 0.55);
  2680. c.lineTo(w * 0.6, h * 0.55);
  2681. c.moveTo(w * 0.1, h * 0.7);
  2682. c.lineTo(w * 0.5, h * 0.7);
  2683. c.stroke();
  2684. c.begin();
  2685. c.ellipse(w * 0.6, h * 0.6, w * 0.2, h * 0.2);
  2686. c.stroke();
  2687. c.begin();
  2688. c.moveTo(w * 0.77, h * 0.77);
  2689. c.lineTo(w * 0.85, h * 0.85);
  2690. c.stroke();
  2691. };
  2692. mxCellRenderer.registerShape(mxMockupC.SHAPE_ISORT_FIND_ICON, mxShapeMockupiSortFindIcon);
  2693. //**********************************************************************************************************************************************************
  2694. //Check Icon
  2695. //**********************************************************************************************************************************************************
  2696. /**
  2697. * Extends mxShape.
  2698. */
  2699. function mxShapeMockupiCheckIcon(bounds, fill, stroke, strokewidth)
  2700. {
  2701. mxShape.call(this);
  2702. this.bounds = bounds;
  2703. this.fill = fill;
  2704. this.stroke = stroke;
  2705. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  2706. };
  2707. /**
  2708. * Extends mxShape.
  2709. */
  2710. mxUtils.extend(mxShapeMockupiCheckIcon, mxShape);
  2711. /**
  2712. * Function: paintVertexShape
  2713. *
  2714. * Paints the vertex shape.
  2715. */
  2716. mxShapeMockupiCheckIcon.prototype.paintVertexShape = function(c, x, y, w, h)
  2717. {
  2718. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '').toString();
  2719. c.translate(x, y);
  2720. this.background(c, x, y, w, h, strokeColor);
  2721. c.setShadow(false);
  2722. this.foreground(c, x, y, w, h, strokeColor);
  2723. };
  2724. mxShapeMockupiCheckIcon.prototype.background = function(c, x, y, w, h, strokeColor)
  2725. {
  2726. var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '').toString();
  2727. var fillColor2 = mxUtils.getValue(this.style, mxMockupC.STYLE_FILLCOLOR2, '').toString();
  2728. c.setGradient(fillColor, fillColor2, 0, 0, w, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  2729. c.setStrokeWidth(1.5);
  2730. c.setStrokeColor(strokeColor);
  2731. c.ellipse(0, 0, w, h);
  2732. c.fillAndStroke();
  2733. };
  2734. mxShapeMockupiCheckIcon.prototype.foreground = function(c, x, y, w, h, strokeColor)
  2735. {
  2736. c.setStrokeWidth(2.5);
  2737. c.begin();
  2738. c.moveTo(w * 0.25, h * 0.5);
  2739. c.lineTo(w * 0.5, h * 0.65);
  2740. c.lineTo(w * 0.75, h * 0.25);
  2741. c.stroke();
  2742. };
  2743. mxCellRenderer.registerShape(mxMockupC.SHAPE_ICHECK_ICON, mxShapeMockupiCheckIcon);
  2744. //**********************************************************************************************************************************************************
  2745. //Keyboard (letters)
  2746. //**********************************************************************************************************************************************************
  2747. /**
  2748. * Extends mxShape.
  2749. */
  2750. function mxShapeMockupiKeybLetters(bounds, fill, stroke, strokewidth)
  2751. {
  2752. mxShape.call(this);
  2753. this.bounds = bounds;
  2754. this.fill = fill;
  2755. this.stroke = stroke;
  2756. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  2757. };
  2758. /**
  2759. * Extends mxShape.
  2760. */
  2761. mxUtils.extend(mxShapeMockupiKeybLetters, mxShape);
  2762. /**
  2763. * Function: paintVertexShape
  2764. *
  2765. * Paints the vertex shape.
  2766. */
  2767. mxShapeMockupiKeybLetters.prototype.paintVertexShape = function(c, x, y, w, h)
  2768. {
  2769. c.translate(x, y);
  2770. this.background(c, x, y, w, h);
  2771. c.setShadow(true);
  2772. this.foreground(c, x, y, w, h);
  2773. };
  2774. mxShapeMockupiKeybLetters.prototype.background = function(c, x, y, w, h)
  2775. {
  2776. c.setGradient('#8A97A7', '#425163', 0, 0, w, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  2777. c.rect(0, 0, w, h);
  2778. c.fill();
  2779. };
  2780. mxShapeMockupiKeybLetters.prototype.foreground = function(c, x, y, w, h, strokeColor)
  2781. {
  2782. c.setGradient('#EEF3F9', '#DBE2E9', w * 0.0086, h * 0.03, w * 0.0776, h * 0.19, mxConstants.DIRECTION_SOUTH, 1, 1);
  2783. rSizeX = w * 0.0144;
  2784. rSizeY = h * 0.025;
  2785. c.setFontSize(10.5);
  2786. c.setFontColor('#000000');
  2787. c.roundrect(w * 0.0086, h * 0.03, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2788. c.fill();
  2789. c.text(w * 0.0474, h * 0.125, 0, 0, 'Q', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2790. c.roundrect(w * 0.1092, h * 0.03, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2791. c.fill();
  2792. c.text(w * 0.148, h * 0.125, 0, 0, 'W', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2793. c.roundrect(w * 0.2098, h * 0.03, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2794. c.fill();
  2795. c.text(w * 0.2486, h * 0.125, 0, 0, 'E', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2796. c.roundrect(w * 0.3103, h * 0.03, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2797. c.fill();
  2798. c.text(w * 0.3491, h * 0.125, 0, 0, 'R', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2799. c.roundrect(w * 0.4109, h * 0.03, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2800. c.fill();
  2801. c.text(w * 0.4497, h * 0.125, 0, 0, 'T', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2802. c.roundrect(w * 0.5115, h * 0.03, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2803. c.fill();
  2804. c.text(w * 0.5503, h * 0.125, 0, 0, 'Y', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2805. c.roundrect(w * 0.6121, h * 0.03, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2806. c.fill();
  2807. c.text(w * 0.6509, h * 0.125, 0, 0, 'U', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2808. c.roundrect(w * 0.7126, h * 0.03, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2809. c.fill();
  2810. c.text(w * 0.7514, h * 0.125, 0, 0, 'I', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2811. c.roundrect(w * 0.8132, h * 0.03, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2812. c.fill();
  2813. c.text(w * 0.852, h * 0.125, 0, 0, 'O', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2814. c.roundrect(w * 0.9138, h * 0.03, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2815. c.fill();
  2816. c.text(w * 0.9526, h * 0.125, 0, 0, 'P', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2817. c.roundrect(w * 0.0632, h * 0.28, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2818. c.fill();
  2819. c.text(w * 0.102, h * 0.375, 0, 0, 'A', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2820. c.roundrect(w * 0.1638, h * 0.28, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2821. c.fill();
  2822. c.text(w * 0.2026, h * 0.375, 0, 0, 'S', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2823. c.roundrect(w * 0.2644, h * 0.28, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2824. c.fill();
  2825. c.text(w * 0.3032, h * 0.375, 0, 0, 'D', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2826. c.roundrect(w * 0.3649, h * 0.28, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2827. c.fill();
  2828. c.text(w * 0.4037, h * 0.375, 0, 0, 'F', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2829. c.roundrect(w * 0.4655, h * 0.28, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2830. c.fill();
  2831. c.text(w * 0.5043, h * 0.375, 0, 0, 'G', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2832. c.roundrect(w * 0.5661, h * 0.28, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2833. c.fill();
  2834. c.text(w * 0.6049, h * 0.375, 0, 0, 'H', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2835. c.roundrect(w * 0.6667, h * 0.28, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2836. c.fill();
  2837. c.text(w * 0.7055, h * 0.375, 0, 0, 'J', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2838. c.roundrect(w * 0.7672, h * 0.28, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2839. c.fill();
  2840. c.text(w * 0.806, h * 0.375, 0, 0, 'K', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2841. c.roundrect(w * 0.8678, h * 0.28, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2842. c.fill();
  2843. c.text(w * 0.9066, h * 0.375, 0, 0, 'L', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2844. c.roundrect(w * 0.1638, h * 0.53, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2845. c.fill();
  2846. c.text(w * 0.2026, h * 0.625, 0, 0, 'Z', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2847. c.roundrect(w * 0.2644, h * 0.53, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2848. c.fill();
  2849. c.text(w * 0.3032, h * 0.625, 0, 0, 'X', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2850. c.roundrect(w * 0.3649, h * 0.53, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2851. c.fill();
  2852. c.text(w * 0.4037, h * 0.625, 0, 0, 'C', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2853. c.roundrect(w * 0.4655, h * 0.53, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2854. c.fill();
  2855. c.text(w * 0.5043, h * 0.625, 0, 0, 'V', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2856. c.roundrect(w * 0.5661, h * 0.53, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2857. c.fill();
  2858. c.text(w * 0.6049, h * 0.625, 0, 0, 'B', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2859. c.roundrect(w * 0.6667, h * 0.53, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2860. c.fill();
  2861. c.text(w * 0.7055, h * 0.625, 0, 0, 'N', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2862. c.roundrect(w * 0.7672, h * 0.53, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2863. c.fill();
  2864. c.text(w * 0.806, h * 0.625, 0, 0, 'M', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2865. c.roundrect(w * 0.2644, h * 0.78, w * 0.4799, h * 0.19, rSizeX, rSizeY);
  2866. c.fill();
  2867. c.setFontColor('#666666');
  2868. c.text(w * 0.5043, h * 0.875, 0, 0, 'space', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2869. c.setFontColor('#ffffff');
  2870. c.setGradient('#8B98A8', '#677488', w * 0.0115, h * 0.53, w * 0.1207, h * 0.19, mxConstants.DIRECTION_SOUTH, 1, 1);
  2871. c.roundrect(w * 0.0115, h * 0.53, w * 0.1207, h * 0.19, rSizeX, rSizeY);
  2872. c.fill();
  2873. c.setGradient('#8B98A8', '#677488', w * 0.8736, h * 0.53, w * 0.115, h * 0.19, mxConstants.DIRECTION_SOUTH, 1, 1);
  2874. c.roundrect(w * 0.8736, h * 0.53, w * 0.115, h * 0.19, rSizeX, rSizeY);
  2875. c.fill();
  2876. c.setGradient('#8B98A8', '#677488', w * 0.0115, h * 0.78, w * 0.2299, h * 0.19, mxConstants.DIRECTION_SOUTH, 1, 1);
  2877. c.roundrect(w * 0.0115, h * 0.78, w * 0.2299, h * 0.19, rSizeX, rSizeY);
  2878. c.fill();
  2879. c.setGradient('#8B98A8', '#677488', w * 0.7672, h * 0.78, w * 0.2213, h * 0.19, mxConstants.DIRECTION_SOUTH, 1, 1);
  2880. c.roundrect(w * 0.7672, h * 0.78, w * 0.2213, h * 0.19, rSizeX, rSizeY);
  2881. c.fill();
  2882. c.text(w * 0.1264, h * 0.875, 0, 0, '.?123', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2883. c.text(w * 0.8779, h * 0.875, 0, 0, 'return', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2884. c.setShadow(false);
  2885. c.setLineJoin('round');
  2886. c.setStrokeColor('#ffffff');
  2887. c.setFillColor('#ffffff');
  2888. c.setStrokeWidth(1.5);
  2889. c.begin();
  2890. c.moveTo(w * 0.0402, h * 0.635);
  2891. c.lineTo(w * 0.0718, h * 0.58);
  2892. c.lineTo(w * 0.1034, h * 0.635);
  2893. c.lineTo(w * 0.0862, h * 0.635);
  2894. c.lineTo(w * 0.0862, h * 0.67);
  2895. c.lineTo(w * 0.0575, h * 0.67);
  2896. c.lineTo(w * 0.0575, h * 0.635);
  2897. c.close();
  2898. c.stroke();
  2899. c.begin();
  2900. c.moveTo(w * 0.9109, h * 0.585);
  2901. c.lineTo(w * 0.9655, h * 0.585);
  2902. c.lineTo(w * 0.9655, h * 0.665);
  2903. c.lineTo(w * 0.9109, h * 0.665);
  2904. c.lineTo(w * 0.8879, h * 0.625);
  2905. c.close();
  2906. c.fillAndStroke();
  2907. c.setStrokeColor('#677488');
  2908. c.begin();
  2909. c.moveTo(w * 0.9224, h * 0.605);
  2910. c.lineTo(w * 0.9454, h * 0.645);
  2911. c.moveTo(w * 0.9224, h * 0.645);
  2912. c.lineTo(w * 0.9454, h * 0.605);
  2913. c.stroke();
  2914. };
  2915. mxCellRenderer.registerShape(mxMockupC.SHAPE_IKEYB_LETTERS, mxShapeMockupiKeybLetters);
  2916. //**********************************************************************************************************************************************************
  2917. //Keyboard (numbers)
  2918. //**********************************************************************************************************************************************************
  2919. /**
  2920. * Extends mxShape.
  2921. */
  2922. function mxShapeMockupiKeybNumbers(bounds, fill, stroke, strokewidth)
  2923. {
  2924. mxShape.call(this);
  2925. this.bounds = bounds;
  2926. this.fill = fill;
  2927. this.stroke = stroke;
  2928. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  2929. };
  2930. /**
  2931. * Extends mxShape.
  2932. */
  2933. mxUtils.extend(mxShapeMockupiKeybNumbers, mxShape);
  2934. /**
  2935. * Function: paintVertexShape
  2936. *
  2937. * Paints the vertex shape.
  2938. */
  2939. mxShapeMockupiKeybNumbers.prototype.paintVertexShape = function(c, x, y, w, h)
  2940. {
  2941. c.translate(x, y);
  2942. this.background(c, x, y, w, h);
  2943. c.setShadow(true);
  2944. this.foreground(c, x, y, w, h);
  2945. };
  2946. mxShapeMockupiKeybNumbers.prototype.background = function(c, x, y, w, h)
  2947. {
  2948. c.setGradient('#8A97A7', '#425163', 0, 0, w, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  2949. c.rect(0, 0, w, h);
  2950. c.fill();
  2951. };
  2952. mxShapeMockupiKeybNumbers.prototype.foreground = function(c, x, y, w, h, strokeColor)
  2953. {
  2954. c.setGradient('#EEF3F9', '#DBE2E9', w * 0.0086, h * 0.03, w * 0.0776, h * 0.19, mxConstants.DIRECTION_SOUTH, 1, 1);
  2955. rSizeX = w * 0.0144;
  2956. rSizeY = h * 0.025;
  2957. c.setFontSize(10.5);
  2958. c.setFontColor('#000000');
  2959. c.roundrect(w * 0.0086, h * 0.03, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2960. c.fill();
  2961. c.text(w * 0.0474, h * 0.125, 0, 0, '1', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2962. c.roundrect(w * 0.1092, h * 0.03, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2963. c.fill();
  2964. c.text(w * 0.148, h * 0.125, 0, 0, '2', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2965. c.roundrect(w * 0.2098, h * 0.03, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2966. c.fill();
  2967. c.text(w * 0.2486, h * 0.125, 0, 0, '3', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2968. c.roundrect(w * 0.3103, h * 0.03, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2969. c.fill();
  2970. c.text(w * 0.3491, h * 0.125, 0, 0, '4', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2971. c.roundrect(w * 0.4109, h * 0.03, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2972. c.fill();
  2973. c.text(w * 0.4497, h * 0.125, 0, 0, '5', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2974. c.roundrect(w * 0.5115, h * 0.03, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2975. c.fill();
  2976. c.text(w * 0.5503, h * 0.125, 0, 0, '6', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2977. c.roundrect(w * 0.6121, h * 0.03, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2978. c.fill();
  2979. c.text(w * 0.6509, h * 0.125, 0, 0, '7', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2980. c.roundrect(w * 0.7126, h * 0.03, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2981. c.fill();
  2982. c.text(w * 0.7514, h * 0.125, 0, 0, '8', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2983. c.roundrect(w * 0.8132, h * 0.03, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2984. c.fill();
  2985. c.text(w * 0.852, h * 0.125, 0, 0, '9', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2986. c.roundrect(w * 0.9138, h * 0.03, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2987. c.fill();
  2988. c.text(w * 0.9526, h * 0.125, 0, 0, '0', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2989. c.roundrect(w * 0.0086, h * 0.28, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2990. c.fill();
  2991. c.text(w * 0.0474, h * 0.375, 0, 0, '-', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2992. c.roundrect(w * 0.1092, h * 0.28, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2993. c.fill();
  2994. c.text(w * 0.148, h * 0.375, 0, 0, '/', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2995. c.roundrect(w * 0.2098, h * 0.28, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2996. c.fill();
  2997. c.text(w * 0.2486, h * 0.375, 0, 0, ':', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  2998. c.roundrect(w * 0.3103, h * 0.28, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  2999. c.fill();
  3000. c.text(w * 0.3491, h * 0.375, 0, 0, ';', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3001. c.roundrect(w * 0.4109, h * 0.28, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  3002. c.fill();
  3003. c.text(w * 0.4497, h * 0.375, 0, 0, '(', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3004. c.roundrect(w * 0.5115, h * 0.28, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  3005. c.fill();
  3006. c.text(w * 0.5503, h * 0.375, 0, 0, ')', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3007. c.roundrect(w * 0.6121, h * 0.28, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  3008. c.fill();
  3009. c.text(w * 0.6509, h * 0.375, 0, 0, '$', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3010. c.roundrect(w * 0.7126, h * 0.28, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  3011. c.fill();
  3012. c.text(w * 0.7514, h * 0.375, 0, 0, '&', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3013. c.roundrect(w * 0.8132, h * 0.28, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  3014. c.fill();
  3015. c.text(w * 0.852, h * 0.375, 0, 0, '@', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3016. c.roundrect(w * 0.9138, h * 0.28, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  3017. c.fill();
  3018. c.text(w * 0.9526, h * 0.375, 0, 0, '\"', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3019. c.roundrect(w * 0.1638, h * 0.53, w * 0.1178, h * 0.19, rSizeX, rSizeY);
  3020. c.fill();
  3021. c.text(w * 0.2227, h * 0.625, 0, 0, '.', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3022. c.roundrect(w * 0.3046, h * 0.53, w * 0.1178, h * 0.19, rSizeX, rSizeY);
  3023. c.fill();
  3024. c.text(w * 0.3635, h * 0.625, 0, 0, ',', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3025. c.roundrect(w * 0.4454, h * 0.53, w * 0.1178, h * 0.19, rSizeX, rSizeY);
  3026. c.fill();
  3027. c.text(w * 0.5043, h * 0.625, 0, 0, '?', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3028. c.roundrect(w * 0.5862, h * 0.53, w * 0.1178, h * 0.19, rSizeX, rSizeY);
  3029. c.fill();
  3030. c.text(w * 0.6451, h * 0.625, 0, 0, '!', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3031. c.roundrect(w * 0.727, h * 0.53, w * 0.1178, h * 0.19, rSizeX, rSizeY);
  3032. c.fill();
  3033. c.text(w * 0.7859, h * 0.625, 0, 0, '\'', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3034. c.roundrect(w * 0.2644, h * 0.78, w * 0.4799, h * 0.19, rSizeX, rSizeY);
  3035. c.fill();
  3036. c.setFontColor('#666666');
  3037. c.text(w * 0.5043, h * 0.875, 0, 0, 'space', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3038. c.setGradient('#8B98A8', '#677488', w * 0.0115, h * 0.53, w * 0.1207, h * 0.19, mxConstants.DIRECTION_SOUTH, 1, 1);
  3039. c.setFontColor('#ffffff');
  3040. c.roundrect(w * 0.0115, h * 0.53, w * 0.1207, h * 0.19, rSizeX, rSizeY);
  3041. c.fill();
  3042. c.roundrect(w * 0.8736, h * 0.53, w * 0.115, h * 0.19, rSizeX, rSizeY);
  3043. c.fill();
  3044. c.roundrect(w * 0.0115, h * 0.78, w * 0.2299, h * 0.19, rSizeX, rSizeY);
  3045. c.fill();
  3046. c.roundrect(w * 0.7672, h * 0.78, w * 0.2213, h * 0.19, rSizeX, rSizeY);
  3047. c.fill();
  3048. c.text(w * 0.0718, h * 0.625, 0, 0, '#+=', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3049. c.text(w * 0.1264, h * 0.875, 0, 0, 'ABC', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3050. c.text(w * 0.8779, h * 0.875, 0, 0, 'return', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3051. c.setShadow(false);
  3052. c.setLineJoin('round');
  3053. c.setStrokeColor('#ffffff');
  3054. c.setFillColor('#ffffff');
  3055. c.setStrokeWidth(1.5);
  3056. c.begin();
  3057. c.moveTo(w * 0.9109, h * 0.585);
  3058. c.lineTo(w * 0.9655, h * 0.585);
  3059. c.lineTo(w * 0.9655, h * 0.665);
  3060. c.lineTo(w * 0.9109, h * 0.665);
  3061. c.lineTo(w * 0.8879, h * 0.625);
  3062. c.close();
  3063. c.fillAndStroke();
  3064. c.setStrokeColor('#677488');
  3065. c.begin();
  3066. c.moveTo(w * 0.9224, h * 0.605);
  3067. c.lineTo(w * 0.9454, h * 0.645);
  3068. c.moveTo(w * 0.9224, h * 0.645);
  3069. c.lineTo(w * 0.9454, h * 0.605);
  3070. c.stroke();
  3071. };
  3072. mxCellRenderer.registerShape(mxMockupC.SHAPE_IKEYB_NUMBERS, mxShapeMockupiKeybNumbers);
  3073. //**********************************************************************************************************************************************************
  3074. //Keyboard (symbols)
  3075. //**********************************************************************************************************************************************************
  3076. /**
  3077. * Extends mxShape.
  3078. */
  3079. function mxShapeMockupiKeybSymbols(bounds, fill, stroke, strokewidth)
  3080. {
  3081. mxShape.call(this);
  3082. this.bounds = bounds;
  3083. this.fill = fill;
  3084. this.stroke = stroke;
  3085. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  3086. };
  3087. /**
  3088. * Extends mxShape.
  3089. */
  3090. mxUtils.extend(mxShapeMockupiKeybSymbols, mxShape);
  3091. /**
  3092. * Function: paintVertexShape
  3093. *
  3094. * Paints the vertex shape.
  3095. */
  3096. mxShapeMockupiKeybSymbols.prototype.paintVertexShape = function(c, x, y, w, h)
  3097. {
  3098. c.translate(x, y);
  3099. this.background(c, x, y, w, h);
  3100. c.setShadow(true);
  3101. this.foreground(c, x, y, w, h);
  3102. };
  3103. mxShapeMockupiKeybSymbols.prototype.background = function(c, x, y, w, h)
  3104. {
  3105. c.setGradient('#8A97A7', '#425163', 0, 0, w, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  3106. c.rect(0, 0, w, h);
  3107. c.fill();
  3108. };
  3109. mxShapeMockupiKeybSymbols.prototype.foreground = function(c, x, y, w, h, strokeColor)
  3110. {
  3111. c.setGradient('#EEF3F9', '#DBE2E9', w * 0.0086, h * 0.03, w * 0.0776, h * 0.19, mxConstants.DIRECTION_SOUTH, 1, 1);
  3112. rSizeX = w * 0.0144;
  3113. rSizeY = h * 0.025;
  3114. c.setFontSize(10.5);
  3115. c.setFontColor('#000000');
  3116. c.roundrect(w * 0.0086, h * 0.03, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  3117. c.fill();
  3118. c.text(w * 0.0474, h * 0.125, 0, 0, '[', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3119. c.roundrect(w * 0.1092, h * 0.03, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  3120. c.fill();
  3121. c.text(w * 0.148, h * 0.125, 0, 0, ']', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3122. c.roundrect(w * 0.2098, h * 0.03, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  3123. c.fill();
  3124. c.text(w * 0.2486, h * 0.125, 0, 0, '{', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3125. c.roundrect(w * 0.3103, h * 0.03, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  3126. c.fill();
  3127. c.text(w * 0.3491, h * 0.125, 0, 0, '}', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3128. c.roundrect(w * 0.4109, h * 0.03, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  3129. c.fill();
  3130. c.text(w * 0.4497, h * 0.125, 0, 0, '#', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3131. c.roundrect(w * 0.5115, h * 0.03, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  3132. c.fill();
  3133. c.text(w * 0.5503, h * 0.125, 0, 0, '%', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3134. c.roundrect(w * 0.6121, h * 0.03, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  3135. c.fill();
  3136. c.text(w * 0.6509, h * 0.125, 0, 0, '^', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3137. c.roundrect(w * 0.7126, h * 0.03, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  3138. c.fill();
  3139. c.text(w * 0.7514, h * 0.125, 0, 0, '*', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3140. c.roundrect(w * 0.8132, h * 0.03, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  3141. c.fill();
  3142. c.text(w * 0.852, h * 0.125, 0, 0, '+', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3143. c.roundrect(w * 0.9138, h * 0.03, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  3144. c.fill();
  3145. c.text(w * 0.9526, h * 0.125, 0, 0, '=', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3146. c.roundrect(w * 0.0086, h * 0.28, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  3147. c.fill();
  3148. c.text(w * 0.0474, h * 0.375, 0, 0, '_', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3149. c.roundrect(w * 0.1092, h * 0.28, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  3150. c.fill();
  3151. c.text(w * 0.148, h * 0.375, 0, 0, '\\', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3152. c.roundrect(w * 0.2098, h * 0.28, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  3153. c.fill();
  3154. c.text(w * 0.2486, h * 0.375, 0, 0, '|', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3155. c.roundrect(w * 0.3103, h * 0.28, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  3156. c.fill();
  3157. c.text(w * 0.3491, h * 0.375, 0, 0, '~', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3158. c.roundrect(w * 0.4109, h * 0.28, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  3159. c.fill();
  3160. c.text(w * 0.4497, h * 0.375, 0, 0, '<', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3161. c.roundrect(w * 0.5115, h * 0.28, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  3162. c.fill();
  3163. c.text(w * 0.5503, h * 0.375, 0, 0, '>', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3164. c.roundrect(w * 0.6121, h * 0.28, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  3165. c.fill();
  3166. c.text(w * 0.6509, h * 0.375, 0, 0, String.fromCharCode(128), mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3167. c.roundrect(w * 0.7126, h * 0.28, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  3168. c.fill();
  3169. c.text(w * 0.7514, h * 0.375, 0, 0, String.fromCharCode(parseInt('00A3', 16)), mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3170. c.roundrect(w * 0.8132, h * 0.28, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  3171. c.fill();
  3172. c.text(w * 0.852, h * 0.375, 0, 0, String.fromCharCode(parseInt('00A5', 16)), mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3173. c.roundrect(w * 0.9138, h * 0.28, w * 0.0776, h * 0.19, rSizeX, rSizeY);
  3174. c.fill();
  3175. c.text(w * 0.9526, h * 0.375, 0, 0, String.fromCharCode(parseInt('0095', 16)), mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3176. c.roundrect(w * 0.1638, h * 0.53, w * 0.1178, h * 0.19, rSizeX, rSizeY);
  3177. c.fill();
  3178. c.text(w * 0.2227, h * 0.625, 0, 0, '.', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3179. c.roundrect(w * 0.3046, h * 0.53, w * 0.1178, h * 0.19, rSizeX, rSizeY);
  3180. c.fill();
  3181. c.text(w * 0.3635, h * 0.625, 0, 0, ',', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3182. c.roundrect(w * 0.4454, h * 0.53, w * 0.1178, h * 0.19, rSizeX, rSizeY);
  3183. c.fill();
  3184. c.text(w * 0.5043, h * 0.625, 0, 0, '?', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3185. c.roundrect(w * 0.5862, h * 0.53, w * 0.1178, h * 0.19, rSizeX, rSizeY);
  3186. c.fill();
  3187. c.text(w * 0.6451, h * 0.625, 0, 0, '!', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3188. c.roundrect(w * 0.727, h * 0.53, w * 0.1178, h * 0.19, rSizeX, rSizeY);
  3189. c.fill();
  3190. c.text(w * 0.7859, h * 0.625, 0, 0, '\'', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3191. c.roundrect(w * 0.2644, h * 0.78, w * 0.4799, h * 0.19, rSizeX, rSizeY);
  3192. c.fill();
  3193. c.setFontColor('#666666');
  3194. c.text(w * 0.5043, h * 0.875, 0, 0, 'space', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3195. c.setGradient('#8B98A8', '#677488', w * 0.0115, h * 0.53, w * 0.1207, h * 0.19, mxConstants.DIRECTION_SOUTH, 1, 1);
  3196. c.setFontColor('#ffffff');
  3197. c.roundrect(w * 0.0115, h * 0.53, w * 0.1207, h * 0.19, rSizeX, rSizeY);
  3198. c.fill();
  3199. c.roundrect(w * 0.8736, h * 0.53, w * 0.115, h * 0.19, rSizeX, rSizeY);
  3200. c.fill();
  3201. c.roundrect(w * 0.0115, h * 0.78, w * 0.2299, h * 0.19, rSizeX, rSizeY);
  3202. c.fill();
  3203. c.roundrect(w * 0.7672, h * 0.78, w * 0.2213, h * 0.19, rSizeX, rSizeY);
  3204. c.fill();
  3205. c.text(w * 0.0718, h * 0.625, 0, 0, '123', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3206. c.text(w * 0.1264, h * 0.875, 0, 0, 'ABC', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3207. c.text(w * 0.8779, h * 0.875, 0, 0, 'return', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3208. c.setShadow(false);
  3209. c.setLineJoin('round');
  3210. c.setStrokeColor('#ffffff');
  3211. c.setFillColor('#ffffff');
  3212. c.setStrokeWidth(1.5);
  3213. c.begin();
  3214. c.moveTo(w * 0.9109, h * 0.585);
  3215. c.lineTo(w * 0.9655, h * 0.585);
  3216. c.lineTo(w * 0.9655, h * 0.665);
  3217. c.lineTo(w * 0.9109, h * 0.665);
  3218. c.lineTo(w * 0.8879, h * 0.625);
  3219. c.close();
  3220. c.fillAndStroke();
  3221. c.setStrokeColor('#677488');
  3222. c.begin();
  3223. c.moveTo(w * 0.9224, h * 0.605);
  3224. c.lineTo(w * 0.9454, h * 0.645);
  3225. c.moveTo(w * 0.9224, h * 0.645);
  3226. c.lineTo(w * 0.9454, h * 0.605);
  3227. c.stroke();
  3228. };
  3229. mxCellRenderer.registerShape(mxMockupC.SHAPE_IKEYB_SYMBOLS, mxShapeMockupiKeybSymbols);
  3230. //**********************************************************************************************************************************************************
  3231. //Delete App
  3232. //**********************************************************************************************************************************************************
  3233. /**
  3234. * Extends mxShape.
  3235. */
  3236. function mxShapeMockupiDeleteApp(bounds, fill, stroke, strokewidth)
  3237. {
  3238. mxShape.call(this);
  3239. this.bounds = bounds;
  3240. this.fill = fill;
  3241. this.stroke = stroke;
  3242. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  3243. };
  3244. /**
  3245. * Extends mxShape.
  3246. */
  3247. mxUtils.extend(mxShapeMockupiDeleteApp, mxShape);
  3248. /**
  3249. * Function: paintVertexShape
  3250. *
  3251. * Paints the vertex shape.
  3252. */
  3253. mxShapeMockupiDeleteApp.prototype.paintVertexShape = function(c, x, y, w, h)
  3254. {
  3255. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '').toString();
  3256. c.translate(x, y);
  3257. this.background(c, x, y, w, h, strokeColor);
  3258. c.setShadow(false);
  3259. this.foreground(c, x, y, w, h);
  3260. };
  3261. mxShapeMockupiDeleteApp.prototype.background = function(c, x, y, w, h, strokeColor)
  3262. {
  3263. var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '').toString();
  3264. var fillColor2 = mxUtils.getValue(this.style, mxMockupC.STYLE_FILLCOLOR2, '').toString();
  3265. c.setGradient(fillColor, fillColor2, 0, 0, w, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  3266. c.setStrokeWidth(1.5);
  3267. c.setStrokeColor(strokeColor);
  3268. c.ellipse(0, 0, w, h);
  3269. c.fillAndStroke();
  3270. };
  3271. mxShapeMockupiDeleteApp.prototype.foreground = function(c, x, y, w, h)
  3272. {
  3273. c.setStrokeWidth(2.5);
  3274. c.begin();
  3275. c.moveTo(w * 0.3, h * 0.3);
  3276. c.lineTo(w * 0.7, h * 0.7);
  3277. c.moveTo(w * 0.3, h * 0.7);
  3278. c.lineTo(w * 0.7, h * 0.3);
  3279. c.stroke();
  3280. };
  3281. mxCellRenderer.registerShape(mxMockupC.SHAPE_IDELETE_APP, mxShapeMockupiDeleteApp);
  3282. //**********************************************************************************************************************************************************
  3283. //Direction
  3284. //**********************************************************************************************************************************************************
  3285. /**
  3286. * Extends mxShape.
  3287. */
  3288. function mxShapeMockupiDirection(bounds, fill, stroke, strokewidth)
  3289. {
  3290. mxShape.call(this);
  3291. this.bounds = bounds;
  3292. this.fill = fill;
  3293. this.stroke = stroke;
  3294. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  3295. };
  3296. /**
  3297. * Extends mxShape.
  3298. */
  3299. mxUtils.extend(mxShapeMockupiDirection, mxShape);
  3300. /**
  3301. * Function: paintVertexShape
  3302. *
  3303. * Paints the vertex shape.
  3304. */
  3305. mxShapeMockupiDirection.prototype.paintVertexShape = function(c, x, y, w, h)
  3306. {
  3307. c.translate(x, y);
  3308. this.background(c, x, y, w, h);
  3309. c.setShadow(false);
  3310. this.foreground(c, x, y, w, h);
  3311. };
  3312. mxShapeMockupiDirection.prototype.background = function(c, x, y, w, h)
  3313. {
  3314. c.setStrokeWidth(0.5);
  3315. c.setStrokeColor('#008cff');
  3316. c.ellipse(0, 0, w, h);
  3317. c.stroke();
  3318. };
  3319. mxShapeMockupiDirection.prototype.foreground = function(c, x, y, w, h)
  3320. {
  3321. c.setAlpha(1);
  3322. c.setGradient('#ffffff', '#ffffff', w * 0.29, h * 0.2, w * 0.42, h * 0.3, mxConstants.DIRECTION_NORTH, 1, 0);
  3323. c.begin();
  3324. c.moveTo(w * 0.29, h * 0.2);
  3325. c.lineTo(w * 0.5, h * 0.5);
  3326. c.lineTo(w * 0.71, h * 0.2);
  3327. c.fillAndStroke();
  3328. c.setStrokeColor('#006cdf');
  3329. c.setGradient('#ffffff', '#007cef', w * 0.47, h * 0.47, w * 0.06, h * 0.06, mxConstants.DIRECTION_SOUTH, 1, 1);
  3330. c.setAlpha(1);
  3331. c.ellipse(w * 0.47, h * 0.47, w * 0.06, h * 0.06);
  3332. c.fillAndStroke();
  3333. c.setFillColor('#ffffff');
  3334. c.setAlpha(0.8);
  3335. c.ellipse(w * 0.4825, h * 0.4825, w * 0.015, h * 0.015);
  3336. c.fill();
  3337. };
  3338. mxCellRenderer.registerShape(mxMockupC.SHAPE_IDIRECTION, mxShapeMockupiDirection);
  3339. //**********************************************************************************************************************************************************
  3340. //Location Bar
  3341. //**********************************************************************************************************************************************************
  3342. /**
  3343. * Extends mxShape.
  3344. */
  3345. function mxShapeMockupiLocationBar(bounds, fill, stroke, strokewidth)
  3346. {
  3347. mxShape.call(this);
  3348. this.bounds = bounds;
  3349. this.fill = fill;
  3350. this.stroke = stroke;
  3351. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  3352. };
  3353. /**
  3354. * Extends mxShape.
  3355. */
  3356. mxUtils.extend(mxShapeMockupiLocationBar, mxShape);
  3357. mxShapeMockupiLocationBar.prototype.customProperties = [
  3358. {name: 'buttonText', dispName: 'Text', type: 'string'},
  3359. {name: 'barPos', dispName: 'Callout Position', type: 'float', min:0, defVal:80},
  3360. {name: 'pointerPos', dispName: 'Callout Orientation', type: 'enum',
  3361. enumList: [{val: 'bottom', dispName: 'Bottom'}, {val: 'top', dispName: 'Top'}]
  3362. }
  3363. ];
  3364. /**
  3365. * Function: paintVertexShape
  3366. *
  3367. * Paints the vertex shape.
  3368. */
  3369. mxShapeMockupiLocationBar.prototype.paintVertexShape = function(c, x, y, w, h)
  3370. {
  3371. c.translate(x, y);
  3372. this.background(c, x, y, w, h);
  3373. c.setShadow(false);
  3374. this.foreground(c, x, y, w, h);
  3375. };
  3376. mxShapeMockupiLocationBar.prototype.background = function(c, x, y, w, h)
  3377. {
  3378. var barPos = mxUtils.getValue(this.style, mxMockupC.BAR_POS, '80');
  3379. barPos = Math.min(barPos, 100);
  3380. barPos = Math.max(barPos, 0);
  3381. var pointerPos = mxUtils.getValue(this.style, mxMockupC.POINTER_POS, mxMockupC.POINTER_BOTTOM);
  3382. var rSize = 2.5;
  3383. var deadzone = rSize + 7.5; // rounding + pointer width / 2
  3384. var virRange = w - 2 * deadzone;
  3385. var truePos = deadzone + virRange * barPos / 100;
  3386. c.setStrokeWidth(0.5);
  3387. c.setStrokeColor('#000000');
  3388. c.setAlpha(0.7);
  3389. c.begin();
  3390. if (pointerPos === mxMockupC.POINTER_BOTTOM)
  3391. {
  3392. c.setGradient('#000000', '#888888', 0, 0, w, h, mxConstants.DIRECTION_NORTH, 1, 1);
  3393. c.moveTo(0, rSize);
  3394. c.arcTo(rSize, rSize, 0, 0, 1, rSize, 0);
  3395. c.lineTo(w - rSize, 0);
  3396. c.arcTo(rSize, rSize, 0, 0, 1, w, rSize);
  3397. c.lineTo(w, h - rSize - 7.5);
  3398. c.arcTo(rSize, rSize, 0, 0, 1, w - rSize, h - 7.5);
  3399. c.lineTo(truePos + 7.5, h - 7.5);
  3400. c.lineTo(truePos, h);
  3401. c.lineTo(truePos - 7.5, h - 7.5);
  3402. c.lineTo(rSize, h - 7.5);
  3403. c.arcTo(rSize, rSize, 0, 0, 1, 0, h - rSize - 7.5);
  3404. }
  3405. else if (pointerPos === mxMockupC.POINTER_TOP)
  3406. {
  3407. c.setGradient('#000000', '#888888', 0, 0, w, h, mxConstants.DIRECTION_NORTH, 1, 1);
  3408. c.moveTo(0, rSize + 7.5);
  3409. c.arcTo(rSize, rSize, 0, 0, 1, rSize, 7.5);
  3410. c.lineTo(truePos - 7.5, 7.5);
  3411. c.lineTo(truePos, 0);
  3412. c.lineTo(truePos + 7.5, 7.5);
  3413. c.lineTo(w - rSize, 7.5);
  3414. c.arcTo(rSize, rSize, 0, 0, 1, w, rSize + 7.5);
  3415. c.lineTo(w, h - rSize);
  3416. c.arcTo(rSize, rSize, 0, 0, 1, w - rSize, h);
  3417. c.lineTo(rSize, h);
  3418. c.arcTo(rSize, rSize, 0, 0, 1, 0, h - rSize);
  3419. }
  3420. c.close();
  3421. c.fillAndStroke();
  3422. };
  3423. mxShapeMockupiLocationBar.prototype.foreground = function(c, x, y, w, h)
  3424. {
  3425. var pointerPos = mxUtils.getValue(this.style, mxMockupC.POINTER_POS, mxMockupC.POINTER_BOTTOM);
  3426. var locText = decodeURIComponent(mxUtils.getValue(this.style, mxMockupC.BUTTON_TEXT, 'Some Location'));
  3427. c.setAlpha(1);
  3428. c.setFontColor('#ffffff');
  3429. c.setFontSize(9.5);
  3430. if (pointerPos === mxMockupC.POINTER_BOTTOM)
  3431. {
  3432. c.text(5, (h - 7.5) * 0.5, 0, 0, locText, mxConstants.ALIGN_LEFT, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3433. c.translate(w - 20, (h - 7.5) * 0.5 - 7.5);
  3434. }
  3435. else
  3436. {
  3437. c.text(5, (h + 7.5) * 0.5, 0, 0, locText, mxConstants.ALIGN_LEFT, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3438. c.translate(w - 20, (h + 7.5) * 0.5 - 7.5);
  3439. }
  3440. w = 15;
  3441. h = 15;
  3442. c.setGradient('#8BbEff', '#135Ec8', 0, 0, w, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  3443. c.setStrokeWidth(1.5);
  3444. c.setStrokeColor('#ffffff');
  3445. c.ellipse(0, 0, w, h);
  3446. c.fillAndStroke();
  3447. c.setStrokeWidth(2.5);
  3448. c.begin();
  3449. c.moveTo(w * 0.4, h * 0.22);
  3450. c.lineTo(w * 0.65, h * 0.5);
  3451. c.lineTo(w * 0.4, h * 0.78);
  3452. c.stroke();
  3453. };
  3454. mxCellRenderer.registerShape(mxMockupC.SHAPE_ILOCATION_BAR, mxShapeMockupiLocationBar);
  3455. //**********************************************************************************************************************************************************
  3456. //Call Dialog
  3457. //**********************************************************************************************************************************************************
  3458. /**
  3459. * Extends mxShape.
  3460. */
  3461. function mxShapeMockupiCallDialog(bounds, fill, stroke, strokewidth)
  3462. {
  3463. mxShape.call(this);
  3464. this.bounds = bounds;
  3465. this.fill = fill;
  3466. this.stroke = stroke;
  3467. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  3468. };
  3469. /**
  3470. * Extends mxShape.
  3471. */
  3472. mxUtils.extend(mxShapeMockupiCallDialog, mxShape);
  3473. /**
  3474. * Function: paintVertexShape
  3475. *
  3476. * Paints the vertex shape.
  3477. */
  3478. mxShapeMockupiCallDialog.prototype.paintVertexShape = function(c, x, y, w, h)
  3479. {
  3480. var rSize = 5;
  3481. c.translate(x, y);
  3482. this.background(c, x, y, w, h, rSize);
  3483. c.setShadow(false);
  3484. this.foreground(c, x, y, w, h, rSize);
  3485. };
  3486. mxShapeMockupiCallDialog.prototype.background = function(c, x, y, w, h, rSize)
  3487. {
  3488. c.setAlpha(0.8);
  3489. c.setStrokeColor('#888888');
  3490. c.setStrokeWidth(1.5);
  3491. c.setFillColor('#000000');
  3492. c.roundrect(0, 0, w, h, rSize, rSize);
  3493. c.fillAndStroke();
  3494. };
  3495. mxShapeMockupiCallDialog.prototype.foreground = function(c, x, y, w, h, rSize)
  3496. {
  3497. c.begin();
  3498. c.moveTo(w * 0.33, 0);
  3499. c.lineTo(w * 0.33, h);
  3500. c.moveTo(w * 0.67, 0);
  3501. c.lineTo(w * 0.67, h);
  3502. c.moveTo(0, h * 0.5);
  3503. c.lineTo(w, h * 0.5);
  3504. c.stroke();
  3505. c.setStrokeColor('#000000');
  3506. c.setFillColor('#ffffff');
  3507. c.setStrokeWidth(0.5);
  3508. c.roundrect(w * 0.1433, h * 0.104, w * 0.0417, h * 0.148, w * 0.02, h * 0.024);
  3509. c.fill();
  3510. c.begin();
  3511. c.moveTo(w * 0.14, h * 0.188);
  3512. c.lineTo(w * 0.14, h * 0.228);
  3513. c.arcTo(w * 0.025, h * 0.03, 0, 0, 0, w * 0.19, h * 0.228);
  3514. c.lineTo(w * 0.19, h * 0.188);
  3515. c.lineTo(w * 0.2, h * 0.188);
  3516. c.lineTo(w * 0.2, h * 0.228);
  3517. c.arcTo(w * 0.0367, h * 0.044, 0, 0, 1, w * 0.17, h * 0.27);
  3518. c.lineTo(w * 0.17, h * 0.296);
  3519. c.lineTo(w * 0.195, h * 0.296);
  3520. c.lineTo(w * 0.195, h * 0.308);
  3521. c.lineTo(w * 0.1367, h * 0.308);
  3522. c.lineTo(w * 0.1367, h * 0.296);
  3523. c.lineTo(w * 0.16, h * 0.296);
  3524. c.lineTo(w * 0.16, h * 0.27);
  3525. c.arcTo(w * 0.0367, h * 0.044, 0, 0, 1, w * 0.13, h * 0.228);
  3526. c.lineTo(w * 0.13, h * 0.188);
  3527. c.close();
  3528. c.fillAndStroke();
  3529. c.begin();
  3530. c.moveTo(w * 0.1033, h * 0.108);
  3531. c.lineTo(w * 0.24, h * 0.286);
  3532. c.lineTo(w * 0.2317, h * 0.298);
  3533. c.lineTo(w * 0.095, h * 0.12);
  3534. c.close();
  3535. c.fillAndStroke();
  3536. c.rect(w * 0.44, h * 0.128, w * 0.033, h * 0.04);
  3537. c.fill();
  3538. c.rect(w * 0.485, h * 0.128, w * 0.033, h * 0.04);
  3539. c.fill();
  3540. c.rect(w * 0.53, h * 0.128, w * 0.033, h * 0.04);
  3541. c.fill();
  3542. c.rect(w * 0.44, h * 0.186, w * 0.033, h * 0.04);
  3543. c.fill();
  3544. c.rect(w * 0.485, h * 0.186, w * 0.033, h * 0.04);
  3545. c.fill();
  3546. c.rect(w * 0.53, h * 0.186, w * 0.033, h * 0.04);
  3547. c.fill();
  3548. c.rect(w * 0.44, h * 0.244, w * 0.033, h * 0.04);
  3549. c.fill();
  3550. c.rect(w * 0.485, h * 0.244, w * 0.033, h * 0.04);
  3551. c.fill();
  3552. c.rect(w * 0.53, h * 0.244, w * 0.033, h * 0.04);
  3553. c.fill();
  3554. c.begin();
  3555. c.moveTo(w * 0.7567, h * 0.18);
  3556. c.lineTo(w * 0.785, h * 0.18);
  3557. c.lineTo(w * 0.825, h * 0.128);
  3558. c.lineTo(w * 0.825, h * 0.28);
  3559. c.lineTo(w * 0.79, h * 0.234);
  3560. c.lineTo(w * 0.7567, h * 0.234);
  3561. c.close();
  3562. c.fill();
  3563. c.setStrokeWidth(1.5);
  3564. c.setStrokeColor('#ffffff');
  3565. c.begin();
  3566. c.moveTo(w * 0.8383, h * 0.16);
  3567. c.arcTo(w * 0.0533, h * 0.064, 0, 0, 1, w * 0.8383, h * 0.252);
  3568. c.moveTo(w * 0.8583, h * 0.134);
  3569. c.arcTo(w * 0.0817, h * 0.098, 0, 0, 1, w * 0.8583, h * 0.276);
  3570. c.moveTo(w * 0.8767, h * 0.11);
  3571. c.arcTo(w * 0.1133, h * 0.136, 0, 0, 1, w * 0.8767, h * 0.304);
  3572. c.stroke();
  3573. c.begin();
  3574. c.moveTo(w * 0.1467, h * 0.62);
  3575. c.lineTo(w * 0.1833, h * 0.62);
  3576. c.lineTo(w * 0.1833,h * 0.676);
  3577. c.lineTo(w * 0.2267,h * 0.676);
  3578. c.lineTo(w * 0.2267,h * 0.724);
  3579. c.lineTo(w * 0.1833,h * 0.724);
  3580. c.lineTo(w * 0.1833,h * 0.78);
  3581. c.lineTo(w * 0.1467,h * 0.78);
  3582. c.lineTo(w * 0.1467,h * 0.724);
  3583. c.lineTo(w * 0.105,h * 0.724);
  3584. c.lineTo(w * 0.105,h * 0.676);
  3585. c.lineTo(w * 0.1467,h * 0.676);
  3586. c.close();
  3587. c.fill();
  3588. c.rect(w * 0.4517, h * 0.624, w * 0.0333, h * 0.152);
  3589. c.fill();
  3590. c.rect(w * 0.5183, h * 0.624, w * 0.0333, h * 0.152);
  3591. c.fill();
  3592. c.begin();
  3593. c.moveTo(w * 0.76, h * 0.752);
  3594. c.arcTo(w * 0.1, h * 0.12, 0, 0, 1, w * 0.8033, h * 0.728);
  3595. c.arcTo(w * 0.0167, h * 0.02, 0, 0, 0, w * 0.8167, h * 0.712);
  3596. c.lineTo(w * 0.8175, h * 0.7);
  3597. c.arcTo(w * 0.0267, h * 0.06, 0, 0, 1, w * 0.8067, h * 0.644);
  3598. c.arcTo(w * 0.0287, h * 0.0344, 0, 0, 1, w * 0.8633, h * 0.644);
  3599. c.arcTo(w * 0.0267, h * 0.06, 0, 0, 1, w * 0.855, h * 0.7);
  3600. c.arcTo(w * 0.05, h * 0.724, 0, 0, 1, w * 0.8633, h * 0.724);
  3601. c.arcTo(w * 0.1667, h * 0.75, 0, 0, 1, w * 0.9083, h * 0.75);
  3602. c.lineTo(w * 0.9083, h * 0.78);
  3603. c.lineTo(w * 0.76, h * 0.78);
  3604. c.close();
  3605. c.fill();
  3606. c.setFontColor('#ffffff');
  3607. c.setFontSize(8.5);
  3608. c.text(w * 0.1667, h * 0.35, 0, 0, 'mute', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3609. c.text(w * 0.5, h * 0.35, 0, 0, 'keypad', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3610. c.text(w * 0.8333, h * 0.35, 0, 0, 'speaker', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3611. c.text(w * 0.1667, h * 0.85, 0, 0, 'add', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3612. c.text(w * 0.5, h * 0.85, 0, 0, 'pause', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3613. c.text(w * 0.8333, h * 0.85, 0, 0, 'contacts', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3614. c.setGradient('#808080', '#ffffff', 0, 0, w, h * 0.308, mxConstants.DIRECTION_NORTH, 1, 1);
  3615. c.setAlpha(0.4);
  3616. c.begin();
  3617. c.moveTo(0, h * 0.308);
  3618. c.lineTo(0, rSize);
  3619. c.arcTo(rSize, rSize, 0, 0, 1, rSize, 0);
  3620. c.lineTo(w - rSize, 0);
  3621. c.arcTo(rSize, rSize, 0, 0, 1, w, rSize);
  3622. c.lineTo(w, h * 0.308);
  3623. c.arcTo(w * 1.5, h * 1.8, 0, 0, 1, 0, h * 0.308);
  3624. c.close();
  3625. c.fill();
  3626. };
  3627. mxCellRenderer.registerShape(mxMockupC.SHAPE_ICALL_DIALOG, mxShapeMockupiCallDialog);
  3628. //**********************************************************************************************************************************************************
  3629. //Call Buttons
  3630. //**********************************************************************************************************************************************************
  3631. /**
  3632. * Extends mxShape.
  3633. */
  3634. function mxShapeMockupiCallButtons(bounds, fill, stroke, strokewidth)
  3635. {
  3636. mxShape.call(this);
  3637. this.bounds = bounds;
  3638. this.fill = fill;
  3639. this.stroke = stroke;
  3640. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  3641. };
  3642. /**
  3643. * Extends mxShape.
  3644. */
  3645. mxUtils.extend(mxShapeMockupiCallButtons, mxShape);
  3646. /**
  3647. * Function: paintVertexShape
  3648. *
  3649. * Paints the vertex shape.
  3650. */
  3651. mxShapeMockupiCallButtons.prototype.paintVertexShape = function(c, x, y, w, h)
  3652. {
  3653. c.translate(x, y);
  3654. this.background(c, x, y, w, h);
  3655. c.setShadow(false);
  3656. this.foreground(c, x, y, w, h);
  3657. };
  3658. mxShapeMockupiCallButtons.prototype.background = function(c, x, y, w, h)
  3659. {
  3660. c.setStrokeWidth(0.5);
  3661. c.setStrokeColor('#008cff');
  3662. c.setGradient('#0F1B2B', '#4F5B6B', 0, 0, w, h, mxConstants.DIRECTION_NORTH, 1, 1);
  3663. c.rect(0, 0, w, h);
  3664. c.fillAndStroke();
  3665. };
  3666. mxShapeMockupiCallButtons.prototype.foreground = function(c, x, y, w, h)
  3667. {
  3668. c.begin();
  3669. c.moveTo(0, h * 0.1667);
  3670. c.lineTo(w, h * 0.1667);
  3671. c.moveTo(0, h * 0.3333);
  3672. c.lineTo(w, h * 0.3333);
  3673. c.moveTo(0, h * 0.5);
  3674. c.lineTo(w, h * 0.5);
  3675. c.moveTo(0, h * 0.6667);
  3676. c.lineTo(w, h * 0.6667);
  3677. c.moveTo(0, h * 0.8333);
  3678. c.lineTo(w, h * 0.8333);
  3679. c.moveTo(w * 0.3333, h * 0.1667);
  3680. c.lineTo(w * 0.3333, h);
  3681. c.moveTo(w * 0.6667, h * 0.1667);
  3682. c.lineTo(w * 0.6667, h);
  3683. c.stroke();
  3684. c.setFontSize(15.5);
  3685. c.setFontColor('#ffffff');
  3686. c.setFontStyle(mxConstants.FONT_BOLD);
  3687. c.text(w * 0.5, h * 0.0834, 0, 0, '(123) 456-7890', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3688. c.text(w * 0.1667, h * 0.22, 0, 0, '1', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3689. c.text(w * 0.5, h * 0.22, 0, 0, '2', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3690. c.text(w * 0.8333, h * 0.22, 0, 0, '3', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3691. c.text(w * 0.1667, h * 0.3867, 0, 0, '3', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3692. c.text(w * 0.5, h * 0.3867, 0, 0, '4', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3693. c.text(w * 0.8333, h * 0.3867, 0, 0, '5', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3694. c.text(w * 0.1667, h * 0.5534, 0, 0, '6', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3695. c.text(w * 0.5, h * 0.5534, 0, 0, '7', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3696. c.text(w * 0.8333, h * 0.5534, 0, 0, '8', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3697. c.setFontSize(27.5);
  3698. c.text(w * 0.1667, h * 0.76, 0, 0, '*', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3699. c.setFontSize(15.5);
  3700. c.text(w * 0.5, h * 0.72, 0, 0, '0', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3701. c.text(w * 0.8333, h * 0.75, 0, 0, '#', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3702. c.setGradient('#E2FFEB', '#008215', w * 0.3333, h * 0.8333, w * 0.3333, h * 0.1667, mxConstants.DIRECTION_SOUTH, 1, 1);
  3703. c.rect(w * 0.3333, h * 0.8333, w * 0.3333, h * 0.1667);
  3704. c.fillAndStroke();
  3705. c.text(w * 0.5, h * 0.9168, 0, 0, 'Call', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3706. c.setFontStyle(0);
  3707. c.setFontSize(8);
  3708. c.setFontColor('#bbbbbb');
  3709. c.text(w * 0.5, h * 0.28, 0, 0, 'ABC', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3710. c.text(w * 0.8333, h * 0.28, 0, 0, 'DEF', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3711. c.text(w * 0.1667, h * 0.4467, 0, 0, 'GHI', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3712. c.text(w * 0.5, h * 0.4467, 0, 0, 'JKL', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3713. c.text(w * 0.8333, h * 0.4467, 0, 0, 'MNO', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3714. c.text(w * 0.1667, h * 0.6134, 0, 0, 'PQRS', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3715. c.text(w * 0.5, h * 0.6134, 0, 0, 'TUV', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3716. c.text(w * 0.8333, h * 0.6134, 0, 0, 'WXYZ', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3717. c.text(w * 0.5, h * 0.78, 0, 0, '+', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3718. c.setFillColor('#ffffff');
  3719. c.begin();
  3720. c.moveTo(w * 0.1028, h * 0.9464);
  3721. c.arcTo(w * 0.0862, h * 0.0652, 0, 0, 1, w * 0.1402, h * 0.9333);
  3722. c.arcTo(w * 0.0144, h * 0.0109, 0, 0, 0, w * 0.1517, h * 0.9246);
  3723. c.lineTo(w * 0.1524, h * 0.9181);
  3724. c.arcTo(w * 0.023, h * 0.0326, 0, 0, 1, w * 0.143, h * 0.8877);
  3725. c.arcTo(w * 0.0247, h * 0.0187, 0, 0, 1, w * 0.1919, h * 0.8877);
  3726. c.arcTo(w * 0.023, h * 0.0326, 0, 0, 1, w * 0.1847, h * 0.9181);
  3727. c.arcTo(w * 0.0431, h * 0.0174, 0, 0, 0, w * 0.1919, h * 0.9311);
  3728. c.arcTo(w * 0.1437, h * 0.1087, 0, 0, 1, w * 0.2307, h * 0.9453);
  3729. c.lineTo(w * 0.2307, h * 0.9616);
  3730. c.lineTo(w * 0.1028, h * 0.9616);
  3731. c.close();
  3732. c.fill();
  3733. c.setStrokeColor('#ffffff');
  3734. c.setStrokeWidth(2.5);
  3735. c.setLineJoin('round');
  3736. c.begin();
  3737. c.moveTo(w * 0.79, h * 0.89);
  3738. c.lineTo(w * 0.9, h * 0.89);
  3739. c.lineTo(w * 0.9, h * 0.95);
  3740. c.lineTo(w * 0.79, h * 0.95);
  3741. c.lineTo(w * 0.76, h * 0.92);
  3742. c.close();
  3743. c.fillAndStroke();
  3744. c.setStrokeColor('#0F1B2B');
  3745. c.begin();
  3746. c.moveTo(w * 0.82, h * 0.907);
  3747. c.lineTo(w * 0.85, h * 0.933);
  3748. c.moveTo(w * 0.82, h * 0.933);
  3749. c.lineTo(w * 0.85, h * 0.907);
  3750. c.stroke();
  3751. };
  3752. mxCellRenderer.registerShape(mxMockupC.SHAPE_ICALL_BUTTONS, mxShapeMockupiCallButtons);
  3753. //**********************************************************************************************************************************************************
  3754. //Option
  3755. //**********************************************************************************************************************************************************
  3756. /**
  3757. * Extends mxShape.
  3758. */
  3759. function mxShapeMockupiOption(bounds, fill, stroke, strokewidth)
  3760. {
  3761. mxShape.call(this);
  3762. this.bounds = bounds;
  3763. this.fill = fill;
  3764. this.stroke = stroke;
  3765. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  3766. };
  3767. /**
  3768. * Extends mxShape.
  3769. */
  3770. mxUtils.extend(mxShapeMockupiOption, mxShape);
  3771. mxShapeMockupiOption.prototype.customProperties = [
  3772. {name: 'buttonText', dispName: 'Text', type: 'string'},
  3773. {name: 'barPos', dispName: 'Callout Position', type: 'float', min:0, defVal:80},
  3774. {name: 'pointerPos', dispName: 'Callout Orientation', type: 'enum',
  3775. enumList: [{val: 'bottom', dispName: 'Bottom'}, {val: 'top', dispName: 'Top'}]
  3776. }
  3777. ];
  3778. /**
  3779. * Function: paintVertexShape
  3780. *
  3781. * Paints the vertex shape.
  3782. */
  3783. mxShapeMockupiOption.prototype.paintVertexShape = function(c, x, y, w, h)
  3784. {
  3785. c.translate(x, y);
  3786. this.background(c, x, y, w, h);
  3787. c.setShadow(false);
  3788. this.foreground(c, x, y, w, h);
  3789. };
  3790. mxShapeMockupiOption.prototype.background = function(c, x, y, w, h)
  3791. {
  3792. var barPos = mxUtils.getValue(this.style, mxMockupC.BAR_POS, '80');
  3793. barPos = Math.min(barPos, 100);
  3794. barPos = Math.max(barPos, 0);
  3795. var pointerPos = mxUtils.getValue(this.style, mxMockupC.POINTER_POS, mxMockupC.POINTER_BOTTOM);
  3796. var rSize = 2.5;
  3797. var deadzone = rSize + 7.5; // rounding + pointer width / 2
  3798. var virRange = w - 2 * deadzone;
  3799. var truePos = deadzone + virRange * barPos / 100;
  3800. c.setStrokeWidth(0.5);
  3801. c.setStrokeColor('#000000');
  3802. c.setAlpha(0.9);
  3803. c.begin();
  3804. if (pointerPos === mxMockupC.POINTER_BOTTOM)
  3805. {
  3806. c.setGradient('#000000', '#888888', 0, 0, w, h, mxConstants.DIRECTION_NORTH, 1, 1);
  3807. c.moveTo(0, rSize);
  3808. c.arcTo(rSize, rSize, 0, 0, 1, rSize, 0);
  3809. c.lineTo(w - rSize, 0);
  3810. c.arcTo(rSize, rSize, 0, 0, 1, w, rSize);
  3811. c.lineTo(w, h - rSize - 7.5);
  3812. c.arcTo(rSize, rSize, 0, 0, 1, w - rSize, h - 7.5);
  3813. c.lineTo(truePos + 7.5, h - 7.5);
  3814. c.lineTo(truePos, h);
  3815. c.lineTo(truePos - 7.5, h - 7.5);
  3816. c.lineTo(rSize, h - 7.5);
  3817. c.arcTo(rSize, rSize, 0, 0, 1, 0, h - rSize - 7.5);
  3818. }
  3819. else if (pointerPos === mxMockupC.POINTER_TOP)
  3820. {
  3821. c.setGradient('#000000', '#888888', 0, 0, w, h, mxConstants.DIRECTION_NORTH, 1, 1);
  3822. c.moveTo(0, rSize + 7.5);
  3823. c.arcTo(rSize, rSize, 0, 0, 1, rSize, 7.5);
  3824. c.lineTo(truePos - 7.5, 7.5);
  3825. c.lineTo(truePos, 0);
  3826. c.lineTo(truePos + 7.5, 7.5);
  3827. c.lineTo(w - rSize, 7.5);
  3828. c.arcTo(rSize, rSize, 0, 0, 1, w, rSize + 7.5);
  3829. c.lineTo(w, h - rSize);
  3830. c.arcTo(rSize, rSize, 0, 0, 1, w - rSize, h);
  3831. c.lineTo(rSize, h);
  3832. c.arcTo(rSize, rSize, 0, 0, 1, 0, h - rSize);
  3833. }
  3834. c.close();
  3835. c.fillAndStroke();
  3836. };
  3837. mxShapeMockupiOption.prototype.foreground = function(c, x, y, w, h)
  3838. {
  3839. var locText = decodeURIComponent(mxUtils.getValue(this.style, mxMockupC.BUTTON_TEXT, 'Some Location'));
  3840. var pointerPos = mxUtils.getValue(this.style, mxMockupC.POINTER_POS, mxMockupC.POINTER_BOTTOM);
  3841. c.setAlpha(1);
  3842. c.setFontColor('#ffffff');
  3843. c.setFontSize(9.5);
  3844. if (pointerPos === mxMockupC.POINTER_BOTTOM)
  3845. {
  3846. c.text(w * 0.5, (h - 7.5) * 0.5, 0, 0, locText, mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3847. }
  3848. else
  3849. {
  3850. c.text(w * 0.5, (h + 7.5) * 0.5, 0, 0, locText, mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3851. }
  3852. };
  3853. mxCellRenderer.registerShape(mxMockupC.SHAPE_IOPTION, mxShapeMockupiOption);
  3854. //**********************************************************************************************************************************************************
  3855. //Alpha List
  3856. //**********************************************************************************************************************************************************
  3857. /**
  3858. * Extends mxShape.
  3859. */
  3860. function mxShapeMockupiAlphaList(bounds, fill, stroke, strokewidth)
  3861. {
  3862. mxShape.call(this);
  3863. this.bounds = bounds;
  3864. this.fill = fill;
  3865. this.stroke = stroke;
  3866. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  3867. };
  3868. /**
  3869. * Extends mxShape.
  3870. */
  3871. mxUtils.extend(mxShapeMockupiAlphaList, mxShape);
  3872. /**
  3873. * Function: paintVertexShape
  3874. *
  3875. * Paints the vertex shape.
  3876. */
  3877. mxShapeMockupiAlphaList.prototype.paintVertexShape = function(c, x, y, w, h)
  3878. {
  3879. c.translate(x, y);
  3880. c.setShadow(false);
  3881. var fontSize = mxUtils.getValue(this.style, mxConstants.STYLE_FONTSIZE, '8');
  3882. c.setFontColor('#999999');
  3883. c.setFontSize(fontSize);
  3884. c.text(w * 0.5, h * 0.069, 0, 0, 'A', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3885. c.text(w * 0.5, h * 0.1035, 0, 0, 'B', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3886. c.text(w * 0.5, h * 0.138, 0, 0, 'C', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3887. c.text(w * 0.5, h * 0.1725, 0, 0, 'D', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3888. c.text(w * 0.5, h * 0.207, 0, 0, 'E', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3889. c.text(w * 0.5, h * 0.2415, 0, 0, 'F', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3890. c.text(w * 0.5, h * 0.276, 0, 0, 'G', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3891. c.text(w * 0.5, h * 0.3105, 0, 0, 'H', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3892. c.text(w * 0.5, h * 0.345, 0, 0, 'I', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3893. c.text(w * 0.5, h * 0.3795, 0, 0, 'J', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3894. c.text(w * 0.5, h * 0.414, 0, 0, 'K', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3895. c.text(w * 0.5, h * 0.4485, 0, 0, 'L', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3896. c.text(w * 0.5, h * 0.483, 0, 0, 'M', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3897. c.text(w * 0.5, h * 0.5175, 0, 0, 'N', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3898. c.text(w * 0.5, h * 0.552, 0, 0, 'O', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3899. c.text(w * 0.5, h * 0.5865, 0, 0, 'P', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3900. c.text(w * 0.5, h * 0.621, 0, 0, 'Q', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3901. c.text(w * 0.5, h * 0.6555, 0, 0, 'R', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3902. c.text(w * 0.5, h * 0.69, 0, 0, 'S', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3903. c.text(w * 0.5, h * 0.7245, 0, 0, 'T', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3904. c.text(w * 0.5, h * 0.759, 0, 0, 'U', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3905. c.text(w * 0.5, h * 0.7935, 0, 0, 'V', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3906. c.text(w * 0.5, h * 0.828, 0, 0, 'W', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3907. c.text(w * 0.5, h * 0.8625, 0, 0, 'X', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3908. c.text(w * 0.5, h * 0.897, 0, 0, 'Y', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3909. c.text(w * 0.5, h * 0.9315, 0, 0, 'Z', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3910. c.text(w * 0.5, h * 0.966, 0, 0, '#', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  3911. c.setStrokeColor('#999999');
  3912. c.ellipse(w * 0.5 - 2.25, h * 0.0345 - 3.5, 4.5, 4.5);
  3913. c.stroke();
  3914. c.begin();
  3915. c.moveTo(w * 0.5 - 4.25, h * 0.0345 + 3);
  3916. c.lineTo(w * 0.5 - 1.75, h * 0.0345);
  3917. c.stroke();
  3918. };
  3919. mxCellRenderer.registerShape(mxMockupC.SHAPE_IALPHA_LIST, mxShapeMockupiAlphaList);
  3920. //**********************************************************************************************************************************************************
  3921. //Horizontal Button Bar
  3922. //**********************************************************************************************************************************************************
  3923. /**
  3924. * Extends mxShape.
  3925. */
  3926. function mxShapeMockupiHorButtonBar(bounds, fill, stroke, strokewidth)
  3927. {
  3928. mxShape.call(this);
  3929. this.bounds = bounds;
  3930. this.fill = fill;
  3931. this.stroke = stroke;
  3932. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  3933. };
  3934. /**
  3935. * Extends mxShape.
  3936. */
  3937. mxUtils.extend(mxShapeMockupiHorButtonBar, mxShape);
  3938. mxShapeMockupiHorButtonBar.prototype.customProperties = [
  3939. {name: 'buttonText', dispName: 'Labels', type: 'string'},
  3940. {name: 'textColor', dispName: 'Text Color', type: 'color'},
  3941. {name: 'textColor2', dispName: 'Text2 Color', type: 'color'},
  3942. {name: 'strokeColor2', dispName: 'Stroke2 Color', type: 'color'}
  3943. ];
  3944. /**
  3945. * Function: paintVertexShape
  3946. *
  3947. * Paints the vertex shape.
  3948. */
  3949. mxShapeMockupiHorButtonBar.prototype.paintVertexShape = function(c, x, y, w, h)
  3950. {
  3951. var textStrings = decodeURIComponent(mxUtils.getValue(this.style, mxMockupC.BUTTON_TEXT, '+Button 1, Button 2, Button 3').toString()).split(',');
  3952. var fontColor = mxUtils.getValue(this.style, mxMockupC.STYLE_TEXTCOLOR, '#666666');
  3953. var selectedFontColor = mxUtils.getValue(this.style, mxMockupC.STYLE_TEXTCOLOR2, '#ffffff');
  3954. var fontSize = mxUtils.getValue(this.style, mxConstants.STYLE_FONTSIZE, '8.5').toString();
  3955. var frameColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#666666');
  3956. var separatorColor = mxUtils.getValue(this.style, mxMockupC.STYLE_STROKECOLOR2, '#c4c4c4');
  3957. var bgColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '#ffffff');
  3958. var selectedFillColor = mxUtils.getValue(this.style, mxMockupC.STYLE_FILLCOLOR2, '#008cff');
  3959. var buttonNum = textStrings.length;
  3960. var buttonWidths = new Array(buttonNum);
  3961. var buttonTotalWidth = 0;
  3962. var selectedButton = -1;
  3963. var rSize = 2.5; //rounding size
  3964. var labelOffset = 2.5;
  3965. for (var i = 0; i < buttonNum; i++)
  3966. {
  3967. var buttonText = textStrings[i];
  3968. if(buttonText.charAt(0) === mxMockupC.SELECTED)
  3969. {
  3970. buttonText = textStrings[i].substring(1);
  3971. selectedButton = i;
  3972. }
  3973. buttonWidths[i] = mxUtils.getSizeForString(buttonText, fontSize, mxConstants.DEFAULT_FONTFAMILY).width;
  3974. buttonTotalWidth += buttonWidths[i];
  3975. }
  3976. var trueH = Math.max(h, fontSize * 1.5, 10);
  3977. var minW = 2 * labelOffset * buttonNum + buttonTotalWidth;
  3978. var trueW = Math.max(w, minW);
  3979. c.translate(x, y);
  3980. this.background(c, trueW, trueH, rSize, buttonNum, buttonWidths, labelOffset, minW, frameColor, separatorColor, bgColor, selectedFillColor, selectedButton);
  3981. c.setShadow(false);
  3982. var currWidth = 0;
  3983. for (var i = 0; i < buttonNum; i++)
  3984. {
  3985. if (i === selectedButton)
  3986. {
  3987. c.setFontColor(selectedFontColor);
  3988. }
  3989. else
  3990. {
  3991. c.setFontColor(fontColor);
  3992. }
  3993. currWidth = currWidth + labelOffset;
  3994. this.buttonText(c, currWidth, trueH, textStrings[i], buttonWidths[i], fontSize, minW, trueW);
  3995. currWidth = currWidth + buttonWidths[i] + labelOffset;
  3996. }
  3997. };
  3998. mxShapeMockupiHorButtonBar.prototype.background = function(c, w, h, rSize, buttonNum, buttonWidths, labelOffset, minW, frameColor, separatorColor, bgColor, selectedFillColor, selectedButton)
  3999. {
  4000. c.begin();
  4001. //draw the frame
  4002. c.setStrokeColor(frameColor);
  4003. c.setFillColor(bgColor);
  4004. c.moveTo(0, rSize);
  4005. c.arcTo(rSize, rSize, 0, 0, 1, rSize, 0);
  4006. c.lineTo(w - rSize, 0);
  4007. c.arcTo(rSize, rSize, 0, 0, 1, w, rSize);
  4008. c.lineTo(w, h - rSize);
  4009. c.arcTo(rSize, rSize, 0, 0, 1, w - rSize, h);
  4010. c.lineTo(rSize, h);
  4011. c.arcTo(rSize, rSize, 0, 0, 1, 0, h - rSize);
  4012. c.close();
  4013. c.fillAndStroke();
  4014. //draw the button separators
  4015. c.setStrokeColor(separatorColor);
  4016. c.begin();
  4017. for (var i = 1; i < buttonNum; i++)
  4018. {
  4019. if (i !== selectedButton && i !== (selectedButton + 1))
  4020. {
  4021. var currWidth = 0;
  4022. for (var j = 0; j < i; j++)
  4023. {
  4024. currWidth += buttonWidths[j] + 2 * labelOffset;
  4025. }
  4026. currWidth = currWidth * w / minW;
  4027. c.moveTo(currWidth, 0);
  4028. c.lineTo(currWidth, h);
  4029. }
  4030. }
  4031. c.stroke();
  4032. //draw the selected button
  4033. var buttonLeft = 0;
  4034. c.setStrokeColor(mxConstants.NONE);
  4035. for (var i = 0; i < selectedButton; i++)
  4036. {
  4037. buttonLeft += buttonWidths[i] + 2 * labelOffset;
  4038. }
  4039. buttonLeft = buttonLeft * w / minW;
  4040. var buttonRight = (buttonWidths[selectedButton] + 2 * labelOffset) * w / minW;
  4041. buttonRight += buttonLeft;
  4042. if (selectedButton === 0)
  4043. {
  4044. c.setGradient('#5D7585', '#008cff', 0, 0, buttonRight, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  4045. c.begin();
  4046. // we draw a path for the first button
  4047. c.moveTo(0, rSize);
  4048. c.arcTo(rSize, rSize, 0, 0, 1, rSize, 0);
  4049. c.lineTo(buttonRight, 0);
  4050. c.lineTo(buttonRight, h);
  4051. c.lineTo(rSize, h);
  4052. c.arcTo(rSize, rSize, 0, 0, 1, 0, h - rSize);
  4053. c.close();
  4054. c.fill();
  4055. }
  4056. else if (selectedButton === buttonNum - 1)
  4057. {
  4058. c.setGradient('#5D7585', '#008cff', buttonLeft, 0, buttonRight - buttonLeft, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  4059. c.begin();
  4060. // we draw a path for the last button
  4061. c.moveTo(buttonLeft, 0);
  4062. c.lineTo(buttonRight - rSize, 0);
  4063. c.arcTo(rSize, rSize, 0, 0, 1, buttonRight, rSize);
  4064. c.lineTo(buttonRight, h - rSize);
  4065. c.arcTo(rSize, rSize, 0, 0, 1, buttonRight - rSize, h);
  4066. c.lineTo(buttonLeft, h);
  4067. c.close();
  4068. c.fill();
  4069. }
  4070. else if (selectedButton !== -1)
  4071. {
  4072. c.setGradient('#5D7585', '#008cff', buttonLeft, 0, buttonRight - buttonLeft, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  4073. c.begin();
  4074. // we draw a path rectangle for one of the buttons in the middle
  4075. c.moveTo(buttonLeft, 0);
  4076. c.lineTo(buttonRight, 0);
  4077. c.lineTo(buttonRight, h);
  4078. c.lineTo(buttonLeft, h);
  4079. c.close();
  4080. c.fill();
  4081. }
  4082. //draw the frame again, to achieve a nicer effect
  4083. c.setStrokeColor(frameColor);
  4084. c.setFillColor(bgColor);
  4085. c.begin();
  4086. c.moveTo(0, rSize);
  4087. c.arcTo(rSize, rSize, 0, 0, 1, rSize, 0);
  4088. c.lineTo(w - rSize, 0);
  4089. c.arcTo(rSize, rSize, 0, 0, 1, w, rSize);
  4090. c.lineTo(w, h - rSize);
  4091. c.arcTo(rSize, rSize, 0, 0, 1, w - rSize, h);
  4092. c.lineTo(rSize, h);
  4093. c.arcTo(rSize, rSize, 0, 0, 1, 0, h - rSize);
  4094. c.close();
  4095. c.stroke();
  4096. };
  4097. mxShapeMockupiHorButtonBar.prototype.buttonText = function(c, w, h, textString, buttonWidth, fontSize, minW, trueW)
  4098. {
  4099. if(textString.charAt(0) === mxMockupC.SELECTED)
  4100. {
  4101. textString = textString.substring(1);
  4102. }
  4103. c.begin();
  4104. c.setFontSize(fontSize);
  4105. c.text((w + buttonWidth * 0.5) * trueW / minW, h * 0.5, 0, 0, textString, mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  4106. };
  4107. mxCellRenderer.registerShape(mxMockupC.SHAPE_IHOR_BUTTON_BAR, mxShapeMockupiHorButtonBar);
  4108. //**********************************************************************************************************************************************************
  4109. //Pin
  4110. //**********************************************************************************************************************************************************
  4111. /**
  4112. * Extends mxShape.
  4113. */
  4114. function mxShapeMockupiPin(bounds, fill, stroke, strokewidth)
  4115. {
  4116. mxShape.call(this);
  4117. this.bounds = bounds;
  4118. this.fill = fill;
  4119. this.stroke = stroke;
  4120. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  4121. };
  4122. /**
  4123. * Extends mxShape.
  4124. */
  4125. mxUtils.extend(mxShapeMockupiPin, mxShape);
  4126. mxShapeMockupiPin.prototype.customProperties = [
  4127. {name: 'fillColor2', dispName: 'Fill2 Color', type: 'color'},
  4128. {name: 'fillColor3', dispName: 'Fill3 Color', type: 'color'}
  4129. ];
  4130. /**
  4131. * Function: paintVertexShape
  4132. *
  4133. * Paints the vertex shape.
  4134. */
  4135. mxShapeMockupiPin.prototype.paintVertexShape = function(c, x, y, w, h)
  4136. {
  4137. var fillColor2 = mxUtils.getValue(this.style, mxMockupC.STYLE_FILLCOLOR2, '#000000');
  4138. var fillColor3 = mxUtils.getValue(this.style, mxMockupC.STYLE_FILLCOLOR3, '#000000');
  4139. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  4140. c.setShadow(false);
  4141. c.translate(x, y);
  4142. c.setStrokeWidth(1.5);
  4143. c.setStrokeColor('#666666');
  4144. c.begin();
  4145. c.moveTo(w * 0.5, h * 0.4);
  4146. c.lineTo(w * 0.5, h);
  4147. c.stroke();
  4148. c.setStrokeWidth(1);
  4149. c.setStrokeColor(strokeColor);
  4150. c.setGradient(fillColor2, fillColor3, 0, 0, w, h * 0.4, mxConstants.DIRECTION_SOUTH, 1, 1);
  4151. c.setAlpha(0.9);
  4152. c.ellipse(0, 0, w, h * 0.4);
  4153. c.fillAndStroke();
  4154. c.setFillColor('#ffffff');
  4155. c.setAlpha(0.5);
  4156. c.ellipse(w * 0.2, h * 0.08, w * 0.3, h * 0.12);
  4157. c.fill();
  4158. };
  4159. mxCellRenderer.registerShape(mxMockupC.SHAPE_IPIN, mxShapeMockupiPin);
  4160. //**********************************************************************************************************************************************************
  4161. //Video Controls
  4162. //**********************************************************************************************************************************************************
  4163. /**
  4164. * Extends mxShape.
  4165. */
  4166. function mxShapeMockupiVideoControls(bounds, fill, stroke, strokewidth)
  4167. {
  4168. mxShape.call(this);
  4169. this.bounds = bounds;
  4170. this.fill = fill;
  4171. this.stroke = stroke;
  4172. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  4173. };
  4174. /**
  4175. * Extends mxShape.
  4176. */
  4177. mxUtils.extend(mxShapeMockupiVideoControls, mxShape);
  4178. mxShapeMockupiVideoControls.prototype.customProperties = [
  4179. {name: 'barPos', dispName: 'Handle Position', type: 'float', min:0, defVal:20}
  4180. ];
  4181. /**
  4182. * Function: paintVertexShape
  4183. *
  4184. * Paints the vertex shape.
  4185. */
  4186. mxShapeMockupiVideoControls.prototype.paintVertexShape = function(c, x, y, w, h)
  4187. {
  4188. c.translate(x, y);
  4189. var rSize = 5;
  4190. c.setStrokeWidth(1);
  4191. c.setFillColor('#000000');
  4192. c.setStrokeColor('#bbbbbb');
  4193. c.setAlpha(0.7);
  4194. c.roundrect(0, 0, w, h, rSize, rSize);
  4195. c.fillAndStroke();
  4196. c.setShadow(false);
  4197. this.foreground(c, w, h, rSize);
  4198. };
  4199. mxShapeMockupiVideoControls.prototype.foreground = function(c, w, h, rSize)
  4200. {
  4201. c.setGradient('#ffffff', '#ffffff', 0, 0, w, h * 0.5, mxConstants.DIRECTION_SOUTH, 0.8, 0.1);
  4202. c.begin();
  4203. c.moveTo(0, rSize);
  4204. c.arcTo(rSize, rSize, 0, 0, 1, rSize, 0);
  4205. c.lineTo(w - rSize, 0);
  4206. c.arcTo(rSize, rSize, 0, 0, 1, w, rSize);
  4207. c.lineTo(w, h * 0.5);
  4208. c.lineTo(0, h * 0.5);
  4209. c.close();
  4210. c.fill();
  4211. c.setAlpha(1);
  4212. c.setFillColor('#ffffff');
  4213. c.setStrokeColor('#ffffff');
  4214. var iconX = w * 0.1;
  4215. var iconY = h * 0.35;
  4216. c.begin();
  4217. c.moveTo(iconX - 7.5, iconY - 2.5);
  4218. c.arcTo(6, 6, 0, 0, 1, iconX, iconY - 2.5);
  4219. c.arcTo(6, 6, 0, 0, 1, iconX + 7.5, iconY - 2.5);
  4220. c.lineTo(iconX + 7.5, iconY + 4);
  4221. c.arcTo(6, 6, 0, 0, 0, iconX, iconY + 4);
  4222. c.arcTo(6, 6, 0, 0, 0, iconX - 7.5, iconY + 4);
  4223. c.close();
  4224. c.stroke();
  4225. c.begin();
  4226. c.moveTo(iconX, iconY - 2.5);
  4227. c.lineTo(iconX, iconY + 4);
  4228. c.stroke();
  4229. iconX = w * 0.3;
  4230. c.rect(iconX - 7.5, iconY - 5, 1, 10);
  4231. c.fill();
  4232. c.begin();
  4233. c.moveTo(iconX - 6.5, iconY);
  4234. c.lineTo(iconX + 0.5, iconY - 5);
  4235. c.lineTo(iconX + 0.5, iconY + 5);
  4236. c.close();
  4237. c.fill();
  4238. c.begin();
  4239. c.moveTo(iconX + 0.5, iconY);
  4240. c.lineTo(iconX + 7.5, iconY - 5);
  4241. c.lineTo(iconX + 7.5, iconY + 5);
  4242. c.close();
  4243. c.fill();
  4244. iconX = w * 0.5;
  4245. c.begin();
  4246. c.moveTo(iconX - 6, iconY - 5);
  4247. c.lineTo(iconX + 6, iconY);
  4248. c.lineTo(iconX - 6, iconY + 5);
  4249. c.close();
  4250. c.fill();
  4251. iconX = w * 0.7;
  4252. c.begin();
  4253. c.moveTo(iconX - 7.5, iconY - 5);
  4254. c.lineTo(iconX - 0.5, iconY);
  4255. c.lineTo(iconX - 7.5, iconY + 5);
  4256. c.close();
  4257. c.fill();
  4258. c.begin();
  4259. c.moveTo(iconX - 0.5, iconY - 5);
  4260. c.lineTo(iconX + 6.5, iconY);
  4261. c.lineTo(iconX - 0.5, iconY + 5);
  4262. c.close();
  4263. c.fill();
  4264. c.rect(iconX + 6.5, iconY - 5, 1, 10);
  4265. c.fill();
  4266. iconX = w * 0.9;
  4267. c.rect(iconX - 7.5, iconY - 4, 15, 8);
  4268. c.stroke();
  4269. c.setStrokeWidth(0.5);
  4270. c.begin();
  4271. c.moveTo(iconX - 7.5, iconY - 4);
  4272. c.lineTo(iconX, iconY + 1.5);
  4273. c.lineTo(iconX + 7.5, iconY - 4);
  4274. c.stroke();
  4275. c.begin();
  4276. c.moveTo(iconX - 7.5, iconY + 4);
  4277. c.lineTo(iconX - 2, iconY);
  4278. c.stroke();
  4279. c.begin();
  4280. c.moveTo(iconX + 7.5, iconY + 4);
  4281. c.lineTo(iconX + 2, iconY);
  4282. c.stroke();
  4283. c.setGradient('#444444', '#ffffff', w * 0.1, h * 0.75 - 2.5, w * 0.8, 5, mxConstants.DIRECTION_SOUTH, 1, 1);
  4284. c.roundrect(w * 0.1, h * 0.75 - 2.5, w * 0.8, 5, 2.5, 2.5);
  4285. c.fill();
  4286. var barPos = mxUtils.getValue(this.style, mxMockupC.BAR_POS, '80');
  4287. barPos = Math.min(barPos, 100);
  4288. barPos = Math.max(barPos, 0);
  4289. var deadzone = w * 0.1;
  4290. var virRange = w - 2 * deadzone;
  4291. var truePos = deadzone + virRange * barPos / 100;
  4292. c.setGradient('#96D1FF', '#003377', w * 0.1, h * 0.75 - 5, truePos - w * 0.1, 10, mxConstants.DIRECTION_SOUTH, 1, 1);
  4293. c.begin();
  4294. c.moveTo(truePos, h * 0.75 - 2.5);
  4295. c.lineTo(truePos, h * 0.75 + 2.5);
  4296. c.lineTo(w * 0.1 + 2.5, h * 0.75 + 2.5);
  4297. c.arcTo(2.5, 2.5, 0, 0, 1, w * 0.1 + 2.5, h * 0.75 - 2.5);
  4298. c.close();
  4299. c.fill();
  4300. c.setStrokeColor('#999999');
  4301. c.setGradient('#444444', '#ffffff', truePos - 5, h * 0.75 - 5, 10, 10, mxConstants.DIRECTION_NORTH, 1, 1);
  4302. c.ellipse(truePos - 5, h * 0.75 - 5, 10, 10);
  4303. c.fillAndStroke();
  4304. c.setStrokeColor('#dddddd');
  4305. c.roundrect(0, 0, w, h, rSize, rSize);
  4306. c.stroke();
  4307. };
  4308. mxCellRenderer.registerShape(mxMockupC.SHAPE_IVIDEO_CONTROLS, mxShapeMockupiVideoControls);
  4309. Graph.handleFactory[mxMockupC.SHAPE_IVIDEO_CONTROLS] = function(state)
  4310. {
  4311. var handles = [Graph.createHandle(state, ['barPos'], function(bounds)
  4312. {
  4313. var barPos = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'barPos', 40))));
  4314. return new mxPoint(bounds.x + bounds.width * 0.1 + barPos * bounds.width * 0.8 / 100, bounds.y + bounds.height * 0.75);
  4315. }, function(bounds, pt)
  4316. {
  4317. this.state.style['barPos'] = Math.round(100 * Math.max(0, Math.min(100, (pt.x - bounds.width * 0.1 - bounds.x) * 100 / (bounds.width * 0.8)))) / 100;
  4318. })];
  4319. return handles;
  4320. };
  4321. //**********************************************************************************************************************************************************
  4322. //URL Bar
  4323. //**********************************************************************************************************************************************************
  4324. /**
  4325. * Extends mxShape.
  4326. */
  4327. function mxShapeMockupiURLBar(bounds, fill, stroke, strokewidth)
  4328. {
  4329. mxShape.call(this);
  4330. this.bounds = bounds;
  4331. this.fill = fill;
  4332. this.stroke = stroke;
  4333. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  4334. };
  4335. /**
  4336. * Extends mxShape.
  4337. */
  4338. mxUtils.extend(mxShapeMockupiURLBar, mxShape);
  4339. /**
  4340. * Function: paintVertexShape
  4341. *
  4342. * Paints the vertex shape.
  4343. */
  4344. mxShapeMockupiURLBar.prototype.paintVertexShape = function(c, x, y, w, h)
  4345. {
  4346. c.translate(x, y);
  4347. c.setGradient('#cccccc', '#003377', 0, 0, w, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  4348. c.rect(0, 0, w, h);
  4349. c.fill();
  4350. c.setShadow(false);
  4351. this.foreground(c, w, h);
  4352. };
  4353. mxShapeMockupiURLBar.prototype.foreground = function(c, w, h)
  4354. {
  4355. c.setStrokeWidth(0.5);
  4356. c.setFillColor('#ffffff');
  4357. c.setStrokeColor('#008cff');
  4358. c.roundrect(w * 0.0287, h * 0.625 - 6.25, w * 0.7184, 12.5, 6.25, 6.25);
  4359. c.fillAndStroke();
  4360. c.setGradient('#cccccc', '#001144', w * 0.7816, h * 0.625 - 6.25, w * 0.1868, 12.5, mxConstants.DIRECTION_SOUTH, 1, 1);
  4361. c.setStrokeColor('#000000');
  4362. c.roundrect(w * 0.7816, h * 0.625 - 6.25, w * 0.1868, 12.5, 2.5, 2.5);
  4363. c.fillAndStroke();
  4364. c.setFillColor('#bbbbbb');
  4365. c.ellipse(w * 0.7471 - 11.5, h * 0.625 - 5, 10, 10);
  4366. c.fill();
  4367. c.setStrokeColor('#ffffff');
  4368. c.setStrokeWidth(1.5);
  4369. c.begin();
  4370. c.moveTo(w * 0.7471 - 8.5, h * 0.625 - 2.5);
  4371. c.lineTo(w * 0.7471 - 3.5, h * 0.625 + 2.5);
  4372. c.moveTo(w * 0.7471 - 8.5, h * 0.625 + 2.5);
  4373. c.lineTo(w * 0.7471 - 3.5, h * 0.625 - 2.5);
  4374. c.stroke();
  4375. var fieldText = decodeURIComponent(mxUtils.getValue(this.style, mxMockupC.BUTTON_TEXT, '').toString()).split(',');
  4376. c.setFontColor('#425664');
  4377. c.setFontStyle(mxConstants.FONT_BOLD);
  4378. c.setFontSize(8);
  4379. c.text(w * 0.5, h * 0.2, 0, 0, fieldText[0], mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  4380. c.setFontColor('#000000');
  4381. c.text(w * 0.06, h * 0.625, 0, 0, fieldText[1], mxConstants.ALIGN_LEFT, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  4382. c.setFontColor('#ffffff');
  4383. c.text(w * 0.875, h * 0.625, 0, 0, fieldText[2], mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  4384. };
  4385. mxCellRenderer.registerShape(mxMockupC.SHAPE_IURL_BAR, mxShapeMockupiURLBar);
  4386. //**********************************************************************************************************************************************************
  4387. //Slider
  4388. //**********************************************************************************************************************************************************
  4389. /**
  4390. * Extends mxShape.
  4391. */
  4392. function mxShapeMockupiSlider(bounds, fill, stroke, strokewidth)
  4393. {
  4394. mxShape.call(this);
  4395. this.bounds = bounds;
  4396. this.fill = fill;
  4397. this.stroke = stroke;
  4398. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  4399. };
  4400. /**
  4401. * Extends mxShape.
  4402. */
  4403. mxUtils.extend(mxShapeMockupiSlider, mxShape);
  4404. mxShapeMockupiSlider.prototype.customProperties = [
  4405. {name: 'barPos', dispName: 'Handle Position', type: 'float', min:0, defVal:20},
  4406. ];
  4407. /**
  4408. * Function: paintVertexShape
  4409. *
  4410. * Paints the vertex shape.
  4411. */
  4412. mxShapeMockupiSlider.prototype.paintVertexShape = function(c, x, y, w, h)
  4413. {
  4414. c.translate(x, y);
  4415. c.setShadow(false);
  4416. this.foreground(c, w, h);
  4417. };
  4418. mxShapeMockupiSlider.prototype.foreground = function(c, w, h)
  4419. {
  4420. c.setStrokeWidth(0.5);
  4421. c.setGradient('#444444', '#ffffff', 0, h * 0.5 - 2.5, w, 5, mxConstants.DIRECTION_SOUTH, 1, 1);
  4422. c.roundrect(0, h * 0.5 - 2.5, w, 5, 2.5, 2.5);
  4423. c.fill();
  4424. var barPos = mxUtils.getValue(this.style, mxMockupC.BAR_POS, '80');
  4425. barPos = Math.min(barPos, 100);
  4426. barPos = Math.max(barPos, 0);
  4427. var deadzone = 0;
  4428. var virRange = w - 2 * deadzone;
  4429. var truePos = deadzone + virRange * barPos / 100;
  4430. c.setGradient('#96D1FF', '#003377', 2.5, h * 0.5 - 2.5, truePos - 2.5, 5, mxConstants.DIRECTION_SOUTH, 1, 1);
  4431. c.begin();
  4432. c.moveTo(truePos, h * 0.5 - 2.5);
  4433. c.lineTo(truePos, h * 0.5 + 2.5);
  4434. c.lineTo(2.5, h * 0.5 + 2.5);
  4435. c.arcTo(2.5, 2.5, 0, 0, 1, 2.5, h * 0.5 - 2.5);
  4436. c.close();
  4437. c.fill();
  4438. c.setStrokeColor('#999999');
  4439. c.setGradient('#444444', '#ffffff', truePos - 5, h * 0.5 - 5, 10, 10, mxConstants.DIRECTION_NORTH, 1, 1);
  4440. c.ellipse(truePos - 5, h * 0.5 - 5, 10, 10);
  4441. c.fillAndStroke();
  4442. };
  4443. mxCellRenderer.registerShape(mxMockupC.SHAPE_ISLIDER, mxShapeMockupiSlider);
  4444. Graph.handleFactory[mxMockupC.SHAPE_ISLIDER] = function(state)
  4445. {
  4446. var handles = [Graph.createHandle(state, ['barPos'], function(bounds)
  4447. {
  4448. var barPos = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'barPos', 0.4))));
  4449. return new mxPoint(bounds.x + barPos * bounds.width / 100, bounds.y + bounds.height / 2);
  4450. }, function(bounds, pt)
  4451. {
  4452. this.state.style['barPos'] = Math.round(100 * Math.max(0, Math.min(100, (pt.x - bounds.x) * 100 / bounds.width))) / 100;
  4453. })];
  4454. return handles;
  4455. };
  4456. //**********************************************************************************************************************************************************
  4457. //Progress Bar
  4458. //**********************************************************************************************************************************************************
  4459. /**
  4460. * Extends mxShape.
  4461. */
  4462. function mxShapeMockupiProgressBar(bounds, fill, stroke, strokewidth)
  4463. {
  4464. mxShape.call(this);
  4465. this.bounds = bounds;
  4466. this.fill = fill;
  4467. this.stroke = stroke;
  4468. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  4469. };
  4470. /**
  4471. * Extends mxShape.
  4472. */
  4473. mxUtils.extend(mxShapeMockupiProgressBar, mxShape);
  4474. mxShapeMockupiProgressBar.prototype.customProperties = [
  4475. {name: 'barPos', dispName: 'Handle Position', type: 'float', min:0, defVal:40},
  4476. ];
  4477. /**
  4478. * Function: paintVertexShape
  4479. *
  4480. * Paints the vertex shape.
  4481. */
  4482. mxShapeMockupiProgressBar.prototype.paintVertexShape = function(c, x, y, w, h)
  4483. {
  4484. c.translate(x, y);
  4485. c.setShadow(false);
  4486. this.foreground(c, w, h);
  4487. };
  4488. mxShapeMockupiProgressBar.prototype.foreground = function(c, w, h)
  4489. {
  4490. c.setStrokeWidth(0.5);
  4491. c.setGradient('#444444', '#ffffff', 0, h * 0.5 - 2.5, w, 5, mxConstants.DIRECTION_SOUTH, 1, 1);
  4492. c.roundrect(0, h * 0.5 - 2.5, w, 5, 2.5, 2.5);
  4493. c.fill();
  4494. var barPos = mxUtils.getValue(this.style, mxMockupC.BAR_POS, '80');
  4495. barPos = Math.min(barPos, 100);
  4496. barPos = Math.max(barPos, 0);
  4497. var deadzone = 0;
  4498. var virRange = w - 2 * deadzone;
  4499. var truePos = deadzone + virRange * barPos / 100;
  4500. c.setGradient('#96D1FF', '#003377', 2.5, h * 0.5 - 2.5, truePos - 2.5, 5, mxConstants.DIRECTION_SOUTH, 1, 1);
  4501. c.begin();
  4502. c.moveTo(truePos, h * 0.5 - 2.5);
  4503. c.arcTo(2.5, 2.5, 0, 0, 1, truePos, h * 0.5 + 2.5);
  4504. c.lineTo(2.5, h * 0.5 + 2.5);
  4505. c.arcTo(2.5, 2.5, 0, 0, 1, 2.5, h * 0.5 - 2.5);
  4506. c.close();
  4507. c.fill();
  4508. };
  4509. mxCellRenderer.registerShape(mxMockupC.SHAPE_IPROGRESS_BAR, mxShapeMockupiProgressBar);
  4510. Graph.handleFactory[mxMockupC.SHAPE_IPROGRESS_BAR] = function(state)
  4511. {
  4512. var handles = [Graph.createHandle(state, ['barPos'], function(bounds)
  4513. {
  4514. var barPos = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'barPos', 0.4))));
  4515. return new mxPoint(bounds.x + barPos * bounds.width / 100, bounds.y + bounds.height / 2);
  4516. }, function(bounds, pt)
  4517. {
  4518. this.state.style['barPos'] = Math.round(100 * Math.max(0, Math.min(100, (pt.x - bounds.x) * 100 / bounds.width))) / 100;
  4519. })];
  4520. return handles;
  4521. };
  4522. //**********************************************************************************************************************************************************
  4523. //iCloud Progress Bar
  4524. //**********************************************************************************************************************************************************
  4525. /**
  4526. * Extends mxShape.
  4527. */
  4528. function mxShapeMockupiCloudProgressBar(bounds, fill, stroke, strokewidth)
  4529. {
  4530. mxShape.call(this);
  4531. this.bounds = bounds;
  4532. this.fill = fill;
  4533. this.stroke = stroke;
  4534. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  4535. };
  4536. /**
  4537. * Extends mxShape.
  4538. */
  4539. mxUtils.extend(mxShapeMockupiCloudProgressBar, mxShape);
  4540. mxShapeMockupiCloudProgressBar.prototype.customProperties = [
  4541. {name: 'barPos', dispName: 'Handle Position', type: 'float', min:0, defVal:20},
  4542. ];
  4543. /**
  4544. * Function: paintVertexShape
  4545. *
  4546. * Paints the vertex shape.
  4547. */
  4548. mxShapeMockupiCloudProgressBar.prototype.paintVertexShape = function(c, x, y, w, h)
  4549. {
  4550. c.translate(x, y);
  4551. c.setShadow(false);
  4552. this.foreground(c, w, h);
  4553. };
  4554. mxShapeMockupiCloudProgressBar.prototype.foreground = function(c, w, h)
  4555. {
  4556. c.setStrokeWidth(0.5);
  4557. c.setFillColor('#5C6E86');
  4558. c.rect(0, h * 0.5 - 2.5, w, 5);
  4559. c.fill();
  4560. var barPos = mxUtils.getValue(this.style, mxMockupC.BAR_POS, '80');
  4561. barPos = Math.min(barPos, 100);
  4562. barPos = Math.max(barPos, 0);
  4563. var deadzone = 0;
  4564. var virRange = w - 2 * deadzone;
  4565. var truePos = deadzone + virRange * barPos / 100;
  4566. c.setFillColor('#8AD155');
  4567. c.rect(0, h * 0.5 - 2.5, truePos, 5);
  4568. c.fill();
  4569. };
  4570. mxCellRenderer.registerShape(mxMockupC.SHAPE_ICLOUD_PROGRESS_BAR, mxShapeMockupiCloudProgressBar);
  4571. Graph.handleFactory[mxMockupC.SHAPE_ICLOUD_PROGRESS_BAR] = function(state)
  4572. {
  4573. var handles = [Graph.createHandle(state, ['barPos'], function(bounds)
  4574. {
  4575. var barPos = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'barPos', 0.4))));
  4576. return new mxPoint(bounds.x + barPos * bounds.width / 100, bounds.y + bounds.height / 2);
  4577. }, function(bounds, pt)
  4578. {
  4579. this.state.style['barPos'] = Math.round(100 * Math.max(0, Math.min(100, (pt.x - bounds.x) * 100 / bounds.width))) / 100;
  4580. })];
  4581. return handles;
  4582. };
  4583. //**********************************************************************************************************************************************************
  4584. //Download Bar
  4585. //**********************************************************************************************************************************************************
  4586. /**
  4587. * Extends mxShape.
  4588. */
  4589. function mxShapeMockupiDownloadBar(bounds, fill, stroke, strokewidth)
  4590. {
  4591. mxShape.call(this);
  4592. this.bounds = bounds;
  4593. this.fill = fill;
  4594. this.stroke = stroke;
  4595. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  4596. };
  4597. /**
  4598. * Extends mxShape.
  4599. */
  4600. mxUtils.extend(mxShapeMockupiDownloadBar, mxShape);
  4601. mxShapeMockupiDownloadBar.prototype.customProperties = [
  4602. {name: 'barPos', dispName: 'Handle Position', type: 'float', min:0, defVal:30},
  4603. ];
  4604. /**
  4605. * Function: paintVertexShape
  4606. *
  4607. * Paints the vertex shape.
  4608. */
  4609. mxShapeMockupiDownloadBar.prototype.paintVertexShape = function(c, x, y, w, h)
  4610. {
  4611. c.translate(x, y);
  4612. c.setGradient('#00ccff', '#0066cc', 0, 0, w, h, mxConstants.DIRECTION_SOUTH, 1, 1);
  4613. c.rect(0, 0, w, h);
  4614. c.fill();
  4615. c.setShadow(false);
  4616. this.foreground(c, w, h);
  4617. };
  4618. mxShapeMockupiDownloadBar.prototype.foreground = function(c, w, h)
  4619. {
  4620. var fieldText = decodeURIComponent(mxUtils.getValue(this.style, mxMockupC.BUTTON_TEXT, ''));
  4621. c.setFontColor('#ffffff');
  4622. c.setFontStyle(mxConstants.FONT_BOLD);
  4623. c.setFontSize(8);
  4624. c.text(w * 0.5, h * 0.2, 0, 0, fieldText, mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  4625. var barPos = mxUtils.getValue(this.style, mxMockupC.BAR_POS, '80');
  4626. barPos = Math.min(barPos, 100);
  4627. barPos = Math.max(barPos, 0);
  4628. var deadzone = w * 0.1;
  4629. var virRange = w - 2 * deadzone;
  4630. var truePos = deadzone + virRange * barPos / 100;
  4631. c.setStrokeWidth(0.5);
  4632. c.setGradient('#96D1FF', '#003377', deadzone, h * 0.65 - 2.5, w - 2 * deadzone, 5, mxConstants.DIRECTION_NORTH, 1, 1);
  4633. c.roundrect(deadzone, h * 0.65 - 2.5, w - 2 * deadzone, 5, 2.5, 2.5);
  4634. c.fill();
  4635. c.setGradient('#aaaaaa', '#ffffff', deadzone + 2.5, h * 0.65 - 2.5, truePos - deadzone - 2.5, 5, mxConstants.DIRECTION_NORTH, 1, 1);
  4636. c.begin();
  4637. c.moveTo(truePos, h * 0.65 - 2.5);
  4638. c.arcTo(2.5, 2.5, 0, 0, 1, truePos, h * 0.65 + 2.5);
  4639. c.lineTo(deadzone + 2.5, h * 0.65 + 2.5);
  4640. c.arcTo(2.5, 2.5, 0, 0, 1, deadzone + 2.5, h * 0.65 - 2.5);
  4641. c.close();
  4642. c.fill();
  4643. };
  4644. mxCellRenderer.registerShape(mxMockupC.SHAPE_IDOWNLOAD_BAR, mxShapeMockupiDownloadBar);
  4645. Graph.handleFactory[mxMockupC.SHAPE_IDOWNLOAD_BAR] = function(state)
  4646. {
  4647. var handles = [Graph.createHandle(state, ['barPos'], function(bounds)
  4648. {
  4649. var barPos = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'barPos', 40))));
  4650. return new mxPoint(bounds.x + bounds.width * 0.1 + barPos * bounds.width * 0.8 / 100, bounds.y + bounds.height * 0.65);
  4651. }, function(bounds, pt)
  4652. {
  4653. this.state.style['barPos'] = Math.round(100 * Math.max(0, Math.min(100, (pt.x - bounds.width * 0.1 - bounds.x) * 100 / (bounds.width * 0.8)))) / 100;
  4654. })];
  4655. return handles;
  4656. };
  4657. //**********************************************************************************************************************************************************
  4658. //Screen Name Bar
  4659. //**********************************************************************************************************************************************************
  4660. /**
  4661. * Extends mxShape.
  4662. */
  4663. function mxShapeMockupiScreenNameBar(bounds, fill, stroke, strokewidth)
  4664. {
  4665. mxShape.call(this);
  4666. this.bounds = bounds;
  4667. this.fill = fill;
  4668. this.stroke = stroke;
  4669. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  4670. };
  4671. /**
  4672. * Extends mxShape.
  4673. */
  4674. mxUtils.extend(mxShapeMockupiScreenNameBar, mxShape);
  4675. /**
  4676. * Function: paintVertexShape
  4677. *
  4678. * Paints the vertex shape.
  4679. */
  4680. mxShapeMockupiScreenNameBar.prototype.paintVertexShape = function(c, x, y, w, h)
  4681. {
  4682. c.translate(x, y);
  4683. var rSize = 5;
  4684. c.setStrokeWidth(0.5);
  4685. var fillColor2 = mxUtils.getValue(this.style, mxMockupC.STYLE_FILLCOLOR2, '#00ff00');
  4686. c.setFillColor(fillColor2);
  4687. c.rect(0, 0, w, h);
  4688. c.fill();
  4689. c.setShadow(false);
  4690. this.foreground(c, w, h, rSize);
  4691. };
  4692. mxShapeMockupiScreenNameBar.prototype.foreground = function(c, w, h, rSize)
  4693. {
  4694. var fillColor3 = mxUtils.getValue(this.style, mxMockupC.STYLE_FILLCOLOR3, '#00ff00');
  4695. c.setGradient(fillColor3, fillColor3, 0, 0, w, h * 0.5, mxConstants.DIRECTION_SOUTH, 0.8, 0.1);
  4696. c.rect(0, 0, w, h * 0.5);
  4697. c.fill();
  4698. var fieldText = decodeURIComponent(mxUtils.getValue(this.style, mxMockupC.BUTTON_TEXT, ''));
  4699. var textColor = mxUtils.getValue(this.style, mxMockupC.STYLE_TEXTCOLOR, '#00ff00');
  4700. c.setFontColor(textColor);
  4701. c.setFontSize(9.5);
  4702. c.text(w * 0.5, h * 0.45, 0, 0, fieldText, mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  4703. };
  4704. mxCellRenderer.registerShape(mxMockupC.SHAPE_ISCREEN_NAME_BAR, mxShapeMockupiScreenNameBar);
  4705. //**********************************************************************************************************************************************************
  4706. //Icon Grid
  4707. //**********************************************************************************************************************************************************
  4708. /**
  4709. * Extends mxShape.
  4710. */
  4711. function mxShapeMockupiIconGrid(bounds, fill, stroke, strokewidth)
  4712. {
  4713. mxShape.call(this);
  4714. this.bounds = bounds;
  4715. this.fill = fill;
  4716. this.stroke = stroke;
  4717. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  4718. };
  4719. /**
  4720. * Extends mxShape.
  4721. */
  4722. mxUtils.extend(mxShapeMockupiIconGrid, mxShape);
  4723. mxShapeMockupiIconGrid.prototype.customProperties = [
  4724. {name: 'gridSize', dispName: 'Grid Size', type: 'string'},
  4725. ];
  4726. /**
  4727. * Function: paintVertexShape
  4728. *
  4729. * Paints the vertex shape.
  4730. */
  4731. mxShapeMockupiIconGrid.prototype.paintVertexShape = function(c, x, y, w, h)
  4732. {
  4733. c.translate(x, y);
  4734. var gridSize = decodeURIComponent(mxUtils.getValue(this.style, mxMockupC.GRID_SIZE, '3,3').toString()).split(',');
  4735. this.background(c, w, h, gridSize);
  4736. c.setShadow(false);
  4737. this.foreground(c, w, h, gridSize);
  4738. };
  4739. mxShapeMockupiIconGrid.prototype.background = function(c, w, h, gridSize)
  4740. {
  4741. var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '#00ff00');
  4742. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#00ff00');
  4743. c.setStrokeColor(strokeColor);
  4744. c.setFillColor(fillColor);
  4745. var boxSizeX = w / (parseInt(gridSize[0],10) + (gridSize[0]-1) * 0.5);
  4746. var boxSizeY = h / (parseInt(gridSize[1],10) + (gridSize[1]-1) * 0.5);
  4747. for (var i = 0; i < gridSize[0]; i++)
  4748. {
  4749. for (var j = 0; j < gridSize[1]; j++)
  4750. {
  4751. c.rect(boxSizeX * 1.5 * i, boxSizeY * 1.5 * j, boxSizeX, boxSizeY);
  4752. c.fillAndStroke();
  4753. }
  4754. }
  4755. };
  4756. mxShapeMockupiIconGrid.prototype.foreground = function(c, w, h, gridSize)
  4757. {
  4758. var boxSizeX = w / (parseInt(gridSize[0],10) + (gridSize[0]-1) * 0.5);
  4759. var boxSizeY = h / (parseInt(gridSize[1],10) + (gridSize[1]-1) * 0.5);
  4760. for (var i = 0; i < gridSize[0]; i++)
  4761. {
  4762. for (var j = 0; j < gridSize[1]; j++)
  4763. {
  4764. c.begin();
  4765. c.moveTo(boxSizeX * 1.5 * i, boxSizeY * 1.5 * j);
  4766. c.lineTo(boxSizeX * 1.5 * i + boxSizeX, boxSizeY * 1.5 * j + boxSizeY);
  4767. c.moveTo(boxSizeX * 1.5 * i + boxSizeX, boxSizeY * 1.5 * j);
  4768. c.lineTo(boxSizeX * 1.5 * i, boxSizeY * 1.5 * j + boxSizeY);
  4769. c.stroke();
  4770. }
  4771. }
  4772. };
  4773. mxCellRenderer.registerShape(mxMockupC.SHAPE_IICON_GRID, mxShapeMockupiIconGrid);
  4774. //**********************************************************************************************************************************************************
  4775. //Copy
  4776. //**********************************************************************************************************************************************************
  4777. /**
  4778. * Extends mxShape.
  4779. */
  4780. function mxShapeMockupiCopy(bounds, fill, stroke, strokewidth)
  4781. {
  4782. mxShape.call(this);
  4783. this.bounds = bounds;
  4784. this.fill = fill;
  4785. this.stroke = stroke;
  4786. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  4787. };
  4788. /**
  4789. * Extends mxShape.
  4790. */
  4791. mxUtils.extend(mxShapeMockupiCopy, mxShape);
  4792. /**
  4793. * Function: paintVertexShape
  4794. *
  4795. * Paints the vertex shape.
  4796. */
  4797. mxShapeMockupiCopy.prototype.paintVertexShape = function(c, x, y, w, h)
  4798. {
  4799. var rSize = 5;
  4800. c.translate(x, y);
  4801. this.background(c, w, h, rSize);
  4802. c.setShadow(false);
  4803. this.foreground(c, w, h, rSize);
  4804. };
  4805. mxShapeMockupiCopy.prototype.background = function(c, w, h, rSize)
  4806. {
  4807. c.begin();
  4808. c.moveTo(0, rSize);
  4809. c.arcTo(rSize, rSize, 0, 0, 1, rSize, 0);
  4810. c.lineTo(w - rSize, 0);
  4811. c.arcTo(rSize, rSize, 0, 0, 1, w, rSize);
  4812. c.lineTo(w, h - rSize - 7.5);
  4813. c.arcTo(rSize, rSize, 0, 0, 1, w - rSize, h - 7.5);
  4814. c.lineTo(w * 0.5 + 7.5, h - 7.5);
  4815. c.lineTo(w * 0.5, h);
  4816. c.lineTo(w * 0.5 - 7.5, h - 7.5);
  4817. c.lineTo(rSize, h - 7.5);
  4818. c.arcTo(rSize, rSize, 0, 0, 1, 0, h - rSize - 7.5);
  4819. c.close();
  4820. c.fillAndStroke();
  4821. };
  4822. mxShapeMockupiCopy.prototype.foreground = function(c, w, h, rSize)
  4823. {
  4824. var fillColor3 = mxUtils.getValue(this.style, mxMockupC.STYLE_FILLCOLOR3, '#00ff00');
  4825. c.setGradient(fillColor3, fillColor3, 0, 0, w, h * 0.5, mxConstants.DIRECTION_SOUTH, 0.8, 0.1);
  4826. c.begin();
  4827. c.moveTo(0, rSize);
  4828. c.arcTo(rSize, rSize, 0, 0, 1, rSize, 0);
  4829. c.lineTo(w - rSize, 0);
  4830. c.arcTo(rSize, rSize, 0, 0, 1, w, rSize);
  4831. c.lineTo(w, (h - 7.5) * 0.5);
  4832. c.lineTo(0, (h - 7.5) * 0.5);
  4833. c.close();
  4834. c.fill();
  4835. var fieldText = decodeURIComponent(mxUtils.getValue(this.style, mxMockupC.BUTTON_TEXT, ''));
  4836. var textColor = mxUtils.getValue(this.style, mxMockupC.STYLE_TEXTCOLOR, '#00ff00');
  4837. c.setFontColor(textColor);
  4838. c.setFontSize(8.5);
  4839. c.text(w * 0.5, (h - 7.5)* 0.45, 0, 0, fieldText, mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  4840. };
  4841. mxCellRenderer.registerShape(mxMockupC.SHAPE_ICOPY, mxShapeMockupiCopy);
  4842. //**********************************************************************************************************************************************************
  4843. //Copy Area
  4844. //**********************************************************************************************************************************************************
  4845. /**
  4846. * Extends mxShape.
  4847. */
  4848. function mxShapeMockupiCopyArea(bounds, fill, stroke, strokewidth)
  4849. {
  4850. mxShape.call(this);
  4851. this.bounds = bounds;
  4852. this.fill = fill;
  4853. this.stroke = stroke;
  4854. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  4855. };
  4856. /**
  4857. * Extends mxShape.
  4858. */
  4859. mxUtils.extend(mxShapeMockupiCopyArea, mxShape);
  4860. /**
  4861. * Function: paintVertexShape
  4862. *
  4863. * Paints the vertex shape.
  4864. */
  4865. mxShapeMockupiCopyArea.prototype.paintVertexShape = function(c, x, y, w, h)
  4866. {
  4867. var rSize = 5;
  4868. c.translate(x, y);
  4869. this.background(c, w, h, rSize);
  4870. c.setShadow(false);
  4871. this.foreground(c, w, h, rSize);
  4872. };
  4873. mxShapeMockupiCopyArea.prototype.background = function(c, w, h, rSize)
  4874. {
  4875. c.begin();
  4876. c.moveTo(w * 0.5 - 20, 0 + rSize);
  4877. c.arcTo(rSize, rSize, 0, 0, 1, w * 0.5 - 20 + rSize, 0);
  4878. c.lineTo(w * 0.5 + 20 - rSize, 0);
  4879. c.arcTo(rSize, rSize, 0, 0, 1, w * 0.5 + 20, rSize);
  4880. c.lineTo(w * 0.5 + 20, 20 - rSize);
  4881. c.arcTo(rSize, rSize, 0, 0, 1, w * 0.5 + 20 - rSize, 20);
  4882. c.lineTo(w * 0.5 + 7.5, 20);
  4883. c.lineTo(w * 0.5, 27.5);
  4884. c.lineTo(w * 0.5 - 7.5, 20);
  4885. c.lineTo(w * 0.5 - 20 + rSize, 20);
  4886. c.arcTo(rSize, rSize, 0, 0, 1, w * 0.5 - 20, 20 - rSize);
  4887. c.close();
  4888. c.fillAndStroke();
  4889. };
  4890. mxShapeMockupiCopyArea.prototype.foreground = function(c, w, h, rSize)
  4891. {
  4892. c.setAlpha(0.3);
  4893. c.setFillColor('#2266ff');
  4894. c.rect(2.5, 27.5, w - 5, h - 30);
  4895. c.fill();
  4896. c.setAlpha(1);
  4897. if (h > 27.5)
  4898. {
  4899. c.setStrokeColor('#ffffff');
  4900. c.setGradient('#88ddff', '#2266ff', w * 0.5 - 2.5, 25, 5, 5, mxConstants.DIRECTION_SOUTH, 1, 1);
  4901. c.ellipse(w * 0.5 - 2.5, 25, 5, 5);
  4902. c.fillAndStroke();
  4903. c.setGradient('#88ddff', '#2266ff', w * 0.5 - 2.5, h - 5, 5, 5, mxConstants.DIRECTION_SOUTH, 1, 1);
  4904. c.ellipse(w * 0.5 - 2.5, h - 5, 5, 5);
  4905. c.fillAndStroke();
  4906. c.setGradient('#88ddff', '#2266ff', 0, h * 0.5 + 10, 5, 5, mxConstants.DIRECTION_SOUTH, 1, 1);
  4907. c.ellipse(0, h * 0.5 + 10, 5, 5);
  4908. c.fillAndStroke();
  4909. c.setGradient('#88ddff', '#2266ff', w - 5, h * 0.5 + 10, 5, 5, mxConstants.DIRECTION_SOUTH, 1, 1);
  4910. c.ellipse(w - 5, h * 0.5 + 10, 5, 5);
  4911. c.fillAndStroke();
  4912. }
  4913. var fillColor2 = mxUtils.getValue(this.style, mxMockupC.STYLE_FILLCOLOR2, '#00ff00');
  4914. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#00ff00');
  4915. c.setFillColor(fillColor2);
  4916. c.setStrokeColor(strokeColor);
  4917. c.begin();
  4918. c.moveTo(w * 0.5 - 20, 0 + rSize);
  4919. c.arcTo(rSize, rSize, 0, 0, 1, w * 0.5 - 20 + rSize, 0);
  4920. c.lineTo(w * 0.5 + 20 - rSize, 0);
  4921. c.arcTo(rSize, rSize, 0, 0, 1, w * 0.5 + 20, rSize);
  4922. c.lineTo(w * 0.5 + 20, 20 - rSize);
  4923. c.arcTo(rSize, rSize, 0, 0, 1, w * 0.5 + 20 - rSize, 20);
  4924. c.lineTo(w * 0.5 + 7.5, 20);
  4925. c.lineTo(w * 0.5, 27.5);
  4926. c.lineTo(w * 0.5 - 7.5, 20);
  4927. c.lineTo(w * 0.5 - 20 + rSize, 20);
  4928. c.arcTo(rSize, rSize, 0, 0, 1, w * 0.5 - 20, 20 - rSize);
  4929. c.close();
  4930. c.fillAndStroke();
  4931. var fillColor3 = mxUtils.getValue(this.style, mxMockupC.STYLE_FILLCOLOR3, '#00ff00');
  4932. c.setGradient(fillColor3, fillColor3, w * 0.5 - 20, 0, 40, 10, mxConstants.DIRECTION_SOUTH, 0.8, 0.1);
  4933. c.begin();
  4934. c.moveTo(w * 0.5 - 20, rSize);
  4935. c.arcTo(rSize, rSize, 0, 0, 1, w * 0.5 - 20 + rSize, 0);
  4936. c.lineTo(w * 0.5 + 20 - rSize, 0);
  4937. c.arcTo(rSize, rSize, 0, 0, 1, w * 0.5 + 20, rSize);
  4938. c.lineTo(w * 0.5 + 20, 10);
  4939. c.lineTo(w * 0.5 - 20, 10);
  4940. c.close();
  4941. c.fill();
  4942. var fieldText = decodeURIComponent(mxUtils.getValue(this.style, mxMockupC.BUTTON_TEXT, ''));
  4943. var textColor = mxUtils.getValue(this.style, mxMockupC.STYLE_TEXTCOLOR, '#00ff00');
  4944. c.setFontColor(textColor);
  4945. c.setFontSize(8.5);
  4946. c.text(w * 0.5, 8.75, 0, 0, fieldText, mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  4947. };
  4948. mxCellRenderer.registerShape(mxMockupC.SHAPE_ICOPY_AREA, mxShapeMockupiCopyArea);
  4949. //**********************************************************************************************************************************************************
  4950. //Home Page Control
  4951. //**********************************************************************************************************************************************************
  4952. /**
  4953. * Extends mxShape.
  4954. */
  4955. function mxShapeMockupiHomePageControl(bounds, fill, stroke, strokewidth)
  4956. {
  4957. mxShape.call(this);
  4958. this.bounds = bounds;
  4959. this.fill = fill;
  4960. this.stroke = stroke;
  4961. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  4962. };
  4963. /**
  4964. * Extends mxShape.
  4965. */
  4966. mxUtils.extend(mxShapeMockupiHomePageControl, mxShape);
  4967. /**
  4968. * Function: paintVertexShape
  4969. *
  4970. * Paints the vertex shape.
  4971. */
  4972. mxShapeMockupiHomePageControl.prototype.paintVertexShape = function(c, x, y, w, h)
  4973. {
  4974. c.translate(x, y);
  4975. var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '#000000');
  4976. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  4977. c.setStrokeColor(strokeColor);
  4978. c.setFillColor(fillColor);
  4979. var rSize = Math.min(h * 0.5, w * 0.05);
  4980. c.ellipse(w * 0.35 - rSize, h * 0.5 - rSize, 2 * rSize, 2 * rSize);
  4981. c.fill();
  4982. c.ellipse(w * 0.65 - rSize, h * 0.5 - rSize, 2 * rSize, 2 * rSize);
  4983. c.fill();
  4984. c.ellipse(w - 2 * rSize, h * 0.5 - rSize, 2 * rSize, 2 * rSize);
  4985. c.fill();
  4986. c.ellipse(rSize * 0.2, h * 0.5 - rSize * 0.8, rSize * 1.2, rSize * 1.2);
  4987. c.stroke();
  4988. c.begin();
  4989. c.moveTo(rSize * 1.15, h * 0.5 + rSize * 0.25);
  4990. c.lineTo(rSize * 1.6, h * 0.5 + rSize * 0.8);
  4991. c.stroke();
  4992. };
  4993. mxCellRenderer.registerShape(mxMockupC.SHAPE_IHOME_PAGE_CONTROL, mxShapeMockupiHomePageControl);
  4994. //**********************************************************************************************************************************************************
  4995. //Page Control
  4996. //**********************************************************************************************************************************************************
  4997. /**
  4998. * Extends mxShape.
  4999. */
  5000. function mxShapeMockupiPageControl(bounds, fill, stroke, strokewidth)
  5001. {
  5002. mxShape.call(this);
  5003. this.bounds = bounds;
  5004. this.fill = fill;
  5005. this.stroke = stroke;
  5006. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  5007. };
  5008. /**
  5009. * Extends mxShape.
  5010. */
  5011. mxUtils.extend(mxShapeMockupiPageControl, mxShape);
  5012. /**
  5013. * Function: paintVertexShape
  5014. *
  5015. * Paints the vertex shape.
  5016. */
  5017. mxShapeMockupiPageControl.prototype.paintVertexShape = function(c, x, y, w, h)
  5018. {
  5019. c.translate(x, y);
  5020. var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '#000000');
  5021. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  5022. var rSize = Math.min(h * 0.5, w * 0.05);
  5023. c.setFillColor(strokeColor);
  5024. c.ellipse(0, h * 0.5 - rSize, 2 * rSize, 2 * rSize);
  5025. c.fill();
  5026. c.setFillColor(fillColor);
  5027. c.ellipse(w * 0.35 - rSize, h * 0.5 - rSize, 2 * rSize, 2 * rSize);
  5028. c.fill();
  5029. c.ellipse(w * 0.65 - rSize, h * 0.5 - rSize, 2 * rSize, 2 * rSize);
  5030. c.fill();
  5031. c.ellipse(w - 2 * rSize, h * 0.5 - rSize, 2 * rSize, 2 * rSize);
  5032. c.fill();
  5033. };
  5034. mxCellRenderer.registerShape(mxMockupC.SHAPE_IPAGE_CONTROL, mxShapeMockupiPageControl);
  5035. //**********************************************************************************************************************************************************
  5036. //iPad
  5037. //**********************************************************************************************************************************************************
  5038. /**
  5039. * Extends mxShape.
  5040. */
  5041. function mxShapeMockupiPad(bounds, fill, stroke, strokewidth)
  5042. {
  5043. mxShape.call(this);
  5044. this.bounds = bounds;
  5045. this.fill = fill;
  5046. this.stroke = stroke;
  5047. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  5048. };
  5049. /**
  5050. * Extends mxShape.
  5051. */
  5052. mxUtils.extend(mxShapeMockupiPad, mxShape);
  5053. mxShapeMockupiPad.prototype.customProperties = [
  5054. {name: 'bgStyle', dispName: 'Background', type: 'enum',
  5055. enumList: [{val: 'bgGreen', dispName: 'Green'}, {val: 'bgWhite', dispName: 'White'}, {val: 'bgGray', dispName: 'Gray'}, {val: 'bgFlat', dispName: 'Flat'}, {val: 'bgMap', dispName: 'Map'}, {val: 'bgStriped', dispName: 'Striped'}]
  5056. }
  5057. ];
  5058. /**
  5059. * Function: paintVertexShape
  5060. *
  5061. * Paints the vertex shape.
  5062. */
  5063. mxShapeMockupiPad.prototype.paintVertexShape = function(c, x, y, w, h)
  5064. {
  5065. var rSize = 25;
  5066. c.translate(x, y);
  5067. this.background(c, x, y, w, h, rSize);
  5068. c.setShadow(false);
  5069. this.foreground(c, x, y, w, h, rSize);
  5070. };
  5071. mxShapeMockupiPad.prototype.background = function(c, x, y, w, h, rSize)
  5072. {
  5073. c.setFillColor('#000000');
  5074. c.setStrokeColor('#000000');
  5075. c.roundrect(0, 0, w, h, rSize, rSize);
  5076. c.fillAndStroke();
  5077. };
  5078. mxShapeMockupiPad.prototype.foreground = function(c, x, y, w, h, rSize)
  5079. {
  5080. c.setStrokeWidth(1.5);
  5081. c.setStrokeColor('#999999');
  5082. c.begin();
  5083. c.setStrokeColor('none');
  5084. c.setFillColor('#808080');
  5085. c.setGradient('#808080', '#000000', w * 0.325, 0, w * 0.675, h * 0.5, mxConstants.DIRECTION_SOUTH, 1, 1);
  5086. c.moveTo(w * 0.325, 0);
  5087. c.lineTo(w - rSize, 0);
  5088. c.arcTo(rSize, rSize, 0, 0, 1, w, rSize);
  5089. c.lineTo(w, h * 0.5);
  5090. c.lineTo(w * 0.7, h * 0.5);
  5091. c.close();
  5092. c.fillAndStroke();
  5093. c.begin();
  5094. c.setFillColor('#1f2923');
  5095. c.setStrokeColor('#18211b');
  5096. c.setStrokeWidth(1);
  5097. var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '');
  5098. var bgStyle = mxUtils.getValue(this.style, mxMockupC.BG_STYLE, mxMockupC.BG_FLAT_GREEN);
  5099. c.setStrokeWidth(1);
  5100. if (bgStyle === mxMockupC.BG_FLAT_WHITE)
  5101. {
  5102. c.setFillColor('#ffffff');
  5103. c.rect(w * 0.0928, h * 0.08, w * 0.8144, h * 0.816);
  5104. c.fill();
  5105. }
  5106. else if (bgStyle === mxMockupC.BG_FLAT_GREEN)
  5107. {
  5108. c.setFillColor('#1f2923');
  5109. c.rect(w * 0.0928, h * 0.08, w * 0.8144, h * 0.816);
  5110. c.fill();
  5111. }
  5112. else if (bgStyle === mxMockupC.BG_FLAT_GRAY)
  5113. {
  5114. c.setFillColor('#dddddd');
  5115. c.rect(w * 0.0928, h * 0.08, w * 0.8144, h * 0.816);
  5116. c.fill();
  5117. }
  5118. else if (bgStyle === mxMockupC.BG_FLAT_CUSTOM)
  5119. {
  5120. c.setFillColor(fillColor);
  5121. c.rect(w * 0.0928, h * 0.08, w * 0.8144, h * 0.816);
  5122. c.fill();
  5123. }
  5124. else if (bgStyle === mxMockupC.BG_STRIPED)
  5125. {
  5126. var xOld = x;
  5127. var yOld = y;
  5128. var wOld = w;
  5129. var hOld = h;
  5130. c.translate(w * 0.0928, h * 0.08);
  5131. w = w * 0.8144;
  5132. h = h * 0.816;
  5133. c.setFillColor('#5D7585');
  5134. c.rect(0, 0, w, h);
  5135. c.fillAndStroke();
  5136. var strokeColor = '#18211b';
  5137. var strokeColor2 = '#657E8F';
  5138. c.setStrokeColor(strokeColor2);
  5139. var i = 7;
  5140. c.begin();
  5141. while (i < w)
  5142. {
  5143. c.moveTo(i, 0);
  5144. c.lineTo(i, h);
  5145. i = i + 7;
  5146. }
  5147. c.stroke();
  5148. c.setStrokeColor(strokeColor);
  5149. c.begin();
  5150. c.rect(0, 0, w, h);
  5151. c.stroke();
  5152. w = wOld;
  5153. h = hOld;
  5154. c.translate( - w * 0.0928, - h * 0.08);
  5155. }
  5156. else if (bgStyle === mxMockupC.BG_MAP)
  5157. {
  5158. var xOld = x;
  5159. var yOld = y;
  5160. var wOld = w;
  5161. var hOld = h;
  5162. c.translate(w * 0.0928, h * 0.08);
  5163. w = w * 0.8144;
  5164. h = h * 0.816;
  5165. c.setFillColor('#ffffff');
  5166. c.rect(0, 0, w, h);
  5167. c.fillAndStroke();
  5168. var fillColor2 = '#96D1FF';
  5169. var strokeColor = '#18211b';
  5170. var strokeColor2 = '#008cff';
  5171. c.setFillColor(fillColor2);
  5172. c.setStrokeColor(strokeColor2);
  5173. c.setStrokeWidth(0.5);
  5174. c.begin();
  5175. c.moveTo(0, 0);
  5176. c.lineTo(w * 0.1171, 0);
  5177. c.lineTo(w * 0.1136, h * 0.0438);
  5178. c.lineTo(w * 0.0993, h * 0.054);
  5179. c.lineTo(0, h * 0.0446);
  5180. c.close();
  5181. c.fillAndStroke();
  5182. c.begin();
  5183. c.moveTo(w * 0.1993, 0);
  5184. c.lineTo(w * 0.1914, h * 0.03884);
  5185. c.lineTo(w * 0.1536, h * 0.0362);
  5186. c.lineTo(w * 0.1586, 0);
  5187. c.close();
  5188. c.fillAndStroke();
  5189. c.begin();
  5190. c.moveTo(w * 0.24, 0);
  5191. c.lineTo(w * 0.2257, h * 0.054);
  5192. c.lineTo(w * 0.2414, h * 0.0674);
  5193. c.lineTo(w * 0.4707, h * 0.0835);
  5194. c.lineTo(w * 0.5264, h * 0.0906);
  5195. c.lineTo(w * 0.6429, h * 0.0929);
  5196. c.arcTo(w * 0.0857, h * 0.0536, 0, 0, 0, w * 0.7193, h * 0.0621);
  5197. c.arcTo(w * 0.48, h * 0.2143, 0, 0, 0, w * 0.7286, 0);
  5198. c.close();
  5199. c.fillAndStroke();
  5200. c.begin();
  5201. c.moveTo(w * 0.8, 0);
  5202. c.lineTo(w * 0.7886, h * 0.04554);
  5203. c.arcTo(w * 0.0857, h * 0.0536, 0, 0, 0, w * 0.8164, h * 0.0875);
  5204. c.arcTo(w * 0.1429, h * 0.0893, 0, 0, 0, w * 0.88, h * 0.1036);
  5205. c.lineTo(w, h * 0.1112);
  5206. c.lineTo(w, 0);
  5207. c.close();
  5208. c.fillAndStroke();
  5209. c.begin();
  5210. c.moveTo(0, h * 0.0933);
  5211. c.lineTo(w * 0.08, h * 0.1036);
  5212. c.lineTo(w * 0.1021, h * 0.1246);
  5213. c.lineTo(w * 0.1007, h * 0.1768);
  5214. c.lineTo(w * 0.0471, h * 0.2241);
  5215. c.lineTo(0, h * 0.2527);
  5216. c.close();
  5217. c.fillAndStroke();
  5218. c.ellipse(w * 0.1214, h * 0.0603, w * 0.0843, h * 0.0576);
  5219. c.fillAndStroke();
  5220. c.begin();
  5221. c.moveTo(w * 0.1293, h * 0.1924);
  5222. c.lineTo(w * 0.1729, h * 0.142);
  5223. c.lineTo(w * 0.1407, h * 0.1411);
  5224. c.lineTo(w * 0.14, h * 0.1777);
  5225. c.close();
  5226. c.fillAndStroke();
  5227. c.begin();
  5228. c.moveTo(w * 0.4586, h * 0.1241);
  5229. c.lineTo(w * 0.455, h * 0.1835);
  5230. c.lineTo(w * 0.3893, h * 0.2246);
  5231. c.lineTo(w * 0.2171, h * 0.1362);
  5232. c.lineTo(w * 0.2171, h * 0.1308);
  5233. c.lineTo(w * 0.2293, h * 0.1214);
  5234. c.lineTo(w * 0.2857, h * 0.1174);
  5235. c.close();
  5236. c.fillAndStroke();
  5237. c.begin();
  5238. c.moveTo(w * 0.5079, h * 0.1134);
  5239. c.lineTo(w * 0.7307, h * 0.1223);
  5240. c.lineTo(w * 0.7279, h * 0.1625);
  5241. c.lineTo(w * 0.715, h * 0.1772);
  5242. c.lineTo(w * 0.6929, h * 0.1688);
  5243. c.lineTo(w * 0.625, h * 0.1795);
  5244. c.lineTo(w * 0.4779, h * 0.2835);
  5245. c.lineTo(w * 0.395, h * 0.2299);
  5246. c.lineTo(w * 0.4657, h * 0.1826);
  5247. c.lineTo(w * 0.4707, h * 0.1223);
  5248. c.close();
  5249. c.fillAndStroke();
  5250. c.begin();
  5251. c.moveTo(w, h * 0.1362);
  5252. c.lineTo(w * 0.7643, h * 0.1237);
  5253. c.lineTo(w * 0.7543, h * 0.1562);
  5254. c.lineTo(w * 0.7643, h * 0.1585);
  5255. c.lineTo(w * 0.9186, h * 0.2366);
  5256. c.lineTo(w, h * 0.1732);
  5257. c.close();
  5258. c.fillAndStroke();
  5259. c.begin();
  5260. c.moveTo(w * 0.2079, h * 0.1545);
  5261. c.lineTo(w * 0.3886, h * 0.2536);
  5262. c.lineTo(w * 0.3414, h * 0.2933);
  5263. c.lineTo(w * 0.1743, h * 0.1969);
  5264. c.close();
  5265. c.fillAndStroke();
  5266. c.begin();
  5267. c.moveTo(w * 0.1579, h * 0.2134);
  5268. c.lineTo(w * 0.3221, h * 0.3067);
  5269. c.lineTo(w * 0.2957, h * 0.3237);
  5270. c.lineTo(w * 0.1157, h * 0.2424);
  5271. c.close();
  5272. c.fillAndStroke();
  5273. c.begin();
  5274. c.moveTo(w * 0.405, h * 0.2656);
  5275. c.lineTo(w * 0.31, h * 0.3353);
  5276. c.lineTo(w * 0.3693, h * 0.3661);
  5277. c.lineTo(w * 0.4571, h * 0.2982);
  5278. c.close();
  5279. c.fillAndStroke();
  5280. c.begin();
  5281. c.moveTo(w * 0.7121, h * 0.1848);
  5282. c.lineTo(w * 0.6879, h * 0.1754);
  5283. c.lineTo(w * 0.6329, h * 0.1844);
  5284. c.lineTo(w * 0.61, h * 0.2018);
  5285. c.lineTo(w * 0.6207, h * 0.2085);
  5286. c.lineTo(w * 0.4986, h * 0.2982);
  5287. c.lineTo(w * 0.535, h * 0.3237);
  5288. c.close();
  5289. c.fillAndStroke();
  5290. c.begin();
  5291. c.moveTo(w * 0.5557, h * 0.3379);
  5292. c.lineTo(w * 0.7464, h * 0.1826);
  5293. c.lineTo(w * 0.8036, h * 0.2076);
  5294. c.lineTo(w * 0.595, h * 0.3616);
  5295. c.close();
  5296. c.fillAndStroke();
  5297. c.begin();
  5298. c.moveTo(w * 0.8293, h * 0.2188);
  5299. c.lineTo(w * 0.8979, h * 0.2509);
  5300. c.lineTo(w * 0.6936, h * 0.4125);
  5301. c.lineTo(w * 0.6171, h * 0.3737);
  5302. c.close();
  5303. c.fillAndStroke();
  5304. c.begin();
  5305. c.moveTo(w, h * 0.2138);
  5306. c.lineTo(w * 0.6821, h * 0.4603);
  5307. c.lineTo(w * 0.815, h * 0.5277);
  5308. c.lineTo(w, h * 0.4);
  5309. c.close();
  5310. c.fillAndStroke();
  5311. c.begin();
  5312. c.moveTo(0, h * 0.317);
  5313. c.lineTo(w * 0.0971, h * 0.2554);
  5314. c.lineTo(w * 0.4121, h * 0.4143);
  5315. c.lineTo(w * 0.3736, h * 0.4415);
  5316. c.lineTo(w * 0.315, h * 0.4076);
  5317. c.lineTo(w * 0.3093, h * 0.4116);
  5318. c.lineTo(w * 0.3686, h * 0.4455);
  5319. c.lineTo(w * 0.285, h * 0.5045);
  5320. c.lineTo(w * 0.1114, h * 0.4134);
  5321. c.lineTo(w * 0.025, h * 0.4603);
  5322. c.lineTo(w * 0.0371, h * 0.4723);
  5323. c.lineTo(w * 0.1114, h * 0.4371);
  5324. c.lineTo(w * 0.2871, h * 0.5312);
  5325. c.lineTo(w * 0.1929, h * 0.6058);
  5326. c.lineTo(w * 0.2271, h * 0.6705);
  5327. c.lineTo(w * 0.17, h * 0.7147);
  5328. c.lineTo(w * 0.0314, h * 0.6321);
  5329. c.lineTo(0, h * 0.6246);
  5330. c.close();
  5331. c.fillAndStroke();
  5332. c.begin();
  5333. c.moveTo(w * 0.48, h * 0.3121);
  5334. c.lineTo(w * 0.5157, h * 0.3375);
  5335. c.lineTo(w * 0.4314, h * 0.3982);
  5336. c.lineTo(w * 0.3929, h * 0.3786);
  5337. c.close();
  5338. c.fillAndStroke();
  5339. c.begin();
  5340. c.moveTo(w * 0.3086, h * 0.5179);
  5341. c.lineTo(w * 0.53, h * 0.3518);
  5342. c.lineTo(w * 0.5757, h * 0.3745);
  5343. c.lineTo(w * 0.3479, h * 0.5411);
  5344. c.close();
  5345. c.fillAndStroke();
  5346. c.begin();
  5347. c.moveTo(w * 0.5964, h * 0.3884);
  5348. c.lineTo(w * 0.6736, h * 0.4277);
  5349. c.lineTo(w * 0.445, h * 0.5991);
  5350. c.lineTo(w * 0.3664, h * 0.5531);
  5351. c.lineTo(w * 0.5057, h * 0.4545);
  5352. c.lineTo(w * 0.5507, h * 0.4754);
  5353. c.lineTo(w * 0.5571, h * 0.4723);
  5354. c.lineTo(w * 0.5114, h * 0.4504);
  5355. c.close();
  5356. c.fillAndStroke();
  5357. c.begin();
  5358. c.moveTo(w * 0.4793, h * 0.6161);
  5359. c.lineTo(w * 0.6771, h * 0.4643);
  5360. c.lineTo(w * 0.8086, h * 0.5326);
  5361. c.lineTo(w * 0.7471, h * 0.5817);
  5362. c.lineTo(w * 0.7214, h * 0.567);
  5363. c.lineTo(w * 0.715, h * 0.571);
  5364. c.lineTo(w * 0.7421, h * 0.5871);
  5365. c.lineTo(w * 0.6014, h * 0.6933);
  5366. c.close();
  5367. c.fillAndStroke();
  5368. c.begin();
  5369. c.moveTo(w, h * 0.4371);
  5370. c.lineTo(w * 0.8443, h * 0.546);
  5371. c.lineTo(w * 0.9071, h * 0.5701);
  5372. c.lineTo(w, h * 0.5022);
  5373. c.close();
  5374. c.fillAndStroke();
  5375. c.begin();
  5376. c.moveTo(w * 0.8407, h * 0.5504);
  5377. c.lineTo(w * 0.8993, h * 0.5759);
  5378. c.lineTo(w * 0.6757, h * 0.7416);
  5379. c.lineTo(w * 0.6286, h * 0.7139);
  5380. c.close();
  5381. c.fillAndStroke();
  5382. c.begin();
  5383. c.moveTo(w, h * 0.5321);
  5384. c.lineTo(w * 0.6979, h * 0.7549);
  5385. c.lineTo(w * 0.7457, h * 0.7781);
  5386. c.lineTo(w * 0.9814, h * 0.6094);
  5387. c.lineTo(w, h * 0.6067);
  5388. c.close();
  5389. c.fillAndStroke();
  5390. c.begin();
  5391. c.moveTo(w, h * 0.6254);
  5392. c.lineTo(w * 0.7664, h * 0.792);
  5393. c.lineTo(w * 0.9586, h * 0.9062);
  5394. c.lineTo(w, h * 0.8786);
  5395. c.close();
  5396. c.fillAndStroke();
  5397. c.begin();
  5398. c.moveTo(w * 0.3093, h * 0.5464);
  5399. c.lineTo(w * 0.4271, h * 0.6152);
  5400. c.lineTo(w * 0.245, h * 0.7643);
  5401. c.lineTo(w * 0.185, h * 0.7228);
  5402. c.lineTo(w * 0.2493, h * 0.6728);
  5403. c.lineTo(w * 0.2214, h * 0.6143);
  5404. c.close();
  5405. c.fillAndStroke();
  5406. c.begin();
  5407. c.moveTo(0, h * 0.65);
  5408. c.lineTo(w * 0.2179, h * 0.7826);
  5409. c.lineTo(w * 0.1136, h * 0.8424);
  5410. c.close();
  5411. c.fillAndStroke();
  5412. c.begin();
  5413. c.moveTo(0, h * 0.7272);
  5414. c.lineTo(w * 0.0821, h * 0.859);
  5415. c.lineTo(0, h * 0.9085);
  5416. c.close();
  5417. c.fillAndStroke();
  5418. c.begin();
  5419. c.moveTo(w * 0.4529, h * 0.6366);
  5420. c.lineTo(w * 0.575, h * 0.7143);
  5421. c.lineTo(w * 0.39, h * 0.8621);
  5422. c.lineTo(w * 0.2657, h * 0.7902);
  5423. c.close();
  5424. c.fillAndStroke();
  5425. c.begin();
  5426. c.moveTo(0, h * 0.9415);
  5427. c.lineTo(w * 0.1036, h * 0.8821);
  5428. c.lineTo(w * 0.2343, h * 0.959);
  5429. c.lineTo(w * 0.1721, h);
  5430. c.lineTo(0, h);
  5431. c.close();
  5432. c.fillAndStroke();
  5433. c.begin();
  5434. c.moveTo(w * 0.2586, h * 0.7951);
  5435. c.lineTo(w * 0.3829, h * 0.8674);
  5436. c.lineTo(w * 0.2543, h * 0.9451);
  5437. c.lineTo(w * 0.1279, h * 0.8692);
  5438. c.close();
  5439. c.fillAndStroke();
  5440. c.begin();
  5441. c.moveTo(w * 0.2836, h * 0.9639);
  5442. c.lineTo(w * 0.4207, h * 0.8772);
  5443. c.lineTo(w * 0.605, h * 0.7321);
  5444. c.lineTo(w * 0.6521, h * 0.7634);
  5445. c.lineTo(w * 0.3486, h);
  5446. c.lineTo(w * 0.3393, h);
  5447. c.close();
  5448. c.fillAndStroke();
  5449. c.begin();
  5450. c.moveTo(w * 0.3879, h);
  5451. c.lineTo(w * 0.6721, h * 0.7759);
  5452. c.lineTo(w * 0.7171, h * 0.7982);
  5453. c.lineTo(w * 0.4564, h);
  5454. c.close();
  5455. c.fillAndStroke();
  5456. c.begin();
  5457. c.moveTo(w * 0.4986, h);
  5458. c.lineTo(w * 0.7386, h * 0.8125);
  5459. c.lineTo(w * 0.9307, h * 0.925);
  5460. c.lineTo(w * 0.8264, h);
  5461. c.close();
  5462. c.fillAndStroke();
  5463. c.begin();
  5464. c.moveTo(w * 0.8671, h);
  5465. c.lineTo(w * 0.9464, h * 0.9491);
  5466. c.lineTo(w, h * 0.975);
  5467. c.lineTo(w, h);
  5468. c.close();
  5469. c.fillAndStroke();
  5470. c.begin();
  5471. c.moveTo(w * 0.2295, h);
  5472. c.lineTo(w * 0.2648, h * 0.9792);
  5473. c.lineTo(w * 0.2981, h);
  5474. c.close();
  5475. c.fillAndStroke();
  5476. w = wOld;
  5477. h = hOld;
  5478. c.translate( - w * 0.0928, - h * 0.08);
  5479. }
  5480. c.setStrokeWidth(1);
  5481. c.setStrokeColor('#18211b');
  5482. c.rect(w * 0.0928, h * 0.08, w * 0.8144, h * 0.816);
  5483. c.stroke();
  5484. c.setStrokeWidth(1.5);
  5485. c.setAlpha(0.8);
  5486. c.setStrokeColor('#dddddd');
  5487. c.begin();
  5488. c.moveTo(0, rSize);
  5489. c.arcTo(rSize, rSize, 0, 0, 1, rSize, 0);
  5490. c.lineTo(w - rSize, 0);
  5491. c.arcTo(rSize, rSize, 0, 0, 1, w, rSize);
  5492. c.lineTo(w, h - rSize);
  5493. c.arcTo(rSize, rSize, 0, 0, 1, w - rSize, h);
  5494. c.lineTo(rSize, h);
  5495. c.arcTo(rSize, rSize, 0, 0, 1, 0, h - rSize);
  5496. c.close();
  5497. c.stroke();
  5498. rSize = 22.5;
  5499. c.begin();
  5500. c.setStrokeColor('#666666');
  5501. c.begin();
  5502. c.moveTo(2.5, 2.5 + rSize);
  5503. c.arcTo(rSize, rSize, 0, 0, 1, 2.5 + rSize, 2.5);
  5504. c.lineTo(w - rSize - 5, 2.5);
  5505. c.arcTo(rSize, rSize, 0, 0, 1, w - 2.5, rSize + 2.5);
  5506. c.lineTo(w - 2.5, h - rSize - 2.5);
  5507. c.arcTo(rSize, rSize, 0, 0, 1, w - rSize - 2.5, h - 2.5);
  5508. c.lineTo(rSize + 2.5, h - 2.5);
  5509. c.arcTo(rSize, rSize, 0, 0, 1, 2.5, h - rSize - 2.5);
  5510. c.close();
  5511. c.stroke();
  5512. c.setAlpha(1);
  5513. c.ellipse(w * 0.4948, h * 0.0444, w * 0.0103, h * 0.008);
  5514. c.setStrokeWidth(2.5);
  5515. c.setStrokeColor('#000000');
  5516. c.setFillColor('#000099');
  5517. c.fillAndStroke();
  5518. c.setGradient('#bbbbbb', '#000000', w * 0.4588, h * 0.912, w * 0.0825, h * 0.064, mxConstants.DIRECTION_SOUTH, 1, 1);
  5519. c.ellipse(w * 0.4588, h * 0.912, w * 0.0825, h * 0.064);
  5520. c.fill();
  5521. c.setAlpha(0.5);
  5522. c.ellipse(w * 0.4588, h * 0.912, w * 0.0825, h * 0.064);
  5523. c.stroke();
  5524. c.begin();
  5525. c.setAlpha(0.85);
  5526. c.setFillColor('#000000');
  5527. c.moveTo(w * 0.4598, h * 0.944);
  5528. c.arcTo(w * 0.0402, h * 0.0296, 0, 0, 1, w * 0.5402, h * 0.944);
  5529. c.arcTo(w * 0.0825, h * 0.064, 0, 0, 1, w * 0.4598, h * 0.944);
  5530. c.close();
  5531. c.fillAndStroke();
  5532. c.begin();
  5533. c.setAlpha(0.7);
  5534. c.setStrokeWidth(1.5);
  5535. c.setStrokeColor('#dddddd');
  5536. rSize = 4;
  5537. c.roundrect(w * 0.4814, h * 0.9296, w * 0.0371, h * 0.0288, h * 0.00515, h * 0.004);
  5538. c.stroke();
  5539. };
  5540. mxCellRenderer.registerShape(mxMockupC.SHAPE_IPAD, mxShapeMockupiPad);
  5541. //**********************************************************************************************************************************************************
  5542. //Rounded rectangle (adjustable rounding)
  5543. //**********************************************************************************************************************************************************
  5544. /**
  5545. * Extends mxShape.
  5546. */
  5547. function mxShapeMockupRRect(bounds, fill, stroke, strokewidth)
  5548. {
  5549. mxShape.call(this);
  5550. this.bounds = bounds;
  5551. this.fill = fill;
  5552. this.stroke = stroke;
  5553. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  5554. };
  5555. /**
  5556. * Extends mxShape.
  5557. */
  5558. mxUtils.extend(mxShapeMockupRRect, mxShape);
  5559. mxShapeMockupRRect.prototype.cst = {
  5560. RRECT : 'mxgraph.ios.rrect',
  5561. R_SIZE : 'rSize'
  5562. };
  5563. mxShapeMockupRRect.prototype.customProperties = [
  5564. {name: 'rSize', dispName: 'Arc Size', type: 'float', min:0, defVal:5},
  5565. ];
  5566. /**
  5567. * Function: paintVertexShape
  5568. *
  5569. * Paints the vertex shape.
  5570. */
  5571. mxShapeMockupRRect.prototype.paintVertexShape = function(c, x, y, w, h)
  5572. {
  5573. c.translate(x, y);
  5574. var rSize = parseInt(mxUtils.getValue(this.style, mxShapeMockupRRect.prototype.cst.R_SIZE, '10'));
  5575. c.roundrect(0, 0, w, h, rSize);
  5576. c.fillAndStroke();
  5577. };
  5578. mxCellRenderer.registerShape(mxShapeMockupRRect.prototype.cst.RRECT, mxShapeMockupRRect);
  5579. //**********************************************************************************************************************************************************
  5580. //Top Button
  5581. //**********************************************************************************************************************************************************
  5582. /**
  5583. * Extends mxShape.
  5584. */
  5585. function mxShapeIosTopButton(bounds, fill, stroke, strokewidth)
  5586. {
  5587. mxShape.call(this);
  5588. this.bounds = bounds;
  5589. this.fill = fill;
  5590. this.stroke = stroke;
  5591. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  5592. };
  5593. /**
  5594. * Extends mxShape.
  5595. */
  5596. mxUtils.extend(mxShapeIosTopButton, mxShape);
  5597. mxShapeIosTopButton.prototype.cst = {
  5598. TOP_BUTTON : 'mxgraph.ios.topButton',
  5599. R_SIZE : 'rSize'
  5600. };
  5601. mxShapeIosTopButton.prototype.customProperties = [
  5602. {name: 'rSize', dispName: 'Arc Size', type: 'float', min:0, defVal:5},
  5603. ];
  5604. /**
  5605. * Function: paintVertexShape
  5606. *
  5607. * Paints the vertex shape.
  5608. */
  5609. mxShapeIosTopButton.prototype.paintVertexShape = function(c, x, y, w, h)
  5610. {
  5611. c.translate(x, y);
  5612. var rSize = parseInt(mxUtils.getValue(this.style, mxShapeIosTopButton.prototype.cst.R_SIZE, '10'));
  5613. c.begin();
  5614. c.moveTo(0, rSize);
  5615. c.arcTo(rSize, rSize, 0, 0, 1, rSize, 0);
  5616. c.lineTo(w - rSize, 0);
  5617. c.arcTo(rSize, rSize, 0, 0, 1, w, rSize);
  5618. c.lineTo(w, h);
  5619. c.lineTo(0, h);
  5620. c.close();
  5621. c.fillAndStroke();
  5622. };
  5623. mxCellRenderer.registerShape(mxShapeIosTopButton.prototype.cst.TOP_BUTTON, mxShapeIosTopButton);
  5624. //**********************************************************************************************************************************************************
  5625. //Bottom Button
  5626. //**********************************************************************************************************************************************************
  5627. /**
  5628. * Extends mxShape.
  5629. */
  5630. function mxShapeIosBottomButton(bounds, fill, stroke, strokewidth)
  5631. {
  5632. mxShape.call(this);
  5633. this.bounds = bounds;
  5634. this.fill = fill;
  5635. this.stroke = stroke;
  5636. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  5637. };
  5638. /**
  5639. * Extends mxShape.
  5640. */
  5641. mxUtils.extend(mxShapeIosBottomButton, mxShape);
  5642. mxShapeIosBottomButton.prototype.cst = {
  5643. BOTTOM_BUTTON : 'mxgraph.ios.bottomButton',
  5644. R_SIZE : 'rSize'
  5645. };
  5646. mxShapeIosBottomButton.prototype.customProperties = [
  5647. {name: 'rSize', dispName: 'Arc Size', type: 'float', min:0, defVal:5},
  5648. ];
  5649. /**
  5650. * Function: paintVertexShape
  5651. *
  5652. * Paints the vertex shape.
  5653. */
  5654. mxShapeIosBottomButton.prototype.paintVertexShape = function(c, x, y, w, h)
  5655. {
  5656. c.translate(x, y);
  5657. var rSize = parseInt(mxUtils.getValue(this.style, mxShapeIosBottomButton.prototype.cst.R_SIZE, '10'));
  5658. c.begin();
  5659. c.moveTo(0, 0);
  5660. c.lineTo(w, 0);
  5661. c.lineTo(w, h - rSize);
  5662. c.arcTo(rSize, rSize, 0, 0, 1, w - rSize, h);
  5663. c.lineTo(rSize, h);
  5664. c.arcTo(rSize, rSize, 0, 0, 1, 0, h - rSize);
  5665. c.close();
  5666. c.fillAndStroke();
  5667. };
  5668. mxCellRenderer.registerShape(mxShapeIosBottomButton.prototype.cst.BOTTOM_BUTTON, mxShapeIosBottomButton);
  5669. //**********************************************************************************************************************************************************
  5670. //Anchor (a dummy shape without visuals used for anchoring)
  5671. //**********************************************************************************************************************************************************
  5672. /**
  5673. * Extends mxShape.
  5674. */
  5675. function mxShapeIosAnchor(bounds, fill, stroke, strokewidth)
  5676. {
  5677. mxShape.call(this);
  5678. this.bounds = bounds;
  5679. };
  5680. /**
  5681. * Extends mxShape.
  5682. */
  5683. mxUtils.extend(mxShapeIosAnchor, mxShape);
  5684. mxShapeIosAnchor.prototype.cst = {
  5685. ANCHOR : 'mxgraph.ios.anchor'
  5686. };
  5687. /**
  5688. * Function: paintVertexShape
  5689. *
  5690. * Paints the vertex shape.
  5691. */
  5692. mxShapeIosAnchor.prototype.paintVertexShape = function(c, x, y, w, h)
  5693. {
  5694. };
  5695. mxCellRenderer.registerShape(mxShapeIosAnchor.prototype.cst.ANCHOR, mxShapeIosAnchor);
  5696. //**********************************************************************************************************************************************************
  5697. //Checkbox
  5698. //**********************************************************************************************************************************************************
  5699. /**
  5700. * Extends mxShape.
  5701. */
  5702. function mxShapeIosCheckbox(bounds, fill, stroke, strokewidth)
  5703. {
  5704. mxShape.call(this);
  5705. this.bounds = bounds;
  5706. this.fill = fill;
  5707. this.stroke = stroke;
  5708. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  5709. };
  5710. /**
  5711. * Extends mxShape.
  5712. */
  5713. mxUtils.extend(mxShapeIosCheckbox, mxShape);
  5714. mxShapeIosCheckbox.prototype.cst = {
  5715. CHECKBOX : 'mxgraph.ios.checkbox'
  5716. };
  5717. /**
  5718. * Function: paintVertexShape
  5719. *
  5720. * Paints the vertex shape.
  5721. */
  5722. mxShapeIosCheckbox.prototype.paintVertexShape = function(c, x, y, w, h)
  5723. {
  5724. c.translate(x, y);
  5725. c.rect(0, 0, w, h);
  5726. c.fillAndStroke();
  5727. c.begin();
  5728. c.moveTo(w * 0.8, h * 0.2);
  5729. c.lineTo(w * 0.4, h * 0.8);
  5730. c.lineTo(w * 0.25, h * 0.6);
  5731. c.stroke();
  5732. };
  5733. mxCellRenderer.registerShape(mxShapeIosCheckbox.prototype.cst.CHECKBOX, mxShapeIosCheckbox);
  5734. //**********************************************************************************************************************************************************
  5735. //Fancy Rounded rectangle (adjustable rounding)
  5736. //**********************************************************************************************************************************************************
  5737. /**
  5738. * Extends mxShape.
  5739. */
  5740. function mxShapeMockupFancyRRect(bounds, fill, stroke, strokewidth)
  5741. {
  5742. mxShape.call(this);
  5743. this.bounds = bounds;
  5744. this.fill = fill;
  5745. this.stroke = stroke;
  5746. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  5747. };
  5748. /**
  5749. * Extends mxShape.
  5750. */
  5751. mxUtils.extend(mxShapeMockupFancyRRect, mxShape);
  5752. mxShapeMockupFancyRRect.prototype.cst = {
  5753. FANCY_RRECT : 'mxgraph.ios.fancyRRect',
  5754. R_SIZE : 'rSize'
  5755. };
  5756. mxShapeMockupFancyRRect.prototype.customProperties = [
  5757. {name: 'rSize', dispName: 'Arc Size', type: 'float', min:0, defVal:8}
  5758. ];
  5759. /**
  5760. * Function: paintVertexShape
  5761. *
  5762. * Paints the vertex shape.
  5763. */
  5764. mxShapeMockupFancyRRect.prototype.paintVertexShape = function(c, x, y, w, h)
  5765. {
  5766. c.translate(x, y);
  5767. var rSize = parseInt(mxUtils.getValue(this.style, mxShapeMockupFancyRRect.prototype.cst.R_SIZE, '10'));
  5768. var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '#ffffff');
  5769. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  5770. // c.setAlpha(0.8);
  5771. c.roundrect(0, 0, w, h, rSize);
  5772. c.fillAndStroke();
  5773. c.setShadow(false);
  5774. c.setStrokeColor(fillColor);
  5775. c.setGradient(fillColor, '#ffffff', 0, 0, w, 22.5, mxConstants.DIRECTION_SOUTH, 1, 1);
  5776. c.setAlpha(0.3);
  5777. c.begin();
  5778. c.moveTo(w - rSize, 0);
  5779. c.arcTo(rSize, rSize, 0, 0, 1, w, rSize);
  5780. c.lineTo(w, 17.5);
  5781. c.arcTo(w * 1.67, h * 2.5, 0, 0, 1, 0, 17.5);
  5782. c.lineTo(0, rSize);
  5783. c.arcTo(rSize, rSize, 0, 0, 1, rSize, 0);
  5784. c.close();
  5785. c.fillAndStroke();
  5786. c.setAlpha(0.8);
  5787. c.setStrokeColor(strokeColor);
  5788. c.setStrokeWidth(1);
  5789. c.roundrect(0, 0, w, h, rSize, rSize);
  5790. c.stroke();
  5791. };
  5792. mxCellRenderer.registerShape(mxShapeMockupFancyRRect.prototype.cst.FANCY_RRECT, mxShapeMockupFancyRRect);