mxMockupiOS.js 223 KB

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