mxMockupiOS.js 197 KB

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